:root{
  --panel: rgba(15, 20, 16, .78);
  --panel-line: rgba(255,255,255,.14);
  --ink: #f2f4ef;
  --ink-dim: #b9c2b4;
  --accent: #ffd166;
}
*{ box-sizing: border-box; }
html, body{ margin:0; height:100%; overflow:hidden; background:#0b0f0c;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink); }
#map{ position:absolute; inset:0; }

/* ---------- title card ---------- */
#titlecard{
  position:absolute; top:14px; left:14px; z-index:10;
  max-width: 300px; padding:14px 16px 12px;
  background:var(--panel); border:1px solid var(--panel-line); border-radius:14px;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 8px 30px rgba(0,0,0,.35);
}
#titlecard h1{ margin:0; font-size:19px; line-height:1.15; letter-spacing:.2px; }
#titlecard h1 span{ display:block; font-size:12px; font-weight:600; color:var(--accent);
  text-transform:uppercase; letter-spacing:1.6px; margin-top:3px; }
#cardlinks{ display:flex; gap:6px; flex-wrap:wrap; }
#cardlinks a{
  display:inline-flex; align-items:center; gap:5px;
  font-size:11.5px; font-weight:600; color:var(--ink-dim); text-decoration:none;
  padding:4px 9px; border:1px solid var(--panel-line); border-radius:999px;
}
#cardlinks a:hover{ color:var(--ink); border-color:rgba(255,255,255,.35); }
#cardlinks svg{ width:13px; height:13px; fill:none; stroke:currentColor;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }

/* ---------- legend chips ---------- */
#legend{
  position:absolute; left:14px; bottom:14px; z-index:10;
  display:flex; gap:6px; flex-wrap:wrap; max-width:min(520px, calc(100vw - 28px));
}
.chip{
  display:inline-flex; align-items:center; gap:6px;
  font: 600 12px/1 inherit; font-family:inherit; color:var(--ink);
  background:var(--panel); border:1px solid var(--panel-line); border-radius:999px;
  padding:7px 12px; cursor:pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.chip svg{ width:14px; height:14px; fill:none; stroke:currentColor;
  stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.chip:hover{ border-color:rgba(255,255,255,.4); }
.chip:not(.on){ color:var(--ink-dim); opacity:.55; }
.chip:not(.on) svg{ opacity:.6; }

/* ---------- view buttons ---------- */
#viewbtns{ position:absolute; right:14px; bottom:62px; z-index:10;
  display:flex; flex-direction:column; gap:6px; align-items:flex-end; }
.viewbtn{
  display:inline-flex; align-items:center; gap:7px;
  font:600 12px/1 inherit; font-family:inherit; color:var(--ink);
  background:var(--panel); border:1px solid var(--panel-line); border-radius:999px;
  padding:8px 13px; cursor:pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}
.viewbtn:hover{ border-color:rgba(255,255,255,.4); }
.viewbtn svg{ width:13px; height:13px; fill:currentColor; stroke:none; }


/* ---------- maplibre chrome ---------- */
.maplibregl-ctrl-top-right{ top:10px; right:10px; }
.maplibregl-ctrl-group{
  background:var(--panel) !important; border:1px solid var(--panel-line);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  box-shadow:0 4px 16px rgba(0,0,0,.3) !important;
}
.maplibregl-ctrl-group button{ background:transparent !important; }
.maplibregl-ctrl-group button + button{ border-top:1px solid var(--panel-line) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon{ filter: invert(1) hue-rotate(180deg); }
.maplibregl-ctrl-attrib{
  background:rgba(15,20,16,.6) !important; color:#aab3a6;
  font-size:10px; border-radius:8px 0 0 0;
}
.maplibregl-ctrl-attrib a{ color:#cdd6c8; }

.maplibregl-popup{ z-index:11; }
.maplibregl-popup-content{
  background:var(--panel); color:var(--ink);
  border:1px solid var(--panel-line); border-radius:12px;
  padding:11px 14px; box-shadow:0 8px 30px rgba(0,0,0,.4);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  font-size:13px;
}
.maplibregl-popup-anchor-bottom .maplibregl-popup-tip{ border-top-color:rgba(15,20,16,.85); }
.maplibregl-popup-anchor-top .maplibregl-popup-tip{ border-bottom-color:rgba(15,20,16,.85); }
.maplibregl-popup-anchor-left .maplibregl-popup-tip{ border-right-color:rgba(15,20,16,.85); }
.maplibregl-popup-anchor-right .maplibregl-popup-tip{ border-left-color:rgba(15,20,16,.85); }

#titlecard{ max-width:330px; }
#facts{ margin:9px 0 10px; font-size:12.5px; color:var(--ink-dim); line-height:1.5; }
#facts b{ color:var(--ink); font-weight:650; }

#bar{ display:flex; height:9px; border-radius:5px; overflow:hidden;
  background:rgba(0,0,0,.55); border:1px solid var(--panel-line); }
#bar i{ display:block; height:100%; }
#barkey{ display:flex; justify-content:space-between; font-size:10.5px;
  color:var(--ink-dim); margin:4px 0 11px; }

#searchwrap{ display:flex; align-items:center; gap:7px; margin-bottom:10px;
  background:rgba(255,255,255,.06); border:1px solid var(--panel-line);
  border-radius:10px; padding:0 10px; }
#searchwrap:focus-within{ border-color:rgba(255,255,255,.4); }
#searchwrap svg{ width:14px; height:14px; fill:none; stroke:var(--ink-dim);
  stroke-width:2; stroke-linecap:round; flex:none; }
#search{ flex:1; min-width:0; background:none; border:none; outline:none;
  color:var(--ink); font:500 12.5px/1 inherit; font-family:inherit; padding:9px 0; }
#search::placeholder{ color:var(--ink-dim); opacity:.8; }

.chip .short{ display:none; }
.chip .sw{ width:12px; height:12px; border-radius:3px; flex:none;
  border:2px solid var(--c); background:color-mix(in srgb, var(--c) 30%, transparent); }
.chip .sw.dash{ border-style:dashed; }

.viewbtn:not(.on):not(#btn-home){ color:var(--ink-dim); opacity:.7; }
.viewbtn svg{ fill:none !important; stroke:currentColor; stroke-width:2;
  stroke-linecap:round; stroke-linejoin:round; }

.popup-kind{ font-size:10px; font-weight:700; letter-spacing:1.2px; text-transform:uppercase;
  color:var(--accent); margin:0 12px 2px 0; }
.popup-name{ font-weight:700; font-size:14px; margin:0; }
.popup-desc{ margin:5px 0 0; color:var(--ink-dim); font-size:12px; line-height:1.4; }
/* public land only: just the easement toggle stays, the view buttons that
   no longer mean anything step aside */
body.natural .chip:not([data-key="ease"]), body.natural #btn-dim, body.natural #btn-tint{ display:none; }
body.natural #bar, body.natural #barkey{ opacity:.35; }
.popup-desc a{ color:var(--accent); }

@media (max-width:640px){
  #titlecard{ left:10px; right:10px; top:10px; max-width:none; padding:11px 13px 10px; }
  #titlecard h1{ font-size:16px; }
  #facts{ font-size:12px; margin:6px 0 8px; }
  #barkey, #cardlinks{ display:none; }
  #searchwrap{ margin-bottom:0; }
  .chip .long{ display:none; }
  .chip .short{ display:inline; }
  #legend{ left:10px; bottom:10px; gap:5px; max-width:calc(100vw - 70px); }
  .chip{ padding:6px 9px; font-size:11px; }
  #viewbtns{ right:10px; bottom:34px; }
  .viewbtn span{ display:none; }
  .viewbtn{ padding:10px; border-radius:50%; }
  .maplibregl-ctrl-top-right{ top:auto; bottom:170px; }
}
#btn-blue.on svg{ stroke:#6db8ff; }
