/* AlalayMed: a clean, calm patient portal. White cards on a pale green-grey ground, one deep
   green for every action and the next step, soft tinted icon tiles, and pill status badges.
   Phones get a top bar and a bottom tab bar; wide screens get a sidebar. No images: every
   picture is an authored SVG icon. */

@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/atkinson-next-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Atkinson Hyperlegible Next';
  font-style: normal;
  font-weight: 200 800;
  font-display: swap;
  src: url(fonts/atkinson-next-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font: 'Atkinson Hyperlegible Next', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;

  /* Colour */
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-2: #f5f8f7;
  --surface-3: #edf2f0;
  --line: #dfe7e4;
  --line-2: #ebf0ee;
  --ink: #142321;
  --ink-2: #55645f;
  --brand: #14614f;
  --brand-deep: #0f4c3e;
  --brand-ink: #14614f;
  --on-brand: #ffffff;
  --brand-tint: #e4f1ec;
  --brand-tint-2: #cfe6dc;
  --warn: #b3362a;
  --warn-tint: #fdeceb;
  --amber: #9a4d00;
  --amber-tint: #fff0dd;
  --blue: #1d5cb8;
  --blue-tint: #e7effc;
  --violet: #6644bb;
  --violet-tint: #efeafb;
  --ok: #19704a;
  --ok-tint: #e1f3e8;
  --slate: #55645f;
  --slate-tint: #edf1ef;
  --focus: #1d5cb8;
  --shadow: 0 1px 2px rgb(20 35 33 / .05), 0 1px 6px rgb(20 35 33 / .04);
  --shadow-lift: 0 2px 6px rgb(20 35 33 / .06), 0 10px 28px rgb(20 35 33 / .08);
  --pattern: rgb(20 97 79 / .07);

  /* Shape and space */
  --r-lg: 18px;
  --r: 14px;
  --r-sm: 10px;
  --r-pill: 999px;
  --s1: 4px; --s2: 8px; --s3: 12px; --s4: 16px; --s5: 20px; --s6: 24px; --s8: 32px; --s12: 48px;

  /* Type scale */
  --t-2xs: .6875rem;
  --t-xs: .8125rem;
  --t-sm: .9375rem;
  --t-md: 1.0625rem;
  --t-lg: 1.1875rem;
  --t-xl: 1.4375rem;
  --t-2xl: 1.75rem;
  --t-3xl: 2.25rem;

  --nav-h: 64px;
  --side-w: 248px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0c1416; --surface: #141f22; --surface-2: #18252a; --surface-3: #1e2d32; --line: #283a3e; --line-2: #1f2f33;
    --ink: #e6efec; --ink-2: #a0b2ad;
    --brand: #3fae8c; --brand-deep: #2f9677; --brand-ink: #74d3b3; --on-brand: #04221a; --brand-tint: #15302a; --brand-tint-2: #1c3d34;
    --warn: #ff9184; --warn-tint: #3a1d1a; --amber: #f3b061; --amber-tint: #33240f; --blue: #93b9ff; --blue-tint: #172641;
    --violet: #bba6ff; --violet-tint: #261f3f; --ok: #73d6a6; --ok-tint: #12301f; --slate: #a0b2ad; --slate-tint: #1d2b2e;
    --focus: #93b9ff; --shadow: 0 1px 2px rgb(0 0 0 / .35); --shadow-lift: 0 2px 6px rgb(0 0 0 / .35), 0 10px 28px rgb(0 0 0 / .3);
    --pattern: rgb(116 211 179 / .06);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0c1416; --surface: #141f22; --surface-2: #18252a; --surface-3: #1e2d32; --line: #283a3e; --line-2: #1f2f33;
  --ink: #e6efec; --ink-2: #a0b2ad;
  --brand: #3fae8c; --brand-deep: #2f9677; --brand-ink: #74d3b3; --on-brand: #04221a; --brand-tint: #15302a; --brand-tint-2: #1c3d34;
  --warn: #ff9184; --warn-tint: #3a1d1a; --amber: #f3b061; --amber-tint: #33240f; --blue: #93b9ff; --blue-tint: #172641;
  --violet: #bba6ff; --violet-tint: #261f3f; --ok: #73d6a6; --ok-tint: #12301f; --slate: #a0b2ad; --slate-tint: #1d2b2e;
  --focus: #93b9ff; --shadow: 0 1px 2px rgb(0 0 0 / .35); --shadow-lift: 0 2px 6px rgb(0 0 0 / .35), 0 10px 28px rgb(0 0 0 / .3);
  --pattern: rgb(116 211 179 / .06);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--t-md);
  line-height: 1.5;
  caret-color: var(--brand);
  overflow-x: hidden;
  padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom, 0px));
}
::selection { background: var(--brand-tint-2); color: var(--ink); }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { line-height: 1.2; margin: 0 0 var(--s2); text-wrap: balance; color: var(--ink); }
h1 { font-size: var(--t-2xl); font-weight: 750; letter-spacing: -0.015em; }
h2 { font-size: var(--t-lg); font-weight: 750; margin-top: var(--s8); letter-spacing: -0.005em; }
h3 { font-size: var(--t-md); font-weight: 700; }
p { margin: 0 0 var(--s3); max-width: 68ch; }
a { color: var(--brand-ink); text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; }
[hidden] { display: none !important; }
.icon { width: 1.25em; height: 1.25em; flex: none; vertical-align: -0.25em; }
.num, .amount { font-variant-numeric: tabular-nums lining-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
.flush { margin: 0; }
.gap-top { margin-top: var(--s3); }
.gap-top-lg { margin-top: var(--s4); }
.bold { font-weight: 800; }
.indent-list { margin: 0; padding-left: 1.1rem; }
.muted { color: var(--ink-2); }
.small { font-size: var(--t-sm); }
.lede { font-size: var(--t-md); color: var(--ink-2); }

.skip-link { position: absolute; left: var(--s2); top: -60px; background: var(--surface); color: var(--ink); padding: 10px 14px; border-radius: var(--r-sm); z-index: 30; font-weight: 700; box-shadow: var(--shadow-lift); }
.skip-link:focus { top: var(--s2); }

/* ---------- Shell: top bar, sidebar, bottom bar ---------- */
.shell { min-height: 100vh; }
.main-col { min-width: 0; }
.sidebar { display: none; }

.topbar { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.topbar-inner { max-width: 72rem; margin: 0 auto; padding: var(--s2) var(--s4); display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 60px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-height: 44px; min-width: 0; color: var(--ink); }
.brand-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--brand); color: var(--on-brand); flex: none; }
.brand-glyph { width: 22px; height: 22px; display: block; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: var(--t-lg); letter-spacing: -0.01em; line-height: 1.1; }
.brand-tagline { font-size: var(--t-xs); font-weight: 600; color: var(--ink-2); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-tools { display: flex; align-items: center; gap: 6px; flex: none; }
.icon-btn, .lang-toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; flex: none;
  min-height: 44px; min-width: 44px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: inherit; font-weight: 700; font-size: var(--t-sm); cursor: pointer; text-decoration: none;
}
.lang-toggle { padding: 0 var(--s3); }
.icon-btn:hover, .lang-toggle:hover { border-color: var(--brand); color: var(--brand-ink); }
.icon-btn[aria-pressed="true"] { background: var(--surface-3); }
.storage-notice { margin: 0; padding: var(--s2) var(--s4); background: var(--amber-tint); color: var(--ink); font-size: var(--t-sm); text-align: center; max-width: none; }

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  background: var(--surface); border-top: 1px solid var(--line);
  padding: 0 max(var(--s1), env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(var(--s1), env(safe-area-inset-left, 0px));
}
.bottom-nav ul { list-style: none; margin: 0 auto; padding: 0; max-width: 36rem; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); height: var(--nav-h); }
.bottom-nav a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 100%; min-height: 44px;
  text-decoration: none; color: var(--ink-2); font-size: var(--t-2xs); font-weight: 700; line-height: 1.15; text-align: center; padding: 6px 2px;
}
.bottom-nav a .icon { width: 22px; height: 22px; }
.bottom-nav a[aria-current="page"] { color: var(--brand-ink); }
.bottom-nav a[aria-current="page"]::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }

.side-nav ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-nav a {
  display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: 8px var(--s3); border-radius: var(--r-sm);
  color: var(--ink-2); font-weight: 650; font-size: var(--t-sm); text-decoration: none;
}
.side-nav a .icon { width: 20px; height: 20px; }
.side-nav a:hover { background: var(--surface-2); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--brand-tint); color: var(--brand-ink); font-weight: 750; }
.side-trust { margin: auto 0 0; padding: var(--s3); border-radius: var(--r-sm); background: var(--surface-2); font-size: var(--t-xs); color: var(--ink-2); }

@media (max-width: 25rem) {
  .topbar-inner { padding: var(--s2) var(--s3); }
  .brand-mark { width: 32px; height: 32px; }
  .brand-name { font-size: var(--t-md); }
  .brand-tagline { display: none; }
  .about-btn { display: none; }
  .lang-toggle { padding: 0 10px; font-size: var(--t-xs); }
}

/* Wide screens: sidebar on the left, tools on the right of a light top strip. */
@media (min-width: 64rem) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .shell { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
  .sidebar {
    display: flex; flex-direction: column; gap: var(--s6); position: sticky; top: 0; height: 100vh; overflow-y: auto;
    padding: var(--s5) var(--s4); background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar .brand { padding: 0 var(--s1); }
  .topbar { background: var(--bg); border-bottom: 0; }
  .topbar-inner { justify-content: flex-end; padding: var(--s3) var(--s8) 0; max-width: 76rem; }
  .topbar .brand, .about-btn { display: none; }
}

/* ---------- Layout ---------- */
.app { display: block; outline: none; }
.screen-body { max-width: 46rem; margin: 0 auto; padding: var(--s5) var(--s4) var(--s12); }
.screen > .notice { max-width: 46rem; margin: var(--s4) var(--s4) 0; }
@media (min-width: 48rem) { .screen > .notice { margin-left: auto; margin-right: auto; } }
@media (min-width: 64rem) {
  .screen-body { max-width: 76rem; padding: var(--s3) var(--s8) var(--s12); }
  .screen[data-screen="intake"] .screen-body, .screen[data-screen="about"] .screen-body { max-width: 52rem; margin-left: 0; }
  .screen > .notice { max-width: 76rem; margin-left: var(--s8); margin-right: var(--s8); }
}
.panel, .card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: var(--s5); box-shadow: var(--shadow); margin-bottom: var(--s4);
}
.panel > :last-child, .card > :last-child { margin-bottom: 0; }
.panel > h2:first-child, .panel > h3:first-child, .card h2 { margin-top: 0; }
.stack > * + * { margin-top: var(--s3); }
.page-head { margin-bottom: var(--s5); }
.page-head h1 { margin-bottom: var(--s1); }
.page-sub { color: var(--ink-2); margin: 0; display: flex; align-items: flex-start; gap: 6px; }
.page-sub .icon { color: var(--brand-ink); margin-top: 2px; }
.page-sub strong { min-width: 0; overflow-wrap: anywhere; }
.screen-body > h1 + .lede { margin-top: calc(var(--s1) * -1); }
.back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 700; font-size: var(--t-sm); text-decoration: none; color: var(--ink-2); margin-bottom: var(--s1); }
.back-link:hover { color: var(--brand-ink); }

.boot { padding: 40px var(--s4); max-width: 46rem; margin: 0 auto; }
.boot-bar { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--brand) 0 30%, var(--line) 30%); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 48px; padding: 11px 20px; border-radius: var(--r-sm);
  font: inherit; font-size: var(--t-sm); font-weight: 750; line-height: 1.2; text-decoration: none; text-align: center;
  cursor: pointer; border: 1px solid transparent; transition: background-color .15s ease-out, border-color .15s ease-out, transform .1s ease-out;
}
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.btn-primary { background: var(--brand); color: var(--on-brand); }
.btn-primary:hover { background: var(--brand-deep); }
.btn-secondary { background: var(--surface); color: var(--ink); border-color: var(--line); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand-ink); }
.btn-danger { background: var(--surface); color: var(--warn); border-color: var(--warn); }
.btn-block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: var(--s4); }
.btn-row > .btn { flex: 1 1 12rem; }
.btn-text { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; background: none; border: 0; padding: 0 var(--s1); min-height: 44px; font: inherit; font-weight: 700; color: var(--brand-ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* ---------- Icon tiles and badges ---------- */
.tile-icon, .stat-icon, .promo-icon {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: 12px;
  background: var(--brand-tint); color: var(--brand-ink);
}
.tile-icon .icon, .stat-icon .icon, .promo-icon .icon { width: 22px; height: 22px; }
.tile-icon.is-blue, .is-blue > .stat-icon { background: var(--blue-tint); color: var(--blue); }
.tile-icon.is-amber, .is-amber > .stat-icon { background: var(--amber-tint); color: var(--amber); }
.tile-icon.is-violet, .is-violet > .stat-icon { background: var(--violet-tint); color: var(--violet); }
.is-ok > .stat-icon { background: var(--ok-tint); color: var(--ok); }
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill);
  font-size: var(--t-xs); font-weight: 750; line-height: 1.4; white-space: nowrap;
  background: var(--slate-tint); color: var(--slate);
}
.badge::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.badge.is-ok { background: var(--ok-tint); color: var(--ok); }
.badge.is-warn { background: var(--amber-tint); color: var(--amber); }
.badge.is-blue { background: var(--blue-tint); color: var(--blue); }

/* ---------- Landing hero ---------- */
.hero {
  position: relative; overflow: hidden; display: grid; gap: var(--s6);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: var(--s6) var(--s5); box-shadow: var(--shadow);
}
/* A quiet dotted field on the right, standing in for the reference's photo. */
.hero::before {
  content: ''; position: absolute; inset: 0 0 0 auto; width: 70%; pointer-events: none;
  background: radial-gradient(circle, var(--pattern) 1.5px, transparent 1.6px) 0 0 / 18px 18px;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 60%); mask-image: linear-gradient(90deg, transparent, #000 60%);
}
.hero > * { position: relative; min-width: 0; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; margin: 0 0 var(--s4); padding: 5px 12px;
  border-radius: var(--r-pill); background: var(--brand-tint); color: var(--brand-ink); font-size: var(--t-xs); font-weight: 700;
}
.eyebrow .icon { width: 16px; height: 16px; }
.hook { font-size: var(--t-2xl); font-weight: 780; line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 var(--s3); max-width: 22ch; }
.hero-lede { color: var(--ink-2); margin-bottom: var(--s2); }
.hero-more { padding-left: 0; }
.hero-ways { background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); }
.ways-title { font-size: var(--t-md); margin: 0 0 var(--s3); }
.hero-ways ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.way, .row-link {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s3);
  min-height: 64px; padding: var(--s3); border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); text-decoration: none;
  transition: border-color .15s ease-out, box-shadow .15s ease-out;
}
.row-link { grid-template-columns: auto minmax(0, 1fr) auto auto; }
.way:hover, .row-link:hover { border-color: var(--brand); box-shadow: var(--shadow-lift); }
.way > .icon, .row-link > .icon { color: var(--ink-2); }
.row-text { display: flex; flex-direction: column; min-width: 0; }
.row-text strong { font-weight: 750; line-height: 1.3; overflow-wrap: anywhere; }
.row-sub { font-size: var(--t-sm); color: var(--ink-2); line-height: 1.35; overflow-wrap: anywhere; }
.hero.is-secondary .hook { font-size: var(--t-xl); }
/* Phones: the choices sit straight on the hero card so their text keeps its width. */
@media (max-width: 30rem) {
  .hero { padding: var(--s5) var(--s4); }
  .hero-ways { background: none; border: 0; padding: 0; }
  .way { padding: var(--s3) 10px; gap: 10px; }
  .feedback > .tile-icon { display: none; }
  .feedback { grid-template-columns: minmax(0, 1fr); }
}
@media (min-width: 40rem) { .hero { padding: var(--s8); } .hook { font-size: 2.125rem; } }
@media (min-width: 56rem) {
  .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: var(--s8); align-items: center; }
  .hook { font-size: 2.5rem; }
  .hero.is-secondary .hook { font-size: var(--t-2xl); }
}

.features { margin-top: var(--s4); }
.features ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); }
.feature { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow); }
.feature h3 { margin: var(--s3) 0 var(--s1); }
.feature p { margin: 0; color: var(--ink-2); font-size: var(--t-sm); }
@media (max-width: 35.99rem) {
  .feature { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px var(--s3); padding: var(--s4); }
  .feature .tile-icon { grid-row: span 2; }
  .feature h3 { margin: 2px 0 0; }
}
@media (min-width: 36rem) { .features ul { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .features ul { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.feedback {
  margin-top: var(--s4); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s3) var(--s4); align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s5); box-shadow: var(--shadow);
}
.feedback h2 { margin: 0 0 var(--s1); font-size: var(--t-md); }
.feedback p { margin-bottom: var(--s2); color: var(--ink-2); font-size: var(--t-sm); }
.feedback .btn { grid-column: 1 / -1; justify-self: start; }
.feedback-email { display: block; font-weight: 800; color: var(--ink); overflow-wrap: anywhere; user-select: all; }
@media (min-width: 48rem) { .feedback { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; } .feedback .btn { grid-column: auto; } }
.trust { display: grid; gap: 6px; margin: var(--s5) 0 0; padding: 0; list-style: none; color: var(--ink-2); font-size: var(--t-sm); }
.trust li { display: flex; gap: var(--s2); align-items: flex-start; }
.trust .icon { color: var(--brand-ink); }
.site-footer { margin-top: var(--s8); padding-top: var(--s4); border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: var(--s1) var(--s4); align-items: center; }
.site-footer a { min-height: 44px; display: inline-flex; align-items: center; font-weight: 700; }

/* ---------- Dashboard (landing with a saved case) ---------- */
.dash { margin-bottom: var(--s8); }
.stats { display: grid; gap: var(--s3); grid-template-columns: minmax(0, 1fr); margin-bottom: var(--s4); }
@media (min-width: 30rem) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 72rem) { .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 48rem) { .stats.stats-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 30rem) and (max-width: 47.99rem) { .stats.stats-3 > :last-child { grid-column: 1 / -1; } }
.stat {
  display: flex; gap: var(--s3); align-items: flex-start; min-width: 0;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); box-shadow: var(--shadow);
}
.stat-text { display: flex; flex-direction: column; min-width: 0; }
.stat-label { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); }
.stat-value { font-size: var(--t-xl); font-weight: 800; line-height: 1.2; margin-top: 2px; letter-spacing: -0.01em; }
.stat-value .range { display: flex; flex-wrap: wrap; column-gap: 6px; font-size: var(--t-lg); }
.stat-none { font-size: var(--t-sm); font-weight: 700; color: var(--ink-2); }
.stat-sub { font-size: var(--t-xs); color: var(--ink-2); margin-top: 2px; }
.stat.is-brand { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.stat.is-brand .stat-label, .stat.is-brand .stat-sub, .stat.is-brand .stat-none { color: var(--on-brand); opacity: .88; }
.stat.is-brand .stat-icon { background: rgb(255 255 255 / .16); color: var(--on-brand); }
.stat.is-loading { min-height: 92px; background: linear-gradient(90deg, var(--surface) 0%, var(--surface-3) 50%, var(--surface) 100%) 0 0 / 200% 100%; animation: shimmer 1.4s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.dash-grid { display: grid; gap: var(--s4); grid-template-columns: minmax(0, 1fr); }
.dash-grid > .card { margin: 0; }
@media (min-width: 56rem) { .dash-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.card-head h2 { margin: 0; font-size: var(--t-md); }
.card-link { font-size: var(--t-sm); font-weight: 700; min-height: 44px; display: inline-flex; align-items: center; }
.row-end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; text-align: right; }
.row-amount { font-weight: 800; }
@media (max-width: 26rem) {
  .row-link { grid-template-columns: auto minmax(0, 1fr); }
  .row-link > .icon { display: none; }
  .row-link .row-end { grid-column: 2; align-items: flex-start; text-align: left; }
}
.next-list { list-style: none; margin: 0; padding: 0; }
.next-list li + li { border-top: 1px solid var(--line-2); }
.next-list a { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; min-height: 44px; color: var(--ink); text-decoration: none; }
.next-list a:hover strong { color: var(--brand-ink); }
.next-dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--ink-2); flex: none; }
.next-dot.is-current { background: var(--brand); color: var(--on-brand); }
.next-dot .icon { width: 18px; height: 18px; }
.promo {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3) var(--s4); margin-top: var(--s4);
  background: var(--brand-tint); border: 1px solid var(--brand-tint-2); border-radius: var(--r); padding: var(--s4) var(--s5);
}
.promo-icon { background: var(--surface); }
.promo-text { flex: 1 1 14rem; display: flex; flex-direction: column; min-width: 0; }
.promo-text span { color: var(--ink-2); font-size: var(--t-sm); }
.empty-card { display: flex; gap: var(--s4); align-items: flex-start; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--r); padding: var(--s5); }
.empty-card p { margin-bottom: var(--s3); }

/* ---------- Hero board (balance, next office, ZBB) ---------- */
.board {
  position: relative; overflow: hidden;
  background: var(--brand); color: var(--on-brand);
  border-radius: var(--r); padding: var(--s5); margin-bottom: var(--s4); box-shadow: var(--shadow);
}
.board::after { content: ''; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%; border: 28px solid rgb(255 255 255 / .07); pointer-events: none; }
.board > * { position: relative; z-index: 1; }
.board-title { font-size: var(--t-sm); font-weight: 700; color: var(--on-brand); margin: 0; opacity: .9; }
.board-main { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s1) 14px; align-items: center; margin-top: 6px; }
@media (max-width: 26rem) { .board-main { grid-template-columns: minmax(0, 1fr); } }
.board-numeral {
  display: grid; place-items: center; justify-self: start; min-width: 56px; height: 56px; padding: 0 var(--s3); border-radius: 14px;
  background: rgb(255 255 255 / .16); font-size: var(--t-2xl); font-weight: 800; line-height: 1; color: var(--on-brand); font-variant-numeric: tabular-nums;
}
.board-numeral.is-money { justify-self: start; height: auto; padding: var(--s1) 0; font-size: var(--t-3xl); background: none; min-width: 0; letter-spacing: -0.02em; }
.board-numeral.is-money .range { display: flex; flex-wrap: wrap; column-gap: var(--s2); font-size: var(--t-2xl); }
.board-office { font-size: var(--t-lg); font-weight: 750; line-height: 1.25; margin: 0; color: var(--on-brand); }
.board-balance { margin-top: 14px; padding-top: var(--s3); border-top: 1px solid rgb(255 255 255 / .2); display: flex; justify-content: space-between; align-items: baseline; gap: var(--s3); flex-wrap: wrap; }
.board-balance .amount { font-size: var(--t-xl); font-weight: 800; }
.board p { color: var(--on-brand); }
.board a, .board .btn-text { color: var(--on-brand); }
.board .mark, .board .src-link { color: var(--on-brand); }
.continue { margin-top: var(--s4); width: 100%; background: var(--surface); color: var(--brand-ink); border-color: transparent; }
.continue:hover { background: var(--surface-2); }
.board .continue { color: var(--brand-ink); }
#balance-hero .continue { margin-top: var(--s3); }

/* ---------- Estimate banner and notices ---------- */
.estimate-banner {
  display: flex; gap: 10px; align-items: center; padding: 10px var(--s4); margin: 0 0 var(--s4); max-width: none;
  background: var(--amber-tint); color: var(--ink); border-radius: var(--r-sm); font-weight: 700; font-size: var(--t-sm);
}
.estimate-banner .icon { color: var(--amber); }
.notice { display: flex; gap: 10px; align-items: flex-start; padding: 14px var(--s4); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); margin-bottom: var(--s4); max-width: none; }
.notice > div, .notice > span { flex: 1; min-width: 0; }
.notice p { margin: 0 0 var(--s1); }
.notice .icon { color: var(--blue); margin-top: 2px; }
.notice.is-warn { background: var(--warn-tint); border-color: transparent; }
.notice.is-warn .icon { color: var(--warn); }
.notice.is-ok { background: var(--ok-tint); border-color: transparent; }
.notice.is-ok .icon { color: var(--ok); }

/* ---------- Status: one quiet mark per row; full chips only in the About table ---------- */
.mark { display: inline-flex; align-items: center; gap: 6px; font-size: var(--t-xs); font-weight: 700; }
.mark::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.mark-warn { color: var(--warn); }
.mark-unconf { color: var(--slate); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: var(--s2) 0; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: var(--s1); padding: 3px 10px; border-radius: var(--r-pill); font-size: var(--t-xs); font-weight: 700; line-height: 1.4; background: var(--slate-tint); color: var(--slate); }
.chip-warn { color: var(--warn); background: var(--warn-tint); }
.chip-ok { color: var(--ok); background: var(--ok-tint); }
.chip-unconf { color: var(--slate); background: var(--slate-tint); }

/* ---------- Forms ---------- */
.field { margin-bottom: var(--s4); }
.field > label, .field-label { display: block; font-weight: 700; font-size: var(--t-sm); margin-bottom: 6px; }
.hint { display: block; color: var(--ink-2); font-size: var(--t-sm); margin-top: var(--s1); }
.input, select.input {
  width: 100%; min-height: 48px; padding: 11px 14px; font: inherit; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm);
}
select.input { cursor: pointer; }
input[type="search"].input {
  padding-left: 42px;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237f8f8a' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-4-4'/%3E%3C/svg%3E") no-repeat 14px 50% / 18px 18px;
}
.input:focus { border-color: var(--brand); outline: 3px solid var(--brand-tint-2); outline-offset: 0; }
.input[aria-invalid="true"] { border-color: var(--warn); }
.input-money { font-size: 1.3125rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.error { color: var(--warn); font-weight: 700; margin-top: 6px; display: flex; gap: 6px; align-items: flex-start; }
.live-amount { margin-top: 6px; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.options { display: flex; flex-wrap: wrap; gap: var(--s2); }
.option {
  min-height: 48px; padding: 10px var(--s4); border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--surface); color: var(--ink); font: inherit; font-size: var(--t-sm); font-weight: 700; cursor: pointer; flex: 1 1 8rem; text-align: center;
}
.option:hover { border-color: var(--brand); }
.option[aria-pressed="true"] { background: var(--brand-tint); color: var(--brand-ink); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
fieldset { border: 0; padding: 0; margin: 0 0 var(--s4); min-width: 0; }
legend { font-weight: 700; font-size: var(--t-sm); margin-bottom: 6px; padding: 0; }
.check { display: flex; gap: var(--s3); align-items: flex-start; min-height: 44px; padding: var(--s2) 0; cursor: pointer; }
.check input { width: 22px; height: 22px; margin: 2px 0 0; flex: none; accent-color: var(--brand); }

/* Intake: the four sections read as numbered steps. */
.screen[data-screen="intake"] .screen-body { counter-reset: step; }
.screen[data-screen="intake"] .panel > h2:first-child { display: flex; align-items: center; gap: var(--s3); }
.screen[data-screen="intake"] .panel > h2:first-child::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; flex: none;
  background: var(--brand-tint); color: var(--brand-ink); font-size: var(--t-sm); font-weight: 800;
}

.results { list-style: none; margin: var(--s2) 0 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.results li + li { border-top: 1px solid var(--line-2); }
.result-btn { display: block; width: 100%; text-align: left; padding: var(--s3) 14px; min-height: 52px; background: transparent; border: 0; font: inherit; color: var(--ink); cursor: pointer; }
.result-btn:hover, .result-btn:focus-visible { background: var(--brand-tint); }
.result-btn strong { display: block; overflow-wrap: anywhere; }
.result-btn span { display: block; color: var(--ink-2); font-size: var(--t-sm); }
.selected { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); padding: var(--s3) 14px; background: var(--brand-tint); border: 1px solid var(--brand-tint-2); border-radius: var(--r-sm); }
.selected > div { min-width: 0; }
.selected strong { display: block; overflow-wrap: anywhere; }
.empty { padding: 14px; color: var(--ink-2); background: var(--surface-2); border: 1px dashed var(--line); border-radius: var(--r-sm); }

details { border-top: 1px solid var(--line-2); }
summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 6px; font-weight: 700; list-style: none; color: var(--brand-ink); }
summary::-webkit-details-marker { display: none; }
summary::before { content: ''; flex: none; width: .5em; height: .5em; margin: 0 .4em 0 .2em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); transition: transform .15s ease-out; }
details[open] > summary::before { transform: rotate(45deg); }
details > div { padding: 0 0 var(--s3); }

/* ---------- Bill details (result) ---------- */
.case-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--s1) var(--s3); align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); box-shadow: var(--shadow); margin-bottom: var(--s4);
}
.case-text { min-width: 0; }
.case-badge { grid-column: 2; justify-self: start; }
@media (min-width: 40rem) { .case-head { grid-template-columns: auto minmax(0, 1fr) auto; } .case-badge { grid-column: 3; grid-row: 1; } }
.case-hospital { font-weight: 800; font-size: var(--t-md); margin: 0; overflow-wrap: anywhere; }
.case-name { margin: 2px 0 0; color: var(--ink-2); font-size: var(--t-sm); overflow-wrap: anywhere; }
.case-code { color: var(--ink-2); font-weight: 700; }
.case-official { border-top: 0; }

.tabs-line { display: flex; gap: var(--s1); border-bottom: 1px solid var(--line); margin-bottom: var(--s4); overflow-x: auto; overscroll-behavior-x: contain; }
.tab-line {
  flex: none; min-height: 48px; padding: 0 var(--s4); border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px;
  background: none; color: var(--ink-2); font: inherit; font-size: var(--t-sm); font-weight: 700; cursor: pointer; white-space: nowrap;
}
/* Scrollbars are hidden, so on phones the tabs share the width and wrap instead of scrolling out of view. */
@media (max-width: 30rem) { .tab-line { flex: 1 1 0; min-width: 0; padding: 6px var(--s2); white-space: normal; line-height: 1.2; } }
.tab-line:hover { color: var(--ink); }
.tab-line[aria-selected="true"] { color: var(--brand-ink); border-bottom-color: var(--brand); }
.tab-panel:focus-visible { outline-offset: 4px; }

.sum-list { margin: 0; }
.sum-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s1) var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line-2); }
.sum-row dt { color: var(--ink-2); font-weight: 600; }
.sum-row dd { margin: 0 0 0 auto; font-weight: 750; text-align: right; }
.sum-row.is-minus dd { color: var(--ok); }
.sum-row.is-total { border: 0; margin-top: var(--s3); padding: var(--s3) var(--s4); border-radius: var(--r-sm); background: var(--warn-tint); }
.sum-row.is-total dt, .sum-row.is-total dd { color: var(--warn); font-weight: 800; }
.sum-row.is-total dd { font-size: var(--t-lg); }
.sum-row.is-total.is-zero { background: var(--ok-tint); }
.sum-row.is-total.is-zero dt, .sum-row.is-total.is-zero dd { color: var(--ok); }
#bill-summary .sum-list + p { margin-top: var(--s3); }

.ledger { margin: 0; padding: 0; list-style: none; }
.ledger-row { padding: 14px 0; border-bottom: 1px solid var(--line-2); }
.ledger-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: var(--s1) var(--s3); }
.ledger-label { font-weight: 700; }
.ledger-amount { font-weight: 800; font-variant-numeric: tabular-nums; text-align: right; margin-left: auto; }
.ledger-row:last-child { border-bottom: 0; padding-bottom: 0; }
.ledger-row.is-total { border-bottom: 0; padding-top: var(--s4); }
.ledger-row.is-total .ledger-label { font-size: var(--t-lg); }
.ledger-row.is-total .ledger-amount { font-size: var(--t-2xl); color: var(--brand-ink); }
.ledger-bar { height: 8px; border-radius: 4px; background: var(--surface-3); margin-top: var(--s2); overflow: hidden; display: flex; }
.ledger-bar > span { display: block; height: 100%; background: var(--brand); border-radius: 4px; }
.ledger-bar > span.is-range { background: repeating-linear-gradient(135deg, var(--brand) 0 6px, var(--brand-tint-2) 6px 12px); border-radius: 0 4px 4px 0; }
.ledger-bar.is-gross > span { background: var(--slate); }
.ledger-bar.is-balance > span { background: var(--brand-deep); }
.ledger-bar.is-balance > span.is-range { background: repeating-linear-gradient(135deg, var(--brand-deep) 0 6px, var(--line) 6px 12px); }
.ledger-meta { font-size: var(--t-xs); color: var(--ink-2); margin-top: 6px; display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--s3); }
.src-link { display: inline-flex; align-items: center; gap: var(--s1); min-height: 44px; font-weight: 700; word-break: break-word; }
.src-link .icon { width: 1em; height: 1em; }
.src-plain { color: var(--ink-2); }
.flag-list { list-style: none; padding: 0; margin: 0; }
.flag-list li { display: flex; gap: 10px; align-items: flex-start; padding: var(--s3) 0; border-top: 1px solid var(--line-2); }
.flag-list li:first-child { border-top: 0; }
.flag-list li > div { min-width: 0; }
.flag-list .icon { color: var(--blue); margin-top: 2px; }

/* ---------- Pill filters (route and free hospitals) ---------- */
.tabs { display: flex; flex-wrap: wrap; gap: var(--s2); margin-bottom: var(--s4); }
.tab {
  flex: 0 1 auto; min-width: 0; min-height: 44px; padding: 6px var(--s4); border-radius: var(--r-pill);
  border: 1px solid var(--line); background: var(--surface); color: var(--ink-2);
  font: inherit; font-size: var(--t-sm); font-weight: 700; line-height: 1.2; text-wrap: balance; cursor: pointer;
}
.tab:hover { border-color: var(--brand); color: var(--ink); }
.tab[aria-selected="true"] { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.tab .num { font-weight: 600; }

/* ---------- Route: office cards ---------- */
.ticket {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); color: var(--ink); border-radius: var(--r);
  box-shadow: var(--shadow); padding: var(--s4); margin-bottom: var(--s3);
}
.ticket-stub {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 12px;
  background: var(--surface-3); color: var(--ink-2); font-weight: 800; font-size: var(--t-lg); font-variant-numeric: tabular-nums;
}
.ticket-body { min-width: 0; }
.ticket.is-current { border-color: var(--brand); box-shadow: inset 4px 0 0 var(--brand), var(--shadow-lift); }
.ticket.is-current .ticket-stub { background: var(--brand); color: var(--on-brand); }
.ticket.is-lit { box-shadow: 0 0 0 4px var(--brand-tint-2), inset 4px 0 0 var(--brand), var(--shadow-lift); transition: box-shadow .25s ease-out; }
.ticket.is-done { background: var(--surface-2); box-shadow: none; padding-top: var(--s3); padding-bottom: var(--s3); }
.ticket.is-done .ticket-stub { background: var(--ok-tint); color: var(--ok); }
.stamp { display: inline-flex; align-items: center; gap: var(--s1); padding: 3px 10px; border-radius: var(--r-pill); background: var(--ok-tint); color: var(--ok); font-weight: 800; font-size: var(--t-xs); }
.stamp .icon { width: 14px; height: 14px; }
.done-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px var(--s3); }
.done-line .window-where { margin: 0; font-size: var(--t-md); }
.done-line p { grid-column: 1 / -1; color: var(--ink-2); }
.window-where { font-weight: 750; font-size: var(--t-lg); line-height: 1.25; margin: 0 0 var(--s1); overflow-wrap: anywhere; }
.window-sub { color: var(--ink-2); margin: 0 0 6px; font-size: var(--t-sm); }
.window-body h4 { font-size: var(--t-sm); margin: var(--s3) 0 var(--s1); }
.window-body ul { margin: 0; padding-left: 1.25rem; }
.window-body li { margin: 2px 0; }
.window-meta { font-size: var(--t-xs); color: var(--ink-2); margin-top: 10px; display: flex; flex-wrap: wrap; gap: var(--s1) var(--s3); align-items: center; }
.window-actions { margin-top: var(--s3); display: flex; flex-wrap: wrap; gap: var(--s2); }
.window-hours { margin-top: var(--s2); color: var(--ink-2); }
.gl-form { margin-top: var(--s3); padding: var(--s4); background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); }
.fallback-heading { margin: var(--s6) 0 var(--s2); font-size: var(--t-sm); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
.outside-cta { margin: var(--s2) 0 var(--s4); }

/* ---------- Checklist ---------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { border-bottom: 1px solid var(--line-2); }
.checklist li:last-child { border-bottom: 0; }
.copies { font-size: var(--t-xs); color: var(--ink-2); display: block; }

/* ---------- Tracker ---------- */
.gl-list { list-style: none; padding: 0; margin: 0; }
.gl-list li { display: flex; align-items: center; gap: var(--s3); padding: var(--s3) 0; border-bottom: 1px solid var(--line-2); }
.gl-list li:last-child { border-bottom: 0; }
.gl-list .row-text { flex: 1; }
.gl-list .tile-icon { width: 40px; height: 40px; }
@media (max-width: 26rem) { .gl-list .tile-icon { display: none; } }

/* ---------- Compare ---------- */
.compare-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
@media (min-width: 40rem) { .compare-grid { grid-template-columns: 1fr 1fr; } }
.compare-col { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: var(--s4); box-shadow: var(--shadow); min-width: 0; }
.compare-col h2 { margin-top: 0; font-size: var(--t-md); overflow-wrap: anywhere; }
.compare-row { padding: 10px 0; border-top: 1px solid var(--line-2); }
.compare-row dt { font-size: var(--t-xs); color: var(--ink-2); font-weight: 700; }
.compare-row dd { margin: 2px 0 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.compare-rows { margin: 0; }
.needs-quote { color: var(--ink-2); font-weight: 700; }

/* ---------- About ---------- */
.source-panel { padding: var(--s2) var(--s4); overflow-x: auto; }
.source-table { width: 100%; border-collapse: collapse; font-size: var(--t-sm); }
.source-table th, .source-table td { text-align: left; padding: 10px var(--s2); border-bottom: 1px solid var(--line-2); vertical-align: top; }
.source-table td { overflow-wrap: anywhere; }
.source-table th { font-size: var(--t-xs); color: var(--ink-2); text-transform: uppercase; letter-spacing: .04em; }
@media (max-width: 40rem) {
  .source-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .source-table tr { display: block; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
  .source-table td { display: block; border: 0; padding: 2px 0; }
  .source-table td[data-label]::before { content: attr(data-label) ': '; font-weight: 700; color: var(--ink-2); }
}
.textarea { width: 100%; min-height: 160px; font: inherit; padding: 10px var(--s3); border: 1px solid var(--line); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); }

/* ---------- Free hospitals (#/free) ---------- */
.free-filters { display: grid; gap: 0 var(--s4); }
@media (min-width: 48rem) { .free-filters { grid-template-columns: repeat(3, minmax(0, 1fr)); } .free-filters .field { margin-bottom: 0; } }
.free-filters .field:last-child { margin-bottom: 0; }
.free-tier { margin-top: var(--s2); }
.free-tier > h2 { margin-top: 0; }
#free-not-listed { margin-top: var(--s5); }
.free-count { font-size: var(--t-xs); font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; background: var(--surface-3); padding: 2px 10px; border-radius: var(--r-pill); }
.free-source { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s1) 6px; color: var(--ink-2); }
.free-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); padding: var(--s1) var(--s4); margin-top: var(--s3); }
.free-province { font-size: var(--t-md); color: var(--ink); gap: var(--s2); }
.free-province .free-count { margin-left: auto; }
.free-group[open] > .free-province { border-bottom: 1px solid var(--line-2); }
.free-list { list-style: none; margin: 0; padding: 0; }
.free-item { border-top: 1px solid var(--line-2); padding: var(--s3) 0; }
.free-group[open] .free-item:first-child { border-top: 0; }
.free-name { font-size: var(--t-md); margin: 0; overflow-wrap: anywhere; }
.free-address { margin: 2px 0 0; color: var(--ink-2); font-size: var(--t-sm); overflow-wrap: anywhere; }
.free-phone { margin: var(--s1) 0 0; }
.free-phone a { display: inline-block; min-height: 44px; line-height: 44px; font-weight: 700; color: var(--brand-ink); }
.free-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s4); margin-top: var(--s2); }
.free-actions .btn { min-height: 44px; padding: 8px 16px; }
@media (min-width: 64rem) { .free-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s6); } .free-group[open] .free-item:nth-child(2) { border-top: 0; } }

/* ---------- Desktop: two working columns ---------- */
.split { display: block; }
@media (min-width: 64rem) {
  .split { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: var(--s6); align-items: start; }
  .split > .split-side { position: sticky; top: 72px; }
  .route-split { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .route-split > .split-side { grid-column: 2; grid-row: 1; }
  .route-split > .split-main { grid-column: 1; grid-row: 1; }
}

/* App feel: no visible scrollbars. Scrolling by touch, wheel and keyboard still works. */
html, body, * { scrollbar-width: none; }
::-webkit-scrollbar { display: none; width: 0; height: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}
