/* FHIR Vault Suite documentation — styled to match the website (Hevelian brand) */
:root {
  --accent: #361B53; --accent-2: #682D8C; --accent-soft: #F3EEF8; --bg-soft: #F7F4FA;
  --text: #1A1A1A; --body: #333333; --muted: #4F4F4F; --line: #E5E7EB; --line-strong: #D3CCDD;
  --ok: #1F7A4D; --warn: #B45309; --warn-soft: #FFF6EA; --blue: #152CAA; --mark: #361B53;
  --mono: ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Inter Tight', 'Plain', system-ui, sans-serif; color: var(--text); background: #FFFFFF; }
a { color: var(--accent); } a:hover { color: var(--accent-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* site header and footer */
.site-top { background: #FFFFFF; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.site-nav { max-width: 1440px; margin: 0 auto; padding: 14px 32px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 16px; text-decoration: none; color: var(--accent); }
.brand span { border-left: 1px solid var(--line); padding-left: 16px; font-weight: 800; font-size: 18px; }
.site-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; font-size: 15px; }
.site-links a { color: var(--accent); text-decoration: none; padding: 12px 0; }
.site-links a.on { padding: 10px 0; border-bottom: 2px solid var(--accent); font-weight: 600; }
.btn, .site-links a.btn { background: var(--accent); color: #FFFFFF; text-decoration: none; padding: 11px 20px; border-radius: 25px; font-size: 14px; display: inline-block; }
.btn:hover, .site-links a.btn:hover { color: #FFFFFF; background: var(--accent-2); }
.site-foot { background: linear-gradient(91.8deg, #270050, #06006A); color: #E6E1EE; font-size: 14px; }
.foot-in { max-width: 1440px; margin: 0 auto; padding: 28px 32px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.foot-in span:last-child { flex-basis: 100%; font-size: 12px; line-height: 1.5; opacity: .85; }

/* layout */
.dwrap { max-width: 1440px; margin: 0 auto; display: grid; grid-template-columns: 300px minmax(0, 1fr); min-height: calc(100vh - 140px); }
.dside { border-right: 1px solid var(--line); padding: 20px 16px 48px; position: sticky; top: 64px; align-self: start; max-height: calc(100vh - 64px); overflow-y: auto; }
.dsearch input { width: 100%; font: inherit; font-size: 15px; padding: 11px 16px; border: 1px solid #9CA3AF; border-radius: 25px; margin-bottom: 14px; color: var(--text); }
.dsearch input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.tm { margin-bottom: 2px; }
.tm summary { cursor: pointer; font-weight: 800; color: var(--accent); padding: 9px 10px; border-radius: 12px; list-style: none; display: flex; justify-content: space-between; }
.tm summary::-webkit-details-marker { display: none; }
.tm summary::after { content: "▸"; color: var(--muted); } .tm[open] summary::after { content: "▾"; }
.tm summary:hover { background: var(--bg-soft); }
.tm-b { padding: 0 0 8px 8px; }
.tm-b a { display: block; padding: 6px 10px; border-radius: 10px; color: var(--body); font-size: 14px; line-height: 1.35; text-decoration: none; }
.tm-b a:hover { background: var(--bg-soft); }
.tm-b a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.dmain { padding: 36px 56px 80px; min-width: 0; max-width: 1040px; }
.dmain h1 { margin: 8px 0 6px; font-size: clamp(30px, 3.4vw, 42px); line-height: 1.12; font-weight: 800; }
.lead { font-size: 18px; color: var(--muted); margin: 10px 0 22px; line-height: 1.55; max-width: 78ch; }
.crumbs { font-size: 14px; color: var(--muted); }
.onpage { display: flex; flex-wrap: wrap; gap: 6px 16px; padding: 12px 16px; background: var(--bg-soft); border-radius: 16px; margin: 0 0 22px; font-size: 14px; }
.onpage b { margin-right: 6px; color: var(--muted); font-weight: 600; }

/* topic body */
.hbody { line-height: 1.65; font-size: 16px; color: var(--body); }
.hbody h2 { margin: 40px 0 10px; font-size: 24px; font-weight: 800; color: var(--text); scroll-margin-top: 80px; }
.hbody h3 { margin: 26px 0 8px; font-size: 18px; font-weight: 800; color: var(--text); }
.hbody h4 { margin: 20px 0 6px; font-size: 16px; font-weight: 600; color: var(--text); }
.hbody p, .hbody li { max-width: 80ch; }
.hbody code, .hbody kbd { font-family: var(--mono); font-size: 13.5px; background: var(--accent-soft); border-radius: 6px; padding: 1px 6px; overflow-wrap: break-word; }
pre.code { background: var(--accent-soft); border-radius: 12px; padding: 14px 16px; overflow-x: auto; font: 13px/1.55 var(--mono); }
pre.code code { background: none; padding: 0; }
.callout { border-left: 4px solid var(--blue); background: var(--bg-soft); border-radius: 12px; padding: 12px 16px; margin: 16px 0; max-width: 80ch; }
.callout > b { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; color: var(--muted); }
.callout.tip { border-left-color: var(--ok); } .callout.warn { border-left-color: var(--warn); background: var(--warn-soft); } .callout.bg { border-left-color: var(--accent); background: var(--accent-soft); }
.callout p:last-child { margin-bottom: 0; } .callout p:first-of-type { margin-top: 0; }
.example { border: 1px solid var(--line-strong); border-radius: 16px; margin: 18px 0; overflow: hidden; max-width: 88ch; }
.ex-h { background: var(--accent-soft); padding: 10px 16px; font-weight: 600; color: var(--text); }
.ex-h span { text-transform: uppercase; font-size: 12px; letter-spacing: .08em; margin-right: 10px; color: var(--accent); font-weight: 800; }
.example > :not(.ex-h) { margin-left: 16px; margin-right: 16px; } .example > .ex-h + * { margin-top: 12px; } .example > :last-child { margin-bottom: 14px; }
/* tables: full width, wrap text, no horizontal scrolling */
.tw { margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
table.dt { border-collapse: collapse; font-size: 14.5px; width: 100%; table-layout: auto; }
table.dt th { text-align: left; background: var(--accent); color: #FFFFFF; font-weight: 600; padding: 10px 12px; }
table.dt td { padding: 10px 12px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: break-word; }
table.dt tr:nth-child(even) td { background: var(--bg-soft); }
dl.fields { display: grid; grid-template-columns: minmax(150px, 240px) 1fr; margin: 14px 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
dl.fields dt { font-weight: 600; padding: 10px 14px; background: var(--bg-soft); border-bottom: 1px solid var(--line); color: var(--text); }
dl.fields dd { margin: 0; padding: 10px 14px; border-bottom: 1px solid var(--line); }
dl.fields dt:last-of-type, dl.fields dd:last-of-type { border-bottom: 0; }
figure.shot { margin: 22px 0 28px; padding: 0; }
.shot-wrap { display: inline-block; max-width: 100%; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: 0 16px 32px rgba(39, 0, 80, 0.10); background: #FFFFFF; }
.shot-wrap img { display: block; max-width: 100%; height: auto; cursor: zoom-in; }
figcaption { font-size: 14px; color: var(--muted); margin: 8px 2px 10px; }
ol.legend { list-style: none; counter-reset: lg; margin: 6px 0 0; padding: 0; display: grid; gap: 6px; max-width: 86ch; }
ol.legend li { counter-increment: lg; position: relative; padding-left: 34px; font-size: 15px; line-height: 1.5; }
ol.legend li::before { content: counter(lg); position: absolute; left: 0; top: 1px; width: 23px; height: 23px; border-radius: 50%; background: #D4202F; color: #FFFFFF; font-weight: 800; font-size: 12px; text-align: center; line-height: 23px; }
.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: stretch; margin: 16px 0; }
.flow > div { flex: 1 1 160px; border-radius: 12px; padding: 12px 14px; background: var(--bg-soft); font-size: 14.5px; }
.flow > div b { display: block; color: var(--accent); margin-bottom: 3px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin: 16px 0; }
.cards a { display: block; border: 1px solid var(--line); border-radius: 16px; padding: 16px 18px; color: var(--body); text-decoration: none; }
.cards a:hover { border-color: var(--accent); }
.cards b { display: block; color: var(--accent); font-size: 17px; margin-bottom: 4px; }
.related { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; font-size: 15px; }
.related b { color: var(--muted); font-weight: 600; margin-right: 4px; }
.related a { border: 1px solid #9CA3AF; border-radius: 25px; padding: 6px 14px; text-decoration: none; }
.pn { display: flex; justify-content: space-between; gap: 16px; margin-top: 44px; padding-top: 16px; border-top: 1px solid var(--line); font-weight: 600; }
.results .res { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; margin-bottom: 12px; color: var(--body); text-decoration: none; }
.results .res:hover { border-color: var(--accent); }
.results .res b { color: var(--accent); } .results .res small { margin-left: 10px; color: var(--muted); }
.results .res p { margin: 6px 0 0; color: var(--muted); font-size: 14.5px; }

figure.diagram { margin: 22px 0 28px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #FFFFFF; max-width: 820px; }
figure.diagram svg { display: block; }
.hbody li[data-checked] { list-style: none; margin-left: -22px; }
.hbody li[data-checked] p { margin: 4px 0; }
.hbody li[data-checked] input { margin-right: 8px; accent-color: var(--accent); }

/* landing */
.mods { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 18px; margin-top: 28px; }
.mod { border: 1px solid var(--line); border-radius: 20px; padding: 22px 24px; }
.mod h2 { margin: 0 0 6px; font-size: 21px; font-weight: 800; } .mod h2 a { text-decoration: none; }
.mod p { margin: 0 0 10px; color: var(--muted); font-size: 15px; line-height: 1.5; }
.mod ul { margin: 0; padding-left: 18px; display: grid; gap: 4px; font-size: 15px; }

@media (max-width: 900px) {
  .dwrap { grid-template-columns: 1fr; }
  .dside { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--line); }
  .dmain { padding: 24px 20px 56px; }
  dl.fields { grid-template-columns: 1fr; }
  .site-top { position: static; }
}
@media print { .site-top, .dside, .site-foot, .pn, .related { display: none !important; } .dwrap { display: block; } .dmain { padding: 0; max-width: none; } }
/* tables stack on phones (tools/tablefix.py adds class rt and data-label) */
@media (max-width: 640px) { table.rt, table.rt tbody, table.rt tr, table.rt td { display: block !important; width: auto !important; min-width: 0 !important; white-space: normal !important; } table.rt thead { display: none !important; } table.rt tr { border-top: 1px solid #E5E7EB; padding: 6px 0; } table.rt td { border-top: 0 !important; padding-top: 4px !important; padding-bottom: 4px !important; } table.rt td[data-label]::before { content: attr(data-label); display: block; font-weight: 700; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #6B7280; margin-bottom: 2px; } }
