/* v0.32 · Shared semantic colour system. No route, permission or medical behaviour changes.
   Last in every shell. The generated bridge covers legacy colour declarations only. */
:root {
  color-scheme: light;
  --theme-bg:#F5F7FA; --theme-surface:#FFFFFF; --theme-raised:#EFF3F8;
  --theme-soft:#EAF1FA; --theme-input:#FFFFFF; --theme-border:#D9E2ED;
  --theme-border-strong:#70839A; --theme-text:#17283D; --theme-muted:#52657B;
  --theme-subtle:#63778E; --theme-accent:#145AC6; --theme-primary:#146BFA;
  --theme-primary-hover:#0754CE; --theme-accent-soft:#E8F1FF; --theme-focus:#146BFA;
  --theme-navy:#1E2F41; --theme-on-strong:#FFFFFF;
  --theme-lime:#CEF500; --theme-lime-ink:#25330B; --theme-lime-soft:#F0F7D8;
  --theme-danger:#AE243C; --theme-danger-soft:#FFF0F3; --theme-danger-border:#C16E7B;
  --theme-warning:#79510D; --theme-warning-soft:#FFF7E8; --theme-warning-border:#A77D36;
  --theme-success:#176454; --theme-success-soft:#E8F6F0; --theme-success-border:#518C7D;
  --theme-teal:#156C75; --theme-teal-soft:#E5F4F5;
  --theme-purple:#6551A7; --theme-purple-soft:#F0ECFA; --theme-shadow:0 12px 40px #182B4412;
}
@media screen {
  html[data-theme="dark"] {
    color-scheme:dark;
    --theme-bg:#0C1420; --theme-surface:#131F2F; --theme-raised:#1A2A3D;
    --theme-soft:#18283C; --theme-input:#0F1B2A; --theme-border:#30445C;
    --theme-border-strong:#69829D; --theme-text:#E8EFF7; --theme-muted:#B0C0D1;
    --theme-subtle:#9AADC3; --theme-accent:#91C2FF; --theme-primary:#2869D1;
    --theme-primary-hover:#1F5CBA; --theme-accent-soft:#1B3352; --theme-focus:#8DCEFF;
    --theme-navy:#172C45; --theme-on-strong:#F8FBFF;
    --theme-lime:#C6EA77; --theme-lime-ink:#15220C; --theme-lime-soft:#273720;
    --theme-danger:#FFB1BB; --theme-danger-soft:#381E2A; --theme-danger-border:#9F6176;
    --theme-warning:#F6CF8A; --theme-warning-soft:#342B1B; --theme-warning-border:#A38653;
    --theme-success:#9CDAC6; --theme-success-soft:#17352F; --theme-success-border:#5F9686;
    --theme-teal:#8DD5DD; --theme-teal-soft:#19343E;
    --theme-purple:#CCB9FF; --theme-purple-soft:#2B2546; --theme-shadow:0 14px 48px #00000040;
    --ink:var(--theme-text); --muted:var(--theme-muted); --link:var(--theme-accent);
    --paper:var(--theme-bg); --border:var(--theme-border); --pale-blue:var(--theme-accent-soft);
    --pale-cyan:var(--theme-teal-soft); --danger:var(--theme-danger); --danger-bg:var(--theme-danger-soft);
    --shadow:0 3px 14px #00000028;
  }
  html[data-theme] body{background:var(--theme-bg);color:var(--theme-text)}
  html[data-theme="dark"] :is(input,select,textarea){color:var(--theme-text);caret-color:var(--theme-text);color-scheme:dark}
  html[data-theme="dark"] :is(input,textarea)::placeholder{color:var(--theme-subtle);opacity:1}
  html[data-theme="dark"] :is(input,textarea):-webkit-autofill{-webkit-text-fill-color:var(--theme-text);box-shadow:0 0 0 1000px var(--theme-input) inset}
  html[data-theme="dark"] :is(a,button,summary,input,select,textarea,[tabindex]:not([tabindex="-1"])):focus-visible{outline:3px solid var(--theme-focus);outline-offset:3px}
  html[data-theme="dark"] ::selection{background:#355E87;color:#FFFFFF}
  html[data-theme="dark"] :is(input[type=checkbox],input[type=radio],progress){accent-color:var(--theme-primary)}
  html[data-theme="dark"] :is(select option,select optgroup){background:var(--theme-input);color:var(--theme-text)}
  html[data-theme="dark"] .hero{background:linear-gradient(115deg,#12263D,#1A3655);color:var(--theme-on-strong)}
  html[data-theme="dark"] .hero :is(h1,h2,h3,p){color:var(--theme-on-strong)}
  html[data-theme="dark"] .hero .eyebrow{color:#C6EA77}
  html[data-theme="dark"] :is(.button.lime,.button.cta,.hero .button:not(.secondary):not(.subtle)){background:var(--theme-lime);border-color:var(--theme-lime);color:var(--theme-lime-ink)}
  html[data-theme="dark"] :is(.button.lime,.hero .button:not(.secondary):not(.subtle)):hover{background:#D6F39D}
  html[data-theme="dark"] .site-footer{background:#101C2B;color:var(--theme-muted);border-top:1px solid var(--theme-border)}
  html[data-theme="dark"] .site-footer :is(a,strong,h2,h3,h4){color:var(--theme-text)}
  html[data-theme="dark"] .site-header{background:var(--theme-surface);border-color:var(--theme-border)}
  html[data-theme="dark"] .brand,html[data-theme="dark"] .brand-name{color:var(--theme-text)}
  html[data-theme="dark"] .brand-mark{color:var(--theme-accent)}
  html[data-theme="dark"] .brand-mark path[stroke="#1E2F41"]{stroke:var(--theme-text)}
  html[data-theme="dark"] .menu-toggle{background:var(--theme-surface);color:var(--theme-text);border-color:var(--theme-border-strong)}
  html[data-theme="dark"] #site-header .primary-nav .donate-nav-button{color:var(--theme-accent);border-color:var(--theme-border-strong);background:var(--theme-accent-soft)}
  html[data-theme="dark"] :is(.ad-stat.focus,.sec-stat-grid article:first-child){background:var(--theme-navy);border-color:var(--theme-border)}
  html[data-theme="dark"] .ad-sidebar nav button[aria-current="page"]{background:var(--theme-accent-soft);color:var(--theme-on-strong);box-shadow:inset 3px 0 var(--theme-lime)}
  html[data-theme="dark"] .ad-side-note strong{color:var(--theme-text)}
  html[data-theme="dark"] :is(.sec-tabs button[aria-current],.care-tabs button[aria-selected=true]){background:var(--theme-accent-soft);color:var(--theme-on-strong);border-color:var(--theme-border-strong)}
  html[data-theme="dark"] :is(th,td){border-color:var(--theme-border)}
  html[data-theme="dark"] :is(.sec-stat-grid article:first-child strong,.ad-stat.focus strong){color:var(--theme-lime)}
  /* Remembrance imagery is an intentional, fixed warm yellow—not an interface status. */
  html[data-theme="dark"] .bereavement-light{--light-color:#FFE600}
}
/* Shared appearance controls use semantic tokens in BOTH modes. */
.appearance-trigger{display:inline-flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;height:44px;min-width:44px;min-height:44px;margin:0;border:1px solid var(--theme-border);border-radius:50%;background:var(--theme-surface);color:var(--theme-muted);cursor:pointer;padding:10px;box-shadow:none}
.appearance-trigger:hover{background:var(--theme-accent-soft);color:var(--theme-accent);border-color:var(--theme-border-strong)}
.appearance-trigger svg{width:21px;height:21px;flex:none}
.appearance-trigger:focus-visible{outline:3px solid var(--theme-focus);outline-offset:3px}
.appearance-settings{color:var(--theme-text);background:var(--theme-surface);border:1px solid var(--theme-border);border-radius:18px;padding:28px;max-width:780px;margin:24px 0;box-sizing:border-box;text-align:left}
.appearance-heading h2{font-size:26px;line-height:1.2;letter-spacing:-.03em;margin:6px 0 10px;color:var(--theme-text)}
.appearance-heading p{font-size:14px;line-height:1.65;color:var(--theme-muted);margin:0 0 22px}
.appearance-eyebrow{font-size:10px;font-weight:750;letter-spacing:.1em;text-transform:uppercase;color:var(--theme-accent)}
.appearance-choices{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:12px;padding:0;border:0;margin:0 0 22px;min-width:0}
.appearance-choices legend{font-size:13px;font-weight:650;color:var(--theme-text);margin-bottom:12px;padding:0}
.appearance-choice{position:relative;display:flex;flex-direction:column;gap:8px;padding:12px;border:1px solid var(--theme-border-strong);border-radius:12px;background:var(--theme-surface);cursor:pointer;min-width:0;text-align:left;color:var(--theme-text)}
.appearance-choice:has(input:checked){border-color:var(--theme-accent);background:var(--theme-accent-soft);box-shadow:inset 0 0 0 1px var(--theme-accent)}
.appearance-choice:has(input:focus-visible){outline:3px solid var(--theme-focus);outline-offset:3px}
.appearance-choice input[type=radio]{position:absolute;top:16px;right:16px;width:17px;height:17px;min-width:17px;min-height:17px;padding:0;margin:0;z-index:1;accent-color:var(--theme-primary)}
.appearance-option-name{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:700;line-height:1.5;white-space:normal}
.appearance-option-name svg{width:16px;height:16px;flex:none}
.appearance-option-note{color:var(--theme-muted);font-size:11px;line-height:1.4}
.appearance-mini{height:72px;border:1px solid #8295AC;border-radius:7px;padding:8px;background:#F5F7FA;display:block;position:relative;overflow:hidden}
.appearance-mini>span{display:block;width:36%;height:5px;border-radius:3px;background:#687C96;margin-bottom:10px}
.appearance-mini>i{display:block;height:19px;width:75%;border-radius:4px;background:#1E2F41;margin-bottom:7px}
.appearance-mini>b{display:block;width:52%;height:7px;border-radius:3px;background:#DAE4F0}
.appearance-mini-dark{background:#0C1420}.appearance-mini-dark>span{background:#ABC0DA}.appearance-mini-dark>i{background:#2E4B6B}.appearance-mini-dark>b{background:#617A99}
.appearance-mini-auto{background:linear-gradient(90deg,#F5F7FA 50%,#0C1420 50%)}.appearance-mini-auto>i{background:linear-gradient(90deg,#1E2F41 56%,#2E4B6B 56%)}
.appearance-schedule{display:flex;align-items:flex-start;gap:12px;background:var(--theme-raised);border-radius:10px;padding:16px;margin-bottom:18px;font-size:12px;line-height:1.6}
.appearance-schedule>span{color:var(--theme-accent);flex:0 0 19px}.appearance-schedule svg{width:19px;height:19px}
.appearance-schedule strong{font-size:12px;color:var(--theme-text);font-weight:650}.appearance-schedule p{color:var(--theme-muted);margin:5px 0 8px;font-size:12px}
.appearance-schedule small{color:var(--theme-subtle);font-size:11px}
.appearance-remember{display:flex;align-items:flex-start;gap:12px;min-height:44px;font-size:13px;font-weight:600;line-height:1.6;cursor:pointer;color:var(--theme-text)}
.appearance-remember input[type=checkbox]{flex:0 0 18px;width:18px;height:18px;min-width:18px;min-height:18px;padding:0;margin:3px 0 0;accent-color:var(--theme-primary)}
.appearance-remember small{display:block;font-size:11px;font-weight:400;color:var(--theme-muted);margin-top:3px}
.appearance-storage{font-size:11px;color:var(--theme-muted);margin:10px 0 18px;line-height:1.65}
.appearance-bottom{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;padding-top:14px;border-top:1px solid var(--theme-border)}
.appearance-current{font-size:11px;font-weight:650;color:var(--theme-accent)}
.appearance-reset,.appearance-close{min-height:44px;border:1px solid var(--theme-border-strong);border-radius:9px;background:var(--theme-surface);color:var(--theme-text);padding:8px 12px;font:inherit;font-size:12px;cursor:pointer}
.appearance-reset:hover,.appearance-close:hover{background:var(--theme-raised)}
.appearance-dialog{color:var(--theme-text);background:var(--theme-surface);border:1px solid var(--theme-border-strong);border-radius:20px;padding:52px 0 0;width:min(590px,calc(100% - 32px));max-width:calc(100% - 32px);max-height:calc(100dvh - 32px);overflow:auto;box-shadow:var(--theme-shadow)}
.appearance-dialog:not([open]){display:none}
.appearance-dialog::backdrop{background:rgba(3,10,20,.66)}
.appearance-dialog .appearance-settings{border:0;margin:0;padding:0 28px 26px;box-shadow:none;border-radius:0}
.appearance-close{position:absolute;right:18px;top:10px;border:0;min-height:38px;font-size:12px;color:var(--theme-muted)}
.appearance-live.sr-only{position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important}
@media(min-width:851px) and (max-width:1500px){#site-header:has(.appearance-trigger) .header-search{display:none}#site-header:has(.appearance-trigger) .header-inner{gap:16px}#site-header:has(.appearance-trigger) .header-utilities{gap:8px}}
@media(max-width:850px){.site-header .header-inner{flex-wrap:wrap}.site-header .header-inner>.appearance-trigger{margin-left:auto}.ad-header nav{flex-wrap:wrap;gap:12px}.ad-header .container{width:calc(100% - 32px)}.site-header:has(.appearance-trigger) .header-utilities{gap:8px}}
@media(max-width:480px){.appearance-settings{padding:20px 16px}.appearance-dialog{width:calc(100% - 20px);max-width:calc(100% - 20px);max-height:calc(100dvh - 20px)}.appearance-dialog .appearance-settings{padding:0 18px 20px}.appearance-choices{gap:8px}.appearance-choice{padding:9px}.appearance-option-name{font-size:11px;gap:4px}.appearance-option-note{font-size:10px}.appearance-mini{height:62px;padding:7px}.appearance-choice input[type=radio]{top:13px;right:13px}.appearance-option-name svg{width:14px;height:14px}.appearance-schedule{padding:13px;gap:9px}.appearance-heading h2{font-size:24px}}
@media(prefers-reduced-motion:reduce){.appearance-settings *,.appearance-dialog,.appearance-trigger{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
@media(forced-colors:active){:root,html[data-theme="dark"]{color-scheme:light dark;--theme-bg:Canvas;--theme-surface:Canvas;--theme-raised:Canvas;--theme-soft:Canvas;--theme-input:Field;--theme-border:ButtonBorder;--theme-border-strong:ButtonBorder;--theme-text:CanvasText;--theme-muted:CanvasText;--theme-subtle:CanvasText;--theme-accent:LinkText;--theme-primary:Highlight;--theme-accent-soft:Canvas;--theme-focus:Highlight}.appearance-choice:has(input:checked){outline:2px solid Highlight;outline-offset:-3px}.appearance-mini{display:none}.appearance-trigger{border:1px solid ButtonText}.appearance-dialog{border:2px solid ButtonText}.appearance-current{color:CanvasText}}
@media print {
  :root,html[data-theme="dark"]{color-scheme:light;--ink:#000;--muted:#333;--paper:#fff;--white:#fff;--border:#bbb;--link:#000;--theme-bg:#fff;--theme-surface:#fff;--theme-text:#000;--theme-muted:#333;--theme-accent:#000}
  .appearance-trigger,.appearance-settings,.appearance-dialog{display:none!important}
  html[data-theme] body{background:white!important;color:black!important}
}

/* The established phone header hides utilities; provide the same control in its menu. */
.appearance-mobile-open{display:none}
@media screen and (max-width:600px){.primary-nav.open .appearance-mobile-open{display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:9px 13px;border:1px solid var(--theme-border-strong);border-radius:10px;color:var(--theme-text);background:var(--theme-surface);font:inherit;font-size:13px}.appearance-mobile-open svg{width:18px;height:18px}}
@media print{.appearance-mobile-open{display:none!important}}
