:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --panel-2: #f4f7fa;
  --text: #172436;
  --muted: #526478;
  --line: #dce4eb;
  --fail: #a12626;
  --pass: #116a40;
  --partial: #885600;
  --accent: #145da0;
  --shadow: 0 3px 12px #1b3d590b;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  padding: 32px;
  border-bottom: 1px solid var(--line);
}
h1, h2, h3 { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: -0.04em; }
.eyebrow { color: var(--accent); text-transform: uppercase; letter-spacing: .14em; font-size: 12px; font-weight: 700; margin: 0 0 8px; }
.muted, .view-note, small { color: var(--muted); }
.header-actions { display: flex; gap: 12px; flex-wrap: wrap; }
button, select, input {
  font: inherit;
}
.header-actions button {
  border: 1px solid #145da0;
  color: #fff;
  background: #145da0;
  padding: 10px 14px;
  border-radius: 6px;
  cursor: pointer;
}
.header-actions button.secondary { background: #fff; color: var(--accent); }
main { padding: 28px 32px 40px; }
.overview-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(150px, 1fr));
  gap: 14px;
  margin-bottom: 22px;
}
.metric {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 18px;
  box-shadow: var(--shadow);
  min-height: 126px;
}
.metric .label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.metric strong { display: block; font-size: 31px; line-height: 1; margin-bottom: 10px; }
.metric.danger strong { color: var(--pass); }
.metric.warning strong { color: var(--fail); }
.panels {
  display: grid;
  grid-template-columns: 280px minmax(420px, 1.05fr) minmax(420px, .95fr);
  gap: 18px;
  align-items: start;
}
.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
}
.filters { padding: 18px; position: sticky; top: 16px; }
.filters h2 { margin-bottom: 18px; }
.filters label { display: block; color: var(--muted); margin: 0 0 14px; font-size: 13px; }
.filter-group { margin: 0 0 14px; }
.filter-title { color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.checkbox-list {
  display: grid;
  gap: 8px;
  max-height: 180px;
  overflow: auto;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 10px;
}
.filters .checkbox-option {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
}
.filters .checkbox-option input {
  width: auto;
  margin: 0;
  accent-color: var(--accent);
}
.filters input, .filters select, .boundary-select select {
  width: 100%;
  margin-top: 6px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 6px;
  padding: 10px;
}
.legend { display: grid; gap: 8px; margin-top: 18px; color: var(--muted); font-size: 13px; }
.dot { display:inline-block; width: 10px; height: 10px; border-radius: 99px; margin-right: 8px; }
.dot.fail { background: var(--fail); }
.dot.pass { background: var(--pass); }
.dot.partial { background: var(--partial); }
.rule-list-panel { overflow: hidden; }
.panel-heading { display: flex; justify-content: space-between; gap: 16px; padding: 18px; border-bottom: 1px solid var(--line); }
.rule-list { max-height: 72vh; overflow: auto; }
.rule-row {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  text-align: left;
  cursor: pointer;
}
.rule-row:hover, .rule-row.active { background: #edf4fb; }
.status-pill { margin-top: 2px; width: 12px; height: 12px; border-radius: 99px; background: var(--fail); box-shadow: 0 0 0 4px rgba(161,38,38,.12); }
.status-pill.pass { background: var(--pass); box-shadow: 0 0 0 4px rgba(17,106,64,.12); }
.status-pill.partial { background: var(--partial); box-shadow: 0 0 0 4px rgba(136,86,0,.12); }
.rule-title { display: block; margin-bottom: 4px; }
.rule-summary { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rule-meta { color: var(--muted); font-size: 12px; text-align: right; white-space: nowrap; }
.detail-panel { padding: 0; position: sticky; top: 16px; max-height: 82vh; overflow: auto; }
.rule-detail { padding: 22px; }
.rule-detail.empty { color: var(--muted); }
.badges { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.badge { border: 1px solid var(--line); background: #e9eff5; color: var(--text); padding: 5px 9px; border-radius: 999px; font-size: 12px; }
.badge.fail { color: var(--fail); border-color: #e9bfc0; }
.badge.pass { color: var(--pass); border-color: #b8dfc9; }
.badge.partial { color: var(--partial); border-color: #e7d39b; }
.detail-section { border-top: 1px solid var(--line); padding-top: 16px; margin-top: 16px; }
.detail-section h3 { font-size: 15px; margin-bottom: 8px; color: #1b3049; }
.statement { line-height: 1.55; color: #172436; }
pre {
  white-space: pre-wrap;
  background: #f4f7fa;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  color: #1b3049;
  max-height: 220px;
  overflow: auto;
}
ul.clean { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
ul.clean li { background: #f6f9fc; border: 1px solid var(--line); padding: 10px; border-radius: 6px; }
@media (max-width: 1280px) {
  .overview-grid { grid-template-columns: repeat(3, 1fr); }
  .panels { grid-template-columns: 260px 1fr; }
  .detail-panel { grid-column: 1 / -1; position: static; max-height: none; }
}
@media (max-width: 800px) {
  .topbar { flex-direction: column; padding: 22px; }
  main { padding: 18px; }
  .overview-grid, .panels { grid-template-columns: 1fr; }
  .filters { position: static; }
}

/* Boundary selector and protected report navigation, using the shared light palette. */
.boundary-select{display:flex;align-items:center;gap:10px;margin-top:12px;color:var(--muted);font-size:14px}.boundary-select select{width:auto;min-width:160px;margin-top:0}.header-note{color:var(--muted);font-size:13px}.header-actions button:disabled{opacity:.5;cursor:not-allowed}

/* Accessible document navigation, retaining the shared light palette. */
a { color: var(--accent); }
a:focus-visible, button:focus-visible { outline: 3px solid #2877c5; outline-offset: 3px; }
.action-link { display: inline-flex; align-items: center; justify-content: center; text-align: center; border: 1px solid #145da0; background: #fff; color: #145da0; padding: 10px 16px; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 14px; cursor: pointer; }
.action-link:hover:not(:disabled) { background: #e8f1fa; color: #124b81; }
.action-link.secondary { background: #f4f7fa; }
.action-link:disabled { background: #f4f7fa; border-color: var(--line); color: #526478; cursor: not-allowed; }
.document-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,280px),1fr)); gap: 12px; margin: 20px 0; }
.document-card { padding: 16px; border: 1px solid var(--line); border-radius: 8px; background: #f8fafc; }
.document-card .action-link { width: 100%; min-height: 48px; }
.document-card p { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 12px 0 0; }
.help-content { max-width: 1040px; margin: auto; display: grid; gap: 18px; }
.help-content section { padding: 24px; scroll-margin-top: 16px; line-height: 1.65; }
.help-content h2 { margin-bottom: 12px; }
.help-content h3 { margin-top: 20px; }
.help-content code { overflow-wrap: anywhere; color: #1b3049; }
.help-content nav a { display: inline-block; margin: 4px 12px 4px 0; }

/* Overall status reflects automation coverage, not certification. */
#overallStatus[data-coverage-status="fail"] { color: var(--fail); }
#overallStatus[data-coverage-status="partial"] { color: var(--partial); }
#overallStatus[data-coverage-status="pass"] { color: var(--pass); }

/* Formal Light: VVWA colors, with the existing Trust Center layout and behavior. */
:root { --navy: #162a40; --heading: #1b3049; --section: #e8f1fa; --control-line: #b9c8d6; color-scheme: light; }
h1, h2, h3, h4 { color: var(--heading); }
.topbar { background: #fff; color: var(--text); border-top: 14px solid var(--navy); border-bottom: 1px solid var(--line); padding-top: 22px; padding-bottom: 20px; }
.topbar h1 { color: var(--heading); font-size: clamp(28px, 3vw, 38px); border-left: 4px solid #2877c5; padding-left: 12px; }
.topbar .muted, .topbar .header-note, .topbar .boundary-select { color: var(--muted); }
.topbar p { margin: 10px 0 0; }
.topbar .action-link { background: #fff; color: var(--accent); border-color: var(--accent); }
.topbar .action-link:hover { background: #e8f1fa; color: #124b81; }
.metric { border-top: 4px solid #2877c5; min-width: 0; }
.metric.danger { border-top-color: #36a47e; }
.metric.warning { border-top-color: #b5262d; }
.metric .label { color: var(--heading); font-weight: 700; background: var(--section); margin: -18px -18px 13px; padding: 10px 18px; border-radius: 6px 6px 0 0; border-bottom: 1px solid var(--line); }
.metric strong { color: var(--heading); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.metric #freshness { font-size: 16px; line-height: 1.4; letter-spacing: -.02em; }
.metric #overallStatus { font-size: clamp(21px, 2vw, 31px); line-height: 1.12; }
.panel-heading { background: var(--section); }
.panel-heading p { margin-bottom: 0; }
.filters h2, .reference-panel > h2, .help-content section > h2 { background: var(--section); border-bottom: 1px solid var(--line); font-size: 1.12rem; padding: 13px 18px; }
.filters h2 { margin: -18px -18px 18px; border-radius: 9px 9px 0 0; }
.reference-panel > h2, .help-content section > h2 { margin: -24px -24px 18px; border-radius: 9px 9px 0 0; }
.panel-heading h2 { font-size: 1.12rem; }
.filters input, .filters select, .boundary-select select, .reference-panel input, select, input[type=search] { border: 1px solid var(--control-line); background: #fff; color: var(--text); border-radius: 6px; }
select, input[type=search] { padding: 10px; }
select:focus-visible, input:focus-visible { outline: 2px solid #2877c5; outline-offset: 2px; }
input::placeholder { color: #65788b; opacity: 1; }
.filters label, .filter-title { color: #465d73; font-weight: 600; }
.filters label small, .filters label p { font-weight: 400; }
.checkbox-list { background: #f8fafc; }
.rule-row { background: #fff; }
.rule-row:hover, .rule-row.active { background: #edf4fb; }
.rule-row.active { box-shadow: inset 3px 0 0 #2877c5; }
.rule-row:focus-visible { outline-offset: -3px; }
.rule-main, .rule-detail { min-width: 0; overflow-wrap: anywhere; }
.rule-title { color: var(--heading); }
.rule-summary { color: var(--muted); }
.badge.fail { background: #ffe0e0; }
.badge.pass { background: #def5e8; }
.badge.partial { background: #fff1c9; }
.status-pill.partial, .dot.partial { background: #d49a27; }
.reference-entry th { background: #e8f1fa; color: var(--heading); }
.reference-entry summary:hover { color: var(--accent); }
.help-content code { background: #eef2f6; padding: .12em .25em; border-radius: 3px; }
.action-link:disabled, .header-actions button:disabled { background: #eef2f6; color: #526478; border-color: #c8d4e0; opacity: 1; }
@media (max-width: 800px) {
  .topbar { gap: 12px; }
  .boundary-select { flex-wrap: wrap; }
  .metric #freshness { font-size: 16px; }
  .metric #overallStatus { font-size: 26px; }
}
