:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --surface-2: #f1f3f6;
  --text: #16191f;
  --muted: #5e6672;
  --faint: #8a919c;
  --line: #e3e6eb;
  --line-strong: #cfd4dc;
  --brand: #1f4f74;
  --brand-2: #163a57;
  --accent: #1f5f8b;
  --accent-hover: #184d72;
  --accent-ink: #ffffff;
  --warn-bg: #fff3d6;
  --warn-ink: #7a5300;
  --bad-bg: #fde4e1;
  --bad-ink: #8f2418;
  --ok-bg: #e1f2e6;
  --ok-ink: #1f5636;
  --info-bg: #e3edf7;
  --info-ink: #1f4d70;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgb(16 24 40 / 0.05);
  --shadow: 0 1px 2px rgb(16 24 40 / 0.04), 0 4px 12px rgb(16 24 40 / 0.06);
  --shadow-lg: 0 2px 4px rgb(16 24 40 / 0.06), 0 12px 28px rgb(16 24 40 / 0.12);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1216;
    --surface: #181c22;
    --surface-2: #20252d;
    --text: #e8ebf0;
    --muted: #a3abb7;
    --faint: #7c8491;
    --line: #2a3039;
    --line-strong: #3a414c;
    --brand: #14324b;
    --brand-2: #0f2639;
    --accent: #7fb6dd;
    --accent-hover: #9cc8e6;
    --accent-ink: #0d1b26;
    --warn-bg: #3a2f12;
    --warn-ink: #f2d27d;
    --bad-bg: #42201c;
    --bad-ink: #f4aea4;
    --ok-bg: #1b3526;
    --ok-ink: #9fd6b3;
    --info-bg: #1a2c3b;
    --info-ink: #a9cbe6;
    --shadow-sm: none;
    --shadow: none;
    --shadow-lg: 0 8px 24px rgb(0 0 0 / 0.4);
    color-scheme: dark;
  }
}

/* The `hidden` attribute must win over component display rules (e.g. `.cards { display: grid }`). */
[hidden] { display: none !important; }

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 720px) { .wrap { padding: 0 24px; } }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Header */
.page-header {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  padding: 28px 0 72px;
}
.title-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px 24px; flex-wrap: wrap; }
.eyebrow {
  display: inline-block;
  margin: 0 0 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: rgb(255 255 255 / 0.14);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
h1 { margin: 0; font-size: clamp(24px, 3.2vw, 32px); line-height: 1.15; letter-spacing: -0.02em; font-weight: 700; }
.updated {
  margin: 0;
  font-size: 13px;
  color: rgb(255 255 255 / 0.8);
  display: flex;
  align-items: center;
  gap: 8px;
}
.updated:not(:empty)::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 3px rgb(74 222 128 / 0.25);
}
.intro { margin: 10px 0 0; color: rgb(255 255 255 / 0.78); max-width: 68ch; }

/* Main pulls up over the header band */
main.wrap { margin-top: -52px; }

/* Stats */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 16px;
}
@media (max-width: 960px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr; } }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow);
  min-width: 0;
}
.stat .label { color: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.stat .value { font-size: 30px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.2; margin-top: 4px; font-variant-numeric: tabular-nums; }
.stat .sub { color: var(--muted); font-size: 13px; }
.stat ul { list-style: none; margin: 8px 0 0; padding: 0; font-variant-numeric: tabular-nums; }
.stat li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; font-size: 13px; }
.stat li + li { border-top: 1px solid var(--line); }
.stat--issues li span { color: var(--muted); }
.stat--sources ul { margin-top: 6px; }
.stat--sources li { padding: 0; }
.row-btn {
  all: unset;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
  margin: 0 -6px;
  width: calc(100% + 12px);
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
}
.row-btn:hover { background: var(--surface-2); }
.row-btn:focus-visible { outline: 2px solid var(--accent); }
.row-btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Controls */
.controls {
  position: sticky;
  top: 0;
  z-index: 5;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
@media (max-width: 720px) { .controls { position: static; } }
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.filters {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 1100px) {
  .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .field--search { grid-column: 1 / -1; }
}
@media (max-width: 700px) { .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 340px) { .filters { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; min-width: 0; }
input[type="search"], input[type="date"], select {
  font: inherit;
  font-size: 14px;
  color: var(--text);
  background-color: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  min-width: 0;
  width: 100%;
  height: 40px;
  transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
input[type="search"]:hover, input[type="date"]:hover, select:hover { border-color: var(--faint); }
input[type="search"]:focus, input[type="date"]:focus, select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
  outline: none;
}
select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 34px;
  cursor: pointer;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a919c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
/* A select set away from its default is highlighted so active filters stand out. */
select.is-set { border-color: var(--accent); background-color: var(--info-bg); color: var(--info-ink); font-weight: 600; }
select option { color: var(--text); background: var(--surface); font-weight: 400; }
input[type="search"] {
  padding-left: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a919c' stroke-width='2' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 13px center;
}
input[type="search"]::placeholder { color: var(--faint); }
input[type="date"] { width: auto; min-width: 150px; }

.date-range { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.date-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--muted); }
.date-sep { color: var(--faint); }
@media (max-width: 560px) {
  .date-range { display: grid; grid-template-columns: 1fr 1fr; }
  .date-item { flex-direction: column; align-items: stretch; gap: 4px; }
  .date-item input { width: 100%; min-width: 0; }
  .date-sep { display: none; }
}

.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 28px;
  padding: 0 6px 0 12px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  background: var(--info-bg);
  color: var(--info-ink);
  font-size: 13px;
  font-weight: 500;
  max-width: 100%;
}
.filter-chip span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filter-chip .x {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  font-size: 15px;
  line-height: 1;
}
.filter-chip:hover { background: var(--info-bg); border-color: var(--accent); }
.filter-chip:hover .x { background: color-mix(in srgb, var(--accent) 20%, transparent); }
.clear-all {
  height: 28px;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  padding: 0 6px;
}
.clear-all:hover { background: none; text-decoration: underline; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.checks { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; user-select: none; }
.check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.check:has(input:disabled) { color: var(--faint); cursor: not-allowed; }
.check input:disabled { cursor: not-allowed; }
.hint { color: var(--faint); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

button {
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0 14px;
  height: 36px;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
button:hover { background: var(--surface-2); }
.btn-primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--text); }
.segmented { display: inline-flex; padding: 3px; background: var(--surface-2); border-radius: 10px; gap: 2px; }
.segmented button { height: 30px; border: 0; background: transparent; color: var(--muted); border-radius: 7px; padding: 0 14px; }
.segmented button:hover { color: var(--text); background: transparent; }
.segmented .is-active, .segmented .is-active:hover { background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm), 0 0 0 1px var(--line); }

.result-count { color: var(--muted); margin: 18px 2px 12px; font-size: 14px; }
.state:empty { display: none; }
.state {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  margin-bottom: 32px;
}
.state.error { border-style: solid; border-color: transparent; background: var(--bad-bg); color: var(--bad-ink); }

/* Cards */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 16px; margin-bottom: 40px; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s, transform 0.2s, border-color 0.2s;
}
.card:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--line-strong); }
@media (prefers-reduced-motion: reduce) { .card, .card:hover { transition: none; transform: none; } }
.card.has-issues { box-shadow: var(--shadow-sm), inset 0 3px 0 var(--warn-ink); }
.card.has-issues:hover { box-shadow: var(--shadow-lg), inset 0 3px 0 var(--warn-ink); }
.thumb {
  aspect-ratio: 16 / 9;
  position: relative;
  background:
    linear-gradient(100deg, transparent 30%, color-mix(in srgb, var(--surface) 55%, transparent) 50%, transparent 70%) var(--surface-2);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.thumb:has(img[data-loaded]), .thumb:has(.noimg) { animation: none; background: var(--surface-2); }
@keyframes shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .thumb { animation: none; } }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; opacity: 0; transition: opacity 0.3s; }
.thumb img[data-loaded] { opacity: 1; }
.thumb .noimg { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); font-size: 13px; }
.thumb .badges { position: absolute; top: 10px; left: 10px; display: flex; gap: 6px; flex-wrap: wrap; }
.thumb .badges .chip { box-shadow: var(--shadow); }
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.date { font-weight: 600; font-size: 13px; color: var(--accent); letter-spacing: 0.01em; }
.card h2 { font-size: 16px; line-height: 1.35; margin: -4px 0 0; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }
.meta { display: grid; grid-template-columns: 72px 1fr; gap: 4px 10px; font-size: 13.5px; margin: 0; }
.meta dt { color: var(--faint); }
.meta dd { margin: 0; overflow-wrap: anywhere; }
.missing { color: var(--faint); font-style: italic; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips:empty { display: none; }
.chip {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip.bad { background: var(--bad-bg); color: var(--bad-ink); }
.chip.ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip.info { background: var(--info-bg); color: var(--info-ink); }
.sources {
  font-size: 13px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 10px;
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sources a { overflow-wrap: anywhere; font-weight: 500; }

/* Table */
.table-wrap {
  overflow: auto;
  max-height: 80vh;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 40px;
}
table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: 13.5px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface-2) 45%, transparent); }
tbody tr:hover td { background: var(--info-bg); }
tbody tr:last-child td { border-bottom: 0; }
td.nowrap { white-space: nowrap; }
td a { font-weight: 500; text-decoration: none; }
td a:hover { text-decoration: underline; }
tr.has-issues td:first-child { box-shadow: inset 3px 0 0 var(--warn-ink); }

.page-footer { color: var(--muted); font-size: 13px; padding: 20px 0 36px; border-top: 1px solid var(--line); }

/* Descriptions */
.desc-wrap { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; margin-top: -2px; }
.desc { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--muted); white-space: pre-line; overflow-wrap: anywhere; }
.desc.missing { margin-top: -2px; color: var(--faint); font-style: italic; }
.desc.is-clamped { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.desc-toggle {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}
.desc-toggle:hover { background: none; text-decoration: underline; }
.desc-excerpt {
  margin-top: 4px;
  font-size: 12.5px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
#table td.title-cell { min-width: 280px; max-width: 420px; }
.desc a, .desc-excerpt a { font-weight: 500; overflow-wrap: anywhere; }

/* Provider categories and tags */
.source-labels { display: flex; flex-direction: column; gap: 6px; }
.label-row { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; align-items: start; }
.label-caption { font-size: 13.5px; color: var(--faint); line-height: 22px; }
.pills { display: flex; flex-wrap: wrap; gap: 4px; }
.pill {
  font-size: 12px;
  line-height: 1;
  padding: 5px 8px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill--cat { background: var(--info-bg); color: var(--info-ink); border-color: transparent; font-weight: 500; }
.cell-sub { margin-top: 4px; font-size: 12px; color: var(--muted); }
#table td.tags-cell { min-width: 160px; font-size: 12.5px; color: var(--muted); }
.desc.desc--lead { color: var(--text); }
.desc.desc--lead.is-clamped { -webkit-line-clamp: 4; line-clamp: 4; }
.desc.desc--full { margin-top: 4px; }
.map-link { display: block; margin-top: 2px; font-size: 12.5px; font-weight: 500; white-space: nowrap; }
