:root {
  --ink: #1d2a24; --muted: #5d6b64; --line: #d9e0dc; --bg: #f6f8f6; --accent: #2f6f4f;
  --warn: #b5541c; --panel: 380px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); }
#app { display: flex; height: 100%; }
body.mappage { display: flex; flex-direction: column; }
body.mappage #app { flex: 1; min-height: 0; height: auto; }
#panel { width: var(--panel); max-width: 100%; display: flex; flex-direction: column; background: #fff; border-right: 1px solid var(--line); z-index: 1000; }
#panel header { display: flex; align-items: center; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
#panel h1 { font-size: 18px; margin: 0; }
.tag { font-size: 11px; color: var(--accent); border: 1px solid var(--accent); border-radius: 10px; padding: 1px 7px; }
.icon { margin-left: auto; border: 0; background: none; font-size: 20px; cursor: pointer; color: var(--muted); }
#panel-body { overflow-y: auto; flex: 1; }
#map { flex: 1; }
.search { position: relative; padding: 12px 14px 6px; }
#q { width: 100%; padding: 9px 11px; border: 1px solid var(--line); border-radius: 8px; font-size: 15px; }
#suggest { position: absolute; left: 14px; right: 14px; top: 52px; margin: 0; padding: 0; list-style: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.12); z-index: 10; }
#suggest li { padding: 8px 11px; cursor: pointer; }
#suggest li:hover, #suggest li.on { background: var(--bg); }
.tabs { display: flex; gap: 4px; padding: 6px 14px 0; border-bottom: 1px solid var(--line); }
.tabs button { border: 0; background: none; padding: 8px 10px; cursor: pointer; color: var(--muted); border-bottom: 2px solid transparent; font-size: 14px; }
.tabs button.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.tab { display: none; padding: 12px 14px 20px; }
.tab.active { display: block; }
.muted { color: var(--muted); }
.small { font-size: 12.5px; }
h2 { font-size: 16px; margin: 0 0 8px; }
.summary { background: var(--bg); border-left: 3px solid var(--accent); padding: 8px 10px; margin: 0 0 12px; }
.summary.warn { border-left-color: var(--warn); }
.layer-results { list-style: none; margin: 0; padding: 0; }
.layer-results li { padding: 7px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.layer-results li b { display: block; font-size: 13px; font-weight: 600; }
.layer-results li.att b::before { content: "● "; color: var(--warn); }
.layer-results li span { font-size: 14px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.filters label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.filters select, .filters input { font-size: 14px; padding: 4px; }
.filters input[type=number] { width: 90px; }
.filters label.check { flex-direction: row; align-items: center; gap: 6px; width: 100%; font-size: 13px; }
.facts { font-size: 12.5px; color: var(--ink); }
.signals { list-style: none; margin: 0; padding: 0; }
.signals li { padding: 9px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.signals li:hover { background: var(--bg); }
.signals .meta { font-size: 12px; color: var(--muted); }
.stars { color: #c58b00; letter-spacing: 1px; font-size: 12px; }
.kind { font-size: 11px; background: var(--bg); border: 1px solid var(--line); border-radius: 9px; padding: 0 6px; margin-left: 4px; }
.group { margin: 10px 0 4px; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ov { padding: 5px 0; }
.ov label { display: flex; gap: 8px; align-items: baseline; cursor: pointer; }
.ov .sub { font-size: 12px; color: var(--muted); }
.ov .extra { margin: 4px 0 4px 24px; }
.ov .extra img { max-width: 100%; display: block; margin-top: 4px; }
.ov input[type=range] { width: 120px; }
.popup a { color: var(--accent); }
.popup button { margin-top: 6px; border: 1px solid var(--accent); background: #fff; color: var(--accent); border-radius: 6px; padding: 3px 8px; cursor: pointer; }
@media (max-width: 760px) {
  #app { flex-direction: column; }
  #panel { width: 100%; max-height: 55%; border-right: 0; border-bottom: 1px solid var(--line); }
  #panel.collapsed #panel-body { display: none; }
  #map { min-height: 45%; }
}
@media (min-width: 761px) {
  #panel.collapsed { width: 56px; }
  #panel.collapsed #panel-body, #panel.collapsed h1, #panel.collapsed .tag { display: none; }
}
body.login { display: flex; align-items: center; justify-content: center; background: var(--bg); }
.login-box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 24px; width: min(360px, 92vw); display: flex; flex-direction: column; gap: 12px; }
.login-box h1 { margin: 0; font-size: 20px; }
.login-box input { padding: 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; }
.login-box button { padding: 10px; border: 0; border-radius: 8px; background: var(--accent); color: #fff; font-size: 15px; cursor: pointer; }
.login-box .error { color: var(--warn); margin: 0; }
.zoomhint { font-size: 12px; color: #8a4b00; background: #fff4e0; border-radius: 4px; padding: 3px 6px; margin-top: 4px; }
.linkbtn { background: none; border: 0; padding: 0; color: inherit; text-decoration: underline; cursor: pointer; font: inherit; }
.mapnote { background: #fff4e0; color: #8a4b00; padding: 4px 8px; border-radius: 4px; font-size: 12px; box-shadow: 0 1px 3px rgba(0,0,0,.3); max-width: 240px; }
.mapnote[hidden] { display: none; }
.zoomhint[hidden] { display: none; }
.hovertip { max-width: 260px; white-space: normal; font-size: 12px; }
.legend { list-style: none; margin: 6px 0 0; padding: 0; font-size: 12px; }
.legend li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 2px 0; }
.legend .swatch { width: 18px; height: 12px; border-radius: 2px; background: var(--c); border: 1px solid rgba(0,0,0,.2); flex: none; }
.legend .swatch.empty { background: repeating-linear-gradient(45deg, #fff 0 3px, #e4e4e4 3px 6px); }
.legend .swatch.outline { background: #fff; border: 2px solid var(--c); }
.legend .infobtn { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--muted); background: none; color: var(--muted);
  font: italic 600 10px/14px Georgia, serif; padding: 0; cursor: pointer; flex: none; }
.legend .info { flex-basis: 100%; margin-left: 26px; color: var(--muted); }
.legend .info[hidden] { display: none; }
.legend[hidden] { display: none; }
.linkbtn.small { font-size: 12px; margin-top: 4px; }
.home-link { color: inherit; text-decoration: none; }
header h1 small { font: 400 12px system-ui; color: var(--muted); }
a.tag { text-decoration: none; }
.sitebar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px; background: #e6ebe4; border-bottom: 1px solid #cfd8cc; font-family: system-ui, sans-serif; }
.sitebar .brand { display: flex; align-items: center; gap: 8px; font: 700 19px "Iowan Old Style", Palatino, Georgia, serif; color: #24312b; text-decoration: none; white-space: nowrap; }
.sitebar .logo { width: 24px; height: 24px; border-radius: 50%; background: radial-gradient(circle at 50% 38%, #e3a83c 0 30%, transparent 31%), linear-gradient(180deg, #dfece6 0 55%, #4f8a6f 55%); border: 2px solid #2f5236; }
.sitebar nav { display: flex; align-items: center; gap: 16px; overflow-x: auto; }
.sitebar nav a { color: #24312b; text-decoration: none; font-size: 14px; white-space: nowrap; }
.sitebar nav a.active { color: #2f5236; font-weight: 600; }
.sitebar .btn { background: #2f5236; color: #fff; border-radius: 18px; padding: 6px 14px; }
@media (max-width: 760px) { .sitebar nav a:not(.btn):not(.active) { display: none; } }
