/* common.css — the one shared stylesheet of the site, published at the site root.
   Every page links it first ("common.css" from the root, "../common.css" one level down, and so
   on), then its own small style.css for rules only that page needs.

   The look is the house style of smart-health-checkin.org, whose tokens are "adapted from the
   SMART Health IT design system": the SMART spectrum stripe and logo mark, Inter / Source Serif 4 /
   JetBrains Mono, the neutral and brand colours, the 8-point spacing, and the shapes of its bar,
   footer, buttons, tables, code, callouts and disclosures. Values are copied from
   smart-health-checkin.org/assets/smart-design.css and adapted here (sizes in rem, light mode
   only); nothing is loaded from that site. Those design assets, including the logo mark in the page
   header, are used under the Apache License 2.0.

   Fonts are served from fonts/ next to this file (latin subsets of the variable fonts from
   Fontsource, SIL Open Font License 1.1; the licence texts are in fonts/).

   Rules of the look
   - Sizes in rem/em, so a larger default font scales everything.
   - Categories are told apart by lightness, shape, pattern and direct labels, never by red versus
     green. The spectrum colours are identity only (the stripe and the logo); status is always
     written out in words and never rests on colour.
   - Digits, bytes and code are set in the monospace face; labels and prose are not. */

@font-face {
  font-family: "Inter"; font-style: normal; font-display: swap; font-weight: 100 900;
  src: url(fonts/inter-latin-wght-normal.woff2) format("woff2-variations"), url(fonts/inter-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4"; font-style: normal; font-display: swap; font-weight: 200 900;
  src: url(fonts/source-serif-4-latin-wght-normal.woff2) format("woff2-variations"), url(fonts/source-serif-4-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono"; font-style: normal; font-display: swap; font-weight: 100 800;
  src: url(fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2-variations"), url(fonts/jetbrains-mono-latin-wght-normal.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
/* Until Inter arrives, a local face sized to match it, so the swap does not reflow the page
   (the house style's metric overrides). */
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans"), local("Helvetica"); ascent-override: 90.96%; descent-override: 22.68%; line-gap-override: 0%; size-adjust: 106.7%; font-weight: 100 400; }
@font-face { font-family: "Inter Fallback"; src: local("Arial"), local("ArialMT"), local("Liberation Sans"), local("LiberationSans"), local("Helvetica"); ascent-override: 90.03%; descent-override: 22.45%; line-gap-override: 0%; size-adjust: 107.8%; font-weight: 500; }
@font-face { font-family: "Inter Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("LiberationSans-Bold"), local("Helvetica Bold"); ascent-override: 95.62%; descent-override: 23.84%; line-gap-override: 0%; size-adjust: 101.5%; font-weight: 600; }
@font-face { font-family: "Inter Fallback"; src: local("Arial Bold"), local("Arial-BoldMT"), local("Liberation Sans Bold"), local("LiberationSans-Bold"), local("Helvetica Bold"); ascent-override: 94.59%; descent-override: 23.59%; line-gap-override: 0%; size-adjust: 102.6%; font-weight: 700 900; }

:root {
  /* SMART spectrum: identity only (the stripe, the logo). Never a category or a status. */
  --smart-red: #E5443B; --smart-orange: #F09623; --smart-green: #6FB43F;
  --smart-teal: #1FA88E; --smart-blue: #3DA9DC; --smart-purple: #6E4FA2;
  --brand-bright: #3DA9DC;

  /* neutrals and semantic colours (light) */
  --bg: #FFFFFF;
  --bg-alt: #F6F8FA;
  --surface: #FFFFFF;
  --surface-alt: #F6F8FA;
  --fg-1: #1F2933;
  --fg-2: #4B5563;
  --fg-3: #5B6675;
  --border: #E4E7EB;
  --border-strong: #CBD2D9;
  --border-subtle: #EEF1F4;
  --brand: #0E6FB8;
  --brand-ink: #094D80;
  --brand-wash: #D6EAF7;
  --on-brand: #FFFFFF;
  --focus: #0E6FB8;
  --info-wash: #E8F4FB;
  --code-bg: #F6F8FA;
  --code-inline-bg: #EEF1F4;
  --mark: #FFF0A6;
  --shadow-md: 0 2px 4px rgba(17, 22, 29, 0.06), 0 4px 8px rgba(17, 22, 29, 0.06);

  /* type: the house scale, in rem */
  --font-sans: "Inter", "Inter Fallback", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --font-mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1rem;
  --fs-md: 1.125rem;
  --fs-lg: 1.25rem;
  --fs-xl: 1.5rem;
  --fs-2xl: 1.875rem;
  --fs-3xl: 2.25rem;
  --lh-tight: 1.15;
  --lh-snug: 1.3;
  --lh-normal: 1.5;
  --lh-relaxed: 1.65;
  --tracking-tight: -0.02em;
  --tracking-snug: -0.01em;

  /* space: the 8-point scale, in rem */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem; --space-4: 1rem;
  --space-5: 1.5rem; --space-6: 2rem; --space-7: 3rem; --space-8: 4rem;
  --radius-sm: 4px; --radius-md: 8px; --radius-lg: 12px; --radius-pill: 9999px;

  /* layout: one left rail, shared by the bar, the page and the footer */
  --container-wide: 80rem;
  --measure: 44rem;
  --rail: 1.5rem;

  /* the lab's and explainer's bars, and other single-series marks */
  --bar: var(--brand);
}
@media (max-width: 46rem) { :root { --rail: 1rem; } }

*, *::before, *::after { box-sizing: border-box; }
/* text-size-adjust 100%: no font boosting (it inflates some blocks and not others). The pages opt in to the
   system text size with <meta name="text-scale" content="scale">, which scales the root font size; every size here is in rem or em. */
html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; color-scheme: light; }
body {
  margin: 0; background: var(--bg); color: var(--fg-1);
  font-family: var(--font-sans); font-size: var(--fs-base); line-height: var(--lh-normal);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh; display: flex; flex-direction: column;
}
body > main { flex: 1 0 auto; }
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
code, kbd, samp, pre { font-variant-ligatures: none; font-feature-settings: "liga" 0, "calt" 0; }
::selection { background: var(--brand); color: var(--on-brand); }

/* ---------- type ---------- */
h1, h2, h3, h4 { color: var(--fg-1); text-wrap: balance; overflow-wrap: break-word; hyphens: manual; /* no hyphenation; only a word wider than the screen (large text, narrow phone) breaks, rather than overflowing */ }
h1 { font-size: clamp(1.625rem, 1rem + 2.5vw, var(--fs-3xl)); line-height: var(--lh-tight); letter-spacing: var(--tracking-tight); font-weight: 700; margin: 0 0 var(--space-4); }
h2 { font-size: var(--fs-xl); line-height: var(--lh-snug); letter-spacing: var(--tracking-tight); font-weight: 700; margin: 0 0 var(--space-4); }
h3 { font-size: var(--fs-md); line-height: var(--lh-snug); letter-spacing: var(--tracking-snug); font-weight: 700; margin: var(--space-5) 0 var(--space-2); }
h4 { font-size: var(--fs-base); line-height: var(--lh-snug); font-weight: 700; margin: var(--space-4) 0 var(--space-1); }
p { margin: 0 0 var(--space-4); }
ul, ol { margin: 0 0 var(--space-4); padding-left: 1.25rem; }
li { margin: 0 0 var(--space-1); }
li > ul, li > ol { margin: var(--space-1) 0 0; }
a { color: var(--brand); text-underline-offset: 2px; }
a:hover { color: var(--brand-ink); }
b, strong { font-weight: 650; }
small, .note { font-size: var(--fs-sm); color: var(--fg-2); }
.meta { color: var(--fg-2); margin: 0 0 var(--space-2); }
.lede { font-family: var(--font-serif); font-size: var(--fs-md); line-height: 1.55; color: var(--fg-2); max-width: 40rem; }
.eyebrow { margin: 0 0 var(--space-3); font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--brand); }
code, kbd, samp, pre, .mono { font-family: var(--font-mono); }
:not(pre) > code { font-size: 0.88em; padding: 1px 5px; border-radius: var(--radius-sm); background: var(--code-inline-bg); overflow-wrap: anywhere; }
.mono { font-size: 0.88em; }
a > code { color: inherit; }
sup, sub { line-height: 0; }
hr { border: 0; border-top: 1px solid var(--border); margin: var(--space-6) 0; }

/* ---------- focus ---------- */
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
button:focus-visible, .button:focus-visible, select:focus-visible, input:focus-visible, textarea:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; box-shadow: 0 0 0 4px color-mix(in srgb, var(--focus) 25%, transparent); }

/* ---------- the bar: spectrum stripe, logo and wordmark, sections ---------- */
.smart-spectrum { display: grid; grid-template-columns: repeat(6, 1fr); height: 3px; width: 100%; }
.smart-spectrum > i { display: block; }
.smart-spectrum > i:nth-child(1) { background: var(--smart-red); }
.smart-spectrum > i:nth-child(2) { background: var(--smart-orange); }
.smart-spectrum > i:nth-child(3) { background: var(--smart-green); }
.smart-spectrum > i:nth-child(4) { background: var(--smart-teal); }
.smart-spectrum > i:nth-child(5) { background: var(--smart-blue); }
.smart-spectrum > i:nth-child(6) { background: var(--smart-purple); }

.skip { position: absolute; left: 8px; top: -100px; z-index: 100; padding: 10px 16px; background: var(--surface); color: var(--brand-ink); font-weight: 600; border: 2px solid var(--brand); border-radius: var(--radius-sm); text-decoration: none; }
.skip:focus { top: 8px; }

.rail { width: 100%; max-width: var(--container-wide); margin: 0 auto; padding-left: var(--rail); padding-right: var(--rail); }
header.site { position: relative; z-index: 60; background: var(--surface); border-bottom: 1px solid var(--border); }
.bar { display: flex; align-items: center; gap: var(--space-2); min-height: 3.5rem; flex-wrap: nowrap; font-size: var(--fs-sm); line-height: 1.35; }
.mark-link { display: inline-flex; align-items: center; gap: 10px; min-height: 2.75rem; color: var(--fg-1); text-decoration: none; border-radius: var(--radius-sm); min-width: 0; flex: 0 1 auto; }
.mark-link:hover { color: var(--fg-1); }
.mark-link svg { display: block; flex: none; width: 30px; height: 30px; }
.mark-title { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 0.5em; }
.mark-title { min-width: 0; }
.mark-title b { font-weight: 700; letter-spacing: -0.005em; }
.mark-title span { color: var(--fg-3); font-weight: 600; }
.menu { flex: none; }
.menu > summary::before { content: none; }
.sections { margin-left: auto; }
.sections ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 2px; }
.sections li { margin: 0; }
.sections a { display: inline-flex; align-items: center; min-height: 2.5rem; padding: 0 7px; border-radius: var(--radius-sm); color: var(--fg-2); font-weight: 600; text-decoration: none; white-space: nowrap; }
.sections a:hover, .sections a[aria-current="page"] { color: var(--brand-ink); background: var(--brand-wash); }
.sections a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--brand-ink); }
/* Always-available disclosure menu (no script needed): on wide screens (>= 56rem) it sits after
   the 5 platform section links as "More" and surfaces Specs & Architecture + Agents & Source;
   below 56rem the sections fold into it as "Menu" with Navigate on top. */
.menu { display: block; margin-left: 4px; position: relative; }
.menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; min-height: 2.5rem; min-width: 2.75rem; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--fg-1); font-weight: 600; cursor: pointer; white-space: nowrap; }
.menu > summary::-webkit-details-marker { display: none; }
@media (max-width: 24rem) { .menu > summary { padding: 0 10px; } .menu > summary svg { display: none; } }
.menu > summary svg { width: 0.75rem; height: 0.75rem; transition: transform 200ms; }
.menu[open] > summary svg { transform: rotate(180deg); }
.menu ul { list-style: none; margin: 0; padding: 6px; position: absolute; right: 0; top: calc(100% + 8px); width: max-content; min-width: 16rem; max-width: calc(100vw - 2 * var(--rail)); max-height: 78vh; overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-md); box-shadow: var(--shadow-md); z-index: 70; }
.menu li { margin: 0; }
.menu li.menu-group { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--fg-3); padding: 10px 12px 4px; margin-top: 4px; border-top: 1px solid var(--border-subtle); }
.menu li.menu-group:first-child { border-top: none; margin-top: 0; }
.menu a { display: flex; align-items: center; min-height: 2.35rem; padding: 0 12px; border-radius: var(--radius-sm); color: var(--fg-1); font-weight: 500; font-size: var(--fs-sm); text-decoration: none; }
.menu a:hover { background: var(--bg-alt); color: var(--brand-ink); }
.menu a[aria-current="page"] { background: var(--brand-wash); color: var(--brand-ink); font-weight: 650; }
@media (min-width: 56rem) {
  .menu .menu-tools { display: none; }
  .menu li.menu-group.menu-desk-first { border-top: none; margin-top: 0; }
  .menu-lbl-mobile { display: none; }
}
@media (max-width: 55.99rem) {
  .sections { display: none; }
  .menu { margin-left: auto; }
  .menu > summary { min-height: 2.75rem; padding: 0 14px; gap: 8px; }
  .menu-lbl-desk { display: none; }
}

/* ---------- footer: spectrum stripe, a site map, the fine print ---------- */
footer.site { position: relative; background: var(--bg-alt); border-top: 1px solid var(--border); padding: 2.5rem 0 1.75rem; margin-top: var(--space-7); font-size: var(--fs-sm); color: var(--fg-2); }
footer.site .smart-spectrum { position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.foot-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); gap: var(--space-5); }
.foot-cols h2 { font-size: var(--fs-sm); margin: 0 0 var(--space-2); letter-spacing: 0; }
.foot-cols ul { list-style: none; margin: 0; padding: 0; }
.foot-cols li { margin: 0; }
.foot-cols a { display: inline-block; padding: 3px 0; color: var(--fg-2); text-decoration: none; }
.foot-cols a:hover { color: var(--brand); text-decoration: underline; }
.foot-fine { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); justify-content: space-between; margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--border); color: var(--fg-3); }
.foot-fine p { margin: 0; max-width: 56ch; }

/* ---------- page frame ---------- */
body > main { width: 100%; max-width: var(--container-wide); margin: 0 auto; padding: 0 var(--rail); overflow-wrap: break-word; }
.prose { max-width: var(--measure); }
.pagehead { padding: var(--space-6) 0 var(--space-5); }
.pagehead h1 { max-width: 24ch; }
.pagehead p { max-width: var(--measure); }
.pagehead .lede { margin-bottom: var(--space-3); }
/* sections: a hairline marks where one ends and the next begins */
main section { border-top: 1px solid var(--border); padding: var(--space-6) 0 var(--space-3); }
main section > h2:first-child { margin-top: 0; }

/* ---------- controls ---------- */
button, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  font: inherit; font-size: var(--fs-sm); font-weight: 600; line-height: 1.1; text-align: center; text-decoration: none;
  padding: 10px 16px; min-height: 2.75rem; border-radius: var(--radius-md);
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg-1); cursor: pointer;
  transition: border-color .12s ease, background-color .12s ease, color .12s ease;
}
button:hover, .button:hover { border-color: var(--brand); color: var(--brand); }
button.primary, .button.primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
button.primary:hover, .button.primary:hover { background: var(--brand-ink); border-color: var(--brand-ink); color: var(--on-brand); }
button.small, .button.small { min-height: 2.25rem; padding: 6px 12px; border-radius: var(--radius-sm); }
button[disabled] { opacity: .5; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); align-items: center; margin: var(--space-4) 0; }
select, input[type="number"], input[type="text"], textarea {
  font: inherit; font-size: var(--fs-sm); color: var(--fg-1); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); padding: 7px 10px; min-height: 2.75rem; max-width: 100%;
}
textarea { width: 100%; font-family: var(--font-mono); line-height: 1.45; }
input[type="radio"], input[type="checkbox"] { width: 1.2rem; height: 1.2rem; margin: 0; accent-color: var(--brand); flex: none; }
input[type="range"] { accent-color: var(--brand); width: 100%; min-height: 2.75rem; }
fieldset { border: 1px solid var(--border); border-radius: var(--radius-md); margin: 0 0 var(--space-3); padding: var(--space-2) var(--space-3) var(--space-3); min-width: 0; }
legend { font-weight: 650; font-size: var(--fs-sm); padding: 0 var(--space-1); }
label.opt { display: flex; align-items: flex-start; gap: 0.6rem; padding: 0.3rem 0; min-height: 2.5rem; cursor: pointer; }
label.opt input { margin-top: 0.15rem; }
label.opt code { overflow-wrap: anywhere; }
label.row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); margin: var(--space-2) 0; }
label.row > span:first-child { min-width: 9em; }

/* ---------- callouts (status is written out; the rule's colour only repeats it) ---------- */
.notice, .error {
  margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); max-width: var(--measure);
  border-left: 3px solid var(--brand); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--info-wash); color: var(--fg-1);
}
.notice > :last-child, .error > :last-child { margin-bottom: 0; }
.notice a, .error a { color: var(--brand-ink); }
.error { border-left: 5px double var(--fg-1); background: var(--bg-alt); }
.error::before { content: "Problem: "; font-weight: 700; }
.error:has(> p)::before { content: none; }

/* ---------- tables ---------- */
/* A table wider than its column scrolls sideways inside .tablewrap. Two cues show there is more:
   the first column stays put (sticky) while the rest slides under it, and a shadow lies on each edge
   with more table beyond it. The shadows are backgrounds: covers that move with the content (local)
   hide the fixed shadows (scroll) when an edge is reached, so no script is needed. Set --table-bg on
   a wrapper that sits on another background. */
.tablewrap {
  --table-bg: var(--bg);
  overflow-x: auto; max-width: 100%; margin: var(--space-4) 0;
  background:
    linear-gradient(to right, var(--table-bg) 40%, transparent) left center / 2.5rem 100% no-repeat local,
    linear-gradient(to left, var(--table-bg) 40%, transparent) right center / 2.5rem 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(31, 41, 51, 0.28), transparent) left center / 0.9rem 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(31, 41, 51, 0.28), transparent) right center / 0.9rem 100% no-repeat scroll;
  background-color: var(--table-bg);
}
.tablewrap > table { margin: 0; }
.tablewrap > table > * > tr > :first-child { position: sticky; left: 0; z-index: 1; background: var(--table-bg); }
/* the column edge the rest slides under: drawn only while the table can scroll (a scroll timeline is
   inactive on a wrapper that does not scroll, so the animation does not apply); without scroll
   timelines there is no edge line, and the shadows still mark the hidden part */
.tablewrap > table > * > tr > :first-child { padding-right: 12px; }
@supports (animation-timeline: scroll()) {
  .tablewrap > table > * > tr > :first-child { animation: table-edge linear both; animation-timeline: scroll(nearest inline); }
  @keyframes table-edge { from, to { box-shadow: inset -1px 0 0 var(--border); } }
}
/* .stacks: on a phone, each row becomes a block: its first cell as a heading, then each other cell
   with its column's name (data-label) above it. */
@media (max-width: 40rem) {
  .tablewrap.stacks { overflow-x: visible; background: none; }
  .tablewrap.stacks > table { min-width: 0; width: 100%; }
  .tablewrap.stacks > table, .tablewrap.stacks tbody, .tablewrap.stacks tr, .tablewrap.stacks th, .tablewrap.stacks td { display: block; }
  .tablewrap.stacks thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tablewrap.stacks caption { display: block; }
  .tablewrap.stacks tr { padding: var(--space-2) 0 var(--space-3); border-bottom: 1px solid var(--border-strong); }
  .tablewrap.stacks > table > * > tr > :first-child { position: static; box-shadow: none; background: none; width: auto; padding: 0 0 var(--space-1); }
  .tablewrap.stacks th, .tablewrap.stacks td { border: 0; padding: 0 0 var(--space-2); }
  .tablewrap.stacks td[data-label]::before { content: attr(data-label); display: block; font-size: var(--fs-xs); font-weight: 600; color: var(--fg-2); }
}
table { border-collapse: collapse; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
caption { text-align: left; font-weight: 650; padding: 0 0 var(--space-2); }
th, td { text-align: left; padding: 8px 12px; vertical-align: top; border-bottom: 1px solid var(--border); }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
thead th { border-bottom-color: var(--border-strong); color: var(--fg-2); font-weight: 600; vertical-align: bottom; }
tbody th { font-weight: 600; }
td.n, th.n, td[align="right"], th[align="right"] { text-align: right; white-space: nowrap; }
td[align="center"], th[align="center"] { text-align: center; }

/* ---------- code ---------- */
pre { margin: var(--space-4) 0; padding: 12px 16px; overflow: auto; background: var(--code-bg); color: var(--fg-1); border: 1px solid var(--border); border-radius: var(--radius-md); font-family: var(--font-mono); font-size: 0.8125rem; line-height: 1.55; tab-size: 2; }
pre code { padding: 0; background: none; font: inherit; overflow-wrap: normal; }
.digits { font-family: var(--font-mono); font-size: var(--fs-sm); line-height: 1.55; word-break: break-all; overflow-wrap: anywhere; }

/* ---------- disclosure ---------- */
/* Disclosures. The header's Menu is a <details> too, styled on its own (.menu), so these rules skip it. */
details:not(.menu) { margin: var(--space-3) 0; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface); }
details:not(.menu) > summary { display: block; padding: 10px 14px 10px 2rem; text-indent: -1.1rem; list-style: none; font-weight: 600; cursor: pointer; border-radius: inherit; }
details:not(.menu) > summary::-webkit-details-marker { display: none; }
/* closed ▸, open ▾: two glyphs rather than one rotated, so the open state sits on the same line and box */
details:not(.menu) > summary::before { content: "▸"; display: inline-block; width: 1.1rem; text-indent: 0; color: var(--fg-3); }
details:not(.menu)[open] > summary::before { content: "▾"; }
details:not(.menu)[open] > summary { border-bottom: 1px solid var(--border); border-radius: var(--radius-md) var(--radius-md) 0 0; }
details:not(.menu) > :not(summary) { margin-left: 14px; margin-right: 14px; }
details:not(.menu)[open] > :last-child:not(summary) { margin-bottom: var(--space-3); }
details:not(.menu) > summary + * { margin-top: var(--space-3); }

/* ---------- dense lists ---------- */
ul.dense { margin: var(--space-2) 0 var(--space-4); padding-left: 1.2rem; }
ul.dense li { margin: 0.25rem 0; }
ul.plain { list-style: none; padding: 0; }
ul.inline { list-style: none; padding: 0; margin: var(--space-2) 0; display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
ul.inline li { margin: 0; }
dl.facts { display: grid; grid-template-columns: fit-content(16rem) minmax(0, 1fr); column-gap: var(--space-5); margin: var(--space-4) 0; }
dl.facts > div { display: contents; }
dl.facts dt, dl.facts dd { margin: 0; padding: var(--space-2) 0; border-top: 1px solid var(--border-subtle); }
dl.facts dt { color: var(--fg-2); font-weight: 600; font-size: var(--fs-sm); }
dl.facts dd { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 46rem) { dl.facts { grid-template-columns: minmax(0, 1fr); } dl.facts dd { border-top: 0; padding-top: 0; } }
.tag { display: inline-flex; align-items: center; padding: 0 8px; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface-alt); color: var(--fg-2); font-size: var(--fs-xs); font-weight: 600; line-height: 1.6; white-space: nowrap; max-width: 100%; }

/* ---------- size bars: label and value on one line, the bar under them ---------- */
ol.bars { list-style: none; margin: var(--space-3) 0; padding: 0; }
ol.bars > li { margin: 0 0 0.65rem; }
.bar-h { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 0.8rem; font-size: var(--fs-sm); }
.bar-h > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.bar-h .v { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.bar-t { height: 0.625rem; background: var(--border-subtle); position: relative; border-radius: 2px; margin-top: 0.2rem; }
.bar-t > span { position: absolute; left: 0; top: 0; bottom: 0; background: var(--bar); min-width: 2px; border-radius: 2px; }
.bar-t > span.light { background: repeating-linear-gradient(135deg, var(--bar) 0 2px, var(--surface) 2px 5px); }
ol.bars > li.muted .bar-h { color: var(--fg-3); }
ol.bars > li.muted .bar-h .v { font-weight: 400; }

/* ---------- QR codes: always dark on white with the quiet zone ---------- */
.qr { background: #fff; display: block; }
.qr svg { display: block; width: min(100%, 24rem); height: auto; background: #fff; }

/* ---------- the FHIR JSON actions (site/shared/fhir-json.ts) ---------- */
.fhirjson { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin: var(--space-3) 0; }
.fhirjson .size { font-size: var(--fs-sm); color: var(--fg-2); }
.fhirjson-view pre { max-height: 70vh; white-space: pre; font-size: var(--fs-xs); }

/* ---------- documents: breadcrumb, contents, prose ---------- */
.crumbs { padding-top: var(--space-4); font-size: var(--fs-sm); color: var(--fg-3); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; padding: 0; list-style: none; }
.crumbs li { display: inline-flex; align-items: center; margin: 0; }
.crumbs li + li::before { content: "›"; margin: 0 8px; color: var(--fg-3); }
.crumbs a { color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current="page"] { color: var(--fg-2); }
.docpage .pagehead { padding-top: var(--space-4); }
.doc-head { padding: var(--space-4) 0 var(--space-4); margin-bottom: var(--space-4); border-bottom: 1px solid var(--border); }
.doc-body > :first-child { margin-top: 0; }
.doc-head h1 { margin-bottom: var(--space-2); max-width: 30ch; }
.doc-body { min-width: 0; max-width: 48rem; }
.doc-body > h2 { margin-top: var(--space-7); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.doc-body > h3 { margin-top: var(--space-6); }
.doc-body h2[id], .doc-body h3[id], .doc-body h4[id] { scroll-margin-top: var(--space-4); }
.doc-body table { font-size: var(--fs-sm); }
.doc-body td code, .doc-body th code { overflow-wrap: normal; white-space: nowrap; }
.doc-body blockquote { margin: var(--space-4) 0; padding: var(--space-3) var(--space-4); border-left: 3px solid var(--brand); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--info-wash); }
.doc-body blockquote > :last-child { margin-bottom: 0; }
.doc-body li > p { margin-bottom: var(--space-2); }
.doc-body img { height: auto; }
.toc { font-size: var(--fs-sm); margin: var(--space-4) 0 0; }
.toc details { margin: 0; }
.toc ol { list-style: none; padding: var(--space-2) 0; margin: 0 14px; }
.toc ol ol { padding: 0 0 var(--space-1) var(--space-3); margin: 0; border-left: 1px solid var(--border); }
.toc li { margin: 0; }
.toc a { display: block; padding: 3px 0; color: var(--fg-2); text-decoration: none; }
.toc a:hover { color: var(--brand); text-decoration: underline; }
@media (min-width: 64rem) {
  .doc.has-toc { display: grid; grid-template-columns: 16rem minmax(0, 1fr); gap: var(--space-7); align-items: start; }
  .toc { position: sticky; top: var(--space-4); max-height: calc(100vh - 2rem); overflow-y: auto; margin-top: 0; }
  .toc details { border: 0; background: none; }
  .toc details > summary { padding: 0 0 var(--space-2); border-bottom: 1px solid var(--border); border-radius: 0; color: var(--fg-1); }
  .toc ol { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
@media print {
  header.site, footer.site, .skip, .actions, .fhirjson { display: none; }
}
table.concepts td:first-child code { white-space: nowrap; overflow-wrap: normal; }

/* ---------- "Copy link" (site/shared/copy-link.ts) ---------- */
.copylink { margin: var(--space-3) 0; max-width: 32rem; }
.copylink .actions { margin: 0 0 var(--space-2); }
.copylink textarea { width: 100%; min-height: 0; font-size: var(--fs-xs); color: var(--fg-2); background: var(--bg-alt); word-break: break-all; resize: vertical; }
.copylink label { display: block; margin-bottom: var(--space-1); }
.copylink p.note { margin: var(--space-2) 0 0; }
/* "Send this record" (site/shared/share.ts): the share sheet button first, full width on phones */
.share { padding: var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg-alt); }
.share fieldset { border: 0; margin: 0 0 var(--space-2); padding: 0; min-width: 0; }
.share legend { padding: 0; margin-bottom: var(--space-2); font-weight: 600; color: var(--fg-1); }
.share .choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: var(--space-2); }
.share .choices label { display: flex; align-items: center; gap: 0.4em; margin: 0; padding: 6px 12px; min-height: 2.25rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--bg); cursor: pointer; }
/* the chosen option: thicker border and bold text, besides the filled radio */
.share .choices label:has(input:checked) { border: 2px solid var(--fg-1); font-weight: 600; padding: 5px 11px; }
.share .choices input { margin: 0; accent-color: var(--brand); }
.share .share-go { width: 100%; margin: 0 0 var(--space-2); }
.share .actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-2) 0 0; }
.share .share-status:empty { display: none; }
.share textarea { background: var(--bg); }

/* ---------- the input model page (site/model-page.ts) ---------- */
ul.downloads { list-style: none; padding: 0; margin: var(--space-4) 0; display: grid; gap: var(--space-2); }
ul.downloads li { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); align-items: center; margin: 0; }
pre.ts { max-height: 40rem; }
pre.ts .c { color: #5B6675; }
pre.ts .k { color: #094D80; font-weight: 600; }
pre.ts .s { color: #0A6150; }
table.fields { font-size: var(--fs-sm); min-width: 34rem; }
table.fields th[scope="row"] { white-space: nowrap; }
table.fields td:nth-child(2) { min-width: 9rem; }
.req { font-size: var(--fs-xs); font-weight: 600; color: var(--fg-2); }
.bounds { display: block; font-size: var(--fs-xs); color: var(--fg-2); }
details.enumdef > summary code { font-weight: 650; }
ul.downloads .button { white-space: normal; overflow-wrap: anywhere; max-width: 100%; }
ul.downloads .note { overflow-wrap: anywhere; min-width: 0; }

/* visually hidden, still read by screen readers */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* The lift report (site/shared/lift-report.ts), on the fit page and the viewer's paste path */
ul.counts { list-style: none; padding: 0; margin: var(--space-3) 0 var(--space-1); display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
ul.counts b { font-size: var(--fs-xl); margin-right: 0.2em; }
.refused { border: 2px solid var(--fg-1); border-left-width: 6px; border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3); margin: var(--space-3) 0; background: var(--bg-alt); }
.refused p { margin: 0; }
.blocked { margin: var(--space-3) 0; }
.blocked h3 { margin-top: 0; }
fieldset.allow { border-radius: var(--radius-sm); padding: var(--space-2) var(--space-3) var(--space-3); margin: var(--space-3) 0; min-width: 0; }
fieldset.allow legend { font-weight: 600; padding: 0 var(--space-1); }
label.check { display: flex; gap: 0.5em; align-items: flex-start; margin: var(--space-1) 0; }
label.check input[type=checkbox], label.check input[type=radio] { margin-top: 0.3em; flex: none; }
label.check span { min-width: 0; }
fieldset.allow { border: 2px solid var(--fg-1); }

details.reason { border-top: 1px solid var(--border-subtle); padding: var(--space-1) 0; }
/* an open disclosure: a down-pointing triangle on the first line's baseline, rather than the closed one turned (which rides above the line) */
details.reason summary { cursor: pointer; }
table.items { font-size: var(--fs-sm); }
table.items td, table.items th { padding: 3px 8px 3px 0; vertical-align: top; text-align: left; }
table.items td.d { white-space: nowrap; }
table.items td { overflow-wrap: anywhere; }
@media (max-width: 40rem) {
  table.items thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.items, table.items tbody, table.items tr, table.items td { display: block; width: auto; }
  table.items tr { padding: var(--space-1) 0; border-bottom: 1px solid var(--border-subtle); }
  table.items td { padding: 0; }
  table.items td.rt { font-weight: 600; }
  table.items td[data-label]:empty { display: none; }
  table.items td[data-label]::before { content: attr(data-label) ": "; color: var(--fg-2); }
}

/* ---------- codec directory & codec hub cards ---------- */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 21.5rem), 1fr)); gap: var(--space-4); margin: var(--space-4) 0; }
.card-grid:has(> :only-child) { grid-template-columns: minmax(0, 42rem); }
.card-tile {
  display: flex; flex-direction: column; gap: var(--space-2);
  padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md);
  background: var(--surface);
}
.card-tile h3 { margin: 0; font-size: var(--fs-md); display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-2); flex-wrap: wrap; }
.card-tile h3 a { text-decoration: none; }
.card-tile h3 a:hover { text-decoration: underline; }
.card-tile p { margin: 0; font-size: var(--fs-sm); color: var(--fg-2); }
.card-tile .tile-meta { margin-top: auto; padding-top: var(--space-2); border-top: 1px solid var(--border-subtle); font-size: var(--fs-xs); color: var(--fg-3); display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); }
.codec-head-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0 0 var(--space-3); }
.codec-head-tags .tag { white-space: normal; overflow-wrap: break-word; line-height: 1.35; padding: 2px 10px; border-radius: 12px; }
.kpi-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); gap: var(--space-3); margin: var(--space-4) 0; }
.kpi-tile { padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--bg-alt); min-width: 0; }
.kpi-tile .k { display: block; font-size: var(--fs-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--fg-3); }
.kpi-tile .v { display: block; font-size: var(--fs-xl); font-weight: 700; color: var(--fg-1); line-height: 1.2; margin-top: 2px; font-variant-numeric: tabular-nums; }
.kpi-tile .d { display: block; font-size: var(--fs-xs); color: var(--fg-2); margin-top: 2px; }
@media (max-width: 40rem) {
  .kpi-tile { padding: var(--space-2) var(--space-3); }
  .kpi-tile .v { font-size: 1.2rem; }
}
