/* Care Core: the accessibility layer. Loaded LAST on every page, so it wins over app.css, the suite kit and the page stylesheets.
   `python3 tests/tools/a11y_audit.py` checks every page against it: keep that at 0 problems.
   Colour: text meets the enhanced 7:1 contrast. Targets: anything pressed is at least 24px, and buttons and fields are 44px.
   Focus: a 3px outline with a gap, light on dark surfaces. Reflow: nothing scrolls sideways at 320px. */
:root { --muted: var(--ink-soft, #2f484b); --focus: #3f2766; }
.muted, .hint, .small.muted, .eyebrow { color: var(--ink-soft, #2f484b); }
::placeholder { color: #4b5d60; opacity: 1; }
main:focus { outline: none; }
a, button, input, select, textarea, summary, [tabindex]:not([tabindex="-1"]) { scroll-margin-top: 5rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.btn, a.btn, button.btn, button, .btn-sm, input[type="submit"] { min-height: 44px; }
input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]), select { min-height: 44px; }
input[type="checkbox"], input[type="radio"] { width: max(1.5rem, 24px); height: max(1.5rem, 24px); flex: none; accent-color: var(--ink, #0d2b2e); }
td a, th a, dd a, dt a, li > a:only-child, .who, .more, summary { display: inline-block; min-height: 24px; min-width: 24px; }
body { overflow-wrap: break-word; }
code, pre { overflow-wrap: anywhere; }
@media (forced-colors: active) { :focus-visible { outline: 3px solid Highlight; } }
/* A link that stands on its own (not inside a sentence) is a target in its own right: at least 24px high. */
:where(div, section, header, footer, nav, aside, article, form, fieldset, h1, h2, h3, h4, .demo-banner, .topbar) > a { display: inline-block; min-height: 24px; min-width: 24px; }
table.list .btn, .row-actions .btn { min-height: 44px; }
.stats a:focus-visible { outline: 3px solid var(--focus); outline-offset: -3px; }
/* On the dark bands (top bar, demonstration notice, footer) muted text and the focus outline must be light to be seen. */
footer .muted, footer .small, .topbar .muted, .demo-banner .muted { color: #dfe7e7; }
.topbar :focus-visible, .demo-banner :focus-visible, footer :focus-visible { outline-color: #fff; }
body .demo-banner a, body .demo-banner a.demo-banner__back { display: inline-block; min-height: 24px; padding-block: .15rem; }
.sitefoot .muted, .sitefoot .small, .sitefoot a { color: #dfe7e7; }
.sitefoot :focus-visible { outline-color: #fff; }
h2.h3 { font-size: 1.17em; }   /* a heading that must be second-level for the outline but reads as a third-level one */
strong > a, .plainlist a { display: inline-block; min-height: 24px; }
/* Tables: View::tables() puts each in a box that scrolls sideways by itself. Relative, so text hidden for screen readers inside it cannot widen the page. */
.tablescroll, .tablewrap { overflow-x: auto; position: relative; max-width: 100%; }
.tablescroll { margin: 0; }
.row-actions span > a { display: inline-block; min-height: 24px; }
/* Reflow at 320px (and with a reader's own text spacing): a box inside a row or grid may shrink below its contents, long words and
   addresses may break, and a button's words may wrap. Without these a single long email address pushes the page sideways. */
main :where(div, section, article, form, fieldset, dl, dt, dd, li, ul, ol, header) { min-width: 0; }
h1, h2, h3, h4, p, li, dd, dt, a, label, legend, .muted { overflow-wrap: anywhere; }
/* Not in a table: there a word stays whole and the table scrolls sideways in its own box. Breaking words to fit makes a column unreadable. */
table, table :where(td, th, a, p, li, label, span, strong, .muted) { overflow-wrap: normal; word-break: normal; }
.btn, a.btn, button.btn, button { white-space: normal; max-width: 100%; }
/* A list of facts: the label column takes its natural width only where there is room; on a narrow screen a long label wraps instead of pushing the page. */
dl.facts { grid-template-columns: minmax(0, max-content) minmax(3rem, 1fr); }
body .demo-banner strong { color: #f6e7b8; }
body .demo-banner a, body .demo-banner a.demo-banner__back { color: #fff; opacity: 1; }
/* Enhanced contrast (7:1) for links and the few coloured labels that fell just short. */
:root { --brand: var(--brand-deep, #0a4440); --gold-deep: #5c430c; }
.srow .st.gold, .gold { color: #5c430c; }
.rg-fine { color: var(--ink-soft, #2f484b); }
.rg-demo-main span { color: #2f2408; }

/* The menu. On a computer the wrapper takes no part in the layout. On a phone, with JavaScript, the links fold behind a Menu button. */
.topbar__menu { display: contents; }
.nav-toggle { display: none; }
@media (max-width: 48rem) {
  .js .nav-toggle { display: inline-flex; align-items: center; gap: .5rem; margin-left: auto; min-height: 44px; padding: 0 1.1rem; font: inherit; font-weight: 600; color: #fff; background: transparent; border: 1px solid rgba(255,255,255,.55); border-radius: var(--radius, 6px); cursor: pointer; }
  .js .nav-toggle[aria-expanded="true"] { background: rgba(255,255,255,.16); }
  .js .topbar__in { gap: .5rem; padding-block: .4rem; }
  .js .topbar__menu { display: none; }
  .js .topbar__menu.is-open { display: block; flex-basis: 100%; padding-bottom: .6rem; border-top: 1px solid rgba(255,255,255,.2); }
  .js .topbar__menu .topnav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .25rem .5rem; padding-top: .5rem; }
  .js .topbar__menu .topnav a { display: flex; align-items: center; min-height: 44px; font-size: 1rem; white-space: normal; }
  .js .topbar__menu .topbar__user { justify-content: space-between; flex-wrap: wrap; margin: .6rem 0 0; padding-top: .6rem; border-top: 1px solid rgba(255,255,255,.2); white-space: normal; }
  .js .topbar__menu .topbar__user .who, .js .topbar__menu .topbar__user .linkbtn { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; }
}

/* A table marked "stack" becomes one block for each row on a phone, each value beside its heading, so nothing is squeezed or cut off.
   The roles in the markup keep it a table to a screen reader. */
@media (max-width: 36rem) {
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: auto; }
  table.stack thead { position: absolute; left: -10000px; }   /* off the screen: each value shows its own heading, and a screen reader still has the real one */
  table.stack tr { padding: .75rem .9rem; border-bottom: 1px solid var(--rule, #dcd8cd); }
  table.stack tr:last-child { border-bottom: 0; }
  body table.stack td, body table.stack td.right, body table.stack td.nowrap { border: 0; padding: .2rem 0; text-align: left; white-space: normal; width: auto; }
  table.stack td[data-label] { display: grid; grid-template-columns: 5rem minmax(0, 1fr); gap: .6rem; align-items: baseline; }
  table.stack td[data-label]::before { content: attr(data-label); font-size: .85rem; color: var(--ink-soft, #2f484b); }
  table.stack td.stack-title { font-weight: 600; }
  table.stack td .row-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: flex-start; margin-top: .35rem; }
}
