:root {
  --gold: #c9a227;
  --gold-dark: #8a6f1a;
  --gold-soft: #faf6ea;
  --gold-border: #e8dfc2;
  --ink: #1a1a1a;
  --body: #333;
  --mute: #666;
  --faint: #999;
  --bg: #fdfbf6;
  --surface: #ffffff;
  --supervision: #c9a227;
  --conditional: #7a9e7e;
  --independent: #4a6fa5;
  --unknown: #cfcfcf;
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: Georgia, 'Times New Roman', serif;
  background: var(--bg);
  color: var(--body);
  line-height: 1.6;
  font-size: 16px;
}
a { color: var(--gold-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Layout */
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 24px; }
header.site {
  border-bottom: 1px solid var(--gold-border);
  background: var(--surface);
}
header.site .wrap {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: 18px; padding-bottom: 18px;
}
header.site .brand { display: flex; align-items: center; gap: 12px; }
header.site .brand img { width: 44px; height: 44px; border-radius: 6px; }
header.site .brand .name { font-weight: bold; color: var(--ink); font-size: 18px; letter-spacing: -0.2px; }
header.site .brand .tag { font-size: 11px; color: var(--mute); font-style: italic; }
header.site nav a { margin-left: 22px; color: var(--ink); font-size: 14px; }
header.site nav a:hover { color: var(--gold-dark); text-decoration: none; }

/* Hero */
.hero { padding: 72px 0 40px 0; text-align: center; }
.hero h1 { font-size: 44px; margin: 0 0 14px 0; color: var(--ink); letter-spacing: -1px; font-weight: normal; }
.hero h1 em { color: var(--gold-dark); font-style: italic; }
.hero .sub { font-size: 18px; color: var(--mute); max-width: 680px; margin: 0 auto; }
.hero .meta { margin-top: 20px; font-size: 13px; color: var(--faint); text-transform: uppercase; letter-spacing: 1.5px; }

/* Map section */
.map-section { padding: 24px 0 60px 0; }
.legend {
  display: flex; gap: 18px; justify-content: center; flex-wrap: wrap;
  margin: 10px 0 24px 0; font-size: 13px; color: var(--body);
}
.legend .chip { display: inline-flex; align-items: center; gap: 8px; }
.legend .swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.swatch.supervision { background: var(--supervision); }
.swatch.conditional { background: var(--conditional); }
.swatch.independent { background: var(--independent); }
.swatch.unknown { background: var(--unknown); }

.map-wrap {
  background: var(--surface);
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  padding: 20px;
  position: relative;
  overflow: hidden;
}
#us-map { width: 100%; height: auto; display: block; }
#us-map path.state {
  fill: var(--unknown);
  stroke: #ffffff;
  stroke-width: 1;
  cursor: pointer;
  transition: opacity 0.15s ease, transform 0.15s ease;
}
#us-map path.state.supervision_required { fill: var(--supervision); }
#us-map path.state.conditional_independence { fill: var(--conditional); }
#us-map path.state.independent { fill: var(--independent); }
#us-map path.state:hover { opacity: 0.78; }

.tooltip {
  position: absolute;
  pointer-events: none;
  background: var(--ink);
  color: #fff;
  padding: 8px 12px;
  border-radius: 4px;
  font-size: 13px;
  font-family: Georgia, serif;
  opacity: 0;
  transition: opacity 0.12s;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}
.tooltip .t-name { font-weight: bold; }
.tooltip .t-status { color: var(--gold); font-size: 12px; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.8px; }

/* State list fallback */
.states-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 6px;
  margin-top: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--gold-border);
}
.states-grid a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--gold-border);
  border-radius: 4px;
  color: var(--ink);
  font-size: 14px;
}
.states-grid a:hover { background: var(--gold-soft); text-decoration: none; border-color: var(--gold); }
.states-grid .state-status { font-size: 10px; text-transform: uppercase; letter-spacing: 0.8px; color: var(--mute); }
.states-grid .state-status.supervision_required { color: var(--supervision); }
.states-grid .state-status.conditional_independence { color: var(--conditional); }
.states-grid .state-status.independent { color: var(--independent); }

/* Content sections */
.section { padding: 56px 0; border-top: 1px solid var(--gold-border); }
.section h2 { font-size: 28px; color: var(--ink); margin: 0 0 16px 0; font-weight: normal; letter-spacing: -0.3px; }
.section h2:before { content: ""; display: inline-block; width: 36px; height: 2px; background: var(--gold); vertical-align: middle; margin-right: 14px; }
.section p { font-size: 16px; color: var(--body); max-width: 760px; }

/* State detail page */
.state-hero { padding: 48px 0 24px 0; }
.state-hero .crumb { font-size: 13px; color: var(--mute); margin-bottom: 8px; }
.state-hero h1 { font-size: 42px; margin: 0 0 8px 0; color: var(--ink); font-weight: normal; }
.status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: #fff;
}
.status-badge.supervision_required { background: var(--supervision); }
.status-badge.conditional_independence { background: var(--conditional); }
.status-badge.independent { background: var(--independent); }
.status-badge.unknown { background: var(--unknown); color: var(--ink); }

.state-summary { font-size: 17px; color: var(--body); max-width: 760px; margin-top: 16px; }

.clinician-tabs { margin: 32px 0 12px 0; display: flex; gap: 2px; flex-wrap: wrap; border-bottom: 1px solid var(--gold-border); }
.clinician-tabs button {
  background: none; border: none;
  padding: 10px 18px;
  font-family: Georgia, serif; font-size: 14px; color: var(--mute);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.clinician-tabs button.active { color: var(--ink); border-bottom-color: var(--gold); font-weight: bold; }
.clinician-tabs button:hover { color: var(--ink); }

.rule-table { width: 100%; border-collapse: collapse; margin: 16px 0; background: var(--surface); border: 1px solid var(--gold-border); border-radius: 6px; overflow: hidden; }
.rule-table td { padding: 12px 16px; border-bottom: 1px solid var(--gold-border); vertical-align: top; }
.rule-table tr:last-child td { border-bottom: none; }
.rule-table td.label { width: 220px; font-weight: bold; color: var(--ink); background: var(--gold-soft); }
.rule-table td.val { color: var(--body); }
.rule-table td.val.empty { color: var(--faint); font-style: italic; }

.callout {
  background: var(--gold-soft);
  border-left: 4px solid var(--gold);
  padding: 14px 18px;
  margin: 20px 0;
  font-size: 14px;
  color: var(--body);
}

.citations { margin-top: 32px; }
.citations h3 { font-size: 16px; margin: 0 0 10px 0; color: var(--ink); }
.citations ol { padding-left: 20px; font-size: 13px; color: var(--mute); }
.citations li { margin: 6px 0; }

/* Footer */
footer.site { padding: 36px 0; margin-top: 60px; border-top: 1px solid var(--gold-border); background: var(--surface); }
footer.site .wrap { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 20px; font-size: 13px; color: var(--mute); }
footer.site .disclaimer { font-size: 12px; font-style: italic; max-width: 680px; }

@media (max-width: 720px) {
  .hero h1 { font-size: 32px; }
  header.site .wrap { flex-direction: column; gap: 12px; }
  header.site nav a { margin-left: 0; margin-right: 18px; }
  .rule-table td.label { width: 140px; }
}
