
/* Layout: lightbox reading column with a film-strip hero and a sticky contents rail on wide screens */
:root{
  --bg:#eef2f4; --surface:#ffffff; --fg:#0f1a22; --muted:#4d5d69; --line:#cfd8de;
  --film:#0b1419; --film-fg:#dbe9ef; --accent:#0b7d8f; --accent-soft:#d6eef1;
  --xray:#3a6fd8; --ct:#0b7d8f; --mri:#9a4fb8; --warn:#b25d0d;
  --display:"Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body:"Literata", Georgia, "Times New Roman", serif;
  --mono:"JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark){:root:not([data-theme="light"]){
  --bg:#0a1116; --surface:#111c23; --fg:#e3edf1; --muted:#9aaeb9; --line:#24343e;
  --film:#05090c; --film-fg:#dbe9ef; --accent:#4fc3d4; --accent-soft:#12323a;
  --xray:#7aa2f0; --ct:#4fc3d4; --mri:#c891e0; --warn:#f0a35a; color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#0a1116; --surface:#111c23; --fg:#e3edf1; --muted:#9aaeb9; --line:#24343e;
  --film:#05090c; --film-fg:#dbe9ef; --accent:#4fc3d4; --accent-soft:#12323a;
  --xray:#7aa2f0; --ct:#4fc3d4; --mri:#c891e0; --warn:#f0a35a; color-scheme:dark}

*{box-sizing:border-box}
body{background:var(--bg);color:var(--fg);font:400 1.0625rem/1.7 var(--body);padding-inline:16px}
a{color:var(--accent)}
a:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px;border-radius:4px}
h1,h2,h3{font-family:var(--display);line-height:1.12;text-wrap:balance;margin:0}
h2{font-size:clamp(1.7rem,3.4vw,2.4rem);font-weight:800;letter-spacing:-.01em}
h3{font-size:1.25rem;font-weight:700}
p{margin:0}
.mono{font-family:var(--mono);font-size:.85em}
.eyebrow{font-family:var(--mono);font-size:.75rem;letter-spacing:.12em;text-transform:uppercase;color:var(--muted)}

.wrap{max-width:1160px;margin-inline:auto}
header.top{display:flex;justify-content:space-between;align-items:center;gap:12px;padding-block:18px;flex-wrap:wrap}
.brand{font-family:var(--display);font-weight:800;font-size:1.05rem;text-decoration:none;color:var(--fg);display:flex;align-items:center;gap:8px}
.brand i{width:14px;height:14px;border-radius:50%;background:radial-gradient(circle at 35% 35%,var(--film-fg),var(--accent));display:inline-block}
nav.top{display:flex;gap:16px;flex-wrap:wrap}
nav.top a{font-family:var(--mono);font-size:.8rem;text-decoration:none;color:var(--muted)}
nav.top a:hover{color:var(--accent)}

/* hero: film strip on lightbox */
.hero{background:var(--film);color:var(--film-fg);border-radius:6px;padding:clamp(24px,5vw,56px);display:grid;gap:32px}
.hero h1{font-size:clamp(2.2rem,6vw,4.4rem);font-weight:800;letter-spacing:-.02em;max-width:16ch}
.hero h1 em{font-style:normal;color:#7fe0ee}
.hero p.lead{max-width:60ch;color:#a9c0ca;font-size:1.1rem}
.strip{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;background:#1b262d;padding:22px 4px;border-radius:2px;position:relative}
.strip::before,.strip::after{content:"";position:absolute;left:8px;right:8px;height:8px;background:repeating-linear-gradient(90deg,#05090c 0 10px,transparent 10px 22px)}
.strip::before{top:7px}.strip::after{bottom:7px}
.frame{background:#020507;padding:16px 14px;min-height:150px;display:flex;flex-direction:column;justify-content:space-between;gap:12px}
.frame svg{width:100%;height:80px}
.frame b{font-family:var(--display);font-size:1.15rem;color:#fff}
.frame span{font-family:var(--mono);font-size:.72rem;color:#7d97a3;display:block}
@media (max-width:560px){.strip{grid-template-columns:1fr}}

.layout{display:grid;grid-template-columns:200px minmax(0,1fr);gap:48px;padding-block:48px}
@media (max-width:900px){.layout{grid-template-columns:minmax(0,1fr)}.toc{display:none}}
.toc{position:sticky;top:calc(env(safe-area-inset-top,0px) + 20px);align-self:start;display:flex;flex-direction:column;gap:6px;font-family:var(--mono);font-size:.78rem}
.toc a{text-decoration:none;color:var(--muted);padding:3px 0 3px 10px;border-left:2px solid var(--line)}
.toc a:hover{color:var(--fg);border-color:var(--accent)}
main{display:flex;flex-direction:column;gap:72px;min-width:0}
section{display:flex;flex-direction:column;gap:20px;scroll-margin-top:20px}
.prose{max-width:68ch;display:flex;flex-direction:column;gap:14px}
.tag{display:inline-block;font-family:var(--mono);font-size:.72rem;padding:2px 8px;border-radius:3px;border:1px solid currentColor;width:fit-content}
.t-x{color:var(--xray)}.t-c{color:var(--ct)}.t-m{color:var(--mri)}

.cols{display:grid;grid-template-columns:repeat(auto-fit,minmax(240px,1fr));gap:16px}
.box{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:20px;display:flex;flex-direction:column;gap:10px;min-width:0}
.box ul{margin:0;padding-left:1.1em;display:flex;flex-direction:column;gap:4px}
.box h3{font-size:1rem}

.tablewrap{overflow-x:auto;border:1px solid var(--line);border-radius:6px;background:var(--surface)}
table{border-collapse:collapse;width:100%;min-width:640px;font-size:.95rem}
th,td{text-align:left;padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:top}
thead th{font-family:var(--display);font-size:.95rem;background:var(--accent-soft)}
tbody th{font-family:var(--mono);font-size:.78rem;font-weight:600;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
tr:last-child td,tr:last-child th{border-bottom:0}

/* Hounsfield scale */
.hu{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:20px;overflow-x:auto}
.hu svg{display:block;min-width:620px;width:100%;height:auto}
.hu text{font-family:var(--mono);font-size:11px;fill:var(--fg)}
.hu .sub{fill:var(--muted);font-size:10px}

/* dose bars */
.dose{display:flex;flex-direction:column;gap:10px;background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:20px}
.drow{display:grid;grid-template-columns:minmax(120px,210px) minmax(0,1fr) 72px;gap:12px;align-items:center;font-size:.92rem}
.track{height:14px;background:var(--bg);border-radius:2px;position:relative}
.bar{height:100%;border-radius:2px;background:var(--ct);min-width:2px}
.bar.x{background:var(--xray)}.bar.n{background:var(--muted)}
.dv{font-family:var(--mono);font-size:.82rem;text-align:right;font-variant-numeric:tabular-nums}
.note{font-size:.85rem;color:var(--muted)}
@media (max-width:520px){.drow{grid-template-columns:1fr 64px}.drow .track{grid-column:1/-1;order:3}}

.alert{border-left:4px solid var(--warn);background:var(--surface);padding:16px 20px;border-radius:0 6px 6px 0}
.alert strong{color:var(--warn)}

ol.timeline{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;border-left:2px solid var(--line)}
ol.timeline li{display:grid;grid-template-columns:76px minmax(0,1fr);gap:16px;padding:10px 0 10px 18px;position:relative}
ol.timeline li::before{content:"";position:absolute;left:-6px;top:20px;width:10px;height:10px;border-radius:50%;background:var(--accent)}
ol.timeline time{font-family:var(--mono);font-weight:600;font-variant-numeric:tabular-nums}

details{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:14px 18px}
details+details{margin-top:8px}
summary{font-family:var(--display);font-weight:700;cursor:pointer}
details p{margin-top:10px;color:var(--muted)}

dl.gloss{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin:0}
dl.gloss div{border-top:1px solid var(--line);padding-top:10px}
dt{font-family:var(--display);font-weight:700}
dd{margin:4px 0 0;color:var(--muted);font-size:.95rem}

/* quiz */
.quiz{display:flex;flex-direction:column;gap:14px}
.q{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:18px;display:flex;flex-direction:column;gap:10px}
.opts{display:flex;flex-wrap:wrap;gap:8px}
.opts button{font:inherit;font-size:.92rem;padding:7px 14px;border-radius:4px;border:1px solid var(--line);background:var(--bg);color:var(--fg);cursor:pointer}
.opts button:hover{border-color:var(--accent)}
.opts button.ok{border-color:#1f9d55;background:color-mix(in srgb,#1f9d55 18%,var(--surface))}
.opts button.no{border-color:var(--warn);background:color-mix(in srgb,var(--warn) 14%,var(--surface))}
.fb{font-size:.9rem;color:var(--muted)}

footer{border-top:1px solid var(--line);padding-block:28px 40px;font-size:.88rem;color:var(--muted);display:flex;flex-direction:column;gap:8px}
@media (prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
html{scroll-behavior:smooth}

/* multi-page additions */
.crumbs{font-family:var(--mono);font-size:.78rem;color:var(--muted);display:flex;gap:6px;flex-wrap:wrap;padding-block:4px 0}
.crumbs a{color:var(--muted);text-decoration:none}.crumbs a:hover{color:var(--accent)}
.pagehead{display:flex;flex-direction:column;gap:14px;padding-block:28px 8px;max-width:68ch}
.pagehead h1{font-size:clamp(2rem,5vw,3.4rem);font-weight:800;letter-spacing:-.02em}
.pagehead p{font-size:1.1rem;color:var(--muted)}
.single{display:flex;flex-direction:column;gap:64px;padding-block:32px 56px;min-width:0}
.cards{display:grid;grid-template-columns:repeat(auto-fit,minmax(250px,1fr));gap:14px}
a.card{background:var(--surface);border:1px solid var(--line);border-radius:6px;padding:20px;text-decoration:none;color:var(--fg);display:flex;flex-direction:column;gap:8px;transition:border-color .15s}
a.card:hover{border-color:var(--accent)}
a.card h3{font-size:1.1rem}a.card p{color:var(--muted);font-size:.95rem}
a.card .go{font-family:var(--mono);font-size:.75rem;color:var(--accent);margin-top:auto}
.pager{display:grid;grid-template-columns:1fr 1fr;gap:14px;border-top:1px solid var(--line);padding-top:24px}
.pager a{text-decoration:none;color:var(--fg);display:flex;flex-direction:column;gap:2px}
.pager a span{font-family:var(--mono);font-size:.72rem;color:var(--muted)}
.pager a b{font-family:var(--display)}
.pager .nx{text-align:right;grid-column:2}
ol.steps{margin:0;padding-left:1.3em;display:flex;flex-direction:column;gap:10px;max-width:68ch}
ol.steps li::marker{font-family:var(--mono);color:var(--accent);font-weight:600}
nav.top a[aria-current="page"]{color:var(--fg);text-decoration:underline;text-underline-offset:4px}
.sitefoot{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:16px}
.sitefoot div{display:flex;flex-direction:column;gap:4px}
.sitefoot a{color:var(--muted);text-decoration:none}.sitefoot a:hover{color:var(--accent)}


/* Responsive editorial banner images */
.radiology-banner{margin:18px 0 24px;overflow:hidden;border:1px solid var(--line);border-radius:18px;background:var(--panel, #101c22)}
.radiology-banner img{display:block;width:100%;height:clamp(190px,32vw,360px);object-fit:cover;object-position:center 42%}
.radiology-banner figcaption{padding:8px 13px;color:var(--muted);font-size:.78rem;line-height:1.4}
@media(max-width:600px){.radiology-banner{margin:12px 0 18px;border-radius:12px}.radiology-banner img{height:210px}}
