:root {
  --bg: #ffffff;
  --fg: #16181d;
  --muted: #5d6470;
  --line: #e4e6ea;
  --chip: #f3f4f6;
  --accent: #1d4ed8;
  --panel-w: 380px;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--fg);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); }
#map { position: fixed; inset: 0 0 0 var(--panel-w); }
a { color: var(--accent); }

#panel {
  position: fixed; inset: 0 auto 0 0; width: var(--panel-w);
  background: var(--bg); border-right: 1px solid var(--line);
  overflow-y: auto; padding: 20px 20px 28px;
}
#sheet-handle { display: none; }
h1 { font-size: 20px; margin: 0 0 6px; letter-spacing: -0.01em; }
.lede { margin: 0 0 16px; color: var(--muted); line-height: 1.45; }

.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 18px; }
.stat { background: var(--chip); border-radius: 8px; padding: 10px; }
.stat b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 12px; }

.filter-group { margin-bottom: 12px; }
.filter-group h2 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 6px; font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line);
  background: var(--bg); border-radius: 999px; padding: 4px 10px; font: inherit; font-size: 12.5px; cursor: pointer; color: var(--fg);
}
.chip[aria-pressed="false"] { opacity: .4; }
.chip .n { color: var(--muted); font-variant-numeric: tabular-nums; }
.swatch { width: 10px; height: 10px; border-radius: 50%; display: inline-block; flex: none; }
.ring { width: 12px; height: 12px; border-radius: 50%; background: #9aa3af; display: inline-block; flex: none; }
.ring.official { box-shadow: 0 0 0 2px #16181d inset; background: #c8ced6; }
.ring.press { border: 1.5px solid #fff; box-shadow: 0 0 0 1px #9aa3af; }
.ring.company { opacity: .5; }

#search { width: 100%; font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; margin: 8px 0 10px; }

#list { list-style: none; margin: 0; padding: 0; }
#list li, #unmapped li {
  display: grid; grid-template-columns: 14px 1fr auto; gap: 10px; align-items: center;
  padding: 8px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 6px;
}
#list li:hover, #unmapped li:hover, #list li.hover { background: var(--chip); }
.li-name { font-weight: 500; line-height: 1.3; }
.li-place { color: var(--muted); font-size: 12.5px; }
.li-mw { color: var(--muted); font-variant-numeric: tabular-nums; font-size: 12.5px; white-space: nowrap; }
#unmapped h3 { font-size: 13px; margin: 18px 0 4px; }
#unmapped p { color: var(--muted); margin: 0 0 6px; font-size: 12.5px; }
#unmapped ul { list-style: none; margin: 0; padding: 0; }
.empty { color: var(--muted); padding: 12px 0; }

footer { margin-top: 18px; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.coverage { background: #fff8e6; border: 1px solid #f5dfa3; color: #6b4e00; padding: 8px 10px; border-radius: 8px; }

/* detail view */
#detail .back { background: none; border: 0; padding: 0; font: inherit; color: var(--accent); cursor: pointer; margin-bottom: 12px; }
#detail h2 { font-size: 19px; margin: 0 0 6px; line-height: 1.25; }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; padding: 3px 9px; border-radius: 999px; background: var(--chip); margin: 0 6px 6px 0; }
#detail dl { display: grid; grid-template-columns: 110px 1fr; gap: 6px 12px; margin: 14px 0; }
#detail dt { color: var(--muted); }
#detail dd { margin: 0; }
#detail .notes { line-height: 1.5; margin: 0 0 14px; }
#detail h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 18px 0 6px; }
.sources { list-style: none; padding: 0; margin: 0; }
.sources li { padding: 8px 0; border-bottom: 1px solid var(--line); line-height: 1.4; }
.kind { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; padding: 1px 6px; border-radius: 4px; margin-right: 6px; }
.kind.official { background: #16181d; color: #fff; }
.kind.press { background: #e7ecf7; color: #1e3a8a; }
.kind.company { background: #f1f1f1; color: #555; }
.src-meta { color: var(--muted); font-size: 12px; }

dialog { max-width: 560px; border: 0; border-radius: 12px; padding: 24px 28px; line-height: 1.55; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(10, 12, 16, .35); }
dialog .close { position: absolute; right: 14px; top: 10px; border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--muted); }
dialog h2 { margin-top: 0; }
.small { font-size: 12px; color: var(--muted); }

.maplibregl-popup-content { font: 13px Inter, system-ui, sans-serif; padding: 8px 10px; border-radius: 8px; }
.tip-name { font-weight: 600; }
.tip-sub { color: var(--muted); }

@media (max-width: 760px) {
  :root { --panel-w: 0px; }
  #map { inset: 0; }
  #panel {
    inset: auto 0 0 0; width: 100%; height: 42vh; border-right: 0; border-top: 1px solid var(--line);
    border-radius: 14px 14px 0 0; box-shadow: 0 -8px 24px rgba(0,0,0,.12); padding: 10px 16px 24px;
    transition: height .2s ease;
  }
  #panel.expanded { height: 88vh; }
  #sheet-handle { display: block; width: 44px; height: 5px; border-radius: 3px; background: #cfd3d9; border: 0; margin: 0 auto 10px; padding: 0; cursor: pointer; }
  .lede { display: none; }
  .stats { gap: 6px; }
}
