/* PayerSight site styles. Tokens first, then layout, then components. */
:root {
  --ink: #15212B;
  --ink-2: #2E3D45;
  --ink-3: #3E4E56;
  --muted: #4F5F67;
  --ground: #F2F4F3;
  --surface: #FFFFFF;
  --surface-2: #F7F9F8;
  --line: #D8DFDE;
  --line-2: #E3E8E7;
  --input: #C7D0CF;
  --teal: #0D6863;
  --teal-hover: #09504C;
  --teal-soft: #DDEFEC;
  --mint: #4DB8AE;
  --box: #9CC9C3;
  --dark: #0F1B22;
  --dark-2: #162027;
  --dark-line: #26343C;
  --on-dark: #E4EBE9;
  --on-dark-2: #C9D3D2;
  --on-dark-3: #9AAAB0;
  --good: #256B41; --good-bg: #E1F1E6;
  --bad: #9A3A27;  --bad-bg: #F7E3DE;
  --warn: #8A560F; --warn-bg: #FAF0DC; --warn-ink: #5C3F0B;
  --amber: #E2B866;
  --flat-bg: #E9EDEC;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --display: "Bricolage Grotesque", "Instrument Sans", system-ui, sans-serif;
  --gutter: clamp(20px, 5vw, 48px);
  --section: clamp(64px, 9vw, 104px);
  --radius: 12px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; background: var(--ground); color: var(--ink); font-family: var(--sans); font-size: 16px; line-height: 1.55; }
img, svg { max-width: 100%; }
a { color: var(--teal); }
a:hover { color: var(--teal-hover); }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
p { margin: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; }
.skip:focus { left: 8px; }
.num, .mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: 1248px; margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }
.section--white { background: var(--surface); border-block: 1px solid var(--line); }
.section--dark { background: var(--dark); color: var(--on-dark); }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack--tight { gap: 10px; }
.stack--loose { gap: 44px; }
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(40px, 6vw, 72px); align-items: center; }
.split--even { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.split--wide-left { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split--narrow-left { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); align-items: start; }
.split--top { align-items: start; }
.split--end { align-items: end; }
.grid { display: grid; gap: 24px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* Breakpoints win over per-section column ratios set inline. */
@media (max-width: 1020px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  .split, .split--even, .split--wide-left, .split--narrow-left { grid-template-columns: minmax(0, 1fr) !important; }
}
@media (max-width: 760px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr) !important; }
}

/* ---------- type ---------- */
.eyebrow { font-family: var(--mono); font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.on-dark .eyebrow, .section--dark .eyebrow { color: var(--on-dark-3); }
.display { font-size: clamp(38px, 5.2vw, 58px); line-height: 1.04; font-weight: 700; letter-spacing: -0.03em; }
.h2 { font-size: clamp(28px, 3.4vw, 40px); line-height: 1.12; font-weight: 700; letter-spacing: -0.02em; }
.h3 { font-size: 20px; line-height: 1.3; font-weight: 700; }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.55; color: var(--ink-3); max-width: 36em; }
.body { font-size: 16px; line-height: 1.6; color: var(--ink-3); }
.small { font-size: 14px; color: var(--muted); }
.on-dark { color: #fff; }
.on-dark-muted { color: var(--on-dark-2); }
.measure { max-width: 820px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 9px; border: 1px solid transparent; font: 600 16px/1 var(--sans); text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn--primary { background: var(--teal); color: #fff; }
.btn--primary:hover { background: var(--teal-hover); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--input); }
.btn--ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn--mint { background: var(--mint); color: #0B1A19; font-weight: 700; }
.btn--mint:hover { background: #63C4BA; color: #0B1A19; }
.btn--lg { min-height: 52px; padding: 0 26px; font-size: 17px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(242, 244, 243, 0.94); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.site-header__inner { display: flex; align-items: center; gap: 32px; min-height: 76px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand__word { font-family: var(--display); font-size: 24px; font-weight: 700; letter-spacing: -0.035em; color: inherit; }
.brand__word--sm { font-size: 16px; color: var(--on-dark); margin-right: 8px; }
.site-nav { display: flex; gap: 26px; margin-left: auto; font-size: 15px; font-weight: 500; }
.site-nav a { color: var(--muted); text-decoration: none; padding-block: 4px; border-bottom: 2px solid transparent; }
.site-nav a:hover { color: var(--ink); }
.site-nav a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--teal); }
.site-header__cta { min-height: 44px; font-size: 15px; padding: 0 18px; }
.nav-toggle { display: none; margin-left: auto; width: 44px; height: 44px; border: 1px solid var(--input); border-radius: 9px; background: var(--surface); cursor: pointer; flex-direction: column; align-items: center; justify-content: center; gap: 5px; }
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s; }
.nav-toggle[aria-expanded="true"] span:first-child { transform: translateY(3.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:last-child { transform: translateY(-3.5px) rotate(-45deg); }
.site-header--minimal .site-nav, .site-header--minimal .nav-toggle { display: none; }
.site-header--minimal .site-header__cta { margin-left: auto; }
@media (max-width: 960px) {
  .site-header__cta { display: none; }
  .site-header--minimal .site-header__cta { display: inline-flex; }
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; padding: 8px var(--gutter) 16px; background: var(--ground); border-bottom: 1px solid var(--line); }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; border-bottom: 1px solid var(--line-2); font-size: 17px; }
  .site-nav a[aria-current="page"] { border-bottom-color: var(--line-2); color: var(--teal); }
}
@media (max-width: 420px) { .brand__word { font-size: 21px; } .site-header--minimal .site-header__cta { padding: 0 14px; font-size: 14px; } }
@media (max-width: 400px) { .site-header--minimal .site-header__cta { display: none; } }

/* ---------- hero ---------- */
.hero { padding-block: clamp(48px, 7vw, 88px) clamp(64px, 8vw, 104px); }
.hero__payers { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 14px; color: var(--muted); }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.card--soft { background: var(--ground); border: 0; }
.card--raised { box-shadow: 0 24px 48px -24px rgba(21, 33, 43, 0.28); border-radius: 14px; }
.card--dark { background: var(--dark); color: var(--on-dark); border: 0; }
.rule-top { padding-top: 18px; border-top: 2px solid var(--ink); display: flex; flex-direction: column; gap: 10px; }
.section--dark .rule-top { border-top-color: var(--mint); }
.tag { align-self: flex-start; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 5px; background: var(--teal-soft); color: var(--ink); }
.tag--solid { background: var(--teal); color: #fff; }
.chip { display: inline-block; align-self: flex-start; font-size: 12.5px; font-weight: 600; padding: 2px 8px; border-radius: 5px; white-space: nowrap; }
.chip--up { background: var(--good-bg); color: var(--good); }
.chip--down { background: var(--bad-bg); color: var(--bad); }
.chip--flat { background: var(--flat-bg); color: var(--muted); }
.chip--warn { background: var(--warn-bg); color: var(--warn-ink); }
.flag { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--warn); background: var(--warn-bg); padding: 3px 8px; border-radius: 4px; white-space: nowrap; }
.note { display: flex; gap: 10px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; background: var(--warn-bg); font-size: 15px; line-height: 1.5; }
.note b { color: var(--warn); white-space: nowrap; }
.pill-row { display: flex; flex-wrap: wrap; gap: 10px 12px; align-items: center; font-size: 14.5px; color: var(--muted); }
.pill { padding: 4px 11px; border: 1px solid var(--input); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; }
a.pill:hover { border-color: var(--ink); color: var(--ink); }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; font-size: 15.5px; }
.check-list li { display: flex; gap: 10px; }
.check-list li::before { content: ""; flex: 0 0 18px; height: 18px; margin-top: 3px; background: no-repeat center/18px url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%230D6863' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 9.5 7 13l7.5-8'/%3E%3C/svg%3E"); }
.section--dark .check-list li::before, .card--dark .check-list li::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18' fill='none' stroke='%234DB8AE' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 9.5 7 13l7.5-8'/%3E%3C/svg%3E"); }

/* ---------- rate example cards ---------- */
.rate-cards { display: flex; flex-direction: column; gap: 20px; }
.rate-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 48px -24px rgba(21, 33, 43, 0.28); overflow: hidden; }
.rate-card__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 20px 22px 14px; }
.rate-card__label { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }
.rate-card__title { font-size: 20px; font-weight: 700; line-height: 1.3; }
.rate-card__sub { font-size: 13.5px; color: var(--muted); }
.rate-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.rate-table th { font-size: 11px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); background: var(--surface-2); text-align: right; padding: 9px 22px; border-block: 1px solid var(--line-2); white-space: nowrap; }
.rate-table th:first-child, .rate-table td:first-child { text-align: left; }
.rate-table td { padding: 13px 22px; border-bottom: 1px solid var(--line-2); text-align: right; vertical-align: middle; }
.rate-table td:first-child { font-weight: 600; }
.rate-table .num { font-weight: 600; }
.rate-table td.muted { color: var(--muted); font-weight: 400; }
.rate-card__foot { display: flex; justify-content: space-between; gap: 12px; padding: 12px 22px; font-size: 13.5px; color: var(--muted); background: var(--surface-2); }
.rate-card [data-swap] { transition: opacity .35s ease; }
.rate-card.is-swapping [data-swap] { opacity: 0.15; }
@media (max-width: 520px) {
  .rate-table th, .rate-table td { padding-inline: 12px; }
  .rate-card__head, .rate-card__foot { padding-inline: 14px; }
  .rate-table { font-size: 14px; }
  .rate-table .hide-sm { display: none; }
}

/* ---------- definition rows ---------- */
.rows { display: flex; flex-direction: column; }
.row { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; padding: 18px 0; border-top: 1px solid var(--line); }
.row:last-child { border-bottom: 1px solid var(--line); }
.row > :first-child { font-size: 17px; font-weight: 700; }
.row > :last-child { font-size: 15.5px; line-height: 1.55; color: var(--ink-3); }
.row--num { grid-template-columns: 56px minmax(0, 1fr); }
.row--num > :first-child { font-family: var(--mono); font-size: 15px; font-weight: 600; color: var(--teal); }
@media (max-width: 640px) { .row { grid-template-columns: minmax(0, 1fr); gap: 6px; } .row--num { grid-template-columns: 40px minmax(0, 1fr); } }

.table-list { display: flex; flex-direction: column; font-size: 15px; }
.table-list > div { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--line-2); }
.table-list > div:last-child { border-bottom: 0; }
.table-list span:last-child { color: var(--muted); text-align: right; }

.stat { display: flex; flex-direction: column; gap: 6px; padding-top: 18px; border-top: 2px solid var(--ink); }
.stat__n { font-family: var(--mono); font-size: clamp(26px, 3vw, 34px); font-weight: 600; letter-spacing: -0.02em; }
.stat__l { font-size: 15px; color: var(--ink-3); }

/* ---------- forms ---------- */
.signup { display: flex; flex-direction: column; gap: 14px; }
.signup--card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 24px; box-shadow: 0 18px 36px -24px rgba(21, 33, 43, 0.3); }
.signup__row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
@media (max-width: 560px) { .signup__row { grid-template-columns: minmax(0, 1fr); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field label { font-size: 12px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.field input, .field select { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--input); border-radius: 8px; font: 16px var(--sans); background: var(--surface); color: var(--ink); }
.field input:focus, .field select:focus { outline: 2px solid var(--teal); outline-offset: 1px; border-color: var(--teal); }
.signup--dark .field label { color: var(--on-dark-3); }
.signup--dark .field input { background: var(--dark-2); border-color: #33444D; color: var(--on-dark); }
.signup--dark .field input::placeholder { color: #7D8E95; }
.signup .btn { width: 100%; }
.signup__msg { font-size: 15px; min-height: 1.4em; }
.signup__msg.is-error { color: var(--bad); }
.signup--dark .signup__msg.is-error { color: #F0A493; }
.signup__thanks { padding: 22px 24px; border-radius: 12px; background: var(--good-bg); color: #1E5A36; display: flex; flex-direction: column; gap: 6px; }
.signup__thanks strong { font-size: 18px; }
.signup--dark .signup__thanks { background: var(--dark-2); color: var(--mint); }

/* ---------- footer ---------- */
.site-footer { background: var(--dark); color: var(--on-dark); padding-block: clamp(56px, 8vw, 88px) 48px; }
.site-footer__cta { align-items: end; margin-bottom: 56px; }
.site-footer__base { display: flex; flex-direction: column; gap: 10px; padding-top: 24px; border-top: 1px solid var(--dark-line); font-size: 13px; line-height: 1.55; color: var(--on-dark-3); }
.site-footer--minimal { padding-block: 32px 40px; }
.site-footer--minimal .site-footer__base { border-top: 0; padding-top: 0; }
.footer-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 24px; }
.footer-nav a { color: var(--on-dark-3); text-decoration: none; }
.footer-nav a:hover { color: #fff; }

/* ---------- coverage map ---------- */
.tile-map { --t: min(52px, calc((100vw - 2 * var(--gutter) - 60px) / 11)); display: grid; grid-template-columns: repeat(11, var(--t)); grid-template-rows: repeat(8, var(--t)); gap: 6px; }
.tile { width: var(--t); height: var(--t); border-radius: 7px; border: 2px solid transparent; font: 600 13px var(--mono); cursor: pointer; padding: 0; }
.tile--full { background: var(--teal); color: #fff; }
.tile--thin { background: var(--amber); color: var(--ink); }
.tile--missing { background: var(--line); color: var(--ink); }
.tile[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--surface) inset; }
@media (max-width: 480px) { .tile { font-size: 10px; border-radius: 5px; } .tile-map { gap: 4px; } }
.legend { display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 13.5px; color: var(--ink-3); }
.legend span { display: inline-flex; align-items: center; gap: 8px; }
.legend i { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.state-panel { gap: 18px; }
.state-panel__group { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid var(--line-2); }
.state-panel__chips { display: flex; flex-wrap: wrap; gap: 8px; }
.payer-chip { padding: 6px 11px; border-radius: 8px; background: var(--teal-soft); font-size: 14.5px; font-weight: 600; }
.payer-chip--thin { background: var(--warn-bg); color: var(--warn-ink); }
.payer-chip--muted { background: var(--flat-bg); }

/* ---------- tabs (solutions) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--input); background: var(--surface); color: var(--ink); font-size: 14.5px; font-weight: 600; text-decoration: none; }
.tab:hover { border-color: var(--ink); color: var(--ink); }
.tab[aria-current="page"] { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- legal ---------- */
.legal { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: clamp(32px, 6vw, 80px); align-items: start; }
.legal__nav { position: sticky; top: 100px; display: flex; flex-direction: column; gap: 4px; font-size: 15px; }
.legal__nav a { padding: 8px 12px; border-radius: 7px; color: var(--ink-3); text-decoration: none; }
.legal__nav a:hover { background: var(--surface); color: var(--ink); }
.prose { display: flex; flex-direction: column; gap: 56px; max-width: 760px; }
.prose article { display: flex; flex-direction: column; gap: 14px; font-size: 16.5px; line-height: 1.65; color: var(--ink-2); scroll-margin-top: 100px; }
.prose h2 { font-size: 28px; line-height: 1.2; color: var(--ink); letter-spacing: -0.01em; }
.prose ol { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; }
@media (max-width: 820px) { .legal { grid-template-columns: minmax(0, 1fr); } .legal__nav { position: static; flex-direction: row; flex-wrap: wrap; } }

/* ---------- consent ---------- */
.consent { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 60; max-width: 520px; margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 18px 40px -18px rgba(21, 33, 43, 0.4); font-size: 14.5px; }
.consent p { flex: 1 1 220px; }
.consent__actions { display: flex; gap: 8px; }
.consent .btn { min-height: 40px; font-size: 14px; padding: 0 14px; }

/* ---------- misc ---------- */
.problem-band h2 { color: #fff; }
.center-404 { min-height: 50vh; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
