/* Base: reset, fonts, typography, focus. Tokens come from tokens/tokens.css. */
@font-face {
  font-family: "Quicksand";
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url("fonts/quicksand-latin.woff2") format("woff2");
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--body);
  font-family: var(--font-sans);
  font-size: var(--fs-3);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, h4 { margin: 0; color: var(--ink); line-height: 1.25; font-weight: 600; }
h1 { font-size: var(--fs-6); }
h2 { font-size: var(--fs-5); }
h3 { font-size: var(--fs-4); }
h4 { font-size: var(--fs-3); }
p { margin: 0 0 var(--space-3); }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
img, svg { max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
table { border-collapse: collapse; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-4) 0; }
code, kbd { font-family: var(--font-mono); font-size: 0.92em; }
small, .small { font-size: var(--fs-2); }
.muted { color: var(--ink-muted); }
.num { font-variant-numeric: tabular-nums; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
[hidden] { display: none !important; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; box-shadow: var(--focus-ring); border-radius: var(--radius-sm); }

.icon { width: 1.25em; height: 1.25em; fill: currentColor; flex: none; vertical-align: -0.25em; }

/* Scrollbar like the clinic app: thin, neutral */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

/* ---- Clinic additions (kit lane K0). Only under html[data-shell], which the clinic app sets; the admin app is unchanged. ---- */
html[data-shell] body { padding-left: var(--safe-l); padding-right: var(--safe-r); }

/* Touch targets: at least 44 px high below 992 px; inputs 16 px on phones so iOS does not zoom. */
@media (max-width: 991px) {
  html[data-shell] .btn,
  html[data-shell] .icon-btn,
  html[data-shell] .tab,
  html[data-shell] .nav-item,
  html[data-shell] .user-menu > summary,
  html[data-shell] .clinic-switch > summary,
  html[data-shell] .clinic-option,
  html[data-shell] .table .btn,
  html[data-shell] .table .icon-btn { min-height: var(--touch); }
  html[data-shell] .icon-btn { min-width: var(--touch); }
}
@media (max-width: 767px) {
  html[data-shell] input:not([type="checkbox"]):not([type="radio"]),
  html[data-shell] select,
  html[data-shell] textarea { font-size: max(1rem, 1em); }
  html[data-shell] input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
  html[data-shell] select { min-height: var(--touch); }
}

/* Long text blocks (consent, terms, instructions) */
.prose { max-width: 70ch; line-height: 1.6; }
.prose h2, .prose h3 { margin: var(--space-4) 0 var(--space-2); }
.prose ul, .prose ol { padding-left: 1.4em; }
