:root {
  color-scheme: light;
  --ink: #253330;
  --muted: #5b6a66;
  --paper: #f6f8f6;
  --surface: #ffffff;
  --line: #dce5df;
  --primary: #0f3f3a;
  --primary-2: #117a65;
  --accent: #c44f3a;
  --gold: #efc84a;
  --soft-green: #e4f0eb;
  --soft-coral: #f8e6e1;
  --shadow: 0 18px 40px rgba(23, 49, 44, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 52px);
  background: rgba(246, 248, 246, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.brand img {
  width: 46px;
  height: 46px;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 1.08rem;
}

.brand small {
  color: var(--muted);
  font-size: 0.78rem;
}

.top-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-nav a {
  padding: 10px 12px;
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  color: var(--primary);
}

main {
  display: grid;
  gap: 0;
}

.hero-shell,
.search-band,
.ranking-band,
.states-band {
  padding: clamp(34px, 6vw, 76px) clamp(18px, 4vw, 52px);
}

.hero-shell {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  min-height: calc(100vh - 76px);
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 740px;
  margin-bottom: 18px;
  color: var(--primary);
  font-size: clamp(2.25rem, 5.5vw, 4.9rem);
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: clamp(1.65rem, 3vw, 2.65rem);
  line-height: 1.04;
  letter-spacing: 0;
}

h3 {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 1.05rem;
}

.hero-text {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.18rem;
  line-height: 1.6;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 10px 16px;
  font-weight: 800;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
}

.button.primary {
  color: #fff;
  background: var(--primary);
}

.button.primary:hover,
.button.primary:focus-visible {
  background: #082d29;
}

.button.secondary {
  color: var(--primary);
  background: var(--soft-green);
  border-color: #c9ded5;
}

.button.ghost {
  color: var(--primary);
  background: transparent;
  border-color: var(--line);
}

.evidence-panel,
.compare-panel,
.provider-card,
.policy-grid article,
.state-grid article {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.evidence-panel {
  padding: 22px;
  box-shadow: var(--shadow);
}

.panel-header,
.panel-title,
.results-toolbar,
.provider-main,
.provider-meta,
.state-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-header {
  margin-bottom: 18px;
  color: var(--muted);
  font-weight: 800;
}

.status-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 0 5px rgba(239, 200, 74, 0.22);
}

.signal-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.signal-grid div,
.source-stack span {
  padding: 14px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.signal-grid span {
  color: var(--primary-2);
  font-size: 2rem;
  font-weight: 900;
}

.signal-grid p {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.source-stack {
  display: grid;
  gap: 10px;
  margin-top: 16px;
}

.source-stack span {
  font-weight: 800;
}

.search-band {
  background: #edf4ef;
  border-bottom: 1px solid var(--line);
}

.section-heading {
  max-width: 760px;
  margin-bottom: 22px;
}

.search-form {
  display: grid;
  grid-template-columns: 1.1fr 1.3fr 1.3fr 0.85fr auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.hero-shell .search-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 760px;
  margin-top: 26px;
}

.hero-shell .submit-button {
  width: 100%;
}

.inline-link {
  margin-top: 2px;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cddbd3;
  border-radius: 8px;
  padding: 10px 12px;
  color: var(--ink);
  background: var(--surface);
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(17, 122, 101, 0.28);
  outline-offset: 2px;
}

.state-context {
  margin-bottom: 18px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.state-context p {
  margin: 0;
  color: var(--muted);
}

.state-context strong {
  color: var(--primary);
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.results-list,
.compare-panel {
  min-width: 0;
}

.results-toolbar {
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 800;
}

.view-tabs {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.tab {
  min-width: 82px;
  border: 0;
  padding: 9px 12px;
  color: var(--muted);
  background: var(--surface);
  cursor: pointer;
}

.tab.active {
  color: #fff;
  background: var(--primary-2);
}

#results {
  display: grid;
  gap: 12px;
}

.provider-card {
  padding: 18px;
  box-shadow: 0 8px 18px rgba(24, 61, 54, 0.06);
}

.provider-card.is-expanded {
  border-color: var(--primary-2);
}

.provider-specialty,
.provider-location {
  margin-bottom: 6px;
  color: var(--muted);
}

.provider-specialty {
  font-weight: 800;
}

.provider-card h3 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.score-block {
  display: grid;
  justify-items: center;
  min-width: 86px;
  padding: 12px;
  background: var(--soft-green);
  border-radius: 8px;
}

.score {
  color: var(--primary);
  font-size: 1.6rem;
  font-weight: 900;
}

.score-block small {
  color: var(--muted);
  font-weight: 800;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--primary);
  background: var(--soft-green);
  font-size: 0.78rem;
  font-weight: 800;
}

.chip.caution {
  color: #7a2b1e;
  background: var(--soft-coral);
}

.provider-meta {
  flex-wrap: wrap;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.compare-panel {
  position: sticky;
  top: 94px;
  padding: 18px;
}

.compare-list {
  display: grid;
  gap: 10px;
}

.compare-empty {
  color: var(--muted);
  line-height: 1.5;
}

.compare-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  background: #f7faf8;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.compare-item strong,
.compare-item span {
  display: block;
}

.compare-item span {
  color: var(--muted);
  font-size: 0.86rem;
}

.policy-grid,
.state-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.policy-grid article,
.state-grid article {
  padding: 18px;
}

.policy-grid p,
.state-grid p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.state-grid strong,
.state-grid span {
  display: block;
}

.state-grid strong {
  margin-bottom: 8px;
  color: var(--primary);
  font-size: 1.2rem;
}

.state-grid span {
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.app-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 26px clamp(18px, 4vw, 52px);
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--line);
}

@media (max-width: 1060px) {
  .hero-shell,
  .results-layout {
    grid-template-columns: 1fr;
  }

  .hero-shell {
    min-height: auto;
  }

  .search-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compare-panel {
    position: static;
  }

  .policy-grid,
  .state-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .app-header,
  .app-footer,
  .provider-main,
  .state-context,
  .results-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .top-nav {
    width: 100%;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 18px;
  }

  .top-nav a {
    padding: 4px 0;
  }

  .search-form,
  .policy-grid,
  .state-grid,
  .signal-grid {
    grid-template-columns: 1fr;
  }

  .submit-button {
    width: 100%;
  }

  .score-block {
    justify-items: start;
  }
}
