/* ── Live filter rail ── */

/* Summary block */
.filter-summary {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(180deg, var(--blue-50), var(--white));
  border-bottom: 1px solid var(--gray-100);
}
.fs-count {
  display: flex; align-items: baseline; gap: 4px;
  flex-shrink: 0;
}
.fs-num {
  font-size: 26px; font-weight: 800;
  color: var(--blue);
  letter-spacing: -.02em;
  line-height: 1;
  font-feature-settings: "tnum";
}
.fs-of { font-size: 11px; color: var(--gray-500); font-weight: 600; }
.fs-text { flex: 1; min-width: 0; }
.fs-title { font-size: 12px; font-weight: 700; color: var(--gray-900); }
.fs-sub {
  font-size: 10.5px; color: var(--gray-500);
  margin-top: 2px;
  line-height: 1.35;
}
.fs-clear {
  font-family: inherit;
  background: transparent;
  border: 1px solid var(--gray-300);
  color: var(--gray-700);
  font-size: 10.5px; font-weight: 600;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  flex-shrink: 0;
}
.fs-clear:hover { background: var(--white); border-color: var(--blue); color: var(--blue); }

/* Collapsible folds */
.lp-fold {
  border-bottom: 1px solid var(--gray-100);
}
.lp-fold > summary {
  list-style: none;
  cursor: pointer;
  padding: 12px 16px;
  display: flex; align-items: center; gap: 10px;
  user-select: none;
  font-size: 12px; font-weight: 700;
  color: var(--gray-900);
  transition: background .12s;
}
.lp-fold > summary::-webkit-details-marker { display: none; }
.lp-fold > summary:hover { background: var(--gray-50); }
.fold-glyph {
  width: 22px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  background: var(--gray-100);
  color: var(--gray-700);
  border-radius: 6px;
  font-size: 11px; font-weight: 600;
  flex-shrink: 0;
}
.fold-label { flex: 1; }
.fold-pip {
  background: var(--blue);
  color: var(--white);
  font-size: 9.5px; font-weight: 700;
  min-width: 18px; height: 18px;
  border-radius: 999px;
  padding: 0 6px;
  display: flex; align-items: center; justify-content: center;
  letter-spacing: .02em;
}
.fold-current {
  font-size: 10.5px; font-weight: 600;
  color: var(--gray-500);
  font-family: inherit;
}
.fold-caret {
  font-size: 12px; color: var(--gray-400);
  transition: transform .15s;
  transform: rotate(180deg);
}
.lp-fold[open] > summary .fold-caret { transform: rotate(0deg); }
.fold-body {
  padding: 4px 16px 14px;
}
.fold-help {
  margin-top: 8px;
  font-size: 10.5px; color: var(--gray-400);
  line-height: 1.4;
}

.fold-divider {
  height: 6px;
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-100);
  border-top: 1px solid var(--gray-100);
}

/* Status chips */
.status-chips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}
.st-chip {
  font-family: inherit;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: var(--radius);
  padding: 8px 4px;
  cursor: pointer;
  display: flex; flex-direction: column;
  align-items: center; gap: 3px;
  transition: all .15s;
}
.st-chip:hover { border-color: var(--gray-300); background: var(--gray-50); }
.st-chip.active {
  border-color: var(--blue);
  background: var(--blue-50);
  box-shadow: inset 0 0 0 1px var(--blue);
}
.st-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.st-dot.ok   { background: #16a34a; }
.st-dot.warn { background: #d97706; }
.st-dot.flag { background: #DC143C; }
.st-label { font-size: 11px; font-weight: 700; color: var(--gray-800); }
.st-cnt {
  font-size: 10px; font-weight: 600;
  color: var(--gray-500);
  font-feature-settings: "tnum";
}
.st-chip.active .st-cnt { color: var(--blue); }

/* Topic chips */
.topic-chips {
  display: flex; flex-wrap: wrap;
  gap: 5px;
}
.tp-chip {
  font-family: inherit;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  padding: 5px 10px 5px 7px;
  font-size: 11px; font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  display: inline-flex; align-items: center; gap: 5px;
  transition: all .15s;
}
.tp-chip:hover { border-color: var(--gray-300); background: var(--gray-50); }
.tp-chip.active {
  background: var(--blue);
  border-color: var(--blue);
  color: var(--white);
}

/* Range sliders — dual-thumb stack */
.range-row { padding-top: 4px; }
.range-vals {
  display: flex; align-items: baseline;
  gap: 6px;
  font-size: 11px; color: var(--gray-500);
  font-weight: 500;
  margin-bottom: 10px;
}
.range-vals b {
  color: var(--gray-900);
  font-size: 13px; font-weight: 700;
  font-feature-settings: "tnum";
}
.range-track {
  position: relative;
  height: 22px;
  margin: 0 4px;
}
.range-track::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 4px; transform: translateY(-50%);
  background: var(--gray-100);
  border-radius: 999px;
}
.range-fill {
  position: absolute;
  top: 50%; height: 4px;
  transform: translateY(-50%);
  background: var(--blue);
  border-radius: 999px;
  pointer-events: none;
}
.range-track input[type=range] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 22px;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  pointer-events: none;
  margin: 0;
}
.range-track input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: 50%;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}
.range-track input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: 50%;
  cursor: grab;
  box-shadow: var(--shadow-sm);
  pointer-events: auto;
}
.range-ticks {
  display: flex; gap: 4px;
  margin-top: 12px;
}
.rt-quick {
  font-family: inherit;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 10px; font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
}
.rt-quick:hover { border-color: var(--blue); color: var(--blue); }

.single-track {
  position: relative;
  height: 22px; margin: 0 4px 4px;
}
.single-track::before {
  content: '';
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: 4px; transform: translateY(-50%);
  background: var(--gray-100);
  border-radius: 999px;
}
.single-track input[type=range] {
  -webkit-appearance: none; appearance: none;
  position: absolute; inset: 0;
  width: 100%; height: 22px;
  background: transparent;
  margin: 0;
}
.single-track input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 18px; height: 18px;
  background: var(--white);
  border: 2px solid var(--blue);
  border-radius: 50%;
  box-shadow: var(--shadow-sm);
  cursor: grab;
}
.single-track input[type=range]::-moz-range-thumb {
  width: 18px; height: 18px;
  background: var(--white); border: 2px solid var(--blue);
  border-radius: 50%; cursor: grab;
}

/* Year pills */
.yr-pills { display: flex; gap: 5px; flex-wrap: wrap; }
.yr-pill {
  font-family: inherit;
  background: var(--white);
  border: 1.5px solid var(--gray-200);
  border-radius: 999px;
  padding: 5px 11px;
  font-size: 11px; font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
}
.yr-pill.active { background: var(--blue); border-color: var(--blue); color: var(--white); }

/* Compact legend at bottom */
.legend-section { padding: 12px 16px 8px; }

/* Active filter pills above the map */
.active-pills[hidden] { display: none; }
.active-pills {
  position: absolute;
  left: 14px; right: 14px;
  top: 132px;             /* below KPI strip (which ends ~120px) */
  z-index: 600;
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 8px 10px;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(4px);
  border: 1px solid var(--gray-200);
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  align-items: center;
}
.ap-label {
  font-size: 10.5px; font-weight: 700;
  color: var(--gray-500);
  text-transform: uppercase; letter-spacing: .05em;
  margin-right: 4px;
}
.ap-chip {
  font-family: inherit;
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--blue-50);
  color: var(--blue);
  border: 1px solid rgba(0,56,147,.18);
  border-radius: 999px;
  padding: 3px 5px 3px 9px;
  font-size: 11px; font-weight: 600;
  cursor: default;
}
.ap-chip .ap-x {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: rgba(0,56,147,.14);
  color: var(--blue);
  font-size: 11px; font-weight: 700;
  border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
  padding: 0;
}
.ap-chip .ap-x:hover { background: var(--blue); color: var(--white); }
.ap-clear {
  font-family: inherit;
  background: transparent; border: none;
  font-size: 10.5px; font-weight: 600;
  color: var(--gray-600);
  cursor: pointer;
  text-decoration: underline;
  margin-left: auto;
}
.ap-clear:hover { color: var(--blue); }
@media (max-width: 760px) {
  .active-pills { top: 76px; left: 8px; right: 8px; }
}
