* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
body { display: flex; }

#sidebar {
  width: 320px;
  min-width: 320px;
  height: 100vh;
  overflow-y: auto;
  background: #fff;
  border-right: 1px solid #e3e3e3;
  padding: 16px;
  z-index: 1000;
}
#sidebar h1 { font-size: 18px; margin: 0 0 2px; }
.subtitle { margin: 0 0 12px; font-size: 12px; color: #777; }

.panel { border-top: 1px solid #eee; padding: 12px 0; }
.panel-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; color: #555; margin-bottom: 8px; }

#search { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 6px; font-size: 14px; }

.chk { display: flex; align-items: center; gap: 8px; font-size: 14px; padding: 4px 0; cursor: pointer; }
.chk.sub { font-size: 13px; color: #555; padding-left: 4px; }
.cnt { margin-left: auto; color: #999; font-size: 12px; }

.dot { width: 14px; height: 14px; border-radius: 50%; display: inline-block; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.dot-wr { background: #2e7d32; }
.dot-tk { background: #e65100; }

.box { width: 16px; height: 12px; display: inline-block; border-radius: 2px; }
.box-1 { background: rgba(0,0,255,.45); border: 1px solid #0000ff; }
.box-2 { background: rgba(231,99,99,.55); border: 1px solid #c62828; }
.box-3 { background: rgba(123,0,0,.6); border: 1px solid #7b0000; }

.scroll-list { max-height: 190px; overflow-y: auto; border: 1px solid #eee; border-radius: 6px; padding: 6px; }
.scroll-list label { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 3px 0; cursor: pointer; }
.scroll-list .cnt { margin-left: auto; }
.mini-actions { font-size: 12px; margin-top: 6px; }
.mini-actions a { color: #1565c0; text-decoration: none; }

.summary { font-size: 14px; }
.summary .muted { color: #999; font-size: 12px; margin-top: 2px; }
.footer { font-size: 11px; color: #aaa; padding-top: 10px; }

#map { flex: 1; height: 100vh; }

#loading {
  position: fixed; top: 12px; right: 12px; z-index: 1200;
  background: #1565c0; color: #fff; padding: 8px 14px; border-radius: 6px;
  font-size: 13px; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}

.popup-name { font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.popup-row { font-size: 13px; margin: 2px 0; }
.popup-row b { color: #555; font-weight: 600; }
.badge { display: inline-block; padding: 1px 7px; border-radius: 10px; color: #fff; font-size: 11px; font-weight: 600; }
.badge-wr { background: #2e7d32; }
.badge-tk { background: #e65100; }
.badge-agro { background: #6a1b9a; margin-left: 4px; }
.badge-former { background: #607d8b; margin-left: 4px; }

.hint { font-size: 11px; color: #999; margin-top: 6px; line-height: 1.4; }

.status-btn {
  margin-top: 8px; width: 100%; padding: 6px 10px; border: none; border-radius: 6px;
  font-size: 12px; font-weight: 600; color: #fff; cursor: pointer;
}
.status-btn.to-former { background: #607d8b; }
.status-btn.to-active { background: #2e7d32; }
.status-btn:disabled { opacity: .6; cursor: default; }

.legend {
  background: #fff; padding: 8px 10px; border-radius: 6px; box-shadow: 0 1px 5px rgba(0,0,0,.3);
  font-size: 12px; line-height: 1.6;
}
.legend .row { display: flex; align-items: center; gap: 6px; }

@media (max-width: 720px) {
  body { flex-direction: column; }
  #sidebar { width: 100%; min-width: 0; height: auto; max-height: 45vh; }
  #map { height: 55vh; }
}
