.status { display: none; margin-bottom: 18px; padding: 12px 14px; border: 1px solid var(--border); background: var(--surface); }
.status.show { display: block; }
.status.error { border-color: #c94a4a; color: #8b2525; background: #fff1f1; }
.metric-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric-card { min-width: 0; padding: 17px; border: 1px solid var(--border); border-top: 3px solid var(--mid); border-radius: 5px; background: var(--surface); box-shadow: 0 3px 14px rgba(10,35,64,.07); }
.metric-card span { display: block; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.metric-card strong { display: block; margin-top: 7px; font-family: 'Playfair Display', serif; font-size: clamp(1.65rem, 3vw, 2.3rem); line-height: 1; }
.metric-card small { display: block; margin-top: 7px; color: var(--muted); line-height: 1.25; }
.map-controls { position: absolute; z-index: 700; top: 94px; left: 14px; right: 14px; padding: 10px; display: flex; align-items: flex-end; gap: 8px; border: 1px solid rgba(10,35,64,.15); border-radius: 5px; background: rgba(255,255,255,.96); box-shadow: 0 5px 16px rgba(10,35,64,.14); }
.map-controls label { min-width: 0; flex: 1; display: grid; gap: 3px; }
.map-controls label span { color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
select { width: 100%; min-height: 34px; padding: 5px 8px; border: 1px solid var(--border); border-radius: 3px; color: var(--text); background: #fff; }
.small-btn { min-height: 34px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 3px; color: var(--navy); background: var(--light); cursor: pointer; }
.small-btn:hover, .small-btn:focus-visible { border-color: var(--mid); background: #e6eef6; }
.responses-actions { display: flex; align-items: flex-end; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.weight-mode { display: flex; align-items: center; overflow: hidden; border: 1px solid var(--border); border-radius: 4px; background: #fff; }
.weight-mode > span { padding: 7px 9px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.weight-mode button { min-height: 34px; padding: 6px 10px; border: 0; border-left: 1px solid var(--border); color: var(--navy); background: #fff; cursor: pointer; }
.weight-mode button[aria-pressed="true"] { color: #fff; background: var(--blue); }
.weight-mode button:hover, .weight-mode button:focus-visible { box-shadow: inset 0 0 0 2px var(--cyan); }
.map-legend { position: absolute; z-index: 650; right: 14px; bottom: 18px; max-width: 240px; padding: 10px 12px; border: 1px solid rgba(10,35,64,.14); border-radius: 4px; background: rgba(255,255,255,.95); box-shadow: 0 4px 14px rgba(10,35,64,.12); font-size: 11px; }
.legend-row { display: flex; align-items: center; gap: 7px; margin-top: 4px; }
.legend-swatch { width: 18px; height: 11px; border: 1px solid rgba(10,35,64,.2); }
.legend-dot { width: 9px; height: 9px; border: 2px solid #fff; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 0 1px var(--navy); }
.active-filter { padding: 6px 9px; border-radius: 3px; color: var(--blue); background: var(--light); font-size: 11px; font-weight: 700; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 9px 8px; color: #fff; background: var(--navy); font-size: 10px; letter-spacing: .02em; text-align: center; }
td { padding: 9px 8px; border-bottom: 1px solid #dde6ed; text-align: right; white-space: nowrap; }
td:first-child { text-align: left; }
tbody tr { cursor: pointer; }
tbody tr:hover, tbody tr.selected { background: #e8f1f8; }
.context-note { margin: -4px 0 16px; color: var(--muted); }
.question-card { padding: 16px; border: 1px solid var(--border); border-radius: 5px; background: var(--light); }
.question-card h3 { min-height: 2.8em; margin-bottom: 13px; font-size: 1rem; line-height: 1.35; }
.answer-selected { margin-bottom: 13px; padding: 10px; border-left: 3px solid var(--cyan); color: var(--navy); background: #fff; }
.answer-selected span { display: block; margin-bottom: 3px; color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.bar-list { display: grid; gap: 9px; }
.bar-label { margin-bottom: 3px; display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; color: #284a68; font-size: 11px; }
.bar-label span:first-child { max-width: 78%; }
.bar-track { height: 8px; overflow: hidden; border-radius: 8px; background: #dfe8ef; }
.bar-fill { height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.question-base { margin: 10px 0 0; color: var(--muted); font-size: 10px; }
.modal { display: none; position: fixed; z-index: 2000; inset: 0; padding: 22px; place-items: center; background: rgba(4,18,32,.64); }
.modal.open { display: grid; }
.modal-card { width: min(760px, 100%); max-height: calc(100vh - 44px); overflow: auto; border-radius: 7px; background: #fff; box-shadow: 0 20px 60px rgba(0,0,0,.28); }
.modal-head { position: sticky; top: 0; padding: 18px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; color: #fff; background: var(--navy); }
.modal-head h2 { font-family: 'Source Sans 3', sans-serif; font-size: 1.2rem; }
.modal-close { width: 34px; height: 34px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: #fff; background: transparent; font-size: 22px; cursor: pointer; }
.modal-body { padding: 24px; }
.modal-body h3 { margin: 20px 0 7px; color: var(--blue); }
.modal-body h3:first-child { margin-top: 0; }
.leaflet-tooltip { font-family: 'Source Sans 3', sans-serif; }

@media (max-width: 1350px) { .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) {
  .metric-grid { grid-template-columns: 1fr; }
  .map-controls { align-items: stretch; flex-direction: column; }
  .map-controls .small-btn { width: 100%; }
  .map { height: 560px; }
  .responses-actions, .weight-mode { width: 100%; }
  .weight-mode { align-items: stretch; flex-direction: column; }
  .weight-mode button { border-top: 1px solid var(--border); border-left: 0; }
}
