/* ============ Scaffolding ============ */
.page-top { padding-top: var(--s-6); }
.page-header { margin-block: var(--s-4) var(--s-8); max-width: 52rem; }
.page-header .lede { margin-top: var(--s-3); }
.page-header--split { max-width: none; display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-6); flex-wrap: wrap; }
.lede { font-size: var(--text-lg); color: var(--text-muted); max-width: 62ch; }
.meta-line { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); margin-top: var(--s-2); font-size: var(--text-sm); color: var(--text-muted); }
.section-block { margin-top: var(--s-12); }
.section-block > h2 { padding-top: var(--s-3); border-top: 2px solid var(--rule); }
.section-block > h2 + * { margin-top: var(--s-3); }
.section-block > p + * { margin-top: var(--s-4); }
.section-block .steps, .section-block .checklist { margin-top: var(--s-4); }
.section-block .checklist + p { margin-top: var(--s-3); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); margin-bottom: var(--s-3); flex-wrap: wrap; }

/* ============ Home ============ */
.finder { padding-block: var(--s-10) var(--s-6); }
.finder-intro { max-width: 46rem; }
.finder h1 { font-size: clamp(2.1rem, 1.6rem + 1.6vw, 2.8rem); line-height: 1.08; }
.finder .lede { margin-top: var(--s-3); }
.search-form { margin-top: var(--s-6); max-width: 52rem; }
.household-toggle { margin-top: var(--s-3); }
.household-toggle summary { display: inline-flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; list-style: none; cursor: pointer; font-size: var(--text-sm); font-weight: 700; color: var(--purple); text-decoration: underline; text-underline-offset: 0.2em; }
.household-toggle summary::-webkit-details-marker { display: none; }
.summary-icon { display: inline-grid; place-items: center; width: 1.1rem; height: 1.1rem; border: 1px solid var(--purple); border-radius: var(--r-xs); }
.summary-icon .icon { width: 0.8rem; height: 0.8rem; }
.household-toggle[open] .summary-icon { transform: rotate(45deg); }
.household-chip { background: var(--purple); color: var(--ivory); padding: 0 0.5rem; border-radius: var(--r-xs); font-size: var(--text-xs); text-decoration: none; }
.household-toggle .household-fields { margin-top: var(--s-3); padding: var(--s-4); background: var(--ivory); border: 1px solid var(--line-strong); border-radius: var(--r-lg); }
.household-fields { display: grid; grid-template-columns: minmax(9rem, 12rem) minmax(11rem, 16rem); gap: var(--s-4); align-items: end; }
.household-fields .field-hint { grid-column: 1 / -1; }
.household-fields--compact { grid-template-columns: 1fr 1.4fr; }

.results-section { padding-bottom: var(--s-6); }
.results-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-2); }
.results-summary { font-size: var(--text-sm); color: var(--text-muted); }
.results-summary strong { color: var(--text); }
.results-estimate-note { font-size: var(--text-sm); color: var(--purple); font-weight: 700; }
.results-more { margin-top: var(--s-4); }
.results-region[aria-busy='true'] { opacity: .5; }
.hospital-table th:first-child { width: 34%; }

.home-columns { display: grid; grid-template-columns: 1.2fr 1fr; gap: var(--s-12); margin-top: var(--s-10); }
.home-columns h2 { font-size: var(--text-xl); padding-top: var(--s-3); border-top: 2px solid var(--rule); margin-bottom: var(--s-3); }
.first-steps { padding-left: 1.5rem; display: grid; gap: var(--s-3); }
.first-steps li::marker { font-weight: 700; color: var(--purple); }
.first-steps strong { display: block; }
.first-steps span { color: var(--text-muted); font-size: var(--text-sm); }
.state-jump { display: flex; gap: var(--s-2); margin-top: var(--s-3); }
.state-jump select { flex: 1; }
@media (max-width: 900px) { .home-columns { grid-template-columns: 1fr; gap: var(--s-8); } }

/* ============ Detail layout ============ */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 17rem; gap: clamp(1.5rem, 1rem + 2.5vw, 3.5rem); align-items: start; }
.detail-main > * + * { margin-top: var(--s-6); }
.detail-main > .section-block { margin-top: var(--s-12); }
.detail-aside { position: sticky; top: calc(var(--header-h) + 3rem); display: grid; gap: var(--s-4); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-6); }
.facts > div { padding-top: var(--s-2); border-top: 1px solid var(--line); }
.facts dt { font-size: var(--text-xs); font-weight: 700; color: var(--accent-text); }
.facts dd { margin-top: 2px; font-size: var(--text-sm); }
.facts strong { color: var(--purple); }
.checker-result { margin-top: var(--s-4); padding: var(--s-3) var(--s-4); border-left: 4px solid var(--line-strong); background: var(--beige); }
.checker-result.is-free { border-left-color: var(--purple); background: var(--lavender-soft); }
.checker-result.is-discount { border-left-color: var(--muted-purple); background: var(--lavender-soft); }
.checker-outcome { display: grid; gap: var(--s-1); }
.checker-outcome strong { color: var(--purple); font-size: var(--text-lg); }
.checker-outcome span { font-size: var(--text-sm); color: var(--text-muted); }
.data-table tr[data-size-row].is-match { background: var(--lavender-soft); }
.data-table tr[data-size-row].is-match th { box-shadow: inset 4px 0 0 var(--purple); }
.contact-list { list-style: none; padding: 0; display: grid; gap: var(--s-2); font-size: var(--text-sm); }
.contact-list a { font-weight: 700; }
.script-tip { font-size: var(--text-sm); border-left: 3px solid var(--purple); padding-left: var(--s-3); }
.verified { font-size: var(--text-xs); color: var(--text-muted); }
.mini-partners { list-style: none; padding: 0; display: grid; gap: var(--s-2); font-size: var(--text-sm); }
.mini-partners span { display: block; color: var(--text-muted); font-size: var(--text-xs); }
@media (max-width: 960px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } .detail-aside { position: static; } }
@media (max-width: 560px) { .facts, .household-fields, .household-fields--compact { grid-template-columns: 1fr; } }

/* ============ State page ============ */
.state-layout { display: grid; grid-template-columns: 14rem minmax(0, 1fr); gap: clamp(1.5rem, 1rem + 3vw, 4rem); align-items: start; }
.toc { position: sticky; top: calc(var(--header-h) + 3rem); font-size: var(--text-sm); }
.toc h2 { font-size: var(--text-sm); margin-bottom: var(--s-2); color: var(--text); }
.toc ol { padding-left: 1.2rem; display: grid; gap: 0.35rem; }
.toc a { color: var(--text-muted); text-decoration: none; }
.toc a:hover { color: var(--purple); text-decoration: underline; }
.state-main > section { margin-top: var(--s-10); }
.state-main > section:first-child { margin-top: 0; }
.state-main > section > h2 { padding-top: var(--s-3); border-top: 2px solid var(--rule); margin-bottom: var(--s-3); }
.state-main > section > * + * { margin-top: var(--s-3); }
.quick-answers { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); }
.quick-answers > div { padding: var(--s-3) var(--s-4) var(--s-3) 0; border-bottom: 1px solid var(--line); }
.quick-answers dt { font-size: var(--text-xs); font-weight: 700; color: var(--accent-text); }
.quick-answers dd { margin-top: 2px; }
.rule-list { padding-left: 1.3rem; display: grid; gap: var(--s-2); }
.protection-list { list-style: none; padding: 0; display: grid; gap: 0; border-top: 1px solid var(--line); }
.protection-list li { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); }
.protection-list strong { display: block; color: var(--purple); }
.cite { display: block; font-size: var(--text-xs); color: var(--text-muted); font-style: italic; margin-top: 2px; }
.agency-list { list-style: none; padding: 0; display: grid; gap: var(--s-3); }
.agency-list li { padding-left: var(--s-3); border-left: 3px solid var(--line-strong); }
.agency-list .agency-for { display: block; font-size: var(--text-sm); color: var(--text-muted); }
.source-list { padding-left: 1.3rem; font-size: var(--text-xs); color: var(--text-muted); display: grid; gap: 0.2rem; word-break: break-all; }
.source-list a { color: var(--text-muted); }
@media (max-width: 900px) { .state-layout { grid-template-columns: minmax(0, 1fr); } .toc { position: static; border: 1px solid var(--line-strong); padding: var(--s-4); border-radius: var(--r-lg); background: var(--ivory); } }
@media (max-width: 600px) { .quick-answers { grid-template-columns: 1fr; } }
.state-table th:first-child { width: 20%; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-4); }
.toolbar .search-bar { flex: 0 1 22rem; }
.table-empty .empty-state { border: 0; }

/* ============ Navigator ============ */
.wizard { padding: clamp(1.25rem, 0.8rem + 2vw, 2rem); }
.wizard > * + * { margin-top: 0; }
.wizard-progress { height: 6px; background: var(--lavender); }
.wizard-progress span { display: block; height: 100%; width: 20%; background: var(--purple); transition: width var(--t) var(--ease); }
.wizard-count { margin-top: var(--s-2); font-size: var(--text-xs); font-weight: 700; color: var(--accent-text); }
.wizard-step { border: 0; padding: 0; margin-top: var(--s-4); min-width: 0; display: grid; gap: var(--s-4); }
.wizard-step legend { padding: 0; margin-bottom: var(--s-4); }
.wizard-step legend + .muted { margin-top: calc(var(--s-3) * -1); }
.wizard .form-error { margin-top: var(--s-4); }
.wizard-actions { display: flex; justify-content: space-between; gap: var(--s-3); margin-top: var(--s-6); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.wizard-actions [data-next] { margin-left: auto; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-4); }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }
.choices { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-2); }
.choices--compact { grid-template-columns: 1fr; }
.choice { position: relative; display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; margin: 0; }
.choice-body { display: flex; align-items: center; gap: var(--s-3); height: 100%; padding: 0.7rem 0.9rem; border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--ivory); }
.choice-body::before { content: ''; width: 1rem; height: 1rem; border: 2px solid var(--text-muted); border-radius: 50%; flex-shrink: 0; }
.choice-icon { display: none; }
.choice:hover .choice-body { border-color: var(--purple); }
.choice input:checked + .choice-body { border-color: var(--purple); background: var(--lavender-soft); box-shadow: inset 0 0 0 1px var(--purple); }
.choice input:checked + .choice-body::before { border-color: var(--purple); background: radial-gradient(var(--purple) 45%, transparent 50%); }
.choice input:focus-visible + .choice-body { box-shadow: var(--focus); }
.hospital-options { display: grid; gap: var(--s-2); max-height: 18rem; overflow: auto; padding: 2px; }
.hospital-options .choice-body small { margin-left: auto; color: var(--text-muted); font-size: var(--text-xs); }
@media (max-width: 600px) { .choices { grid-template-columns: 1fr; } }

.plan { margin-top: var(--s-4); outline: none; }
.plan > * + * { margin-top: var(--s-8); }
.plan h2 { padding-top: var(--s-3); border-top: 2px solid var(--rule); }
.plan-summary h2 { border-top: 0; padding-top: 0; font-size: var(--text-3xl); }
.plan-summary > * + * { margin-top: var(--s-3); }
.plan-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); border-top: 1px solid var(--line); }
.plan-stat { padding: var(--s-3) var(--s-4) var(--s-3) 0; border-bottom: 1px solid var(--line); }
.plan-stat dt { font-size: var(--text-xs); font-weight: 700; color: var(--accent-text); }
.plan-stat dd { margin-top: 2px; font-weight: 700; color: var(--purple); font-size: var(--text-lg); line-height: 1.3; }
.plan-stat dd small { display: block; font-size: var(--text-xs); color: var(--text-muted); font-weight: 400; }
.timeline { list-style: none; padding: 0; border-left: 2px solid var(--purple); margin-left: 0.4rem; }
.timeline li { position: relative; padding: 0 0 var(--s-4) var(--s-5); }
.timeline li::before { content: ''; position: absolute; left: -0.45rem; top: 0.4rem; width: 0.8rem; height: 0.8rem; border-radius: 50%; background: var(--ivory); border: 2px solid var(--purple); }
.timeline li.is-past::before { background: var(--purple); }
.timeline li.is-urgent::before { background: var(--danger); border-color: var(--danger); }
.timeline time { font-weight: 700; color: var(--purple); }
.timeline li.is-urgent time { color: var(--danger); }
.timeline p { font-size: var(--text-sm); color: var(--text-muted); }
.plan-steps { padding-left: 1.5rem; display: grid; gap: var(--s-5); }
.plan-steps > li::marker { font-weight: 700; color: var(--purple); font-size: var(--text-lg); }
.plan-steps h3 { font-size: var(--text-lg); }
.plan-steps p { margin-top: var(--s-1); }
.plan-steps .say { margin-top: var(--s-2); border-left: 3px solid var(--purple); padding-left: var(--s-3); font-style: italic; }
.call-list { list-style: none; padding: 0; display: grid; gap: var(--s-3); }
.call-list li { padding-left: var(--s-3); border-left: 3px solid var(--line-strong); }
.call-list .call-why { display: block; font-size: var(--text-sm); color: var(--text-muted); }
.plan-checks { list-style: none; padding: 0; display: grid; gap: var(--s-1); }
.plan-checks label { display: flex; gap: var(--s-3); align-items: flex-start; padding: 0.4rem 0; cursor: pointer; }
.plan-checks input { width: 1.1rem; height: 1.1rem; margin-top: 0.3rem; flex-shrink: 0; accent-color: var(--purple); }
.plan-checks input:checked + span { color: var(--text-muted); text-decoration: line-through; }
.letter-tabs { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.letter { white-space: pre-wrap; font-size: var(--text-sm); line-height: 1.6; background: var(--ivory); border: 1px solid var(--line-strong); padding: var(--s-4); font-family: var(--font); }
.plan-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); flex-wrap: wrap; }

/* ============ Articles ============ */
.pill-nav { margin-bottom: var(--s-6); }
.article-list { list-style: none; padding: 0; border-top: 2px solid var(--rule); }
.article-item a { display: grid; grid-template-columns: 9rem 1fr auto; gap: var(--s-4); align-items: baseline; padding: var(--s-4) 0; border-bottom: 1px solid var(--line); text-decoration: none; color: var(--text); }
.article-item a:hover .article-title { text-decoration: underline; }
.article-cat { font-size: var(--text-xs); font-style: italic; color: var(--accent-text); }
.article-title { font-size: var(--text-lg); }
.article-item p { color: var(--text-muted); font-size: var(--text-sm); margin-top: 2px; }
.article-meta { font-size: var(--text-xs); color: var(--text-muted); white-space: nowrap; }
@media (max-width: 720px) { .article-item a { grid-template-columns: 1fr; gap: var(--s-1); } }
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 16rem; gap: clamp(2rem, 1rem + 4vw, 4.5rem); align-items: start; margin-top: var(--s-4); }
.article-header { margin-bottom: var(--s-6); padding-bottom: var(--s-4); border-bottom: 2px solid var(--rule); }
.article-header .lede { margin-top: var(--s-3); }
.article-aside { position: sticky; top: calc(var(--header-h) + 3rem); display: grid; gap: var(--s-5); }
@media (max-width: 960px) { .article-layout { grid-template-columns: minmax(0, 1fr); } .article-aside { position: static; } }
.prose { max-width: 70ch; line-height: 1.6; }
.prose > * + * { margin-top: 0.9em; }
.prose h2 { font-size: var(--text-xl); margin-top: 1.8em; }
.prose h3 { font-size: var(--text-lg); margin-top: 1.4em; }
.prose h2 + *, .prose h3 + * { margin-top: 0.5em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.35em; }
.prose li::marker { color: var(--accent-text); }
.prose .callout { margin-block: 1.4em; }
.prose table { width: 100%; border-collapse: collapse; font-size: var(--text-sm); background: var(--ivory); }
.prose th, .prose td { border: 1px solid var(--line-strong); padding: 0.4rem 0.6rem; text-align: left; }
.prose thead th { background: var(--beige); }
.prose .table-wrap { overflow-x: auto; }
.prose pre { white-space: pre-wrap; background: var(--ivory); border: 1px solid var(--line-strong); padding: var(--s-4); font-family: var(--font); font-size: var(--text-sm); }

/* ============ Partners ============ */
.filter-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-4); margin-bottom: var(--s-6); padding-bottom: var(--s-4); border-bottom: 1px solid var(--line); }
.field--inline { display: flex; align-items: center; gap: var(--s-3); }
.field--inline select { width: 12rem; }
.partner-section + .partner-section { margin-top: var(--s-10); }
.partner-section h2 { padding-top: var(--s-3); border-top: 2px solid var(--rule); margin-bottom: var(--s-2); }
.partner-list { list-style: none; padding: 0; }
.partner { padding: var(--s-4) 0; border-bottom: 1px solid var(--line); display: grid; gap: var(--s-2); }
.partner-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); }
.partner h3 { font-size: var(--text-lg); }
.partner > p { color: var(--text-muted); font-size: var(--text-sm); max-width: 70ch; }
.service-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-4); font-size: var(--text-xs); color: var(--text-muted); }
.service-list li + li::before { content: '·'; margin-right: var(--s-4); }
.partner-contact { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); font-size: var(--text-sm); }
.partner-contact a { font-weight: 700; }
.partner-note { margin-top: var(--s-10); }

/* ============ Flyer ============ */
.flyer-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); }
.flyer-tools form { display: inline; }
.flyer { background: #fff; border: 1px solid var(--line-strong); padding: clamp(1.5rem, 1rem + 3vw, 3rem); color: #1d1a22; }
.flyer > * + * { margin-top: var(--s-4); }
.flyer-kicker { font-style: italic; color: var(--accent-text); font-size: var(--text-lg); }
.flyer h1 { font-size: clamp(2.1rem, 1.5rem + 2.5vw, 3rem); }
.flyer-lede, .flyer-state { font-size: 1.3rem; line-height: 1.4; }
.flyer-steps { padding-left: 1.6rem; display: grid; gap: var(--s-2); font-size: 1.2rem; }
.flyer-url { border: 3px solid var(--purple); padding: var(--s-4) var(--s-5); text-align: center; }
.flyer-url span { display: block; }
.flyer-url strong { display: block; font-size: clamp(1.6rem, 1rem + 2.5vw, 2.4rem); color: var(--purple); word-break: break-all; }
.flyer-foot { text-align: center; }

.page-404 { padding-block: var(--s-16); }

/* ============ Mobile ============ */
@media (max-width: 640px) {
  .search-bar { flex-wrap: wrap; }
  .search-bar input { flex-basis: calc(100% - 3rem); }
  .search-divider { display: none; }
  .search-state { flex: 1; max-width: none; border-top: 1px solid var(--line) !important; border-radius: 0; }
  .search-submit { flex: 0 0 auto; }
  .finder h1 { font-size: 1.8rem; }
  .lede { font-size: var(--text-base); }
  .wizard-actions .btn { flex: 1; }
}
@media (max-width: 760px) { .hospital-table th:first-child, .state-table th:first-child { width: 100%; } }

/* ============ Print ============ */
@media print {
  :root { font-size: 100%; }
  .site-header, .site-footer, .wizard, .plan-actions, .skip-link, .flyer-tools, .toc, .letter-tabs { display: none !important; }
  body { background: #fff; }
  .card, .panel { border: 1px solid #999; break-inside: avoid; }
  .page-flyer .page-top { padding: 0; }
  .flyer { border: 0; padding: 0; }
}
.toc--static { position: static; }
.home-navigator { margin-top: var(--s-5); }
.home-guides { margin-top: var(--s-8); }
.more-link { margin-top: var(--s-3); }
[data-show-for] { display: none; }
[data-show-for].is-shown { display: grid; }
fieldset.field { border: 0; padding: 0; margin: 0; min-width: 0; }
fieldset.field legend { padding: 0; margin-bottom: var(--s-2); }
.form-row { align-items: start; }

/* Hospital directory additions */
.check-inline { display: inline-flex; align-items: center; gap: var(--s-2); margin-top: var(--s-3); font-size: var(--text-sm); cursor: pointer; }
.check-inline input { width: 1.1em; height: 1.1em; accent-color: var(--purple); }
.btn-row { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.obligation + .obligation { margin-top: var(--s-3); }
.obligation--strong { border-left: 4px solid var(--purple); }
.obligation--warn { border-left: 4px solid var(--line-strong); }
.obligation--quiet { border-left: 4px solid var(--line); }
.facts--stacked > div { display: block; }
.facts--stacked dt { font-weight: 600; }
.facts--stacked dd { margin: var(--s-1) 0 0; }
.letter-details { border: 1px solid var(--line); padding: var(--s-3) var(--s-4); margin-top: var(--s-3); background: var(--ivory); }
.letter-details summary { cursor: pointer; }
.letter-details .letter { margin-top: var(--s-3); }
.two-col { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.city-index { columns: 3 220px; column-gap: var(--s-5); margin-top: var(--s-3); }
.city-group { break-inside: avoid; margin-bottom: var(--s-4); }
.city-name { font-size: var(--text-sm); text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin: 0 0 var(--s-1); }
.city-group ul { list-style: none; margin: 0; padding: 0; }
.city-group li { font-size: var(--text-sm); padding: 2px 0; }
.tag-xs { font-size: 0.7rem; padding: 0 6px; vertical-align: middle; }

/* Numbers, comparisons, rankings */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: var(--s-3); margin: var(--s-4) 0; }
.stat { background: var(--ivory); border: 1px solid var(--line); border-radius: var(--r-md); padding: var(--s-3) var(--s-4); display: flex; flex-direction: column; gap: 2px; }
.stat-n { font-size: var(--text-2xl); font-weight: 700; color: var(--purple); line-height: 1.1; }
.stat-l { font-size: var(--text-xs); color: var(--text-muted); }
.markup-card, .section-block .card + .card { margin-top: var(--s-4); }
.inline-form { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-2) var(--s-3); }
.inline-form label { width: 100%; font-size: var(--text-sm); font-weight: 600; }
.inline-form .input-affix { max-width: 12rem; }
.markup-result { font-size: var(--text-lg); }
.bar-compare { display: grid; gap: var(--s-2); margin: var(--s-2) 0 var(--s-3); }
.bar-row { display: grid; grid-template-columns: minmax(8rem, 14rem) 1fr 4rem; align-items: center; gap: var(--s-3); font-size: var(--text-sm); }
.bar { height: 12px; background: var(--lavender-soft); border-radius: var(--r-pill); overflow: hidden; }
.bar span { display: block; height: 100%; width: var(--w); background: var(--purple); border-radius: var(--r-pill); }
.bar-row--muted .bar span { background: var(--muted-purple); }
.bar-val { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.table-scroll { overflow-x: auto; }
.compare-table td, .compare-table th { white-space: nowrap; }
.compare-table th[scope='row'] { white-space: normal; min-width: 14rem; }
.rank-grid { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); padding-bottom: var(--s-10); }
.rank-list { margin: var(--s-3) 0 0; padding-left: 1.4em; }
.rank-list li { display: grid; grid-template-columns: 1fr auto; gap: 0 var(--s-3); padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.rank-meta { grid-column: 1; font-size: var(--text-xs); color: var(--text-muted); }
.rank-val { max-width: 8rem; grid-column: 2; grid-row: 1 / span 2; align-self: center; font-weight: 600; font-variant-numeric: tabular-nums; font-size: var(--text-sm); text-align: right; }
.city-name a { color: inherit; }
.page-top > .btn-row { margin: 0 0 var(--s-6); }

/* Easier navigation: quick start, section bar, task chooser */
.quick-start { list-style: none; margin: 0 0 var(--s-4); padding: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.quick-start a { display: flex; gap: var(--s-3); align-items: flex-start; height: 100%; padding: var(--s-4); background: var(--purple); color: var(--ivory); border-radius: var(--r-lg); text-decoration: none; transition: background var(--t) var(--ease); }
.quick-start a:hover { background: var(--purple-hover); }
.quick-start a:focus-visible { box-shadow: var(--focus); outline: none; }
.qs-n { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--ivory); color: var(--purple); display: grid; place-items: center; font-weight: 700; }
.qs-t { display: flex; flex-direction: column; gap: 2px; }
.qs-t strong { font-size: var(--text-lg); }
.qs-t span { font-size: var(--text-sm); opacity: 0.9; }
.section-nav { position: sticky; top: var(--header-h, 72px); z-index: 40; background: var(--beige); border-bottom: 1px solid var(--line); margin: 0 0 var(--s-6); padding: var(--s-2) 0; }
.section-nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--s-2); overflow-x: auto; scrollbar-width: none; }
.section-nav a { display: inline-block; white-space: nowrap; padding: 6px 14px; border: 1px solid var(--line-strong); border-radius: var(--r-pill); font-size: var(--text-sm); color: var(--text); text-decoration: none; background: var(--ivory); }
.section-nav a:hover, .section-nav a:focus-visible { border-color: var(--purple); color: var(--purple); }
.detail-main [id] { scroll-margin-top: 9rem; }
.task-section { padding: var(--s-2) 0 var(--s-6); }
.task-section h2 { margin-bottom: var(--s-3); }
.task-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.task-grid a { display: flex; flex-direction: column; gap: 4px; height: 100%; padding: var(--s-4); background: var(--ivory); border: 1px solid var(--line-strong); border-radius: var(--r-lg); text-decoration: none; color: var(--text); }
.task-grid a:hover { border-color: var(--purple); background: var(--lavender-soft); }
.task-grid strong { color: var(--purple); font-size: var(--text-lg); }
.task-grid span { font-size: var(--text-sm); color: var(--text-muted); }
@media print { .quick-start, .section-nav, .task-section { display: none !important; } }

/* ---------- Revamp: trust bar, qualify flow, call notes, application helper ---------- */
.trust-bar { background: var(--purple); color: var(--ivory); font-size: var(--text-sm); }
.trust-inner { display: flex; align-items: center; justify-content: space-between; gap: var(--s-4); padding-top: 6px; padding-bottom: 6px; }
.trust-inner p { margin: 0; }
.lang-switch { flex: none; color: var(--ivory); font-weight: 700; border: 1px solid rgba(255, 252, 248, 0.6); border-radius: var(--r-pill); padding: 2px 12px; text-decoration: none; }
.lang-switch:hover, .lang-switch:focus-visible { background: var(--ivory); color: var(--purple); }

.qualify { border: 2px solid var(--purple); }
.qualify h2 { margin-bottom: 0; }
.q-grid { display: grid; gap: var(--s-3) var(--s-4); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); margin-top: var(--s-3); }
.q-ins { border: 0; padding: 0; margin: 0; grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.q-ins legend { width: 100%; font-weight: 600; font-size: var(--text-sm); margin-bottom: var(--s-2); }
.qualify-result { margin-top: var(--s-4); padding: var(--s-4); border-left: 6px solid var(--line-strong); background: var(--beige); border-radius: var(--r-sm); }
.qualify-result > * + * { margin-top: var(--s-3); }
.qualify-result.is-free { border-left-color: var(--purple); background: var(--lavender-soft); }
.qualify-result.is-discount { border-left-color: var(--muted-purple); background: var(--lavender-soft); }
.qualify-result.is-unknown { border-left-color: #6C8EB4; background: var(--powder-blue); }
.q-verdict strong { font-size: var(--text-xl); color: var(--purple); line-height: 1.25; display: block; }
.q-deadlines, .q-next { border-top: 1px solid var(--line); padding-top: var(--s-3); }
.q-deadlines ul, .q-next ol { margin: var(--s-2) 0 var(--s-3); padding-left: 1.2em; }
.q-deadlines li, .q-next li { margin: var(--s-1) 0; }

.letter-es { margin-top: var(--s-2); }
.letter-es summary { cursor: pointer; font-size: var(--text-sm); }
.notes-form textarea { width: 100%; font: inherit; padding: var(--s-2); border: 1px solid var(--line-strong); border-radius: var(--r-sm); background: var(--ivory); }
.notes-list { margin: var(--s-4) 0 0; padding-left: 1.2em; }
.notes-list li { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.notes-list p { margin: var(--s-1) 0; white-space: pre-wrap; }

.apply-wrap { display: grid; gap: var(--s-4); padding-bottom: var(--s-12); }
.apply-step h2 { display: flex; align-items: center; gap: var(--s-3); }
.step-n { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--purple); color: var(--ivory); display: grid; place-items: center; font-size: var(--text-base); }
.income-rows { display: grid; gap: var(--s-3); margin: var(--s-3) 0; }
.income-row { display: grid; grid-template-columns: 1fr minmax(9rem, 13rem); gap: var(--s-3); align-items: center; }
.income-row label { font-weight: 400; }
.affix-end { padding: 0 var(--s-2); color: var(--text-muted); font-size: var(--text-sm); white-space: nowrap; }
.apply-total { font-size: var(--text-lg); margin-top: var(--s-3); }
.apply-total strong { color: var(--purple); }
.checklist--boxes { list-style: none; padding: 0; }
.checklist--boxes li { padding: var(--s-2) 0; border-bottom: 1px solid var(--line); }
.checklist--boxes input { width: 1.1em; height: 1.1em; accent-color: var(--purple); margin-right: var(--s-2); vertical-align: -2px; }
@media (max-width: 560px) { .income-row { grid-template-columns: 1fr; } .trust-inner { font-size: var(--text-xs); } }

/* Print one thing (a letter, call notes, or the application packet) */
.print-only, .packet { display: none; }
@media print {
  body.is-printing-one > *:not(.print-only), body.is-printing-packet .site-header, body.is-printing-packet .site-footer, body.is-printing-packet .trust-bar,
  body.is-printing-packet main > *:not(.apply-wrap), body.is-printing-packet .apply-wrap > *:not(.packet), .trust-bar { display: none !important; }
  body.is-printing-one .print-only, body.is-printing-packet .packet { display: block !important; }
  .print-only .letter, .packet .letter { border: 0; background: #fff; font-size: 11pt; padding: 0; }
  .packet-page { break-after: page; }
  .packet-page:last-child { break-after: auto; }
  .packet-table { border-collapse: collapse; width: 100%; } .packet-table td { border-bottom: 1px solid #999; padding: 4px 0; }
  .packet-check { list-style: none; padding: 0; } .packet-check li { padding: 3px 0; }
}
.input-affix > .affix-end { left: auto; right: 0.4rem; } .input-affix:has(.affix-end) input { padding-right: 4.5rem; }

/* Mobile: keep everything inside the screen, and make tap targets comfortable */
.article-main, .detail-main, .state-layout > * { min-width: 0; }
.prose .table-wrap, .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.toc ol { overflow-wrap: anywhere; }
@media (max-width: 640px) {
  .city-group li { padding: 6px 0; }
  .city-group li a, .data-table th[scope='row'] a { display: inline-block; min-height: 28px; }
  .data-table td, .data-table th { overflow-wrap: anywhere; }
  .quick-start a { padding: var(--s-3); }
  .qs-t strong { font-size: var(--text-base); }
}

/* My bills */
.nav-count { display: inline-grid; place-items: center; min-width: 1.3rem; height: 1.3rem; padding: 0 4px; border-radius: var(--r-pill); background: var(--purple); color: var(--ivory); font-size: 0.75rem; font-weight: 700; margin-left: 4px; vertical-align: 1px; }
.nav-count[hidden] { display: none; }
.q-save { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-3); border-top: 1px solid var(--line); padding-top: var(--s-3); }
.bills-wrap { display: grid; gap: var(--s-4); padding-bottom: var(--s-12); }
[data-bills-root] { display: grid; gap: var(--s-4); }
.bill-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s-3); }
.bill-head h2 { margin: 0; }
.bill-progress { height: 8px; background: var(--lavender-soft); border-radius: var(--r-pill); overflow: hidden; }
.bill-progress span { display: block; height: 100%; width: var(--w); background: var(--purple); }
.bill-next { background: var(--lavender-soft); border-left: 5px solid var(--purple); padding: var(--s-3) var(--s-4); border-radius: var(--r-sm); }
.bill-next.is-urgent { background: var(--danger-bg); border-left-color: var(--danger); }
.bill-next p { margin: var(--s-1) 0 0; }
.bill-dates { margin: 0; padding-left: 1.2em; font-size: var(--text-sm); }
.bill-steps { list-style: none; margin: 0; padding: 0; }
.bill-steps li { border-bottom: 1px solid var(--line); }
.bill-steps label { display: flex; gap: var(--s-3); align-items: center; padding: var(--s-3) 0; cursor: pointer; min-height: 44px; }
.bill-steps input { width: 1.3em; height: 1.3em; accent-color: var(--purple); flex: none; }
.bill-steps input:checked + span { text-decoration: line-through; color: var(--text-muted); }
.bill-add-card summary { cursor: pointer; }
.bill-add { margin-top: var(--s-3); }
.btn-wrap { white-space: normal; text-align: left; height: auto; padding-top: var(--s-2); padding-bottom: var(--s-2); }
