:root {
  --ink: #17201c;
  --muted: #5f6d65;
  --paper: #f4f1e9;
  --panel: #fffdf8;
  --line: #d7d2c7;
  --green: #295c49;
  --green-bright: #37745c;
  --amber: #d3a15f;
  --rust: #9f5c45;
  --navy: #203b4b;
  --shadow: 0 18px 50px rgba(23, 32, 28, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input { font: inherit; }
button { color: inherit; }
a { color: inherit; }
.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; }
.skip-link { position: fixed; top: 12px; left: 12px; transform: translateY(-180%); background: white; padding: 10px 14px; z-index: 99; border-radius: 8px; }
.skip-link:focus { transform: translateY(0); }

.topbar { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(23,32,28,.14); background: rgba(244,241,233,.94); backdrop-filter: blur(16px); }
.shell { display: flex; width: min(1180px,calc(100% - 48px)); min-height: 68px; margin: 0 auto; align-items: center; gap: 28px; }
.af-brand { margin-right: auto; color: var(--ink); font-size: .95rem; font-weight: 850; letter-spacing: .02em; text-decoration: none; text-transform: uppercase; }
.af-brand b { color: var(--rust); }
.navlinks { display: flex; gap: 22px; }
.navlinks a { display: inline-flex; min-height: 44px; align-items: center; color: var(--muted); font-size: .67rem; font-weight: 800; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.navlinks a:hover, .navlinks a:focus-visible, .navlinks a[aria-current="page"] { color: var(--rust); }
.navlinks a:focus-visible { outline: 2px solid var(--rust); outline-offset: 4px; }

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px clamp(22px, 5vw, 74px);
  border-bottom: 1px solid rgba(23,32,28,.12);
}
.brand-lockup { display: flex; align-items: center; gap: 14px; }
.brand-mark { display: grid; place-items: center; width: 44px; height: 44px; background: var(--ink); color: white; border-radius: 12px; font-weight: 800; letter-spacing: -.04em; }
.site-header h1 { margin: 0; font-family: Georgia, serif; font-size: 1.55rem; letter-spacing: -.03em; }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: .71rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.edition { display: flex; gap: 8px; align-items: center; color: var(--muted); font-size: .84rem; }
.status-dot { width: 8px; height: 8px; background: var(--amber); border-radius: 50%; box-shadow: 0 0 0 4px rgba(211,161,95,.18); }

main { width: min(1480px, calc(100% - 32px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 50px; align-items: end; padding: 72px 0 42px; }
.kicker { margin: 0 0 14px; color: var(--rust); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; }
.hero h1 { max-width: 900px; margin: 0; font: 700 clamp(2.8rem, 6vw, 6.2rem)/.95 Georgia, serif; letter-spacing: -.055em; }
.hero-copy { max-width: 760px; margin: 26px 0 0; color: var(--muted); font-size: 1.08rem; }
.hero-status { max-width: 760px; margin: 18px 0 0; padding-left: 12px; border-left: 3px solid var(--rust); color: var(--muted); font-size: .84rem; }
.hero-status strong { color: var(--ink); }
.hero-stats { display: grid; grid-template-columns: repeat(2, 1fr); background: rgba(255,255,255,.58); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.hero-stats div { padding: 20px 12px; text-align: center; border-right: 1px solid var(--line); }
.hero-stats div:last-child { border-right: 0; }
.hero-stats strong { display: block; font: 700 2rem Georgia, serif; }
.hero-stats span { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }

.controls { display: grid; grid-template-columns: 1fr auto; gap: 14px 20px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line); }
.map-lens-control { display: grid; gap: 4px; }
.control-label, .metric-selectors legend { color: var(--muted); font-size: .72rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.metric-selectors { grid-column: 1 / -1; grid-row: 2; display: flex; flex-wrap: wrap; gap: 4px 12px; min-width: 0; margin: 0; padding: 0; border: 0; }
.metric-selectors legend { margin-bottom: 4px; }
.metric-actions { display: inline-flex; align-items: center; gap: 6px; margin-right: 8px; }
.metric-actions button { min-height: 32px; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.7); color: var(--ink); font: 700 .7rem system-ui, sans-serif; cursor: pointer; }
.metric-actions button:hover, .metric-actions button:focus-visible { border-color: var(--ink); background: #fff; }
.metric-selectors label { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; white-space: nowrap; cursor: pointer; font-size: .78rem; }
.metric-selectors label[hidden] { display: none; }
.metric-selectors input { accent-color: var(--ink); }
.context-metrics { grid-column: 1 / -1; grid-row: 3; margin: -6px 0 0; color: var(--muted); font-size: .75rem; line-height: 1.4; }
.search-box { grid-column: 2; grid-row: 1; }
.filter-group { display: flex; gap: 7px; flex-wrap: wrap; }
.filter, .quiet-button, .text-button { border: 0; background: transparent; cursor: pointer; }
.filter { padding: 9px 14px; border-radius: 999px; color: var(--muted); }
.filter:hover, .filter:focus-visible { background: rgba(255,255,255,.7); }
.filter.is-active { background: var(--ink); color: white; }
.search-box input { width: min(300px, 40vw); padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.72); color: var(--ink); }

.atlas-shell { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(380px, .65fr); min-height: 760px; background: var(--panel); border: 1px solid var(--line); border-radius: 24px; overflow: hidden; box-shadow: var(--shadow); }
.map-panel { min-width: 0; padding: 24px; border-right: 1px solid var(--line); background: radial-gradient(circle at 55% 42%, #fffdf8 0, #f3efe5 75%); }
.panel-heading { display: flex; justify-content: space-between; align-items: flex-start; }
.panel-heading h2 { margin: 0; font: 700 1.65rem Georgia, serif; }
.quiet-button { padding: 7px 0; color: var(--muted); border-bottom: 1px solid currentColor; }
.map-wrap { position: relative; aspect-ratio: 960 / 610; margin: 18px 0 4px; }
#us-map { width: 100%; height: 100%; overflow: visible; }
.state-shape { stroke: #fffdf8; stroke-width: .8; cursor: pointer; transition: filter .16s ease, opacity .16s ease, stroke-width .16s ease; }
.state-shape:hover, .state-shape:focus-visible { filter: brightness(.93); stroke: var(--ink); stroke-width: 2; outline: none; }
.state-shape.is-selected { stroke: var(--ink); stroke-width: 2.8; filter: drop-shadow(0 3px 3px rgba(0,0,0,.15)); }
.state-borders { fill: none; stroke: rgba(255,255,255,.76); stroke-linejoin: round; pointer-events: none; }
.tooltip { position: absolute; z-index: 3; display: none; min-width: 160px; padding: 10px 12px; background: rgba(23,32,28,.94); color: white; border-radius: 10px; box-shadow: var(--shadow); pointer-events: none; }
.tooltip.is-visible { display: block; }
.tooltip strong, .tooltip span { display: block; }
.tooltip span { margin-top: 2px; color: #d9e4de; font-size: .8rem; }
.legend { display: flex; gap: 16px; flex-wrap: wrap; color: var(--muted); font-size: .75rem; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 11px; height: 11px; border-radius: 3px; }
.swatch.open { background: var(--green-bright); }
.swatch.mixed { background: var(--amber); }
.swatch.constrained { background: var(--rust); }
.swatch.pending { background: #e7e5df; border: 1px solid #c9c6bd; }
.map-note { margin: 18px 0 0; max-width: 680px; color: var(--muted); font-size: .78rem; }

.detail-panel { min-width: 0; max-height: 850px; overflow-y: auto; padding: 28px; background: #fff; scroll-behavior: smooth; }
.detail-panel:focus-visible { outline: 3px solid var(--rust); outline-offset: -3px; }
.profile-header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px; align-items: flex-start; }
.profile-header h2, .empty-profile h2, .method-detail h2 { margin: 0; font: 700 2.4rem Georgia, serif; letter-spacing: -.04em; }
.tagline { margin: 8px 0 0; color: var(--muted); }
.status-pill, .pending-badge { display: inline-flex; padding: 6px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; white-space: nowrap; }
.status-pill.open { background: #d9eee4; color: var(--green); }
.status-pill.mixed { background: #f5e6c8; color: #7d541f; }
.status-pill.constrained { background: #f1ddd5; color: #773d2e; }
.status-pill.unscored { background: #efede7; color: var(--muted); }
.pending-badge { margin: 16px 0; background: #ece9e1; color: var(--muted); }
.score-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 24px 0; }
.primary-score-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; margin-bottom: 16px; }
.primary-score-grid .direction-card:not(.judgment-card) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: baseline; }
.primary-score-grid .direction-card:not(.judgment-card) strong { justify-self: end; margin: 0; text-align: right; }
.primary-score-grid .direction-card:not(.judgment-card) small { grid-column: 1 / -1; margin-top: 5px; }
.domain-metrics { margin: 0 0 20px; }
.domain-metrics h3 { margin: 0 0 4px; font: 700 1rem Georgia, serif; }
.domain-metrics p { margin: 0; color: var(--muted); font-size: .78rem; }
.domain-metrics .score-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 12px 0 0; }
.domain-metrics .metric-only-grid { grid-template-columns: minmax(0, 1fr); }
.counterweight-heading { margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--line); }
.counterweight-heading h3 { margin: 0 0 5px; font: 700 1.1rem Georgia, serif; }
.counterweight-heading p { margin: 0; color: var(--muted); font-size: .82rem; }
.direction-card strong { display: block; margin: 10px 0 4px; overflow-wrap: normal; word-break: normal; }
.direction-card small { display: block; line-height: 1.35; }
.judgment-card ul { margin: 10px 0 0; padding-left: 17px; color: var(--muted); font-size: .76rem; line-height: 1.4; }
.judgment-card li + li { margin-top: 3px; }
.trajectory-note { margin: -4px 0 17px; padding: 9px 12px; border-left: 3px solid var(--amber); background: #fff8eb; color: #71542b; font-size: .79rem; }
.score-card.unrated { background: #efede7; color: var(--muted); }
.score-card.unrated small { display: block; }
.score-card.unrated strong { display: block; margin: 12px 0 2px; font: 700 1rem/1.2 system-ui, sans-serif; }
.score-card.unrated::after { background: #c9c5bb; }
.score-card { position: relative; padding: 14px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.score-card::after { content: ""; position: absolute; inset: auto 0 0; height: 4px; background: var(--amber); }
.score-card.open::after { background: var(--green-bright); }
.score-card.constrained::after { background: var(--rust); }
.score-card span { display: block; color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.score-card strong { font: 700 2rem Georgia, serif; }
.score-card.direction-card strong { font: 700 1.05rem/1.25 system-ui, sans-serif; }
.primary-score-grid .judgment-card strong { font: 700 1.4rem/1.2 Georgia, serif; }
.primary-score-grid .direction-card:not(.judgment-card) strong { font: 700 1.2rem/1.2 Georgia, serif; }
.score-card small { color: var(--muted); }
.condition-sources { margin: -8px 0 14px; color: var(--muted); font-size: .78rem; }
.condition-sources summary { cursor: pointer; width: fit-content; }
.condition-sources .citation-list { margin-top: 8px; }
.summary { font-size: .98rem; }
.current-policy-note { margin: 18px 0; padding: 14px 16px; border: 1px solid var(--line); background: rgba(255,255,255,.36); }
.current-policy-note h3 { margin: 0 0 7px; font: 700 1rem Georgia, serif; }
.current-policy-note p { margin: 0; color: var(--muted); font-size: .82rem; }
.current-policy-note ul { margin: 9px 0 0; padding-left: 18px; font-size: .82rem; }
.current-policy-note li + li { margin-top: 5px; }
.current-policy-note small { color: var(--muted); }
.factor-observations { margin: 20px 0; }
.factor-observations h3 { margin: 0 0 8px; font: 700 1rem Georgia, serif; }
.factor-observation { padding: 12px 0; border-top: 1px solid var(--line); }
.factor-observation > div:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.factor-observation strong { font-size: .88rem; }
.factor-observation small { display: block; margin-top: 4px; color: var(--muted); }
.factor-observation p { margin: 6px 0 8px; color: var(--muted); font-size: .82rem; }
.factor-status { padding: 2px 7px; border-radius: 20px; background: #eceae3; color: var(--ink); font-size: .7rem; font-weight: 700; }
.factor-status.constraint { background: #f5e7e1; color: #843f2c; }
.factor-status.enabling { background: #e5f0e8; color: #2e6548; }
.recent-changes { margin: 20px 0; }
.recent-changes h3 { margin: 0 0 8px; font: 700 1rem Georgia, serif; }
.change-note { padding: 12px 0; border-top: 1px solid var(--line); }
.change-note time { display: block; color: var(--muted); font-size: .72rem; }
.change-note strong { display: block; margin-top: 3px; font-size: .88rem; }
.change-note p { margin: 5px 0 8px; color: var(--muted); font-size: .82rem; }
.government-note { display: grid; gap: 4px; margin: 18px 0; padding: 13px 14px; background: #f5f3ed; border-left: 3px solid var(--navy); font-size: .82rem; }
.government-note span { color: var(--muted); }
.detail-tabs { display: flex; gap: 16px; margin: 26px 0 20px; border-bottom: 1px solid var(--line); }
.detail-tab { padding: 0 0 10px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--muted); cursor: pointer; font-weight: 700; }
.detail-tab.is-active { color: var(--ink); border-color: var(--rust); }
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }
.tab-panel h3, .method-detail h3 { font: 700 1.15rem Georgia, serif; }
.factor { padding: 16px 0; border-top: 1px solid var(--line); }
.factor-top { display: flex; justify-content: space-between; gap: 12px; }
.factor-bar { height: 5px; margin: 8px 0 10px; background: #ece9e1; border-radius: 99px; overflow: hidden; }
.factor-bar i { display: block; height: 100%; background: var(--green); }
.factor p, .policy-card p { margin: 7px 0; color: var(--muted); font-size: .86rem; }
.citation-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.citation { display: inline-flex; flex-direction: column; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; font-size: .68rem; line-height: 1.25; }
.citation:hover, .citation:focus-visible { border-color: var(--green); }
.citation span { color: var(--muted); font-size: .62rem; }
.pending-citation { color: var(--muted); border-style: dashed; }
.policy-card { padding: 16px; margin-bottom: 10px; border: 1px solid var(--line); border-radius: 14px; }
.policy-card h4 { margin: 8px 0; }
.policy-meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 6px 12px; color: var(--muted); font-size: .72rem; }
.policy-meta > span { display: flex; align-items: center; gap: 6px; }
.policy-meta .policy-date { display: inline; overflow-wrap: anywhere; }
.policy-card .policy-date-note { color: var(--muted); font-size: .74rem; }
.domain { text-transform: uppercase; letter-spacing: .08em; font-size: .62rem; color: var(--ink); }
.stage { padding: 4px 7px; border-radius: 99px; background: #e9e6de; color: var(--ink); font-weight: 800; }
.stage.proposed, .stage.draft-rule { background: #f5e6c8; color: #7d541f; }
.policy-card .proposal-direction { color: #7d541f; font-size: .76rem; font-weight: 700; }
.policy-card .context { color: var(--ink); font-size: .78rem; }
.metro-list { display: grid; gap: 7px; }
.metro-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: white; text-align: left; cursor: pointer; }
.metro-row:hover, .metro-row.is-active { border-color: var(--green); background: #f4f8f5; }
.metro-row small { display: block; margin-top: 3px; color: var(--muted); font-size: .72rem; }
.metro-marker { width: 10px; height: 10px; background: var(--rust); border: 3px solid #f1ddd5; border-radius: 50%; box-sizing: content-box; }
.metro-score { font: 700 1.25rem Georgia, serif; }
.metro-detail { margin-top: 12px; padding: 14px; background: #f5f3ed; border-radius: 12px; color: var(--muted); font-size: .82rem; }
.metro-detail strong, .metro-detail span { display: block; color: var(--ink); }
.research-checklist { display: grid; gap: 8px; margin: 22px 0; color: var(--muted); }
.fine-print { color: var(--muted); font-size: .8rem; }
.weight-list, .safeguard-list { padding-left: 20px; }
.weight-list li { margin: 14px 0; }
.weight-list span { display: block; color: var(--muted); font-size: .82rem; }
.text-button { padding: 0 0 4px; border-bottom: 1px solid currentColor; font-weight: 800; }

.method-strip { display: grid; grid-template-columns: .7fr 1.3fr auto; gap: 28px; align-items: center; margin: 36px 0 80px; padding: 28px; background: var(--ink); color: white; border-radius: 20px; }
.method-strip h2 { margin: 0; font: 700 2rem Georgia, serif; }
.method-strip p { margin: 0; color: #ccd7d1; }
.method-strip .eyebrow { color: #aebdb5; }
footer { display: flex; justify-content: space-between; gap: 30px; padding: 30px clamp(22px, 5vw, 74px); border-top: 1px solid var(--line); color: var(--muted); font-size: .78rem; }
footer strong { color: var(--ink); font: 700 1.1rem Georgia, serif; }
footer p { max-width: 540px; margin: 0; text-align: right; }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; }
  .atlas-shell { grid-template-columns: 1fr; }
  .map-panel { border-right: 0; border-bottom: 1px solid var(--line); }
  .detail-panel { max-height: none; }
  .method-strip { grid-template-columns: 1fr; }
}
@media (max-width: 620px) {
  .shell { width: calc(100% - 28px); align-items: flex-start; flex-direction: column; gap: 0; padding: 10px 0 8px; }
  .af-brand { display: inline-flex; min-height: 36px; align-items: center; }
  .navlinks { width: 100%; gap: 18px; overflow-x: auto; scrollbar-width: none; }
  .navlinks::-webkit-scrollbar { display: none; }
  .navlinks a { flex: 0 0 auto; min-height: 36px; font-size: .6rem; }
  .site-header { align-items: flex-start; }
  .edition { max-width: 150px; text-align: right; }
  .hero { gap: 24px; padding-top: 32px; }
  .hero h1 { font-size: 2.8rem; }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero-stats div { padding: 14px 8px; }
  .controls { grid-template-columns: 1fr; align-items: start; }
  .metric-selectors, .context-metrics, .search-box { grid-column: 1; grid-row: auto; }
  .search-box, .search-box input { width: 100%; max-width: none; }
  .map-panel, .detail-panel { padding: 18px; }
  .legend { gap: 9px; }
  .score-grid { grid-template-columns: 1fr; }
  footer { flex-direction: column; }
  footer p { text-align: left; }
}

/* Slate-blue map: cyan identifies selection, never a rating category. */
.map-panel {
  background: radial-gradient(ellipse at 47% 38%, #365c70, #243f53 84%);
  color: #edf3ec;
}
.map-panel .eyebrow { color: #83dbdf; }
.map-panel .quiet-button, .map-panel .legend, .map-panel .map-note { color: #b7cdd0; }
.map-panel .map-note a { color: #9cebee; }
.map-panel { scroll-margin-top: 120px; }
.map-wrap {
  background-image: linear-gradient(#b6deec1c 1px, transparent 1px), linear-gradient(90deg, #b6deec1c 1px, transparent 1px);
  background-size: 23px 23px;
  border: 1px solid #a4c9da56;
}
.state-shape {
  stroke: #102329;
  stroke-width: .8px;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
}
.state-shape:hover, .state-shape:focus-visible {
  stroke: #e8f8f4;
  stroke-width: 1.6px;
  filter: brightness(1.13);
}
.state-outline { pointer-events: none; fill: none; stroke-linejoin: round; }
.state-outline path { vector-effect: non-scaling-stroke; }
.state-outline path:first-child { stroke: #071820; stroke-width: 5px; }
.state-outline path:last-child { stroke: #84f1f6; stroke-width: 2.3px; }
.map-panel .swatch { border: 1px solid #ffffff2b; }
.map-panel .swatch.open { background: #3d896f; }
.map-panel .swatch.mixed { background: #cda459; }
.map-panel .swatch.constrained { background: #b0644c; }
.map-panel .swatch.pending { background: #89949d; }
.tooltip {
  box-sizing: border-box;
  width: min(285px, 100%);
  min-width: 0;
  border: 1px solid #6fabb1;
  border-radius: 2px;
  background: #10242c;
}
.map-readout {
  display: flex;
  align-items: start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 17px;
  padding: 13px 14px;
  border-top: 2px solid #70dfe6;
  background: #18343e;
}
#map-readout { flex: 1 1 15rem; min-width: 0; scroll-margin: 120px 0 16px; }
#map-readout strong, #map-readout span { display: block; }
.map-readout strong { font: 700 1.2rem Georgia, serif; }
.map-readout .preview-label, .tooltip .preview-label { color: #a6eaed; font-size: .78rem; font-weight: 700; }
.map-readout .preview-reason { margin-top: 4px; color: #d7e7e8; font-size: .85rem; }
#map-open-profile { min-height: 40px; padding: 6px 12px; border: 1px solid #6ca4ae; background: #10242c; color: #e3fcfd; }
#map-open-profile:hover, #map-open-profile:focus-visible { background: #28535e; }
