:root { color-scheme: light; font-family: system-ui, sans-serif; color: #172743; background: #f3f7fc; }
* { box-sizing: border-box; }
body { margin: 0; font-size: 1rem; line-height: 1.55; }
header { background: #142456; color: white; }
.shell { width: min(100% - 2.5rem, 67rem); margin-inline: auto; }
.brand { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem 1rem; padding-block: 1rem; }
.brand span { color: #c7ddfe; }
main { padding-block: 2.4rem; }
h1, h2, p, ul { margin: 0 0 .7rem; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.05; letter-spacing: -.035em; color: #142456; }
h2 { font-size: 1.23rem; line-height: 1.3; }
a { color: #243b91; font-weight: 650; text-underline-offset: .2rem; }
:focus-visible { outline: 3px solid #096f8b; outline-offset: 3px; }
.pilot { color: #395d8a; font-size: .875rem; font-weight: 700; }
.muted, .tag { color: #485e77; }
.panel, .summary > div { background: white; border: 1px solid #cbd9ed; border-radius: .65rem; }
.panel { padding: clamp(1rem, 3vw, 1.6rem); margin-top: 1rem; }
.panel > :last-child { margin-bottom: 0; }
.summary { margin-block: 1.25rem; display: grid; gap: .65rem; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary > div { padding: .9rem; display: grid; }
.summary strong { color: #243b91; font-size: 1.65rem; line-height: 1.15; }
.summary span { font-size: .92rem; }
.table-scroll { overflow-x: auto; }
table { width: 100%; min-width: 610px; border-collapse: collapse; text-align: left; }
th, td { padding: .65rem .55rem; border-bottom: 1px solid #e3ebf7; }
thead { color: #485e77; font-size: .875rem; }
tbody th small { display: block; color: #485e77; font-weight: 400; }
tbody tr:last-child > * { border-bottom: 0; }
.tag { display: inline-block; border-radius: .3rem; padding: .23rem .48rem; font-size: .88rem; background: #eef3fa; }
.tag.ready, .message { background: #ddf3ef; color: #164d4b; }
.message { border-radius: .45rem; padding: .65rem .85rem; }
.message-preview { background: #f0f5ff; padding: .8rem; border-radius: .4rem; overflow-wrap: anywhere; }
form { display: grid; justify-items: start; gap: 1rem; }
label { display: grid; gap: .28rem; font-weight: 600; }
.check { display: flex; align-items: start; max-width: 34rem; font-weight: 400; }
.check input { flex: none; height: 1.05rem; width: 1.05rem; margin: .27rem .4rem 0 0; }
input, select { max-width: 100%; border: 1px solid #829bbd; border-radius: .35rem; padding: .58rem .65rem; font: inherit; }
button, .button { display: inline-block; background: #243b91; color: white; border: 1px solid transparent; border-radius: .4rem;
  padding: .68rem .9rem; cursor: pointer; text-decoration: none; font: 650 1rem system-ui, sans-serif; }
button:hover, .button:hover { background: #142456; }
.secondary { background: white; color: #243b91; border-color: #829bbd; }
.secondary:hover { background: #eef3fa; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
dl { display: grid; grid-template-columns: minmax(0, 12rem) 1fr; gap: .4rem .75rem; margin-block: 1rem; }
dt { font-weight: 650; }
dd { margin: 0; overflow-wrap: anywhere; }
.patient { max-width: 34rem; }
.patient .panel { padding: clamp(1.1rem, 4vw, 2.1rem); }
.amount { color: #243b91; font-size: 2.25rem; font-weight: 700; }
.patient { max-width: 43rem; }
.patient .panel { border-top: .32rem solid #287975; box-shadow: 0 8px 32px #1a355310; }
.patient h1 { font: 500 clamp(2.4rem, 6vw, 3.4rem)/1.1 Georgia, serif; }
.balance-label, .service small, .check small { display: block; color: #485e77; }
.balance-label { margin: 1.5rem 0 0; }
.amount { margin: 0; font-variant-numeric: tabular-nums; }
.visit { border-block: 1px solid #d9e2e6; padding-block: 1rem; margin-block: 1.25rem; }
.service { display: flex; justify-content: space-between; gap: 1rem; margin-block: .75rem; }
.billing-help { margin-top: 1.25rem; }
.patient button:disabled { background: #e7edf2; color: #4b5e70; border-color: #c8d3dd; cursor: default; }
fieldset { width: 100%; padding: 1rem; border: 1px solid #cbd9ed; border-radius: .5rem; }
fieldset .check { padding-block: .4rem; }
@media (max-width: 520px) {
  .shell { width: calc(100% - 1.4rem); }
  .summary > div { padding: .55rem; }
  dl { grid-template-columns: 1fr; }
  dd { margin-bottom: .35rem; }
}
