* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  display: flex;
  font: 14px/1.4 system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1c2126;
}
#panel {
  width: 280px; flex: none; padding: 16px; overflow-y: auto;
  background: #f7f8f9; border-right: 1px solid #d5d9de;
  display: flex; flex-direction: column; gap: 4px;
}
#map { flex: 1; min-width: 0; background: #e9ecef; }
h1 { font-size: 17px; margin: 0; }
h2 {
  font-size: 11px; letter-spacing: .06em; text-transform: uppercase;
  color: #5d6670; margin: 18px 0 6px;
}
label { display: flex; align-items: center; gap: 6px; padding: 3px 0; cursor: pointer; }
label.indent { padding-left: 22px; }
.status { margin: 4px 0 0; color: #3c6e47; font-size: 12px; }
.status.bad { color: #b3261e; font-weight: 600; }
.banner {
  margin: 8px 0 0; padding: 8px; font-size: 12px;
  background: #fff4d6; border: 1px solid #e0c36a; border-radius: 4px;
}
.swatch {
  display: inline-block; width: 11px; height: 11px; border-radius: 50%;
  border: 1.5px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25);
}
.swatch.stop { background: #4a5560; width: 8px; height: 8px; }
.swatch.gym { background: #7b3fa0; }
.legend { list-style: none; margin: 4px 0 0; padding: 0 0 0 22px; font-size: 12px; color: #3d454d; }
.legend li { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.legend.off { display: none; }
.counts { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.counts th { font-weight: 500; font-size: 11px; color: #5d6670; text-align: right; }
.counts td { padding: 2px 0; text-align: right; }
.counts td:first-child { text-align: left; }
.hint { font-size: 12px; color: #5d6670; margin: 6px 0 0; }
.jumps { display: flex; flex-wrap: wrap; gap: 6px; }
button {
  font: inherit; font-size: 12px; padding: 4px 8px; cursor: pointer;
  background: #fff; border: 1px solid #c3c9d0; border-radius: 4px;
}
button:hover { background: #eef1f4; }
footer { margin-top: auto; padding-top: 16px; font-size: 11px; color: #5d6670; }

.maplibregl-popup-content { padding: 12px 14px; max-width: 280px; font: inherit; }
.pop h3 { margin: 0 0 2px; font-size: 15px; }
.pop .kind { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #5d6670; }
.pop img { display: block; width: 100%; max-height: 160px; object-fit: cover; border-radius: 4px; margin: 8px 0; }
.pop p { margin: 6px 0; font-size: 13px; }
.pop dl { display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; margin: 8px 0 0; font-size: 12px; }
.pop dt { color: #5d6670; }
.pop dd { margin: 0; }
.pop ul { margin: 4px 0 0; padding-left: 18px; font-size: 12px; }
.capture { margin: 2px 0 0; font-size: 12px; color: #3d454d; }
.capture.stale { color: #9a5b00; font-weight: 600; }
.sliders { display: grid; gap: 2px; margin-top: 10px; }
.sliders label { justify-content: space-between; padding: 6px 0 0; cursor: default; font-size: 13px; }
.sliders output { color: #5d6670; font-variant-numeric: tabular-nums; }
.sliders input[type="range"] { width: 100%; margin: 0; }
.sliders select { font: inherit; font-size: 13px; padding: 3px 4px; }
.sliders button { margin-top: 10px; justify-self: start; }
button[aria-pressed="true"] { background: #1c2126; color: #fff; border-color: #1c2126; }
button:disabled { opacity: .45; cursor: default; }
.measure-total { margin: 8px 0 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.measure-tip {
  background: #1c2126; color: #fff; font-size: 12px; font-weight: 600;
  padding: 2px 6px; border-radius: 3px; white-space: nowrap; pointer-events: none;
  font-variant-numeric: tabular-nums;
}
.swatch.battle { background: rgba(123,63,160,.45); border: 0; box-shadow: none; }
.swatch.raid { background: rgba(31,138,76,.5); border: 0; box-shadow: none; }
.sliders.indent-block { margin: 2px 0 0 22px; }

/* Context drawer (context.js): pops out of the right edge */
#context {
  width: 260px; flex: none; padding: 16px; overflow-y: auto;
  background: #f7f8f9; border-left: 1px solid #d5d9de;
  display: flex; flex-direction: column; gap: 4px;
}
#context[hidden] { display: none; }
#context-tab {
  position: fixed; right: 0; top: 50%; z-index: 5;
  transform: translateY(-50%); writing-mode: vertical-rl;
  padding: 12px 5px; font-size: 12px; font-weight: 600; letter-spacing: .05em;
  background: #f7f8f9; border: 1px solid #c3c9d0; border-right: 0;
  border-radius: 6px 0 0 6px; box-shadow: -1px 1px 4px rgba(0,0,0,.15);
}
#context-tab::before { content: "‹ "; }
body.context-open #context-tab { right: 260px; }
body.context-open #context-tab::before { content: "› "; }
.swatch.place {
  width: 13px; height: 13px; border: 0; border-radius: 0; box-shadow: none; background: #c2570c;
  clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%);
}
.swatch.community {
  width: 13px; height: 13px; border: 0; border-radius: 0; box-shadow: none; background: #0b7a75;
  clip-path: polygon(50% 0, 98% 35%, 79% 91%, 21% 91%, 2% 35%);
}
.pop a { color: #1a5fb4; }
