.disclosure-banner {
  background: var(--surface-2, #f4f6f8);
  border-left: 4px solid var(--accent, #1f5fa6);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  border-radius: 4px;
}

.era {
  color: var(--text-muted, #555);
  margin-top: -.25rem;
}

.table-wrap { overflow-x: auto; }

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem;
  margin: 1rem 0 .5rem;
  padding: 0;
}
.summary-grid > div {
  background: var(--surface-2, #f4f6f8);
  padding: 1rem 1.25rem;
  border-radius: 6px;
  border-left: 3px solid var(--accent, #1f5fa6);
}
.summary-grid dt {
  font-size: .85rem;
  color: var(--text-muted, #555);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .03em;
  margin: 0 0 .25rem;
}
.summary-grid dd {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text, #111);
  line-height: 1.1;
}
.ci-note, .disclosure-footer {
  font-size: .9rem;
  color: var(--text-muted, #555);
}
.disclosure-footer {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border, #e2e5e9);
}
:root[data-theme="dark"] .summary-grid > div {
  background: var(--surface-2-dark, #1c2530);
  border-left-color: var(--accent-dark, #4a8edd);
}
:root[data-theme="dark"] .summary-grid dd { color: var(--text-dark, #e8ecef); }
:root[data-theme="dark"] .summary-grid dt,
:root[data-theme="dark"] .ci-note,
:root[data-theme="dark"] .disclosure-footer { color: var(--text-muted-dark, #b0b8c1); }
:root[data-theme="dark"] .disclosure-footer { border-top-color: var(--border-dark, #2c3540); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .summary-grid > div {
    background: var(--surface-2-dark, #1c2530);
    border-left-color: var(--accent-dark, #4a8edd);
  }
  :root:not([data-theme="light"]) .summary-grid dd { color: var(--text-dark, #e8ecef); }
  :root:not([data-theme="light"]) .summary-grid dt,
  :root:not([data-theme="light"]) .ci-note,
  :root:not([data-theme="light"]) .disclosure-footer { color: var(--text-muted-dark, #b0b8c1); }
  :root:not([data-theme="light"]) .disclosure-footer { border-top-color: var(--border-dark, #2c3540); }
}

#rep-overall-table, #bucket-dc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0;
}

#rep-overall-table th,
#rep-overall-table td,
#bucket-dc-table th,
#bucket-dc-table td {
  padding: .65rem .75rem;
  text-align: left;
  border-bottom: 1px solid var(--border, #e2e5e9);
}

#rep-overall-table th button {
  background: none;
  border: 0;
  font: inherit;
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
#rep-overall-table th button:focus-visible {
  outline: 2px solid var(--accent, #1f5fa6);
  outline-offset: 2px;
}
#rep-overall-table th button[aria-sort="ascending"]::after { content: " \25B2"; }
#rep-overall-table th button[aria-sort="descending"]::after { content: " \25BC"; }

.pct-bar {
  display: inline-block;
  vertical-align: middle;
  height: 8px;
  background: var(--accent-bar, #1f5fa6);
  margin-left: .5rem;
  border-radius: 2px;
  min-width: 2px;
}
.pct-cell { white-space: nowrap; }

.multi-issue-note {
  font-size: .9rem;
  color: var(--text-muted, #555);
  margin-top: -.5rem;
}

.bucket-pill-row {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.bucket-pill-row a {
  display: inline-block;
  padding: .4rem .8rem;
  background: var(--surface-2, #f4f6f8);
  border-radius: 16px;
  text-decoration: none;
  color: var(--text, #111);
  min-height: 44px;
  line-height: 1.6;
}
.bucket-pill-row a:hover, .bucket-pill-row a:focus-visible {
  background: var(--accent-soft, #dde7f5);
}

.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;
}

@media (max-width: 640px) {
  #rep-overall-table th, #rep-overall-table td { padding: .5rem .4rem; font-size: .9rem; }
  .pct-bar { display: none; }
}

/* Dark mode, BOTH mechanisms per project memory rule (single mechanism breaks Auto theme) */
:root[data-theme="dark"] .disclosure-banner {
  background: var(--surface-2-dark, #1c2530);
  border-left-color: var(--accent-dark, #4a8edd);
}
:root[data-theme="dark"] #rep-overall-table th,
:root[data-theme="dark"] #rep-overall-table td,
:root[data-theme="dark"] #bucket-dc-table th,
:root[data-theme="dark"] #bucket-dc-table td {
  border-bottom-color: var(--border-dark, #2c3540);
}
:root[data-theme="dark"] .bucket-pill-row a {
  background: var(--surface-2-dark, #1c2530);
  color: var(--text-dark, #e8ecef);
}
:root[data-theme="dark"] .pct-bar { background: var(--accent-dark, #4a8edd); }
:root[data-theme="dark"] .multi-issue-note,
:root[data-theme="dark"] .era { color: var(--text-muted-dark, #b0b8c1); }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .disclosure-banner {
    background: var(--surface-2-dark, #1c2530);
    border-left-color: var(--accent-dark, #4a8edd);
  }
  :root:not([data-theme="light"]) #rep-overall-table th,
  :root:not([data-theme="light"]) #rep-overall-table td,
  :root:not([data-theme="light"]) #bucket-dc-table th,
  :root:not([data-theme="light"]) #bucket-dc-table td {
    border-bottom-color: var(--border-dark, #2c3540);
  }
  :root:not([data-theme="light"]) .bucket-pill-row a {
    background: var(--surface-2-dark, #1c2530);
    color: var(--text-dark, #e8ecef);
  }
  :root:not([data-theme="light"]) .pct-bar { background: var(--accent-dark, #4a8edd); }
  :root:not([data-theme="light"]) .multi-issue-note,
  :root:not([data-theme="light"]) .era { color: var(--text-muted-dark, #b0b8c1); }
}
