/* Health declarations (health-declaration.js, health-review-ui.js).
   B "Brand Bold" on /apply and in the member portal; C "Night Shift" for staff. Every rule is scoped to its
   experience, uses tokens (both themes follow html[data-theme]) and pairs its colour with its background. */

/* ---------- The health step on /apply (B) ---------- */
/* Four steps once the health step is there (application-steps.js). */
html[data-experience=brand] #application-form .step-progress:has(>span:nth-child(4)){grid-template-columns:repeat(4,minmax(0,1fr))}
html[data-experience=brand] #application-form .health-section{margin:0;padding:28px;border:1.5px solid var(--b-line);border-radius:20px;background:var(--b-sunken);color:var(--b-ink)}
html[data-experience=brand] #application-form .health-section h3{margin:0 0 6px;background:transparent;color:var(--b-ink);font:800 24px/30px var(--b-display);letter-spacing:-.02em}
html[data-experience=brand] #application-form .health-section :is(.health-lead,.health-people-lead,.health-hint,.health-scope){margin:0 0 16px;background:transparent;color:var(--b-ink-2);font:400 15px/1.6 var(--b-body)}
html[data-experience=brand] #application-form .health-section label{display:block;min-width:0;margin:0;background:transparent;color:var(--b-ink);font:600 15px/1.4 var(--b-body)}
html[data-experience=brand] #application-form .health-question{margin:0;padding:0;border:0;min-width:0}
html[data-experience=brand] #application-form .health-question legend{padding:0;margin:0 0 12px;background:transparent;color:var(--b-ink);font:700 17px/1.45 var(--b-body)}
html[data-experience=brand] #application-form .health-choices{display:flex;flex-wrap:wrap;gap:12px}
html[data-experience=brand] #application-form .health-section label.health-choice{display:inline-flex;align-items:center;gap:10px;min-height:52px;min-width:120px;padding:0 20px;border:1.5px solid var(--b-line-strong);border-radius:var(--b-r-pill);background:var(--b-surface);color:var(--b-ink);font:700 16px/1 var(--b-body);cursor:pointer}
html[data-experience=brand] #application-form .health-section label.health-choice:has(input:checked){border-color:var(--b-brand);background:var(--b-mist);color:var(--b-ink)}
html[data-experience=brand] #application-form .health-section label.health-choice:has(.field-error){flex-wrap:wrap;padding:12px 20px;border-color:var(--b-bad-ink);background:var(--b-surface);color:var(--b-ink)}
html[data-experience=brand] #application-form .health-section label.health-choice .field-error{flex:1 0 100%;margin:0;background:transparent;color:var(--b-bad-ink);font:600 13px/1.5 var(--b-body)}
html[data-experience=brand] #application-form .health-section input[type=radio]{width:22px;height:22px;margin:0;accent-color:var(--b-brand);cursor:pointer}
html[data-experience=brand] #application-form .health-list{margin:18px 0 0;padding:14px 18px;border:1.5px solid var(--b-line);border-radius:var(--b-r-card-sm);background:var(--b-surface);color:var(--b-ink-2);font:400 14px/1.6 var(--b-body)}
html[data-experience=brand] #application-form .health-section summary{min-height:44px;padding:10px 0;background:transparent;color:var(--b-link);font:700 15px/24px var(--b-body);cursor:pointer}
html[data-experience=brand] #application-form .health-list ul{margin:10px 0 0;padding-left:20px}
html[data-experience=brand] #application-form .health-list b{background:transparent;color:var(--b-ink)}
html[data-experience=brand] #application-form .health-exclusion{margin:16px 0 0;padding:14px 18px;border:1.5px solid var(--b-warn-edge);border-radius:var(--b-r-card-sm);background:var(--b-warn-bg);color:var(--b-warn-ink);font:600 14px/1.6 var(--b-body)}
html[data-experience=brand] #application-form .health-people{margin-top:24px}
html[data-experience=brand] #application-form .health-person{min-width:0;margin:20px 0 0;padding:20px;border:1.5px solid var(--b-line);border-radius:var(--b-r-card-sm);background:var(--b-surface);color:var(--b-ink)}
html[data-experience=brand] #application-form .health-person legend{padding:0 6px;background:transparent;color:var(--b-ink);font:800 17px/1.3 var(--b-display)}
html[data-experience=brand] #application-form .health-conditions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px 16px}
html[data-experience=brand] #application-form .health-section label.health-check{display:flex;align-items:flex-start;gap:10px;min-height:44px;padding:10px 12px;border:1.5px solid var(--b-line);border-radius:var(--b-r-control);background:var(--b-page);color:var(--b-ink);font:500 15px/1.4 var(--b-body);cursor:pointer}
html[data-experience=brand] #application-form .health-section label.health-check:has(input:checked){border-color:var(--b-brand);background:var(--b-mist);color:var(--b-ink)}
html[data-experience=brand] #application-form .health-section .health-pregnant{margin-top:16px}
html[data-experience=brand] #application-form :is(.health-other,.health-delivery){margin-top:14px}
html[data-experience=brand] #application-form .health-block{margin-top:18px}
html[data-experience=brand] #application-form .health-block-title{margin:0 0 8px;background:transparent;color:var(--b-ink);font:700 15px/1.4 var(--b-body)}
html[data-experience=brand] #application-form .health-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;margin:0 0 12px}
html[data-experience=brand] #application-form .health-row label{font-weight:500;font-size:14px}
html[data-experience=brand] #application-form .health-section button.health-add{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 20px;border:2px solid var(--b-brand);border-radius:var(--b-r-pill);background:var(--b-surface);color:var(--b-link);font:700 14px/1 var(--b-body);cursor:pointer}
html[data-experience=brand] #application-form .health-section button.health-add:hover{background:var(--b-mist);color:var(--b-link)}
html[data-experience=brand] #application-form .health-section button.health-add:disabled{opacity:.55;cursor:not-allowed}
html[data-experience=brand] #application-form .health-consent{margin-top:20px}
html[data-experience=brand] #application-form .health-declaration-text{padding:14px 18px;border:1.5px solid var(--b-line);border-radius:var(--b-r-card-sm);background:var(--b-surface);color:var(--b-ink-2);font:400 14px/1.6 var(--b-body)}
html[data-experience=brand] #application-form .health-declaration-text ol{margin:10px 0 0;padding-left:22px}
html[data-experience=brand] #application-form .health-declaration-text li{margin:0 0 6px}
@media (max-width:640px){
 html[data-experience=brand] #application-form .step-progress:has(>span:nth-child(4)) span{padding:8px 4px;font-size:12px}
 html[data-experience=brand] #application-form .health-section{padding:20px 16px}
 html[data-experience=brand] #application-form .health-person{padding:16px 12px}
 html[data-experience=brand] #application-form :is(.health-conditions,.health-row){grid-template-columns:minmax(0,1fr)}
 html[data-experience=brand] #application-form .health-row{padding-bottom:12px;border-bottom:1px solid var(--b-line)}
}

/* ---------- The same section in a capture form (#create-form): member portal (B) ---------- */
html[data-experience=brand] body dialog .health-section{margin:20px 0;padding:20px;border:1px solid var(--b-line);border-radius:20px;background:var(--b-sunken);color:var(--b-ink)}
html[data-experience=brand] body dialog .health-section h3{margin:0 0 6px;background:transparent;color:var(--b-ink);font:800 20px/1.3 var(--b-display)}
html[data-experience=brand] body dialog .health-section :is(.health-lead,.health-people-lead,.health-hint,.health-scope,.health-declaration-text){background:transparent;color:var(--b-ink-2);font-size:14px;line-height:1.6}
html[data-experience=brand] body dialog .health-section :is(fieldset.health-person){margin:14px 0 0;padding:14px;border:1px solid var(--b-line);border-radius:16px;background:var(--b-surface);color:var(--b-ink)}
html[data-experience=brand] body dialog .health-section legend{padding:0 6px;background:transparent;color:var(--b-ink);font-weight:700}
html[data-experience=brand] body dialog .health-section .health-exclusion{padding:12px 14px;border:1px solid var(--b-warn-edge);border-radius:12px;background:var(--b-warn-bg);color:var(--b-warn-ink);font-weight:600;font-size:14px}
html[data-experience=brand] body dialog .health-section summary{min-height:44px;padding:10px 0;background:transparent;color:var(--b-link);font-weight:700;line-height:24px;cursor:pointer}

/* ---------- The same section in a capture form (#create-form): staff and agents (C) ---------- */
html[data-experience=console] .health-section{margin:16px 0;padding:16px;border:1px solid var(--c-line);border-radius:var(--c-r-panel);background:var(--c-raised);color:var(--c-ink)}
html[data-experience=console] .health-section h3{margin:0 0 4px;background:transparent;color:var(--c-ink);font:600 15px/1.4 var(--c-sans)}
html[data-experience=console] .health-section :is(.health-lead,.health-people-lead,.health-hint,.health-scope,.health-block-title){margin:0 0 10px;background:transparent;color:var(--c-ink-2);font-size:13px;line-height:1.55}
html[data-experience=console] .health-section :is(fieldset.health-question,fieldset.health-person){min-width:0;margin:10px 0 0;padding:12px;border:1px solid var(--c-line);border-radius:var(--c-r-control);background:var(--c-surface);color:var(--c-ink)}
html[data-experience=console] .health-section legend{padding:0 4px;background:transparent;color:var(--c-ink);font:600 13px/1.4 var(--c-sans)}
html[data-experience=console] .health-section label{display:block;min-width:0;background:transparent;color:var(--c-ink);font-size:13px}
html[data-experience=console] .health-section :is(input:not([type=radio]):not([type=checkbox]),select,textarea){display:block;width:100%;margin-top:4px}
html[data-experience=console] .health-section .health-people-lead{margin-top:12px}
html[data-experience=console] .health-section :is(label.health-choice,label.health-check){display:flex;align-items:center;gap:8px;min-height:36px;padding:6px 10px;border:1px solid var(--c-line);border-radius:var(--c-r-control);background:var(--c-surface);color:var(--c-ink);cursor:pointer}
html[data-experience=console] .health-section :is(label.health-choice,label.health-check):has(input:checked){border-color:var(--c-blue);background:var(--c-selected);color:var(--c-ink)}
html[data-experience=console] .health-section .health-choices{display:flex;flex-wrap:wrap;gap:8px}
html[data-experience=console] .health-section label.health-choice .field-error{flex:1 0 100%;margin:0;background:transparent;color:var(--c-red);font-size:12px}
html[data-experience=console] .health-section label.health-choice:has(.field-error){flex-wrap:wrap}
html[data-experience=console] .health-section .health-conditions{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:6px}
html[data-experience=console] .health-section .health-row{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin:0 0 8px}
html[data-experience=console] .health-section :is(.health-block,.health-other,.health-delivery,.health-pregnant,.health-consent){margin-top:10px}
html[data-experience=console] .health-section .health-exclusion{margin:10px 0 0;padding:8px 10px;border:1px solid var(--tone-warn-edge);border-radius:var(--c-r-control);background:var(--c-amber-tint);color:var(--tone-warn-ink);font-size:13px}
html[data-experience=console] .health-section :is(.health-list,.health-declaration-text){margin-top:10px;padding:8px 10px;border:1px solid var(--c-line);border-radius:var(--c-r-control);background:var(--c-surface);color:var(--c-ink-2);font-size:13px;line-height:1.55}
html[data-experience=console] .health-section summary{background:transparent;color:var(--c-blue);font-weight:600;cursor:pointer}
html[data-experience=console] .health-section :is(.health-list ul,.health-declaration-text ol){margin:8px 0 0;padding-left:20px}
html[data-experience=console] .health-section .health-add{min-height:32px;padding:4px 12px;border:1px solid var(--c-line-strong);border-radius:var(--c-r-control);background:var(--c-surface);color:var(--c-ink);font:500 13px var(--c-sans);cursor:pointer}
html[data-experience=console] .health-section .health-add:hover{border-color:var(--c-blue);background:var(--c-selected);color:var(--c-ink)}
html[data-experience=console] .health-section .req{background:transparent;color:var(--c-red)}
@media (max-width:640px){
 html[data-experience=console] .health-section .health-row{grid-template-columns:minmax(0,1fr)}
 html[data-experience=console] .health-section :is(label.health-choice,label.health-check){min-height:44px}
}

/* ---------- Health review workspace, application and claim panels (C) ---------- */
html[data-experience=console] .health-tabs{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
html[data-experience=console] .health-tabs .health-count{display:inline-block;min-width:20px;margin-left:6px;padding:0 6px;border-radius:999px;background:var(--c-neutral-tint);color:var(--c-ink);font:600 12px/20px var(--c-mono);text-align:center}
html[data-experience=console] .health-toolbar{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
html[data-experience=console] :is(.health-plan-chip,.plan-review-chip){display:inline-block;margin-top:4px;padding:2px 8px;border:1px solid var(--tone-warn-edge);border-radius:999px;background:var(--c-amber-tint);color:var(--tone-warn-ink);font:600 12px/1.5 var(--c-sans)}
html[data-experience=console] .health-panel :is(.health-empty,.health-footnote,.health-meta p){background:transparent;color:var(--c-ink-2)}
html[data-experience=console] .health-panel h2{margin:4px 0 8px;background:transparent;color:var(--c-ink)}
html[data-experience=console] .health-panel h3{margin:18px 0 8px;background:transparent;color:var(--c-ink);font:600 15px/1.4 var(--c-sans)}
html[data-experience=console] .health-meta{margin:12px 0;padding:10px 12px;border:1px solid var(--c-line);border-radius:var(--c-r-control);background:var(--c-raised);color:var(--c-ink)}
html[data-experience=console] .health-meta p{margin:0 0 4px}
html[data-experience=console] .health-people-list{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:12px}
html[data-experience=console] .health-person-card{min-width:0;padding:12px;border:1px solid var(--c-line);border-radius:var(--c-r-panel);background:var(--c-surface);color:var(--c-ink)}
html[data-experience=console] .health-person-card :is(h4,h5){margin:0 0 8px;background:transparent;color:var(--c-ink);font:600 14px/1.4 var(--c-sans)}
html[data-experience=console] .health-person-card h5{margin-top:10px;font-size:13px;background:transparent;color:var(--c-ink-2)}
html[data-experience=console] .health-person-card .sub{background:transparent;color:var(--c-muted);font-weight:400}
html[data-experience=console] .health-tags{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none}
html[data-experience=console] .health-tags li{padding:2px 8px;border:1px solid var(--tone-blue-edge);border-radius:999px;background:var(--c-blue-tint);color:var(--c-ink);font-size:12px}
html[data-experience=console] .health-rows-table{width:100%;font-size:13px}
html[data-experience=console] .health-decision{margin:16px 0 0;padding:12px;border:1px solid var(--c-line-strong);border-radius:var(--c-r-panel);background:var(--c-raised);color:var(--c-ink)}
html[data-experience=console] :is(.health-decision,.health-plan-form) fieldset{margin:0 0 10px;padding:0;border:0;min-width:0}
html[data-experience=console] :is(.health-decision,.health-plan-form) legend{margin:0 0 6px;padding:0;background:transparent;color:var(--c-ink);font:600 13px/1.4 var(--c-sans)}
html[data-experience=console] :is(.health-decision,.health-plan-form,.health-access-form) label{display:block;min-width:0;margin:0 0 8px;background:transparent;color:var(--c-ink);font-size:13px}
html[data-experience=console] :is(.health-decision,.health-plan-form) .health-choices{display:flex;flex-wrap:wrap;gap:8px}
html[data-experience=console] :is(.health-decision,.health-plan-form) label.health-choice{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:4px 14px;border:1px solid var(--c-line);border-radius:var(--c-r-control);background:var(--c-surface);color:var(--c-ink);cursor:pointer}
html[data-experience=console] :is(.health-decision,.health-plan-form) label.health-choice:has(input:checked){border-color:var(--c-blue);background:var(--c-selected);color:var(--c-ink)}
html[data-experience=console] .health-form-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
html[data-experience=console] :is(.health-decision,.health-plan-form,.health-access-form) :is(input:not([type=radio]):not([type=checkbox]),select,textarea){display:block;width:100%;margin-top:4px}
html[data-experience=console] :is(.health-rows-table,.health-queue) :is(th,td){white-space:normal}
html[data-experience=console] .health-plan-form{margin-top:8px}
html[data-experience=console] .health-plan-line{margin:0 0 8px;background:transparent;color:var(--c-ink)}
html[data-experience=console] .health-history{margin:0;padding-left:20px}
html[data-experience=console] .health-history li{margin:0 0 10px;background:transparent;color:var(--c-ink-2)}
html[data-experience=console] .health-history p{margin:4px 0 0;background:transparent;color:var(--c-ink)}
html[data-experience=console] .health-claim{margin:12px 0;padding:14px;border:1px solid var(--c-line);border-radius:var(--c-r-panel);background:var(--c-surface);color:var(--c-ink)}
html[data-experience=console] .health-claim h3{margin:0 0 8px;background:transparent;color:var(--c-ink);font:600 15px/1.4 var(--c-sans)}
html[data-experience=console] .health-patient{margin:0 0 8px;padding:8px;border-left:3px solid var(--c-blue);background:var(--c-blue-tint);color:var(--c-ink)}
html[data-experience=console] .health-exclusion-check{display:flex;align-items:center;gap:8px;margin-top:8px;padding:6px 10px;border:1px solid var(--tone-warn-edge);border-radius:var(--c-r-control);background:var(--c-amber-tint);color:var(--c-ink);font-size:13px;cursor:pointer}
html[data-experience=console] .health-application :is(p,.small){background:transparent;color:var(--c-ink-2)}
/* A corrected declaration (health-review-ui.js healthCorrectionForm). Its own fields only (child combinators): the
   questions inside it are the .health-section above, styled as in a capture form. */
html[data-experience=console] .health-correction{margin:16px 0 0;padding:12px;border:1px solid var(--c-line-strong);border-radius:var(--c-r-panel);background:var(--c-raised);color:var(--c-ink)}
html[data-experience=console] .health-correction>h3{margin:0 0 6px;background:transparent;color:var(--c-ink);font:600 15px/1.4 var(--c-sans)}
html[data-experience=console] .health-correction>:is(p,.small){background:transparent;color:var(--c-ink-2)}
html[data-experience=console] .health-correction>fieldset{margin:10px 0;padding:0;border:0;min-width:0}
html[data-experience=console] .health-correction>fieldset>legend{margin:0 0 6px;padding:0;background:transparent;color:var(--c-ink);font:600 13px/1.4 var(--c-sans)}
html[data-experience=console] .health-correction>fieldset .health-choices{display:flex;flex-wrap:wrap;gap:8px}
html[data-experience=console] .health-correction>fieldset label.health-choice{display:inline-flex;align-items:center;gap:8px;min-height:36px;padding:4px 14px;border:1px solid var(--c-line);border-radius:var(--c-r-control);background:var(--c-surface);color:var(--c-ink);font-size:13px;cursor:pointer}
html[data-experience=console] .health-correction>fieldset label.health-choice:has(input:checked){border-color:var(--c-blue);background:var(--c-selected);color:var(--c-ink)}
html[data-experience=console] .health-correction>label{display:block;min-width:0;margin:0 0 8px;background:transparent;color:var(--c-ink);font-size:13px}
html[data-experience=console] .health-correction>label textarea{display:block;width:100%;margin-top:4px}
html[data-experience=console] .health-correction>.health-toolbar{margin:12px 0 0}
html[data-experience=console] .health-correct-slot{margin-top:16px}
/* A declaration corrected after joining: dated, beside the one made at joining (Health review and the claim panel). */
html[data-experience=console] .health-late{margin:12px 0;padding:10px 12px;border:1px solid var(--tone-warn-edge);border-radius:var(--c-r-control);background:var(--c-amber-tint);color:var(--tone-warn-ink)}
html[data-experience=console] .health-late :is(h4,p){margin:0 0 4px;background:transparent;color:var(--tone-warn-ink)}
html[data-experience=console] .health-late h4{font:600 14px/1.4 var(--c-sans)}
@media (max-width:640px){
 html[data-experience=console] .health-correction>fieldset label.health-choice{min-height:44px}
}
html[data-experience=console] .health-access-table form{display:grid;grid-template-columns:minmax(160px,1fr) minmax(200px,1.4fr) auto;gap:8px;align-items:end;min-width:420px}
html[data-experience=console] .health-access-table form .form-error{grid-column:1/-1;margin:0}
html[data-experience=console] .health-access-history{margin-top:12px;background:transparent;color:var(--c-ink-2);font-size:13px}
html[data-experience=console] .health-access-history summary{background:transparent;color:var(--c-blue);font-weight:600;cursor:pointer}
@media (max-width:800px){
 html[data-experience=console] :is(.health-form-row,.health-access-table form){grid-template-columns:minmax(0,1fr)}
 html[data-experience=console] .health-people-list{grid-template-columns:minmax(0,1fr)}
}

/* ---------- The member's own view, their application and their claim (B) ---------- */
html[data-experience=brand] :is(.health-own,.health-application) :is(h2,h3,h4){background:transparent;color:var(--b-ink)}
html[data-experience=brand] :is(.health-own,.health-application) :is(p,.small){background:transparent;color:var(--b-ink-2)}
html[data-experience=brand] .health-own-application{margin-top:16px;padding-top:16px;border-top:1px solid var(--b-line);background:transparent;color:var(--b-ink)}
html[data-experience=brand] .health-person-card{min-width:0;margin:12px 0 0;padding:14px 16px;border:1px solid var(--b-line);border-radius:16px;background:var(--b-sunken);color:var(--b-ink)}
html[data-experience=brand] .health-person-card :is(h4,h5){margin:0 0 8px;background:transparent;color:var(--b-ink)}
html[data-experience=brand] .health-person-card .sub{background:transparent;color:var(--b-muted);font-weight:400}
html[data-experience=brand] .health-tags{display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0;list-style:none}
html[data-experience=brand] .health-tags li{padding:4px 10px;border:1px solid var(--b-info-edge);border-radius:999px;background:var(--b-info-bg);color:var(--b-info-ink);font-size:13px;font-weight:600}
html[data-experience=brand] .health-rows-table{width:100%;font-size:14px}
html[data-experience=brand] .health-rows-table :is(th,td){white-space:normal;overflow-wrap:anywhere}
html[data-experience=brand] .health-plan-line{margin:0 0 8px;background:transparent;color:var(--b-ink)}
html[data-experience=brand] :is(.health-plan-chip,.plan-review-chip){display:inline-block;margin-top:4px;padding:2px 10px;border:1px solid var(--b-warn-edge);border-radius:999px;background:var(--b-warn-bg);color:var(--b-warn-ink);font-size:12px;font-weight:600}
html[data-experience=brand] .health-member-exclusion{margin:10px 0;padding:12px 14px;border:1px solid var(--b-warn-edge);border-radius:12px;background:var(--b-warn-bg);color:var(--b-warn-ink);line-height:1.6}
