:root {
  --bg: #fafaf7;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-muted: #5a5a5a;
  --ink-soft: #888;
  --border: #e4e2dd;
  --accent: #2d6a4f;
  --accent-soft: #d8efe2;
  --link: #1d4ed8;
  --link-hover: #1e40af;
  --warn: #b45309;
  --legacy: #b85c38;
  --hybrid: #4f7ab0;
  --modern: #2d6a4f;
  --portal-only: #84cc16;
  --editorial-bg: #f7f1e3;
  --editorial-border: #d9cfb6;
  --editorial-ink: #4a3f24;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lift: 0 4px 14px rgba(0, 0, 0, 0.06);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--bg);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Make sure the [hidden] attribute always wins over component display rules. */
[hidden] { display: none !important; }

code {
  background: #f0eee8;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 0.9em;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

/* --- Gate (password) --- */
.gate {
  position: fixed; inset: 0;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
}
.gate-card {
  background: var(--surface);
  padding: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  max-width: 380px;
  width: 92%;
  box-shadow: var(--shadow);
}
.gate-card h1 { margin: 0 0 8px; font-size: 1.3rem; }
.gate-card p { margin: 0 0 16px; color: var(--ink-muted); font-size: 0.9rem; }
.gate-card form { display: flex; gap: 8px; }
.gate-card input {
  flex: 1;
  padding: 8px 12px;
  font-size: 1rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}
.gate-card button {
  padding: 8px 16px;
  font-size: 0.95rem;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}
.gate-card button:hover { background: #1f5239; }
.gate-error { color: var(--legacy); margin-top: 12px !important; }

/* --- Header & tabs --- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.site-header h1 {
  font-size: 1.1rem;
  margin: 0;
  font-weight: 600;
}
.subtitle {
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin: 2px 0 0;
}
.tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  padding-bottom: 12px;
}
.tab {
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 8px 18px;
  font-size: 0.92rem;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 999px;
  font-family: inherit;
  transition: all 0.12s ease;
  font-weight: 500;
}
.tab:hover {
  color: var(--ink);
  border-color: var(--ink-muted);
}
.tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.tab.active:hover { color: white; }
.tab-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--bg);
  color: var(--ink-muted);
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.tab.active .tab-badge {
  background: rgba(255,255,255,0.22);
  color: white;
}

/* --- Layout --- */
main { padding: 32px 0 80px; }
.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 0 24px;
}
.container-wide {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}
.tab-panel { display: none; }
.tab-panel.active { display: block; }

h2 {
  font-size: 1.4rem;
  margin: 0 0 12px;
  font-weight: 600;
}
h3 {
  font-size: 1.15rem;
  margin: 44px 0 10px;
  font-weight: 600;
  letter-spacing: -0.005em;
}
p { margin: 0 0 12px; }
.lede { font-size: 1.05rem; color: var(--ink-muted); margin-bottom: 24px; }
.footnote {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 48px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* --- Hero --- */
.hero {
  margin: 8px 0 28px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  margin: 0 0 8px;
}
.hero h2 {
  font-size: 2rem;
  line-height: 1.15;
  margin: 0 0 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.hero-lede {
  font-size: 1.08rem;
  color: var(--ink-muted);
  line-height: 1.55;
  max-width: 640px;
  margin: 0;
}
.hero-aside {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--ink-soft);
}
.hero-aside a {
  color: var(--ink-muted);
  border-bottom: 1px dashed var(--ink-soft);
  padding-bottom: 1px;
}
.hero-aside a:hover {
  color: var(--accent);
  border-color: var(--accent);
  text-decoration: none;
}

.hero-callout {
  background: var(--accent-soft);
  border-left: 4px solid var(--accent);
  padding: 18px 22px;
  border-radius: 4px;
  margin: 32px 0 8px;
}
.hero-callout p { margin: 0; font-size: 1rem; line-height: 1.55; }

.unlocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 14px 0 8px;
}
.unlocks-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px 18px;
}
.unlocks-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.72rem;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 6px;
}
.unlocks-card p {
  margin: 0;
  font-size: 0.92rem;
  color: var(--ink);
  line-height: 1.5;
}

.section-lede {
  color: var(--ink-muted);
  font-size: 0.95rem;
  max-width: 640px;
  margin: 0 0 12px;
}

/* --- Stats --- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 20px 0 8px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 20px;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.stat:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: #d8d6d0;
}
.stat-num {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
  letter-spacing: -0.02em;
}
.stat-label {
  margin-top: 10px;
  font-size: 0.92rem;
  color: var(--ink);
  font-weight: 500;
}
.stat-sub {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--ink-muted);
  line-height: 1.45;
}
.stat.lead-stat {
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--surface) 70%);
  border-color: #b8d8c5;
}
.stat.lead-stat .stat-num { font-size: 2.6rem; }

/* --- Legend --- */
.legend {
  margin: 8px 0 0;
  font-size: 0.82rem;
  color: var(--ink-muted);
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  vertical-align: middle;
  margin-right: 4px;
}

/* --- Next-tab grid --- */
.next-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}
.next-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px;
  display: block;
  color: var(--ink);
  transition: all 0.12s ease;
}
.next-card:hover {
  border-color: var(--accent);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.04);
}
.next-card h4 {
  margin: 0 0 6px;
  font-size: 1rem;
  color: var(--accent);
  font-weight: 600;
}
.next-card p {
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
  line-height: 1.5;
}

/* --- Spectrum chart --- */
#spectrum {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  margin: 16px 0;
}
.spectrum-row {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.spectrum-row:last-child { border-bottom: none; }
.spectrum-row-top {
  display: grid;
  grid-template-columns: 260px 1fr 70px;
  gap: 16px;
  align-items: center;
}
.spectrum-label {
  font-size: 0.92rem;
  font-weight: 600;
}
.spectrum-sub {
  display: block;
  font-size: 0.82rem;
  color: var(--ink-muted);
  font-weight: 400;
  margin-top: 3px;
  line-height: 1.4;
}
.spectrum-bar {
  background: #f0eee8;
  height: 22px;
  border-radius: 3px;
  position: relative;
  overflow: hidden;
}
.spectrum-fill {
  height: 100%;
  min-width: 10px;
  border-radius: 3px 0 0 3px;
}
.spectrum-count {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--ink);
  text-align: right;
}
.spectrum-count-unit {
  font-weight: 400;
  color: var(--ink-muted);
  font-size: 0.78rem;
  margin-left: 2px;
}
.spectrum-states {
  font-size: 0.82rem;
  color: var(--ink-muted);
  margin-top: 8px;
  margin-left: 276px;
  line-height: 1.6;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.tier-legacy { background: var(--legacy); }
.tier-hybrid { background: var(--hybrid); }
.tier-modern { background: var(--modern); }
.tier-portal-only { background: var(--portal-only); }

/* --- 51-state tile grid --- */
.state-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(48px, 1fr));
  gap: 6px;
  margin: 14px 0 8px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.state-tile {
  font-family: inherit;
  font-weight: 600;
  font-size: 0.78rem;
  color: white;
  border: none;
  border-radius: 4px;
  padding: 0;
  cursor: pointer;
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  letter-spacing: 0.02em;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.state-tile:hover {
  transform: translateY(-2px) scale(1.06);
  box-shadow: 0 4px 10px rgba(20, 30, 25, 0.18);
  filter: brightness(1.08);
  z-index: 2;
}
.state-tile:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}
.state-tile.tier-legacy { background: var(--legacy); }
.state-tile.tier-hybrid { background: var(--hybrid); }
.state-tile.tier-modern { background: var(--modern); }
.state-tile.tier-portal-only { background: var(--portal-only); }
.state-tile-code {
  font-feature-settings: "tnum";
}
@media (max-width: 720px) {
  .state-tiles { grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 5px; padding: 10px; }
  .state-tile { font-size: 0.72rem; }
}

/* --- Glossary --- */
.glossary {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 10px 24px;
  margin: 14px 0 0;
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 0.92rem;
}
.glossary dt {
  font-weight: 600;
  color: var(--ink);
}
.glossary dd {
  margin: 0;
  color: var(--ink-muted);
  line-height: 1.5;
}
@media (max-width: 720px) {
  .glossary { grid-template-columns: 1fr; gap: 4px 0; }
  .glossary dt { margin-top: 8px; }
  .glossary dd { margin-bottom: 4px; }
}

/* --- Findings --- */
.finding-group {
  margin-bottom: 40px;
}
.finding-group-header {
  border-bottom: 2px solid var(--accent);
  padding-bottom: 8px;
  margin-bottom: 16px;
}
.finding-group-header h2 { margin: 0 0 4px; font-size: 1.15rem; }
.finding-group-header .blurb { color: var(--ink-muted); font-size: 0.9rem; margin: 0; }

.finding {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 18px 20px;
  margin-bottom: 12px;
}
.finding-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}
.finding-headline {
  font-size: 1.02rem;
  font-weight: 600;
  margin: 0;
  flex: 1;
}
.shape-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 3px 9px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
}
.shape-tam   { background: #d8efe2; color: #1f5239; }
.shape-wedge { background: #fde8c9; color: #92400e; }
.shape-risk  { background: #fbd5d1; color: #9b1c1c; }
.shape-uxgap { background: #e0e7ff; color: #3730a3; }
.shape-watch { background: #f3e8ff; color: #6b21a8; }
.finding-summary {
  color: var(--ink-muted);
  font-size: 0.93rem;
  margin: 0 0 10px;
}
.finding-keypoint {
  font-size: 0.93rem;
  line-height: 1.55;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.finding-keypoint p { margin: 0; }
.finding-detail {
  font-size: 0.92rem;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: none;
}
.finding-detail.open { display: block; }
.finding-detail table {
  border-collapse: collapse;
  width: 100%;
  margin: 8px 0;
  font-size: 0.88rem;
}
.finding-detail th, .finding-detail td {
  border: 1px solid var(--border);
  padding: 6px 10px;
  text-align: left;
  vertical-align: top;
}
.finding-detail th {
  background: #f5f3ed;
  font-weight: 600;
}
.finding-toggle {
  background: none;
  border: none;
  padding: 6px 0 0;
  color: var(--accent);
  font-size: 0.85rem;
  cursor: pointer;
  font-family: inherit;
  font-weight: 500;
}
.finding-toggle:hover { text-decoration: underline; }

/* --- Top Reads rail (editorial cream block) --- */
.top-reads {
  background: var(--editorial-bg);
  border: 1px solid var(--editorial-border);
  border-left: 4px solid var(--editorial-ink);
  border-radius: 4px 10px 10px 4px;
  padding: 22px 24px 24px;
  margin-bottom: 40px;
  position: relative;
}
.top-reads::before {
  content: "★";
  position: absolute;
  top: 18px;
  right: 22px;
  font-size: 1.1rem;
  color: var(--editorial-ink);
  opacity: 0.32;
}
.top-reads-header { margin-bottom: 14px; }
.top-reads-eyebrow {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.74rem;
  color: var(--editorial-ink);
  font-weight: 700;
  margin-right: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}
.top-reads-blurb {
  display: inline;
  color: var(--ink-muted);
  font-size: 0.93rem;
  margin: 0;
  font-style: italic;
}
.top-reads-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
.top-reads .finding {
  margin-bottom: 0;
  background: var(--surface);
  border-color: var(--editorial-border);
}

/* --- Suggested-view chips --- */
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}
.chip {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-family: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  transition: all 0.12s ease;
}
.chip:hover {
  color: var(--ink);
  border-color: var(--ink-muted);
}
.chip.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

/* --- Filter bar --- */
.filter-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  align-items: center;
}
.filter-bar input,
.filter-bar select {
  padding: 7px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  font-family: inherit;
}
.filter-bar input[type=search] { flex: 1; min-width: 200px; }
.filter-count {
  margin-left: auto;
  color: var(--ink-muted);
  font-size: 0.85rem;
}
.lang-pill {
  display: inline-block;
  padding: 1px 6px;
  margin-left: 4px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  background: #eef4ff;
  color: #2a4d8c;
  border: 1px solid #c8d8f3;
  border-radius: 3px;
  white-space: nowrap;
  vertical-align: 1px;
}

/* --- Forms table --- */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
table#forms-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
#forms-table th,
#forms-table td {
  text-align: left;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
}
#forms-table th {
  background: #f5f3ed;
  font-weight: 600;
}
#forms-table tbody tr:hover { background: #f9f8f3; }
#forms-table .state-cell {
  font-weight: 600;
  white-space: nowrap;
  width: 50px;
}
#forms-table .title-cell { max-width: 320px; word-break: break-word; }
#forms-table .issuer-cell { color: var(--ink-muted); max-width: 220px; word-break: break-word; }
#forms-table .open-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 8px;
  font-size: 0.78rem;
  color: var(--ink-muted);
  cursor: pointer;
  font-family: inherit;
}
#forms-table .open-btn:hover { background: #f0eee8; color: var(--ink); }
.empty {
  padding: 32px;
  text-align: center;
  color: var(--ink-muted);
}
.pager {
  padding: 12px 16px;
  text-align: center;
  color: var(--ink-muted);
  font-size: 0.85rem;
  margin: 0;
}

/* --- States grid --- */
.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}
.state-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 16px;
  font-size: 0.88rem;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}
.state-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
  border-color: #d8d6d0;
}
.state-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
}
.state-card .state-code {
  color: var(--ink-soft);
  font-weight: normal;
  font-size: 0.85rem;
}
.state-card dl {
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 4px 8px;
}
.state-card dt {
  color: var(--ink-muted);
  font-size: 0.78rem;
}
.state-card dd {
  margin: 0;
  font-size: 0.85rem;
  word-break: break-word;
}
.tier-pill {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 0.72rem;
  color: white;
  margin-left: 6px;
  vertical-align: middle;
}

/* --- Modal --- */
.modal {
  position: fixed; inset: 0;
  background: rgba(20, 20, 20, 0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 50;
  padding: 24px;
}
.modal-card {
  background: var(--surface);
  border-radius: 8px;
  max-width: 640px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}
.modal-close {
  position: absolute;
  top: 8px; right: 12px;
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  color: var(--ink-soft);
  font-family: inherit;
}
.modal-close:hover { color: var(--ink); }
.modal dl {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 8px 16px;
  margin: 0;
  font-size: 0.9rem;
}
.modal dt {
  color: var(--ink-muted);
  font-weight: 500;
}
.modal dd {
  margin: 0;
  word-break: break-word;
}

@media (max-width: 720px) {
  .site-header-inner { padding: 12px 16px 0; }
  .tabs { overflow-x: auto; }
  .container, .container-wide { padding: 0 16px; }
  .spectrum-row-top { grid-template-columns: 1fr; gap: 8px; }
  .spectrum-states { margin-left: 0; }
  #forms-table th { position: static; }
  .state-card dl { grid-template-columns: 100px 1fr; }
}

/* ---------- Recertification tab ---------- */
.recert-matrix-controls {
  display: flex;
  gap: 8px;
  margin: 16px 0;
  flex-wrap: wrap;
  align-items: center;
}
.recert-matrix-controls input,
.recert-matrix-controls select {
  padding: 7px 10px;
  font-size: 0.9rem;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: var(--surface);
  font-family: inherit;
  color: var(--ink);
}
.recert-matrix-controls input[type=search] { flex: 1; min-width: 220px; }
.recert-matrix-controls select { flex: 0 0 220px; }

/* Recert table needs to scroll horizontally on narrow viewports — overrides
   the global .table-wrap overflow:hidden. min-width on the table prevents
   columns from squeezing invisibly when the viewport is narrower than the
   table's natural width. */
.recert-table-wrap {
  overflow-x: auto;
  overflow-y: visible;
}

/* Synced top scrollbar — gives the user a horizontal scroll handle near
   the column headers so they don't have to scroll past 51 rows to find
   one. JS keeps the inner div's width in sync with the table's
   scrollWidth, and the two scroll positions in sync on either move. */
.recert-scroll-top {
  overflow-x: auto;
  overflow-y: hidden;
  height: 14px;
  margin-bottom: 6px;
  scrollbar-width: thin;
}
.recert-scroll-top > div { height: 1px; }

#recert-table {
  width: 100%;
  min-width: 760px;
  border-collapse: collapse;
  font-size: 0.92rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
}
#recert-table thead th {
  text-align: left;
  padding: 10px 12px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  color: var(--ink);
}
#recert-table thead th:hover { background: var(--accent-soft); }
#recert-table tbody td {
  padding: 9px 12px;
  border-bottom: 1px solid var(--border);
  color: var(--ink);
}
#recert-table tbody tr:last-child td { border-bottom: none; }
#recert-table tbody tr {
  cursor: pointer;
  transition: background 0.1s;
}
#recert-table tbody tr:hover { background: var(--accent-soft); }

/* State card — recert block (replaces the bare enum on the Recert dt/dd) */
.state-recert-headline {
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 4px;
}
.state-recert-facts {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.88rem;
  color: var(--ink-muted);
}
.state-recert-facts li {
  padding: 1px 0;
  line-height: 1.45;
}
.state-recert-facts b {
  color: var(--ink);
  font-weight: 500;
}

@media (max-width: 720px) {
  .recert-matrix-controls input,
  .recert-matrix-controls select { flex: 1 1 100%; min-width: 0; }
  #recert-table { font-size: 0.85rem; }
  #recert-table thead th, #recert-table tbody td { padding: 7px 9px; }
}

/* ---- Recert journey browser ---- */

.recert-browser {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}

.recert-rail {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  position: sticky;
  top: 12px;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
}

.recert-rail-controls {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 10px;
}

.recert-rail-controls input,
.recert-rail-controls select {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.85rem;
  background: var(--bg);
  color: var(--ink);
  font-family: inherit;
}

.recert-rail-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recert-rail-item {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  align-items: baseline;
  gap: 8px;
  padding: 7px 6px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.88rem;
  line-height: 1.35;
}

.recert-rail-item:hover {
  background: var(--accent-soft);
}

.recert-rail-item.is-selected {
  background: var(--accent);
  color: white;
}

.recert-rail-item.is-selected .recert-rail-meta,
.recert-rail-item.is-selected .recert-rail-flag {
  color: rgba(255, 255, 255, 0.85);
}

.recert-rail-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  align-self: center;
}

.recert-rail-name strong {
  font-weight: 600;
  margin-right: 4px;
}

.recert-rail-meta {
  font-size: 0.75rem;
  color: var(--ink-muted);
  white-space: nowrap;
}

.recert-rail-flag {
  grid-column: 2 / -1;
  font-size: 0.7rem;
  color: var(--warn);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.recert-rail .filter-count {
  margin-top: 8px;
  font-size: 0.75rem;
  color: var(--ink-muted);
}

/* Right pane */
.recert-pane {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 24px 28px;
  min-height: 400px;
}

.recert-pane-empty {
  color: var(--ink-muted);
  font-style: italic;
}

.recert-pane-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 16px;
  margin-bottom: 20px;
}

.recert-pane-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.recert-pane-title h3 {
  margin: 0;
  font-size: 1.4rem;
}

.recert-pane-archetype {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  background: var(--bg);
  padding: 3px 10px 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.recert-pane-archetype .recert-rail-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 auto;
}

.recert-facts {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
  line-height: 1.7;
}

.recert-facts li {
  display: inline-block;
  white-space: nowrap;
}

.recert-facts li:not(:last-child)::after {
  content: " · ";
  color: var(--border);
  padding: 0 8px;
}

/* Beats */
.recert-beat {
  margin-bottom: 22px;
}

.recert-beat-title {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--ink-muted);
  margin: 0 0 6px;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.recert-beat-body {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

.recert-beat-body p {
  margin: 0 0 8px;
}

.recert-beat-body p:last-child {
  margin-bottom: 0;
}

.recert-beat-flag {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--warn);
  background: #fef4e6;
  border-radius: 999px;
  padding: 1px 7px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.recert-beat--review .recert-beat-body {
  background: #fefaf2;
  border-left: 3px solid var(--warn);
  padding: 10px 12px;
  border-radius: 0 4px 4px 0;
}

.recert-pane-footer {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.recert-pane-jumplink {
  font-size: 0.9rem;
}

/* Matrix as collapsible disclosure */
.recert-matrix-details {
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px 16px;
  background: var(--surface);
}

.recert-matrix-details summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 4px 0;
}

.recert-matrix-details[open] summary {
  margin-bottom: 12px;
}

/* Responsive: collapse to single column on narrow screens */
@media (max-width: 900px) {
  .recert-browser {
    grid-template-columns: 1fr;
  }
  .recert-rail {
    position: static;
    max-height: 320px;
  }
}

/* ---- Recert v2: timeline + narrative + sources ---- */

.recert-section-title {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 24px 0 6px;
  font-weight: 600;
}

.recert-timeline-wrap,
.recert-narrative-wrap,
.recert-sources {
  margin-bottom: 20px;
}

.recert-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px 4px;
  position: relative;
}

.recert-timeline-node {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 4px;
  text-align: center;
  padding: 8px 6px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
}

.recert-timeline-dot {
  display: inline-flex;
  width: 22px;
  height: 22px;
  margin: 0 auto;
  border-radius: 50%;
  background: #4f7ab0;
  color: white;
  font-size: 0.72rem;
  font-weight: 600;
  align-items: center;
  justify-content: center;
}

.recert-timeline-label {
  font-size: 0.82rem;
  color: var(--ink);
  line-height: 1.3;
}

.recert-timeline-offset {
  font-size: 0.7rem;
  color: var(--ink-muted);
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.recert-timeline-branches {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.recert-timeline-branches li {
  background: #f3efe3;
  border-radius: 999px;
  padding: 2px 10px;
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.recert-narrative {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink);
}

.recert-narrative p {
  margin: 0 0 10px;
}

.recert-narrative p:last-child { margin-bottom: 0; }

.recert-narrative h5 {
  font-size: 0.9rem;
  margin: 16px 0 6px;
  color: var(--ink);
}

.recert-narrative--needs-research {
  background: #fefaf2;
  border-left: 3px solid var(--warn);
  padding: 10px 14px;
  border-radius: 0 4px 4px 0;
  color: var(--ink-muted);
  font-style: italic;
}

.recert-sources-list {
  margin: 0;
  padding-left: 20px;
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.recert-sources-list li { margin-bottom: 4px; }

.recert-sources-list a {
  word-break: break-word;
}

/* ---- Universal timeline (horizontal, above the master-detail browser) ---- */

.recert-universal-timeline {
  margin: 16px 0 24px;
  padding: 14px 16px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.recert-universal-timeline-title {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 0 0 12px;
  font-weight: 600;
}

.recert-timeline-horizontal {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 5px;
  position: relative;
}

.recert-timeline-h-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  padding: 8px 4px;
  background: var(--bg);
  border-radius: 6px;
  border: 1px solid var(--border);
  position: relative;
  min-width: 0;
}

.recert-timeline-h-node:not(:last-child)::after {
  content: "→";
  position: absolute;
  right: -8px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ink-soft);
  font-size: 0.8rem;
  z-index: 1;
}

.recert-timeline-h-node--late {
  background: #fef2f2;
  border-color: #f3c9c4;
}

.recert-timeline-h-node--late .recert-timeline-dot {
  background: #b91c1c;
}

.recert-timeline-h-label {
  font-size: 0.82rem;
  line-height: 1.3;
  color: var(--ink);
  font-weight: 500;
}

.recert-timeline-h-offset {
  font-size: 0.7rem;
  color: var(--ink-muted);
  font-family: "SF Mono", Menlo, Consolas, monospace;
}

.recert-universal-timeline-foot {
  font-size: 0.75rem;
  color: var(--ink-muted);
  margin: 12px 0 0;
  line-height: 1.45;
}

@media (max-width: 1100px) {
  .recert-timeline-horizontal {
    grid-template-columns: repeat(4, 1fr);
  }
  .recert-timeline-h-node:not(:last-child)::after { display: none; }
}

@media (max-width: 540px) {
  .recert-timeline-horizontal {
    grid-template-columns: 1fr 1fr;
  }
}

/* ---- Required documents chip list ---- */
.recert-required-docs {
  margin: 16px 0 22px;
  padding: 14px 16px;
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
}

.recert-doc-chips {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
}

.recert-doc-chip {
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  color: var(--ink);
  cursor: help;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1.3;
}

.recert-doc-conds {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}

.recert-doc-cond {
  padding: 8px 12px;
  background: #fefaf2;
  border: 1px solid #e8d9b5;
  border-radius: 6px;
  font-size: 0.84rem;
  line-height: 1.45;
  cursor: help;
  color: var(--ink);
}

.recert-doc-cond-label {
  font-weight: 600;
}

.recert-doc-cond-label::before {
  content: "⚠";
  color: var(--warn);
  margin-right: 6px;
  font-size: 0.82rem;
}

.recert-doc-cond-text {
  display: block;
  margin-top: 2px;
  color: var(--ink-muted);
  font-size: 0.78rem;
}

/* New 2026-05-07: per-pill + state-overview links in recert required-docs */

.recert-section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.recert-doc-overview-link {
  font-size: 0.78rem;
  color: var(--link);
  text-decoration: underline;
  padding: 3px 10px;
  border: 1px solid var(--link);
  border-radius: 999px;
  background: var(--surface);
  white-space: nowrap;
  transition: color 120ms ease, border-color 120ms ease, background-color 120ms ease;
}

.recert-doc-overview-link:hover,
.recert-doc-overview-link:focus-visible {
  color: #fff;
  background-color: var(--link-hover);
  border-color: var(--link-hover);
}

.recert-doc-chip--link {
  cursor: pointer;
  border-color: var(--link);
}

.recert-doc-chip--link a {
  color: var(--link);
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.recert-doc-chip--link:hover,
.recert-doc-chip--link:focus-within {
  background-color: var(--link-hover);
  border-color: var(--link-hover);
}

.recert-doc-chip--link:hover a,
.recert-doc-chip--link:focus-within a {
  color: #fff;
}

.recert-doc-chip-arrow {
  font-size: 0.72rem;
  line-height: 1;
}

.recert-doc-cond-label-link {
  color: var(--link);
  text-decoration: underline;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.recert-doc-cond-label-link:hover,
.recert-doc-cond-label-link:focus-visible {
  color: var(--link-hover);
}

.recert-doc-subhead {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  margin: 14px 0 6px;
}

.recert-doc-subhead:first-of-type {
  margin-top: 4px;
}

.recert-doc-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 18px 0 0;
}

/* ---- Per-state pane tabs (Audit narrative / Suggested client messaging) ---- */
.recert-tabs {
  display: flex;
  gap: 4px;
  margin: 18px 0 14px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.recert-tab {
  background: transparent;
  border: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--ink-muted);
  cursor: pointer;
  border-radius: 6px 6px 0 0;
  transition: all 0.12s ease;
  margin-bottom: -1px;
  position: relative;
}

.recert-tab:hover {
  color: var(--ink);
  background: var(--bg);
}

.recert-tab.is-active {
  background: var(--surface);
  color: var(--accent);
  border-color: var(--border);
  border-bottom: 1px solid var(--surface);
  font-weight: 600;
}

.recert-narrative-wrap--audit,
.recert-narrative-wrap--messaging {
  margin-bottom: 22px;
}

.recert-client-messaging h2 {
  font-size: 1.05rem;
  font-weight: 600;
  margin: 22px 0 10px;
  color: var(--ink);
}

.recert-client-messaging ol,
.recert-client-messaging ul {
  margin: 12px 0 16px;
  padding-left: 22px;
  line-height: 1.6;
}

.recert-client-messaging ol li,
.recert-client-messaging ul li {
  margin-bottom: 8px;
}

.recert-client-messaging .cta {
  background: #f0f4f8;
  border-left: 4px solid var(--accent);
  padding: 12px 16px;
  border-radius: 4px;
  margin: 16px 0;
}
