:root {
  --bg: #0f172a; --bg2: #16213a; --bg3: #1e2a48; --line: #2b3a5e;
  --fg: #e6edf7; --fg2: #a9b6cf; --fg3: #7b89a6;
  --accent: #38bdf8; --accent2: #f59e0b; --danger: #ef4444; --ok: #22c55e;
  --panel-w: 440px; --top-h: 58px;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--fg); font-size: 14px; }
body { display: flex; flex-direction: column; overflow: hidden; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
button, select, input { font: inherit; color: inherit; }

#topbar {
  min-height: var(--top-h); flex: none; display: flex; align-items: center; gap: 18px; padding: 0 14px;
  background: var(--bg2); border-bottom: 1px solid var(--line); position: relative; z-index: 20;
}
.controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; }
.ctl { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg2); }
.ctl > span:first-child { text-transform: uppercase; letter-spacing: .4px; font-size: 10px; color: var(--fg3); }
.ctl input, .ctl select, .toggles select {
  background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; color: var(--fg); font-size: 12px;
}
.ctl input[type=date] { color-scheme: dark; }
.toggle { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 5px 9px; font-size: 12px; color: var(--fg2); cursor: pointer; }
.toggle.on { background: #1d4ed8; border-color: #3b82f6; color: #fff; }
.toggle:hover { filter: brightness(1.15); }
.chip { background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 5px 11px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.chip.alerts.hot { background: #7f1d1d; border-color: var(--danger); color: #fff; }
.chip:hover { filter: brightness(1.15); }

#main { position: relative; flex: 1; min-height: 0; display: flex; }
#map-wrap { position: relative; flex: 1; min-height: 0; display: flex; }
#map { flex: 1; height: 100%; }
.maplibregl-popup-content { background: var(--bg2); color: var(--fg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.4); }
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: var(--bg2); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: var(--bg2); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: var(--bg2); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: var(--bg2); }
.popup-title { font-weight: 600; margin-bottom: 3px; }
.popup-big { font-size: 20px; font-weight: 700; }
.popup-sub { color: var(--fg2); font-size: 11px; }
.maplibregl-ctrl-group { background: var(--bg2); }
.maplibregl-ctrl-group button + button { border-top-color: var(--line); }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(1) brightness(1.4); }

.floating { position: absolute; z-index: 5; background: rgba(22, 33, 58, .92); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; backdrop-filter: blur(4px); }
#legend { left: 12px; bottom: 34px; max-width: 220px; max-height: max(90px, calc(100% - var(--ctl-h, 250px) - 34px)); overflow: auto; display: flex; flex-direction: column; }
#legend-body { overflow: auto; min-height: 0; }
.legend-toggle { display: block; background: none; border: none; color: var(--fg2); font-size: 11px; text-transform: uppercase; letter-spacing: .5px; padding: 0 0 4px; cursor: pointer; text-align: left; }
.legend-toggle::after { content: " ▾"; color: var(--fg3); }
#legend.collapsed .legend-toggle::after { content: " ▴"; }
#legend.collapsed .legend-toggle { padding: 0; }
#legend.collapsed #legend-body { display: none; }
#legend h4 { margin: 0 0 6px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg3); }
#legend h4 + h4 { margin-top: 8px; }
.legend-row { display: flex; align-items: center; gap: 7px; line-height: 18px; }
.swatch { width: 13px; height: 13px; border-radius: 50%; border: 1px solid rgba(255,255,255,.35); flex: none; }
.swatch.sq { border-radius: 3px; }
#status { left: 12px; bottom: 8px; padding: 3px 8px; font-size: 11px; color: var(--fg2); }
#status.error { color: #fca5a5; border-color: var(--danger); }

#panel { width: var(--panel-w); background: var(--bg2); border-left: 1px solid var(--line); display: flex; flex-direction: column; transition: width .2s; }
#panel:not(.open) { width: 36px; }
#panel:not(.open) .panel-body, #panel:not(.open) .tabs { display: none; }
.panel-head { display: flex; align-items: center; border-bottom: 1px solid var(--line); }
.tabs { display: flex; flex: 1; }
.tab { flex: 1; background: none; border: none; border-bottom: 2px solid transparent; padding: 10px 4px; color: var(--fg2); cursor: pointer; font-size: 13px; }
.tab.on { color: #fff; border-bottom-color: var(--accent); }
.tab:disabled { color: var(--fg3); cursor: default; opacity: .6; }
#panel-toggle { background: none; border: none; color: var(--fg2); font-size: 20px; padding: 6px 10px; cursor: pointer; }
#panel:not(.open) #panel-toggle { transform: rotate(180deg); }
.panel-body { flex: 1; overflow: auto; padding: 12px 14px 24px; }
.tab-pane { display: none; }
.tab-pane.on { display: block; }

h2 { font-size: 16px; margin: 0 0 2px; }
h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg3); margin: 16px 0 6px; }
.muted { color: var(--fg2); font-size: 12px; }
.small { font-size: 11px; color: var(--fg3); }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12px; }
.kv dt { color: var(--fg3); }
.kv dd { margin: 0; }
.stat-row { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
.stat { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; min-width: 90px; flex: 1; }
.stat .v { font-size: 20px; font-weight: 700; line-height: 1.1; }
.stat .l { font-size: 10px; text-transform: uppercase; letter-spacing: .4px; color: var(--fg3); margin-top: 2px; }
.stat .s { font-size: 11px; color: var(--fg2); }
.stat.warn .v { color: var(--accent2); }
.stat.bad .v { color: var(--danger); }
.stat.good .v { color: var(--ok); }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; }
table.data th { text-align: left; color: var(--fg3); font-weight: 500; border-bottom: 1px solid var(--line); padding: 4px 6px; font-size: 11px; }
table.data td { padding: 4px 6px; border-bottom: 1px solid rgba(43,58,94,.5); }
table.data td.num, table.data th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.data tr.clickable { cursor: pointer; }
table.data tr.clickable:hover { background: var(--bg3); }
.chart { width: 100%; height: 220px; margin: 4px 0; }
.chart.tall { height: 280px; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; margin: 8px 0; }
.btn { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 5px 10px; font-size: 12px; cursor: pointer; color: var(--fg); }
.btn:hover { filter: brightness(1.15); }
.btn.primary { background: #1d4ed8; border-color: #3b82f6; color: #fff; }
.alert { border-left: 3px solid var(--danger); background: rgba(127,29,29,.25); padding: 6px 8px; border-radius: 4px; margin: 6px 0; font-size: 12px; }
.alert.moderate { border-left-color: var(--accent2); background: rgba(120,53,15,.25); }
.alert.minor { border-left-color: var(--accent); background: rgba(14,116,144,.2); }
.alert .h { font-weight: 600; }
.notice { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 8px 10px; font-size: 12px; color: var(--fg2); margin: 8px 0; }
.spinner { color: var(--fg3); font-size: 12px; padding: 12px 0; }
.spinner::before { content: "⟳ "; display: inline-block; animation: spin 1.2s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.hydro-img { width: 100%; border-radius: 6px; background: #fff; margin: 4px 0; }
.pill { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; background: var(--bg3); border: 1px solid var(--line); color: var(--fg2); margin-right: 4px; }
.pill.class { color: #fff; border: none; }
.forecast-row { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0; }
.fc { flex: none; width: 92px; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 6px; font-size: 11px; }
.fc .n { font-weight: 600; }
.fc .t { font-size: 15px; font-weight: 700; margin: 2px 0; }
.fc .p { color: var(--accent); }
.fc .d { color: var(--fg2); line-height: 1.2; }

#attrib { flex: none; height: 26px; line-height: 26px; padding: 0 12px; font-size: 11px; color: var(--fg3); background: var(--bg2); border-top: 1px solid var(--line); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

}

/* projects */
.form label { display: block; font-size: 11px; color: var(--fg3); margin: 8px 0 2px; text-transform: uppercase; letter-spacing: .4px; }
.form input, .form select, .form textarea { display: block; width: 100%; background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; color: var(--fg); font-size: 13px; text-transform: none; letter-spacing: 0; }
.form .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.checks { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 6px; }
.chk { display: flex !important; align-items: center; gap: 6px; text-transform: none !important; letter-spacing: 0 !important; font-size: 12px !important; color: var(--fg) !important; margin: 0 !important; }
.chk input { width: auto; display: inline; margin: 0; }
.btn.danger { border-color: var(--danger); color: #fca5a5; margin-left: auto; }
.pcard { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; margin: 6px 0; cursor: pointer; }
.pcard:hover { border-color: var(--accent); }
.pcard.alert-on { border-color: var(--danger); }
.pcard-head { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.pcard-stats { display: flex; gap: 14px; margin-top: 4px; font-size: 12px; color: var(--fg2); }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; }

.ctl-inline { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--fg2); }
.ctl-inline input, .ctl-inline select { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; color: var(--fg); font-size: 12px; }
details summary { margin: 6px 0; }
table.data sub { font-size: 9px; }

.save-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 10px 0; padding: 8px; background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; }
.save-row select, .save-row input { background: var(--bg2); border: 1px solid var(--line); border-radius: 6px; padding: 5px 7px; color: var(--fg); font-size: 12px; }
.save-row input { flex: 1; min-width: 140px; }
.btn.danger { margin-left: 0; }

/* loading bar */
#loadbar { position: relative; height: 0; overflow: visible; flex: none; z-index: 30; }
#loadbar-fill { position: absolute; left: 0; top: 0; height: 3px; width: 0; background: linear-gradient(90deg, #38bdf8, #22c55e); transition: width .35s ease; opacity: 0; box-shadow: 0 0 8px rgba(56,189,248,.6); }
#loadbar-text { display: none; color: var(--accent); }
#loadbar-text:not(:empty)::before { content: " · "; color: var(--fg3); }
#loadbar.on ~ #main #loadbar-text { display: inline; }
#loadbar-text-old { position: absolute; right: 12px; top: 6px; font-size: 11px; color: var(--fg2); background: rgba(22,33,58,.9); border: 1px solid var(--line); border-radius: 999px; padding: 2px 9px; opacity: 0; transition: opacity .2s; pointer-events: none; }
#loadbar.on #loadbar-fill { opacity: 1; }

/* terrain menu */
.menu-wrap { position: relative; }
.menu { position: absolute; top: 34px; left: 0; z-index: 40; width: 320px; overflow-y: auto; overscroll-behavior: contain; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); font-size: 12px; color: var(--fg); text-transform: none; letter-spacing: 0; }
.menu-title { font-weight: 600; margin-bottom: 6px; }
.menu-row { display: flex; align-items: center; gap: 8px; padding: 4px 0; cursor: pointer; text-transform: none; letter-spacing: 0; font-size: 12px; color: var(--fg); }
.menu-row input[type=checkbox] { margin: 0; }
.menu-row input[type=range] { flex: 1; }
.menu .small { margin-top: 6px; }

details.steps { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; margin: 10px 0; font-size: 12px; }
details.steps summary { cursor: pointer; font-weight: 600; color: var(--fg); }
details.steps ol { padding-left: 18px; margin: 6px 0 2px; }
details.steps li { margin: 5px 0; line-height: 1.4; color: var(--fg2); }
details.steps code { background: var(--bg2); padding: 0 4px; border-radius: 3px; font-size: 11px; }

/* search */
.search-wrap { position: relative; }
#ctl-search { width: 250px; background: var(--bg3); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; color: var(--fg); font-size: 12px; }
#ctl-search:focus { outline: none; border-color: var(--accent); }
#search-results { width: 340px; padding: 4px; max-height: 60vh; overflow: auto; }
.sr-item { display: flex; gap: 8px; align-items: flex-start; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.sr-item:hover, .sr-item.active { background: var(--bg3); }
.sr-kind { width: 16px; text-align: center; flex: none; margin-top: 1px; }
.sr-kind.gauge { color: #f59e0b; } .sr-kind.station { color: #38bdf8; } .sr-kind.project { color: #a78bfa; } .sr-kind.place { color: var(--fg2); }
.sr-empty { padding: 6px 8px; color: var(--fg3); font-size: 12px; }
.step { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; font-size: 12px; color: var(--fg2); cursor: pointer; }
.step:hover { color: var(--fg); border-color: var(--accent); }
/* help modal */
.modal[hidden], .menu[hidden], #map-hint[hidden] { display: none !important; }
.modal { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55); display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; width: min(720px, 100%); max-height: 90vh; display: flex; flex-direction: column; box-shadow: 0 20px 60px rgba(0,0,0,.6); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; border-bottom: 1px solid var(--line); font-size: 15px; }
.modal-head button { background: none; border: none; color: var(--fg2); font-size: 16px; cursor: pointer; }
.modal-body { padding: 8px 18px 18px; overflow: auto; font-size: 13px; line-height: 1.45; }
.modal-body h4 { margin: 14px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg3); }
.modal-body ul { padding-left: 18px; margin: 4px 0; }
.modal-body li { margin: 3px 0; }
.hint { background: rgba(56,189,248,.08); border: 1px dashed rgba(56,189,248,.4); border-radius: 6px; padding: 6px 9px; font-size: 12px; color: var(--fg2); margin: 8px 0; }
.legend-toggle-row { display: flex; align-items: center; gap: 6px; font-size: 11px; color: var(--fg2); margin-top: 4px; cursor: pointer; }

/* ---------- mobile / narrow (≤ 900px): compact header, scrolling control strip, bottom-sheet panel ---------- */
@media (max-width: 900px) {
  :root { --top-h: auto; }
  #topbar { flex-wrap: wrap; padding: 6px 8px 4px; gap: 6px 8px; align-items: center; }
  .search-wrap { order: -2; flex: 0 0 auto; }
  #ctl-search { width: 40px; height: 34px; padding: 6px 10px 6px 30px; transition: width .15s; background: var(--bg3) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23a9b6cf' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") no-repeat 9px center / 16px 16px; }
  #ctl-search:focus, #ctl-search.open { width: min(70vw, 320px); }
  #ctl-search::placeholder { color: transparent; }
  #ctl-search:focus::placeholder { color: var(--fg3); }
  #search-results { position: fixed; left: 8px; right: 8px; width: auto; top: 96px; }
  .controls { order: 3; flex-basis: 100%; flex-wrap: nowrap; overflow-x: auto; overflow-y: visible; gap: 6px; padding: 2px 0 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .controls::-webkit-scrollbar { display: none; }
  .controls > * { flex: 0 0 auto; }
  .ctl > span:first-child { display: none; }
  .ctl input, .ctl select, .toggles select, .toggle, .chip, .step { min-height: 34px; }
  .toggles { gap: 4px; }
  #btn-help { order: -1; }
  .menu { position: fixed; left: 8px; right: 8px; width: auto; max-height: 60vh; overflow: auto; }
  #main { flex-direction: column; }
  #map-wrap { flex: 1; min-height: 0; }
  #legend { bottom: auto; top: 8px; right: 8px; left: auto; max-width: 200px; }
  #legend.collapsed { padding: 0; background: none; border: none; backdrop-filter: none; }
  .legend-toggle { display: block; margin-left: auto; background: rgba(22, 33, 58, .92); border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; color: var(--fg); font-size: 12px; text-transform: none; letter-spacing: 0; }
  .legend-toggle::after { content: " ▴"; color: var(--fg2); }
  #legend.collapsed .legend-toggle::after { content: " ▾"; }
  #legend:not(.collapsed) .legend-toggle { margin-bottom: 6px; }
  #legend-body { max-height: 40vh; overflow: auto; }
  #status { max-width: calc(100% - 24px); }
  /* bottom sheet */
  #panel { width: 100%; border-left: none; border-top: 1px solid var(--line); flex: none; height: 44px; transition: height .2s; box-shadow: 0 -6px 20px rgba(0,0,0,.35); }
  #panel[data-sheet="half"] { height: 52vh; }
  #panel[data-sheet="full"] { height: calc(100% - 4px); }
  #panel:not(.open) { width: 100%; height: 44px; }
  #panel:not(.open) .tabs { display: flex; }
  .panel-head { position: relative; }
  .panel-head::before { content: ""; position: absolute; left: 50%; top: 3px; width: 36px; height: 4px; margin-left: -18px; border-radius: 2px; background: var(--line); }
  .tabs { padding-top: 4px; overflow-x: auto; scrollbar-width: none; }
  .tabs::-webkit-scrollbar { display: none; }
  .tab { flex: 0 0 auto; padding: 10px 12px; }
  #panel-toggle { transform: none !important; font-size: 18px; padding: 6px 12px; }
  #panel-toggle::after { content: "▴"; }
  #panel[data-sheet="full"] #panel-toggle::after { content: "▾"; }
  #panel-toggle { font-size: 0; }
  #panel-toggle::after { font-size: 16px; }
  .panel-body { padding: 10px 12px 28px; }
  .stat .v { font-size: 17px; }
  .chart { height: 200px; }
  .chart.tall { height: 240px; }
  #attrib { white-space: nowrap; overflow-x: auto; height: 24px; line-height: 23px; font-size: 10px; scrollbar-width: none; }
  .forecast-row .fc { width: 84px; }
  .stat-row { gap: 6px; }
  .stat { min-width: 96px; padding: 6px 8px; }
  table.data { font-size: 11.5px; }
  .modal { padding: 8px; }
  .modal-body { font-size: 12.5px; }
}
@media (max-width: 480px) {
  #legend { max-width: 170px; font-size: 11px; }
  .legend-row { line-height: 16px; }
}

/* panel history */
.nav-bar { display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--line); background: var(--bg2); font-size: 12px; }
.nav-back { padding: 3px 9px; font-size: 12px; }
.crumbs { display: flex; align-items: center; gap: 4px; overflow: hidden; white-space: nowrap; color: var(--fg3); min-width: 0; }
.crumb { cursor: pointer; color: var(--accent); overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.crumb.on { color: var(--fg); cursor: default; }
.crumb-sep { color: var(--fg3); }
th.has-tip, .stat .l.has-tip { cursor: help; text-decoration: underline dotted rgba(169,182,207,.5); text-underline-offset: 3px; }
@media (max-width: 900px) { .nav-bar { padding: 4px 8px; } }
details.well { border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; margin: 6px 0; }
details.well summary { cursor: pointer; font-size: 12px; }
details.well .data { margin-top: 4px; }

/* grouped layers menu */
.layers-menu { width: 400px; padding: 10px 12px 8px; }
.layers-menu .menu-title { font-size: 13px; }
.layers-menu .menu-title .small { font-weight: 400; }
.layer-group { margin-top: 8px; }
.group-name { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg3); margin: 4px 0 2px; }
.layer-row { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; background: none; border: none; border-radius: 6px; padding: 5px 6px; cursor: pointer; color: var(--fg); }
.layer-row:hover { background: var(--bg3); }
.lr-box { width: 15px; height: 15px; border-radius: 4px; border: 1.5px solid var(--fg3); flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; }
.layer-row.on .lr-box { background: #1d4ed8; border-color: #3b82f6; }
.layer-row.on .lr-box::after { content: "✓"; color: #fff; font-weight: 700; }
.lr-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.lr-name { font-size: 12.5px; font-weight: 600; }
.lr-desc { font-size: 11px; color: var(--fg2); }
.lr-zoom { font-size: 10px; color: var(--fg3); white-space: nowrap; }
.layer-row.far .lr-zoom { color: var(--accent2); }
.layer-row.far .lr-zoom::after { content: " · zoom in"; }
#map-hint { top: 12px; left: 56px; max-width: 320px; display: flex; gap: 10px; align-items: center; background: rgba(29, 78, 216, .92); border-color: #3b82f6; color: #fff; font-size: 12.5px; box-shadow: 0 6px 20px rgba(0,0,0,.35); }
#map-hint button { background: none; border: none; color: #fff; cursor: pointer; font-size: 13px; padding: 0 2px; }
@media (max-width: 900px) { #map-hint { left: 8px; right: 8px; max-width: none; top: 52px; } .layers-menu { width: auto; } }

/* resizable panel, text size */
#panel { position: relative; }
#panel-resize { position: absolute; left: -4px; top: 0; bottom: 0; width: 9px; cursor: col-resize; z-index: 6; }
#panel-resize:hover, #panel.resizing #panel-resize { background: rgba(56,189,248,.35); }
#panel.resizing { transition: none !important; user-select: none; }
#panel:not(.open) #panel-resize { display: none; }
@media (max-width: 900px) { #panel-resize { display: none; } .panel-head { touch-action: pan-x; } #panel.resizing { transition: none !important; } }

/* map tools: locate, measure */
.maplibregl-ctrl-group button { color: var(--fg); }
.maplibregl-ctrl-attrib summary { margin: 0; }  /* our generic details summary margin pushed the (i) button 6 px below its box */
.maplibregl-ctrl-group button svg { display: block; margin: auto; }
.maplibregl-ctrl-group button.active { background: #1d4ed8; color: #fff; }
.locate-btn.busy svg { animation: spin 1.2s linear infinite; }
.locate-btn.following { color: #60a5fa; }
body.measuring .maplibregl-canvas { cursor: crosshair !important; }
#measure-box { top: 12px; left: 56px; min-width: 180px; z-index: 6; }
#measure-box .mb-title { font-weight: 600; display: flex; justify-content: space-between; gap: 8px; align-items: center; }
#measure-box .mb-x { background: none; border: none; color: var(--fg2); cursor: pointer; font-size: 13px; padding: 0 2px; }
#measure-box .mb-v { font-size: 17px; font-weight: 700; margin: 2px 0; }
/* point panel: coordinates and section jump bar */
.coords { display: flex; flex-wrap: wrap; gap: 3px 10px; align-items: center; font-size: 11.5px; color: var(--fg2); margin: 2px 0 6px; font-variant-numeric: tabular-nums; }
.coords .copy { background: none; border: 1px solid var(--line); border-radius: 4px; color: var(--fg2); cursor: pointer; font-size: 11px; padding: 0 5px; margin-left: -7px; line-height: 1.5; }
.coords .copy:hover { color: var(--fg); border-color: var(--fg3); }
#tab-point > div[id^="pt-"] { scroll-margin-top: 46px; }
@media (max-width: 900px) { #measure-box { left: 8px; right: auto; top: 52px; } }

/* help dialog tabs */
.modal-head { gap: 10px; }
.modal-tabs { display: flex; gap: 4px; flex: 1; justify-content: center; }
.mtab { background: none; border: 1px solid transparent; border-radius: 6px; padding: 4px 10px; font-size: 12.5px; color: var(--fg2); cursor: pointer; }
.mtab.on { background: var(--bg3); border-color: var(--line); color: var(--fg); }
.help-pane { display: none; } .help-pane.on { display: block; }
ul.src li { margin: 5px 0; }
ul.src .small { display: block; margin-top: 1px; }
@media (max-width: 900px) { .modal-head { flex-wrap: wrap; } .modal-tabs { order: 3; flex-basis: 100%; justify-content: flex-start; } }

/* phone control strip: scroll affordance */
.strip-more, .strip-hint { display: none; }
@media (max-width: 900px) {
  #topbar.can-right::after { content: ""; position: absolute; right: 0; bottom: 0; width: 56px; height: 46px; pointer-events: none; background: linear-gradient(90deg, rgba(22,33,58,0), var(--bg2) 70%); }
  #topbar.can-left::before { content: ""; position: absolute; left: 0; bottom: 0; width: 28px; height: 46px; pointer-events: none; background: linear-gradient(270deg, rgba(22,33,58,0), var(--bg2) 80%); z-index: 1; }
  .strip-more { display: block; position: absolute; right: 6px; z-index: 25; width: 30px; height: 30px; border-radius: 50%; border: 1px solid #3b82f6; background: #1d4ed8; color: #fff; font-size: 20px; line-height: 26px; padding: 0; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,.4); }
  .strip-more[hidden] { display: none; }
  .strip-hint { display: block; position: absolute; right: 44px; z-index: 25; background: #1d4ed8; border: 1px solid #3b82f6; color: #fff; font-size: 12px; padding: 5px 10px; border-radius: 999px; box-shadow: 0 4px 14px rgba(0,0,0,.4); animation: nudge 1.2s ease-in-out 3; }
  .strip-hint[hidden] { display: none; }
  @keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-8px); } }
}

/* focus, open-elsewhere row, retry chips, quick start */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.open-row { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: center; font-size: 11.5px; color: var(--fg3); margin: 0 0 6px; }
.open-row a { border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; color: var(--fg2); }
.open-row a:hover { color: var(--fg); border-color: var(--accent); text-decoration: none; }
.quick { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; margin: 10px 0 6px; }
.qs { background: var(--bg3); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font-size: 12px; display: flex; flex-direction: column; gap: 2px; color: var(--fg2); }
.qs b { color: var(--fg); }
.qn { width: 20px; height: 20px; border-radius: 50%; background: #1d4ed8; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 2px; }
.quick .btn { grid-column: 1 / -1; justify-self: start; }
.sr-kind.recent { color: var(--fg3); }
@media (max-width: 900px) { .quick { grid-template-columns: 1fr; } }

.asof { font-size: 10.5px; color: var(--fg3); text-align: right; margin: 2px 0 6px; }

/* phone: when the bottom sheet covers the map, hide everything that floats over the map */
@media (max-width: 900px) { body.sheet-full #map-wrap .floating, body.sheet-full #map-wrap .maplibregl-ctrl { visibility: hidden; } }

@media (max-width: 900px) {
  .strip-less { right: auto; left: 6px; }
  .controls { cursor: grab; }
  #topbar.can-left::before { width: 44px; }
}
.mb-actions { display: flex; gap: 6px; margin-top: 6px; }
.mb-actions .btn { padding: 6px 12px; min-height: 32px; }

.sr-kind.parcel { color: var(--accent2); }

table.fresh-table td { font-size: 12px; }
table.fresh-table tr.warn td:last-child { color: var(--accent2); }

#profile-box { left: 56px; right: 12px; bottom: 44px; max-width: 760px; z-index: 6; }
#profile-box .pf-chart { height: 180px; }
#profile-box .pf-stats { margin: 2px 0 4px; }
@media (max-width: 900px) { #profile-box { left: 8px; right: 8px; bottom: 60px; } #profile-box .pf-chart { height: 150px; } }

.lg-select { display: block; margin: 2px 0 6px; background: var(--bg3); border: 1px solid var(--line); border-radius: 5px; color: var(--fg); font-size: 11px; padding: 2px 4px; max-width: 100%; }

/* imagery compare */
#compare { position: absolute; inset: 0; z-index: 4; pointer-events: none; }
#compare-map { position: absolute; inset: 0; }
#compare-handle { position: absolute; top: 0; bottom: 0; width: 0; pointer-events: auto; cursor: col-resize; touch-action: none; }
#compare-handle .ch-bar { position: absolute; top: 0; bottom: 0; left: -2px; width: 4px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.4); }
#compare-handle .ch-grip { position: absolute; top: 50%; left: -18px; width: 36px; height: 36px; margin-top: -18px; border-radius: 50%; background: #1d4ed8; color: #fff; border: 2px solid #fff; display: flex; align-items: center; justify-content: center; font-size: 16px; box-shadow: 0 2px 8px rgba(0,0,0,.5); }
#compare-box { top: 12px; left: 50%; transform: translateX(-50%); display: flex; gap: 10px; align-items: center; pointer-events: auto; white-space: nowrap; }
#compare-box select { background: var(--bg3); border: 1px solid var(--line); border-radius: 5px; color: var(--fg); font-size: 11px; padding: 2px 4px; max-width: 220px; }
#compare-box .mb-x { background: none; border: none; color: var(--fg2); cursor: pointer; font-size: 13px; }
@media (max-width: 900px) { #compare-box { top: 52px; left: 8px; right: 8px; transform: none; white-space: normal; flex-wrap: wrap; } #compare-box select { max-width: 100%; } }

.layer-row.loading .lr-zoom { color: var(--accent); }
.layer-row.loading .lr-zoom::before { content: "⟳ "; display: inline-block; animation: spin 1.2s linear infinite; }
.layer-row.error .lr-zoom { color: #fca5a5; }
.layer-row.error .lr-zoom::after { content: ""; }

hr.popup-sep { border: 0; border-top: 1px solid #334155; margin: 6px 0; }
/* Radar QPE legend (NWS classes) */
.qpe-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px 10px; margin: 4px 0; }
.qpe-row { display: flex; align-items: center; gap: 5px; font-size: 11px; line-height: 16px; white-space: nowrap; }
.qpe-row img { border-radius: 2px; flex: none; }
#qpe-legend .warn { color: #f59e0b; }

/* Freshness chips in the Sources tab (data/freshness.json) */
.fresh { display: inline-block; margin: 2px 4px 0 0; padding: 0 6px; border-radius: 9px; font-size: 10.5px; line-height: 16px; background: #1f2937; color: #cbd5e1; border: 1px solid #374151; white-space: nowrap; }
.fresh-ok { border-color: #14532d; color: #86efac; } .fresh-watch { border-color: #78350f; color: #fcd34d; }
.fresh-stale, .fresh-newer { border-color: #7f1d1d; color: #fca5a5; } .fresh-error { color: #9ca3af; font-style: italic; }
.fresh-flag { color: #fca5a5; }

/* Touch targets: small icon buttons get a 32 px hit area without changing their look (audit 2026-09-23) */
.mb-x, .copy { position: relative; }
.mb-x::after, .copy::after { content: ""; position: absolute; inset: -8px; }
@media (pointer: coarse) { .mb-x, .copy { min-width: 28px; min-height: 28px; } }

/* HUC line in the Point header, land-cover table in the runoff card */
.huc-line { margin: 2px 0 6px; line-height: 1.5; }
.lc-table summary { cursor: pointer; margin: 6px 0; font-size: 12px; }
.lc-table .swatch { display: inline-block; width: 10px; height: 10px; margin-right: 5px; vertical-align: -1px; border-radius: 2px; }

/* Site name lives in the footer; the header is controls only (2026-09-23) */
.foot-brand { white-space: nowrap; color: var(--fg1, inherit); }
.foot-brand img { vertical-align: -2px; }
/* keep the desktop header to two rows: the basemap list has long option names */
@media (min-width: 901px) { #ctl-basemap { max-width: 190px; } #topbar { gap: 12px; } }

/* Radar row carries its product picker (moved from the header, 2026-09-24) */
.lr-with-select { display: flex; align-items: center; gap: 6px; }
.lr-with-select .layer-row { flex: 1; min-width: 0; }
.lr-select { background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; color: var(--fg); font-size: 12px; max-width: 150px; }

/* one-row desktop header: Layers/Basemap captions dropped (the controls name themselves), search a bit narrower */
@media (min-width: 901px) { #ctl-search { width: 215px; } }

/* Field notes (points, tracks, photos kept on the device) */
.fd-actions { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 6px; }
.fd-actions .btn { padding: 9px 12px; font-size: 13px; }
.fd-rec { background: #7f1d1d; border-color: var(--danger); color: #fff; }
.fd-live { border-color: #f43f5e; }
.fd-err { color: #fca5a5; }
.fd-row { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; border-bottom: 1px solid var(--line); }
.fd-row.fd-hl { background: rgba(56,189,248,.15); }
.fd-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 4px; cursor: zoom-in; flex: none; }
.fd-ico { width: 56px; text-align: center; font-size: 20px; flex: none; }
.fd-main { flex: 1; min-width: 0; }
.fd-main input { width: 100%; background: transparent; border: 1px solid transparent; border-radius: 4px; color: var(--fg); padding: 2px 4px; font-size: 13px; }
.fd-main input:focus { border-color: var(--line); background: var(--bg3); outline: none; }
.fd-main .fd-note { font-size: 12px; color: var(--fg2); }
.fd-btns { display: flex; flex-direction: column; gap: 4px; flex: none; }
.fd-btns .chip { padding: 4px 9px; }
.fd-lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.92); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px; }
.fd-lightbox img { max-width: 100%; max-height: calc(100% - 40px); object-fit: contain; }
.fd-cap { color: #ddd; font-size: 13px; margin-top: 8px; text-align: center; }
#fd-banner { position: absolute; top: 10px; left: 50%; transform: translateX(-50%); z-index: 5; background: #1d4ed8; color: #fff; border: 1px solid #3b82f6; border-radius: 999px; padding: 7px 14px; font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.4); cursor: pointer; white-space: nowrap; max-width: calc(100% - 120px); overflow: hidden; text-overflow: ellipsis; }
#fd-banner.rec { background: #7f1d1d; border-color: var(--danger); }
#fd-banner span { opacity: .75; }

/* Footer logo easter egg */
#egg-pop { position: fixed; z-index: 1000; width: 40px; height: 40px; image-rendering: pixelated; cursor: pointer; filter: drop-shadow(0 3px 6px rgba(0,0,0,.55)); transform-origin: 0 100%; animation: egg-pop .3s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes egg-pop { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@media (max-width: 900px) { #legend { max-height: calc(100% - 16px); } } /* phones: legend sits top-right, clear of the tool column */
ul.abbr { columns: 2 260px; column-gap: 24px; } ul.abbr li { break-inside: avoid; }

/* Point panel: fixed, grouped section rows (one-line answer in each header; open on demand) */
.linkbtn { background: none; border: none; padding: 0; color: var(--accent); cursor: pointer; font: inherit; }
.linkbtn:hover { text-decoration: underline; }
.sec-tools { text-align: right; font-size: 11px; color: var(--fg3); margin: 10px 0 0; }
.sec-group { margin: 8px 0 6px; border-left: 3px solid var(--g); background: rgba(255,255,255,.015); border-radius: 0 6px 6px 0; }
.sec-group-h { font-size: 10.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--g); padding: 6px 10px 4px; font-weight: 600; }
.g-water { --g: #38bdf8; } .g-screen { --g: #f59e0b; } .g-land { --g: #a3e635; } .g-wx { --g: #c084fc; }
details.sec { border-top: 1px solid rgba(43,58,94,.7); }
details.sec > summary { list-style: none; display: flex; align-items: baseline; gap: 10px; padding: 7px 10px; cursor: pointer; }
details.sec > summary::-webkit-details-marker { display: none; }
details.sec > summary::before { content: "▸"; color: var(--fg3); font-size: 10px; width: 8px; flex: none; transition: transform .15s; }
details.sec[open] > summary::before { transform: rotate(90deg); }
details.sec > summary:hover { background: var(--bg3); }
.sec-t { font-weight: 600; font-size: 13px; flex: none; white-space: nowrap; }
.sec-s { flex: 1 1 auto; min-width: 0; text-align: right; font-size: 12px; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.sec.pending .sec-s { color: var(--fg3); font-style: italic; }
details.sec.none .sec-t, details.sec.none .sec-s { color: var(--fg3); font-weight: 500; }
details.sec.error .sec-s { color: #fca5a5; }
.sec-body { padding: 2px 10px 12px 28px; overflow-anchor: auto; }
.sec-body > h3:first-child { font-size: 11px; font-weight: 500; color: var(--fg3); margin: 0 0 6px; }
.sec-body:empty::after { content: "Nothing mapped here."; color: var(--fg3); font-size: 12px; }
@media (max-width: 900px) { .sec-t { font-size: 13.5px; } details.sec > summary { padding: 10px; } .sec-body { padding-left: 14px; } }
.sec-cta { background: #1d4ed8; border: 1px solid #60a5fa; color: #fff; font: inherit; font-weight: 700; font-size: 12.5px; border-radius: 999px; padding: 3px 12px; cursor: pointer; box-shadow: 0 0 0 2px rgba(59,130,246,.25); white-space: nowrap; }
.sec-cta:hover { background: #2563eb; box-shadow: 0 0 0 3px rgba(59,130,246,.4); }

/* Site report options dialog */
.rpt-box { width: min(760px, 100%); }
.rpt-map { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.rpt-map-opts { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; }
.rpt-map-opts label, .rpt-group label { display: flex; gap: 6px; align-items: baseline; cursor: pointer; }
.rpt-prev { flex: 0 0 260px; min-height: 120px; display: flex; align-items: center; justify-content: center; background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.rpt-prev img { width: 100%; display: block; }
.rpt-presets { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 8px; color: var(--fg3); font-size: 12px; }
.rpt-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 10px; }
.rpt-group { border: 1px solid var(--line); border-radius: 6px; padding: 6px 10px 8px; margin: 0; display: flex; flex-direction: column; gap: 4px; }
.rpt-group legend { font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--fg3); padding: 0 4px; }
.rpt-foot { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 10px 16px; border-top: 1px solid var(--line); }
.rpt-foot .small { margin-right: auto; color: #fca5a5; }
@media (max-width: 900px) { .rpt-prev { flex-basis: 100%; } }
.rpt-prev img[hidden] { display: none; }
.rpt-style { display: flex; flex-direction: column; gap: 6px; } .rpt-style label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
#rpt-detail[hidden] { display: none; }

/* Site-in-development notice (footer label and help panels): neutral, not alarming */
.foot-wip { display: inline-block; vertical-align: middle; padding: 0 6px; border-radius: 999px; border: 1px solid var(--line); color: var(--fg2); background: var(--bg3); font-size: 10.5px; line-height: 14px; white-space: nowrap; }
.wip-note { border: 1px solid var(--line); background: var(--bg3); color: var(--fg2); border-radius: 6px; padding: 8px 10px; margin: 10px 0; font-size: 12.5px; line-height: 1.45; }
.wip-note b { color: var(--fg); }
.wip-note a { color: var(--accent); }
/* keep every footer item on the footer's single line (taller inline items pushed the text below the clip) */
#attrib > * { vertical-align: middle; }

/* Field notes team sync and project field records */
.fd-sync { border: 1px solid var(--line); background: var(--bg3); border-radius: 6px; padding: 8px 10px; margin: 8px 0; display: grid; gap: 6px; }
.fd-sync label.small { display: grid; gap: 3px; }
.fd-sync select, .fd-visit { width: 100%; background: var(--bg2); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 6px; font-size: 13px; }
.fd-sync .btn { justify-self: start; }
.fd-sync .chk { display: flex; gap: 6px; align-items: center; }
.fd-sync-hint { margin: 6px 0; }
.fd-badge { display: inline-block; margin-right: 4px; color: var(--fg2); }
.fd-badge.ok { color: #38bdf8; }
.fr-visit { border-top: 1px solid var(--line); padding: 6px 0; }
.fr-vhead { font-size: 13px; }
.fr-vnote { font-size: 12.5px; color: var(--fg2); margin: 2px 0 4px; white-space: pre-wrap; }
.fr-row { display: flex; gap: 8px; align-items: flex-start; padding: 4px 0; }
.fr-thumb { width: 48px; height: 48px; object-fit: cover; border-radius: 4px; cursor: zoom-in; flex: none; }
.fr-ico { width: 48px; text-align: center; font-size: 18px; flex: none; }
.fr-main { flex: 1; min-width: 0; font-size: 13px; }
.pt-form label { display: grid; gap: 3px; }

/* Password boxes with a show/hide eye */
.pw-wrap { position: relative; display: block; }
.form .pw-wrap input { padding-right: 34px; }
.pw-eye { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); background: none; border: 0; color: var(--fg2); padding: 5px 7px; cursor: pointer; line-height: 0; border-radius: 4px; }
.pw-eye:hover, .pw-eye[aria-pressed="true"] { color: var(--fg); }
.pw-eye:focus-visible { outline: 2px solid #38bdf8; }

/* Photo annotate card (after Take photo / a single Add photo) */
.fd-annot { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.75); display: flex; align-items: center; justify-content: center; padding: 12px; }
.fd-annot-box { background: var(--bg2); border: 1px solid var(--line); border-radius: 10px; padding: 12px; width: min(520px, 100%); max-height: 100%; overflow: auto; display: grid; gap: 8px; }
.fd-annot-box img { width: 100%; max-height: 45vh; object-fit: contain; background: #000; border-radius: 6px; }
.fd-annot-box label { display: grid; gap: 3px; }
.fd-annot-box input, .fd-annot-box textarea { width: 100%; background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 7px 8px; color: var(--fg); font: inherit; font-size: 15px; }
.fd-annot-box .fd-actions { margin: 2px 0 0; }

/* Polish pass 2026-10-06 */
.tab:disabled { display: none; } /* Station, Gauge, Point and Export appear once they have something to show */
#ctl-basemap { max-width: 190px; text-overflow: ellipsis; }
.legend-grid { display: grid; grid-template-columns: auto auto; column-gap: 12px; }
button:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible, input[type=checkbox]:focus-visible, .layer-row:focus-visible { outline: 2px solid #38bdf8; outline-offset: 2px; }
@media (min-width: 901px) and (max-width: 1300px) {
  .ctl > span:first-child { display: none; } /* "End date" / "Window" labels: the controls explain themselves */
  #ctl-search { width: 170px; }
  .controls { gap: 8px; }
}
@media (min-width: 901px) and (max-width: 1200px) { /* keep the header to one row: icon-only export and link buttons */
  .chip .lbl { display: none; }
  #ctl-search { width: 145px; }
  #ctl-basemap { max-width: 150px; }
}
@media (max-width: 900px) { #map-hint { top: auto; bottom: 64px; } } /* clear of the zoom buttons and legend */

/* QoL pass 2 */
.group-name[data-on]:not([data-on=""])::after { content: " · " attr(data-on); color: var(--accent); text-transform: none; letter-spacing: 0; }
#layers-off { font-size: 11.5px; margin-left: 6px; }
.fd-initials input { width: 70px; margin-left: 6px; background: var(--bg2); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; padding: 4px 6px; text-transform: uppercase; }
@media (max-width: 900px) { #status { max-width: calc(100% - 60px); } } /* clear of the map credits (ⓘ) button */

/* QoL pass 3: map menu, what's new, offline, layer filter */
.map-menu { position: absolute; z-index: 30; min-width: 220px; background: var(--bg2); border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.map-menu .mm-head { font-size: 11px; color: var(--fg3); padding: 4px 8px 6px; border-bottom: 1px solid var(--line); margin-bottom: 2px; }
.map-menu button { display: block; width: 100%; text-align: left; background: none; border: 0; color: var(--fg); padding: 7px 8px; border-radius: 5px; font-size: 13px; cursor: pointer; }
.map-menu button:hover, .map-menu button:focus { background: var(--bg3); outline: none; }
#whats-new { right: 12px; bottom: 34px; max-width: 360px; z-index: 6; font-size: 12.5px; }
#whats-new .wn-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 4px; }
ul.changes { margin: 4px 0 6px; padding-left: 18px; } ul.changes li { margin: 2px 0; }
.changes-box { margin: 6px 0 10px; font-size: 12.5px; } .changes-box summary { cursor: pointer; color: var(--accent); }
.changes-box h4 { margin: 8px 0 2px; font-size: 11px; text-transform: uppercase; color: var(--fg3); }
#offline-banner { top: 10px; left: 50%; transform: translateX(-50%); z-index: 7; max-width: min(560px, calc(100% - 120px)); background: #78350f; border-color: #b45309; color: #fff; font-size: 12.5px; }
.layers-filter { width: 100%; margin: 0 0 8px; background: var(--bg3); border: 1px solid var(--line); border-radius: 6px; padding: 6px 9px; color: var(--fg); font-size: 12.5px; }
@media (max-width: 900px) { #whats-new { left: 8px; right: 8px; bottom: 64px; max-width: none; } #offline-banner { top: auto; bottom: 110px; max-width: calc(100% - 16px); } }
#layers-menu [hidden] { display: none !important; }
#whats-new .wn-x { background: none; border: 0; color: var(--fg2); cursor: pointer; font-size: 14px; padding: 0 2px; } #whats-new .wn-x:hover { color: var(--fg); }
button.foot-wip { cursor: pointer; font-family: inherit; margin: 0; } button.foot-wip:hover { color: var(--fg); border-color: var(--fg3); }
#help-pane-changelog h4 { margin: 14px 0 2px; font-size: 12px; text-transform: uppercase; letter-spacing: .4px; color: var(--fg3); }
#open-changelog { margin: 2px 0 4px; }

/* Watershed method chooser */
.ws-method { display: inline-flex; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: 2px 0 6px; }
.ws-m { padding: 5px 12px; font-size: 12.5px; cursor: pointer; color: var(--fg2); }
.ws-m input { position: absolute; opacity: 0; pointer-events: none; }
.ws-m.on { background: var(--accent); color: #fff; }
.ws-m:has(input:focus-visible) { outline: 2px solid #38bdf8; outline-offset: -2px; }
.ws-method-help { margin-bottom: 6px; }

#legend .lg-select { background: var(--bg3); color: var(--fg); border: 1px solid var(--line); border-radius: 4px; font-size: 10.5px; padding: 0 2px; text-transform: none; letter-spacing: 0; }

/* The three map menus (Layers, Terrain, basemap/imagery) are where most of the site lives: a light accent tint
   invites a first click; once something is switched on, Layers and Terrain take the solid "on" style as before. */
#btn-layers:not(.on), #tg-terrain:not(.on), #ctl-basemap { border-color: rgba(56,189,248,.55); background: rgba(56,189,248,.12); color: #e0f2fe; }
#btn-layers:not(.on):hover, #tg-terrain:not(.on):hover, #ctl-basemap:hover { background: rgba(56,189,248,.22); filter: none; }
/* the tint is translucent, so give the basemap dropdown list its own opaque colors (else white list, light text) */
#ctl-basemap { color-scheme: dark; }
#ctl-basemap option, #ctl-basemap optgroup { background: var(--bg3); color: var(--fg); }
