:root {
  --ink: #14212b;
  --ink2: #4a5a66;
  --line: #dbe3e8;
  --bg: #f7f9fa;
  --card: #ffffff;
  --accent: #0e6e63;      /* A3HCS deep teal */
  --accent2: #0a4f8f;     /* navy */
  --pos: #0e6e63;
  --neg: #b3402a;
  --warn-bg: #fdf6ec;
  --warn-line: #e5c890;
}
* { box-sizing: border-box; margin: 0; }
body { font-family: -apple-system, "Segoe UI", Helvetica, Arial, sans-serif; color: var(--ink); background: var(--bg); line-height: 1.55; }
main { max-width: 1080px; margin: 0 auto; padding: 0 24px 64px; }
section { margin-top: 56px; }

.top { display: flex; align-items: baseline; gap: 16px; padding: 14px 24px; background: var(--card); border-bottom: 2px solid var(--accent); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 800; color: var(--accent2); }
.brand span { font-weight: 400; color: var(--ink2); font-size: 12px; margin-left: 6px; }
.tool-name { font-size: 12px; letter-spacing: 2px; color: var(--accent); font-weight: 700; }
.top-hosp { margin-left: auto; font-size: 13px; color: var(--ink2); }

.kicker { font-size: 12px; letter-spacing: 2px; text-transform: uppercase; color: var(--accent); font-weight: 700; margin-bottom: 8px; }
h1 { font-size: 34px; line-height: 1.15; max-width: 720px; }
h1 em { color: var(--accent); font-style: normal; }
h2 { font-size: 24px; margin-bottom: 8px; }
h3 { font-size: 16px; margin: 18px 0 8px; }
.lede { max-width: 680px; color: var(--ink2); margin-top: 12px; }
.nat { margin-top: 18px; font-size: 14px; color: var(--ink2); max-width: 760px; }
.meta { color: var(--ink2); font-size: 14px; }

.picker { display: flex; gap: 32px; flex-wrap: wrap; margin-top: 24px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.search-wrap { flex: 1 1 320px; position: relative; }
.basis-wrap { flex: 1 1 320px; }
label { display: block; font-size: 12px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; color: var(--ink2); margin-bottom: 6px; }
input[type=text], input[type=number] { width: 100%; padding: 10px 12px; font-size: 16px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
input[type=text]:focus { outline: 2px solid var(--accent); border-color: transparent; }
.results { position: absolute; left: 0; right: 0; top: 100%; background: #fff; border: 1px solid var(--line); border-radius: 0 0 8px 8px; max-height: 320px; overflow-y: auto; z-index: 10; box-shadow: 0 8px 24px rgba(20,33,43,.12); }
.results button { display: block; width: 100%; text-align: left; padding: 10px 12px; border: 0; background: none; cursor: pointer; font-size: 14px; }
.results button:hover, .results button.sel { background: #eef4f3; }
.results .sub { color: var(--ink2); font-size: 12px; }
/* Search miss: the facility exists, it is just paid under another system. */
.miss { padding: 11px 13px; border-bottom: 1px solid var(--line); font-size: 14px; }
.miss:last-child { border-bottom: 0; }
.miss .why { font-size: 12.5px; color: var(--ink2); margin-top: 5px; line-height: 1.45; }
.miss .why b { color: var(--ink); }
.miss-cta { display: inline-block; margin-top: 7px; font-size: 12.5px; font-weight: 700; color: var(--accent); text-decoration: none; }
.miss-cta:hover { text-decoration: underline; }

/* Payment stack. The three bases are nested (base ⊂ +add-ons ⊂ +charity care),
   so they read as cumulative layers, not as three parallel tabs. Selecting a
   layer includes it and everything beneath it. */
.stack { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; max-width: 420px; background: #fff; }
.stack button { display: flex; align-items: flex-start; gap: 10px; width: 100%; padding: 10px 12px; border: 0; border-bottom: 1px solid var(--line); background: #fff; font: inherit; font-size: 13px; text-align: left; cursor: pointer; color: var(--ink2); transition: background .12s, color .12s; }
.stack button:last-child { border-bottom: 0; }
.stack button:hover { background: #f2f6f6; }
.stack button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.stack .lyr { display: block; font-weight: 600; }
.stack .lyr em { display: block; font-style: normal; font-weight: 400; font-size: 12px; color: var(--ink2); margin-top: 1px; }
.stack .tick { flex: 0 0 14px; height: 14px; margin-top: 3px; border: 1.5px solid var(--line); border-radius: 3px; background: #fff; position: relative; }
/* included: this layer is counted at the current basis */
.stack button.inc { color: var(--ink); background: #f3f8f7; }
.stack button.inc .tick { background: var(--accent); border-color: var(--accent); }
.stack button.inc .tick::after { content: ""; position: absolute; left: 3.5px; top: .5px; width: 3.5px; height: 8px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
/* the selected layer is the cut line: everything above it is excluded */
.stack button.cut { box-shadow: inset 3px 0 0 var(--accent); }
.stack button.cut .lyr { font-weight: 800; }
.stack button.out .lyr { text-decoration: line-through; text-decoration-color: var(--line); }
.note { font-size: 13px; color: var(--ink2); margin-top: 8px; max-width: 420px; }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-top: 20px; }
.tile { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.tile .lab { font-size: 11px; letter-spacing: 1px; text-transform: uppercase; color: var(--ink2); font-weight: 700; }
.tile .val { font-size: 26px; font-weight: 800; margin: 4px 0 2px; }
.tile .sub { font-size: 12.5px; color: var(--ink2); }
.tile .val.pos { color: var(--pos); } .tile .val.neg { color: var(--neg); }

#flags { margin: 16px 0 4px; }
.flag { background: var(--warn-bg); border: 1px solid var(--warn-line); border-left: 4px solid var(--warn-line); border-radius: 6px; padding: 10px 14px; font-size: 14px; margin-bottom: 8px; }
.flag b { color: var(--ink); }

.bridge { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
.brow { display: grid; grid-template-columns: 220px 1fr 110px; align-items: center; gap: 12px; padding: 7px 0; font-size: 14px; }
.brow .bar-track { height: 18px; position: relative; }
.brow .bar { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.brow .bar.pos { background: var(--pos); } .brow .bar.neg { background: var(--neg); }
.brow.total { border-top: 1px solid var(--line); font-weight: 700; }
.brow .amt { text-align: right; font-variant-numeric: tabular-nums; }
.comps { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 20px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .two-col { grid-template-columns: 1fr; } }
.dl { display: grid; grid-template-columns: 1fr 90px; gap: 4px 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 13.5px; align-items: baseline; }
.dl:last-child { border-bottom: 0; }
.dl .t { font-weight: 600; }
.dl .s { grid-column: 1; color: var(--ink2); font-size: 12.5px; }
.dl .amt { grid-column: 2; grid-row: 1 / span 2; text-align: right; font-weight: 800; font-variant-numeric: tabular-nums; }
.dl .amt.pos { color: var(--pos); } .dl .amt.neg { color: var(--neg); }

.scenario-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 20px; }
input[type=range] { width: 100%; accent-color: var(--accent); }

.tbl-wrap { overflow-x: auto; background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
th, td { padding: 9px 12px; text-align: right; border-bottom: 1px solid var(--line); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink2); cursor: pointer; }
tr.you { background: #eef4f3; font-weight: 700; }
td.pos { color: var(--pos); } td.neg { color: var(--neg); }
tbody tr:hover { background: #f2f6f5; }
td button.linklike { background: none; border: 0; color: var(--accent2); cursor: pointer; font-size: 13.5px; padding: 0; text-decoration: underline; }

.cta { background: var(--accent2); color: #fff; border-radius: 12px; padding: 32px; text-align: center; }
.cta p { max-width: 560px; margin: 10px auto 18px; opacity: .92; }
.btn { display: inline-block; background: #fff; color: var(--accent2); font-weight: 800; padding: 12px 28px; border-radius: 8px; text-decoration: none; }

.btn.ghost { background: transparent; color: #fff; border: 2px solid rgba(255,255,255,.6); margin-left: 10px; }
.gate { position: fixed; inset: 0; background: rgba(20,33,43,.55); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.gate[hidden] { display: none; }
.gate-card { background: #fff; border-radius: 12px; padding: 26px 28px; max-width: 440px; width: 100%; position: relative; box-shadow: 0 20px 60px rgba(20,33,43,.3); }
.gate-card h3 { margin-bottom: 6px; }
.gate-card form { margin-top: 12px; }
.gate-card input { margin-bottom: 12px; }
.gate-card .btn { border: 0; width: 100%; cursor: pointer; font-size: 15px; }
.gate-x { position: absolute; top: 10px; right: 14px; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--ink2); }
.note.small { font-size: 11.5px; }

#method p { font-size: 13px; color: var(--ink2); max-width: 820px; }
footer { text-align: center; font-size: 12px; color: var(--ink2); padding: 24px; border-top: 1px solid var(--line); }
