/* EMOD App — accessibility layer (audit of 6 Oct 2026). Loaded LAST so it wins over the tool stylesheets.
   Tap targets: 44 × 44 CSS px (Apple's minimum) for every control a person uses with a gloved or hurried finger.
   Focus: a visible ring for keyboard, switch control and external-keyboard users; mouse and touch see nothing new.
   Re-run the audit after a design change: [C] Tests/a11y-audit.js. */

/* a visible focus ring, only for keyboard-style focus */
:focus-visible { outline: 3px solid var(--teal); outline-offset: 2px; border-radius: 6px; }
.search:focus-within { box-shadow: 0 0 0 3px var(--teal); }
.pd-in input:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

/* text only for screen readers */
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* top bar */
.top .theme-btn, .theme-btn { width: 44px; height: 44px; }
.top .strike-chip, .strike-chip { min-height: 44px; }
.brand { min-height: 44px; }

/* links that are really buttons */
.back { min-height: 44px; padding-top: 4px; padding-bottom: 4px; }
.h-row a, .link-btn { display: inline-flex; align-items: center; min-height: 44px; padding: 0 6px; margin: -10px -6px; }

/* the controls used mid-task */
.opt { min-height: 44px; align-items: center; }
.seg button { min-height: 44px; }
.cb-input, input[type="text"], input[type="number"], input[type="email"], input[type="password"], input[type="search"], input[type="month"], input[type="date"], select { min-height: 44px; }
.search input { min-height: 40px; }
.cb-ico { width: 44px; height: 44px; }
.bd-clock { min-height: 44px; }
.mt-opts button { min-height: 44px; }
.rt-no, .rt-leave { min-height: 40px; }
.rt-del { width: 40px; height: 40px; }
.rt-name { min-height: 40px; }
.btn { min-height: 44px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  /* the critical Code Blue prompt keeps its red background and text; only the pulse stops */
}

/* headings and the main area receive focus on navigation for screen readers; they are not controls */
[tabindex="-1"]:focus { outline: none; }
h1.cb-title { font-size: 13px; }

/* second pass */
.top .theme-btn, .theme-btn { flex: none; min-width: 44px; }
.h-row a, .back { min-width: 44px; }
.cr-pick button, .cr-multi button, .ask-ex button { min-height: 44px; }
.rt-no, .rt-leave, .rt-del, .rt-name { min-height: 44px; }
.rt-del { width: 44px; height: 44px; }
.ld-i { position: relative; }
.ld-i::after { content: ""; position: absolute; inset: -10px; }   /* 24 px icon, 44 px tap area */

/* third pass: the paediatric section jump links, leave chips' remove buttons, rota day toggles */
.pd-nav a { min-height: 44px; display: inline-flex; align-items: center; }
.rt-lv button { min-width: 32px; min-height: 32px; }
#rt-days .sel, .rt-days button { min-width: 44px; }

/* dark mode: colours that were fixed for light backgrounds */
@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .sc-gate { color: #f3d9a4; border-color: #5a4720; }
  html:not([data-theme="light"]) .cb-title { color: #ff8a80; }
  html:not([data-theme="light"]) .cb-rhythms .rb.rosc.cur { background: #1e7d3c; border-color: #1e7d3c; color: #fff; }
  html:not([data-theme="light"]) .cb-actions .ab.amio { background: #166a93; }
}
html[data-theme="dark"] .sc-gate { color: #f3d9a4; border-color: #5a4720; }
html[data-theme="dark"] .cb-title { color: #ff8a80; }
html[data-theme="dark"] .cb-rhythms .rb.rosc.cur { background: #1e7d3c; border-color: #1e7d3c; color: #fff; }
html[data-theme="dark"] .cb-actions .ab.amio { background: #166a93; }

/* the 44-px top-bar buttons must never push the strike chip off a narrow phone: the brand gives way instead */
.top .brand { flex: 1 1 auto; min-width: 0; overflow: hidden; }
.top .brand-text { min-width: 0; }
.top .brand-text small { overflow: hidden; text-overflow: ellipsis; }
.top .find-btn { margin-inline-start: 6px; }
.top .find-btn + .theme-btn, .top .strike-chip { margin-inline-start: 4px; flex: none; }

/* the two account buttons share the row evenly; "Sign in" must not wrap */
#btn-signup, #btn-signin, #ask-signin, #ask-signup { flex: 1 1 0; width: auto; white-space: nowrap; padding-left: 10px; padding-right: 10px; }
