:root {
  --paper: #faf8f3;
  --panel: #ffffff;
  --ink: #1d1b18;
  --muted: #736c61;
  --line: #e8e2d6;
  --land: #ebe5d8;
  --gold: #a8812f;
  --gold-soft: #f3ead6;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--paper); color: var(--ink); }
body { font: 14px/1.4 "Segoe UI", system-ui, -apple-system, sans-serif; }
#app { max-width: 1180px; margin: 0 auto; padding: 28px 24px 24px; }

.head { text-align: center; margin-bottom: 18px; }
.eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
h1 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; font-size: 32px; margin: 6px 0 4px; letter-spacing: -0.01em; }
.dek { margin: 0; color: var(--muted); }

/* search bar: centered, width-capped, themed to the app through its tokens */
.search-host { margin: 0 auto 4px; }
.das { --das-accent: #8a6a24; --das-accent-soft: #f3ead6; --das-border: #e1d9c8; --das-fg: #1d1b18; --das-muted: #736c61; max-width: 640px; margin: 0 auto; }

.kpis { display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 40px; margin: 18px 0 22px; }
.kpi { text-align: center; min-width: 90px; }
.kpi b { display: block; font-family: Georgia, serif; font-weight: 500; font-size: 28px; font-variant-numeric: tabular-nums; }
.kpi span { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 16px 22px 14px; margin-bottom: 16px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
h2 { margin: 0; font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.legend { font-size: 12px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.legend .ring { width: 9px; height: 9px; border-radius: 50%; border: 1.6px solid var(--ink); display: inline-block; }

.grid { display: grid; gap: 16px; }
.grid.two { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); }
.grid.two.even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.grid .panel { margin-bottom: 0; }
.grid + .grid { margin-top: 16px; }

.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; }
.chart text { font-family: inherit; fill: var(--muted); font-size: 11px; }

.lane-label { cursor: pointer; font-size: 12px !important; font-weight: 600; }
.lane-label.on { fill: var(--ink) !important; }
.lane-label.off { opacity: 0.35; }
.axis line, .axis path { stroke: var(--line); }
.dot { transition: opacity 0.2s; }

.bars .row { display: grid; grid-template-columns: 118px minmax(0, 1fr) 34px; align-items: center; gap: 10px; padding: 3px 0; }
.bars .name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bars .trk { height: 10px; background: var(--gold-soft); border-radius: 5px; overflow: hidden; }
.bars .bar { height: 100%; background: var(--gold); border-radius: 5px; transition: width 0.3s; }
.bars .v { text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.empty { color: var(--muted); text-align: center; padding: 30px 0; }
.foot { text-align: center; color: var(--muted); font-size: 11px; margin: 16px 0 0; }
.error { color: #b00020; text-align: center; }

.tip {
  position: fixed; z-index: 50; pointer-events: none; max-width: 260px;
  background: #1d1b18; color: #fff; border-radius: 8px; padding: 8px 10px; font-size: 12px; line-height: 1.35;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.25);
}
.tip b { display: block; font-size: 13px; }
.tip span { color: #d8cfbf; }

@media (max-width: 900px) {
  .kpis { gap: 8px 24px; }
  .kpi { min-width: 70px; }
  .kpi b { font-size: 24px; }
}
@media (max-width: 760px) {
  #app { padding: 18px 16px; }
  h1 { font-size: 24px; }
  .grid.two, .grid.two.even { grid-template-columns: minmax(0, 1fr); }
  .kpis { gap: 8px 22px; }
  .kpi b { font-size: 22px; }
}
@media (max-height: 320px) {
  .dek, .foot { display: none; }
  #app { padding-top: 10px; }
}

/* map: cities or density */
.seg { display: inline-flex; flex: none; border: 1px solid var(--line); border-radius: 14px; padding: 2px; background: var(--panel); }
.seg button { height: 24px; padding: 0 10px; border: 0; border-radius: 11px; background: none; color: var(--muted);
  font-family: inherit; font-size: 12px; font-weight: 600; cursor: pointer; }
.seg button.on { background: var(--ink); color: #fff; }
.seg button:not(.on):hover { color: var(--ink); }
.mapkey { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 14px; margin-top: 6px; font-size: 11px; color: var(--muted); }
.mapkey span { display: inline-flex; align-items: center; gap: 5px; }
.mapkey i { width: 9px; height: 9px; border-radius: 2px; opacity: 0.7; display: inline-block; }
