/* Localise. Tokens and components come from ../demo-house.css, so the app
   reads as part of the atlas; this file is its own layout: the bar, the
   pages, the question, and the look every map shares. */
:root{
  --les:var(--vm); --ghost:var(--ca); --abn:var(--vm);
  --abn-bg:color-mix(in srgb, var(--vm) 11%, transparent);
  --hl:var(--partly);
  /* the arteries, on the tree and on whatever they feed */
  --sup-aca:var(--na); --sup-mca:var(--ca); --sup-lsa:var(--k); --sup-acha:var(--partly); --sup-pca:var(--cl);
  --sup-pm:var(--k); --sup-circ:var(--na); --sup-asa:var(--na); --sup-psa:var(--ca);
  --bar-h:52px;
  /* what a structure does, said in the same colour on every map */
  --sys-motor:var(--na); --sys-touch:var(--ca); --sys-pain:var(--cl); --sys-cbl:var(--k); --sys-auto:var(--partly);
  /* the five roots of a limb, in order, as demo 24 colours them */
  --r0:#1f6fb2; --r1:#cf8600; --r2:#178a64; --r3:#8a4fb0; --r4:#cf4f1c;
  --plate:color-mix(in srgb, var(--paper) 62%, var(--sheet));
}
@media (prefers-color-scheme: dark){ :root:not([data-theme="light"]){ --r0:#6fb2f0; --r1:#f0b34a; --r2:#4cc79a; --r3:#c08ae6; --r4:#f08a5a; } }
:root[data-theme="dark"]{ --r0:#6fb2f0; --r1:#f0b34a; --r2:#4cc79a; --r3:#c08ae6; --r4:#f08a5a; }
html,body{ height:100%; }
body.lz{ font-family:var(--sans); font-size:16px; line-height:1.45; display:flex; flex-direction:column; min-height:100%; }
.lz [hidden]{ display:none !important; }
.lz h1,.lz h2,.lz h3{ font-family:var(--serif); font-weight:500; letter-spacing:-.01em; margin:0; }
.lz a{ color:inherit; }
.lz a.btn{ color:var(--sheet); text-decoration:none; display:inline-block; }
.lz a.btn.ghost{ color:var(--ink); }
.eyebrow{ font-size:12.5px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-3); margin:0 0 6px; }
.muted{ color:var(--ink-3); }
.btn.sm{ padding:5px 10px; font-size:14px; }
.chip.sm{ padding:3px 9px; font-size:13px; }
.linkbtn{ appearance:none; background:none; border:0; padding:0; font:inherit; color:var(--ink-2); text-decoration:underline; text-underline-offset:2px; cursor:pointer; }
.linkbtn:hover{ color:var(--ink); }
kbd{ font:600 12px/1 var(--sans); border:1px solid var(--rule); border-bottom-width:2px; border-radius:4px; padding:2px 5px; color:var(--ink-2); background:var(--sheet); }

/* ---------- the bar ---------- */
.lz-top{ position:sticky; top:0; z-index:30; height:var(--bar-h); display:flex; align-items:center; gap:6px 18px; padding:0 18px;
  background:color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); border-bottom:1px solid var(--rule); }
.lz-brand{ font-family:var(--serif); font-size:22px; font-weight:500; text-decoration:none; letter-spacing:-.01em; }
.lz-nav{ display:flex; gap:2px; margin-left:8px; overflow-x:auto; scrollbar-width:none; }
.lz-nav a{ text-decoration:none; font-weight:600; font-size:14.5px; color:var(--ink-2); padding:6px 10px; border-radius:7px; white-space:nowrap; }
.lz-nav a:hover{ background:var(--tint); }
.lz-nav a[aria-current="page"]{ color:var(--ink); background:var(--tint); }
.lz-nav .due{ font-size:12px; font-weight:700; background:var(--ink); color:var(--sheet); border-radius:9px; padding:0 6px; margin-left:5px; }
.lz-fill{ flex:1; }
.lz-atlas{ font-size:14px; color:var(--ink-2); text-decoration:none; white-space:nowrap; }
.lz-atlas:hover{ color:var(--ink); text-decoration:underline; }
.lz-theme{ appearance:none; border:1px solid var(--rule); background:var(--sheet); border-radius:7px; width:34px; height:30px; cursor:pointer; color:var(--ink-2); }
#view{ flex:1; min-height:0; }
@media (max-width:640px){ .lz-top{ padding:0 10px; gap:6px 8px; } .lz-atlas{ display:none; } .lz-brand{ font-size:20px; } }

/* ---------- pages ---------- */
.page{ max-width:1080px; margin:0 auto; padding:26px 20px 70px; }
.page > h1{ font-size:clamp(30px,5vw,44px); line-height:1.05; margin:0 0 8px; }
.page > .lede{ font-family:var(--serif); font-size:18px; color:var(--ink-2); max-width:62ch; margin:0 0 22px; }
.page h2{ font-size:24px; margin:26px 0 10px; }
.cards{ display:grid; gap:12px; grid-template-columns:repeat(auto-fit, minmax(230px, 1fr)); }
.card{ padding:14px 16px 16px; display:flex; flex-direction:column; gap:6px; }
.card h3{ font-size:20px; }
.card p{ margin:0; font-size:14.5px; color:var(--ink-2); }
.card .btn{ align-self:flex-start; margin-top:auto; }
button.card{ appearance:none; text-align:left; cursor:pointer; font:inherit; color:inherit; }
button.card:hover{ border-color:var(--ink-2); }
.field{ margin:0 0 18px; }
.field > .fname{ font-size:14px; font-weight:700; color:var(--ink-2); margin:0 0 6px; }
.field .note{ font-size:13.5px; color:var(--ink-3); margin:6px 0 0; }
.radios{ display:grid; gap:6px; grid-template-columns:repeat(auto-fit, minmax(240px, 1fr)); max-width:760px; }
.radios label{ display:flex; gap:10px; align-items:flex-start; border:1px solid var(--rule); border-radius:8px; padding:9px 12px; cursor:pointer; font-size:15px; background:var(--sheet); }
.radios label:has(input:checked){ border-color:var(--ink); box-shadow:inset 0 0 0 1px var(--ink); }
.radios input{ margin:3px 0 0; accent-color:var(--ink); width:16px; height:16px; flex:none; }
.radios small{ display:block; color:var(--ink-3); font-size:13.5px; line-height:1.35; }
.stat{ display:flex; flex-wrap:wrap; gap:8px 28px; margin:0 0 18px; }
.stat div b{ display:block; font-family:var(--serif); font-size:34px; font-weight:500; line-height:1; font-variant-numeric:tabular-nums; }
.stat div span{ font-size:13.5px; color:var(--ink-3); }
.bars{ display:grid; gap:7px; max-width:720px; }
.bar-row{ display:grid; grid-template-columns:minmax(120px, 230px) minmax(0,1fr) auto; gap:4px 12px; align-items:center; font-size:14.5px; }
.bar-row .track{ height:9px; border-radius:5px; background:var(--grid); overflow:hidden; }
.bar-row .track i{ display:block; height:100%; border-radius:5px; background:var(--good); }
.bar-row .n{ color:var(--ink-2); font-variant-numeric:tabular-nums; white-space:nowrap; font-size:13.5px; }
@media (max-width:560px){ .bar-row{ grid-template-columns:minmax(0,1fr) auto; } .bar-row .track{ grid-column:1 / -1; order:3; } .page{ padding:18px 12px 60px; } }
table.list{ width:100%; border-collapse:collapse; font-size:14.5px; }
table.list th, table.list td{ text-align:left; padding:6px 8px; border-bottom:1px solid var(--grid); vertical-align:top; }
table.list th{ font-size:12.5px; color:var(--ink-3); font-weight:600; border-bottom-color:var(--rule); }
.num{ font-variant-numeric:tabular-nums; white-space:nowrap; }

/* progress */
.pg-two{ display:grid; gap:18px 28px; grid-template-columns:minmax(260px, 380px) minmax(0,1fr); align-items:start; margin-top:14px; }
@media (max-width:820px){ .pg-two{ grid-template-columns:minmax(0,1fr); } }
.pg-fig{ padding:10px 12px; } .pg-fig svg{ width:100%; height:auto; display:block; max-height:560px; }
.pg-fig .pg-reg{ cursor:pointer; }
.pg-fig .pg-reg.has{ fill:color-mix(in srgb, var(--good) calc(var(--share) * 70%), color-mix(in srgb, var(--bad) calc((1 - var(--share)) * 55%), transparent)); }
.pg-fig .pg-reg:hover{ stroke:var(--focus); stroke-width:2; }
.pg-days{ display:flex; align-items:flex-end; gap:4px; height:64px; max-width:420px; }
.pg-days span{ flex:1; height:100%; display:flex; align-items:flex-end; background:var(--grid); border-radius:3px; overflow:hidden; }
.pg-days i{ display:block; width:100%; background:var(--ink-2); min-height:0; }
/* the library */
.lib-find{ width:100%; max-width:520px; font:16px var(--sans); color:var(--ink); background:var(--sheet); border:1px solid var(--rule); border-radius:8px; padding:9px 12px; }
.lib-group h2{ font-size:20px; margin:22px 0 8px; }
.lib-list{ display:flex; flex-wrap:wrap; gap:6px; }
.lib-list a{ text-decoration:none; border:1px solid var(--rule); background:var(--sheet); border-radius:999px; padding:5px 12px; font-weight:600; font-size:14px; color:var(--ink-2); }
.lib-list a:hover{ border-color:var(--ink-2); color:var(--ink); }
.lib-list a.known{ box-shadow:inset 0 -3px 0 var(--good); } .lib-list a.learning{ box-shadow:inset 0 -3px 0 var(--partly); } .lib-list a.weak{ box-shadow:inset 0 -3px 0 var(--bad); }
.lib-two{ display:grid; gap:16px 24px; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:start; }
@media (max-width:899px){ .lib-two{ grid-template-columns:minmax(0,1fr); } }
.lib-map{ padding:10px 14px; min-height:460px; display:flex; flex-direction:column; position:sticky; top:calc(var(--bar-h) + 10px); }
@media (max-width:899px){ .lib-map{ position:static; } }

/* ---------- the question ---------- */
.q{ display:flex; flex-direction:column; height:calc(100vh - var(--bar-h)); height:calc(100dvh - var(--bar-h)); }
.q-bar{ display:flex; align-items:center; gap:8px 14px; padding:7px 18px; border-bottom:1px solid var(--rule); background:var(--sheet); font-size:14.5px; flex-wrap:wrap; }
.q-pos{ font-weight:700; white-space:nowrap; }
.q-prog{ flex:1 1 80px; min-width:60px; height:6px; border-radius:3px; background:var(--grid); overflow:hidden; }
.q-prog i{ display:block; height:100%; background:var(--ink); transition:width .25s; }
.q-clock{ color:var(--ink-2); font-variant-numeric:tabular-nums; min-width:3.2em; text-align:right; }
.q-bar .tool{ appearance:none; border:1px solid var(--rule); background:var(--paper); color:var(--ink-2); border-radius:7px; padding:4px 10px; font:600 13.5px var(--sans); cursor:pointer; white-space:nowrap; }
.q-bar .tool[aria-pressed="true"]{ border-color:var(--ink); color:var(--ink); box-shadow:inset 0 0 0 1px var(--ink); }
.q-bar .tool:disabled{ opacity:.4; cursor:default; }
.q-grid{ flex:1; min-height:0; display:grid; grid-template-columns:minmax(0,9fr) minmax(0,11fr); }
.q-left{ overflow-y:auto; padding:16px 18px 40px; display:flex; flex-direction:column; gap:12px; overscroll-behavior:contain; }
.q-right{ border-left:1px solid var(--rule); background:var(--sheet); display:flex; flex-direction:column; min-height:0; overflow:hidden; }
.q-tabs{ display:flex; gap:8px; align-items:center; padding:8px 12px 0; overflow-x:auto; scrollbar-width:thin; }
.q-tabs:empty{ padding-top:2px; }
.q-tabs > *{ flex:none; }
.q-pane{ flex:1; min-height:0; overflow:auto; padding:8px 12px 10px; display:flex; flex-direction:column; }
@media (max-width:899px){
  .q{ height:auto; } .q-grid{ display:block; } .q-left{ overflow:visible; padding:12px 12px 16px; }
  .q-right{ border-left:0; border-top:1px solid var(--rule); min-height:70vh; } .q-bar{ padding:6px 10px; position:sticky; top:var(--bar-h); z-index:20; }
}
.q-patient{ padding:14px 16px 12px; }
.q-history{ font-family:var(--serif); font-size:19.5px; line-height:1.42; margin:0 0 10px; max-width:66ch; }
.q-forms{ margin:2px 0 8px; }
.q-exam{ font-size:15.5px; line-height:1.5; }
.q-meta{ font-size:13px; color:var(--ink-3); margin:8px 0 0; }

/* the examination as prose (vignette.js gives the structure) */
.vg-block{ margin:0 0 7px; }
.vg-block b.t{ font-weight:700; color:var(--ink-2); margin-right:4px; }
.vg-line{ border-radius:3px; transition:background .15s; }
.vg-line.abn{ color:var(--ink); }
.vg-line.decides{ box-shadow:inset 0 -2px 0 color-mix(in srgb, var(--good) 60%, transparent); }
.vg-line.hint{ background:color-mix(in srgb, var(--partly) 22%, transparent); }
.vg-line.hl, [data-keys].hl{ background:color-mix(in srgb, var(--hl) 30%, transparent); }
.vg-line.changed{ background:var(--abn-bg); }
.vg-rest{ color:var(--ink-2); margin:6px 0 0; }
.vg-ncs{ margin:8px 0 0; padding:7px 10px; border-left:3px solid var(--rule); background:var(--tint); border-radius:0 6px 6px 0; font-size:15px; }

/* the answer */
.q-answer{ padding:14px 16px 16px; }
.q-answer h2{ font-size:22px; margin:0 0 10px; display:flex; flex-wrap:wrap; gap:8px 14px; align-items:center; justify-content:space-between; }
.opts{ list-style:none; margin:0; padding:0; display:grid; gap:6px; }
.opt{ appearance:none; width:100%; text-align:left; display:grid; grid-template-columns:26px minmax(0,1fr) auto; gap:8px; align-items:baseline;
  border:1px solid var(--rule); background:var(--paper); color:var(--ink); border-radius:8px; padding:9px 12px; cursor:pointer; font:15.5px/1.35 var(--sans); }
.opt .n{ font-weight:700; color:var(--ink-3); font-variant-numeric:tabular-nums; }
.opt:hover:not(:disabled){ border-color:var(--ink-2); }
.opt[aria-pressed="true"]{ border-color:var(--ink); background:var(--sheet); box-shadow:inset 0 0 0 1px var(--ink); }
.opt.out .txt{ text-decoration:line-through; color:var(--ink-3); }
.opt:disabled{ cursor:default; }
.opt.right{ border-color:var(--good); box-shadow:inset 4px 0 0 var(--good); }
.opt.wrong{ border-color:var(--bad); box-shadow:inset 4px 0 0 var(--bad); }
.opt .tag{ font-size:13px; font-weight:700; white-space:nowrap; }
.opt.right .tag{ color:var(--good); } .opt.wrong .tag{ color:var(--bad); }
.opt-why{ font-size:14.5px; color:var(--ink-2); margin:4px 4px 6px 38px; line-height:1.45; }
.opt-why summary{ cursor:pointer; font-weight:600; font-size:13.5px; color:var(--ink-3); }
.opt-why[open] summary{ margin-bottom:3px; }
.q-actions{ display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px; margin-top:12px; }
.q-actions .grow{ flex:1; }
.q-conf{ display:flex; align-items:center; gap:6px; font-size:13.5px; color:var(--ink-3); }
.om-q{ margin:0 0 10px; font-size:15.5px; max-width:60ch; }
.q-how{ font-family:var(--sans); }
.mapanswer{ border:1px dashed var(--rule); border-radius:10px; padding:11px 13px; font-size:15.5px; min-height:48px; display:flex; flex-wrap:wrap; align-items:center; gap:4px 10px; }
.mapanswer.has{ border-style:solid; border-color:var(--focus); background:color-mix(in srgb, var(--focus) 7%, var(--sheet)); }
.mapanswer b{ font-family:var(--serif); font-weight:500; font-size:19px; line-height:1.25; }
.mapanswer .eyebrow{ flex-basis:100%; margin:0; }
.mapanswer ol{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:4px 14px; color:var(--ink-2); font-size:14.5px; }
.mapanswer ol li::before{ content:attr(data-n); display:inline-grid; place-items:center; width:19px; height:19px; margin-right:6px; border-radius:50%; background:var(--tint); color:var(--ink-2); font-weight:700; font-size:12px; }

/* the verdict and what follows */
.verdict{ padding:12px 16px 14px; border-left:4px solid var(--ink); }
.verdict.right{ border-left-color:var(--good); } .verdict.partly{ border-left-color:var(--partly); } .verdict.wrong{ border-left-color:var(--bad); }
.verdict .marks{ display:flex; flex-wrap:wrap; gap:4px 16px; font-weight:700; font-size:15px; margin:0 0 8px; }
.marks .ok{ color:var(--good); } .marks .half{ color:var(--partly); } .marks .no{ color:var(--bad); }
.verdict .truth{ font-family:var(--serif); font-size:21px; line-height:1.25; margin:0 0 6px; }
.verdict .rule{ font-family:var(--serif); font-size:17.5px; line-height:1.45; margin:0 0 4px; max-width:66ch; }
.q-answer .verdict{ margin:0 0 12px; padding:2px 0 2px 14px; }
.after{ padding:12px 16px 14px; }
.after h3{ font-family:var(--sans); font-size:14.5px; font-weight:700; margin:14px 0 5px; }
.after h3:first-child{ margin-top:0; }
.after .teach{ font-family:var(--serif); font-size:17px; line-height:1.5; margin:0; max-width:68ch; }
.after ul{ margin:0; padding-left:20px; font-size:14.5px; }
.after textarea{ width:100%; min-height:64px; font:15px/1.4 var(--sans); color:var(--ink); background:var(--paper); border:1px solid var(--rule); border-radius:8px; padding:8px 10px; resize:vertical; }
.model-note{ padding:8px 12px; border-left:4px solid var(--abn); font-size:14.5px; display:flex; flex-wrap:wrap; gap:6px 12px; align-items:center; justify-content:space-between; }

/* findings as tables (the Full form, and the examination asked for part by part) */
table.find{ width:100%; border-collapse:collapse; font-size:14.5px; }
table.find th{ text-align:left; font-weight:600; color:var(--ink-3); font-size:12.5px; padding:2px 6px 4px; border-bottom:1px solid var(--rule); }
table.find td{ padding:4px 6px; border-bottom:1px solid var(--grid); vertical-align:top; }
table.find td.v{ width:27%; }
table.find tr.h td{ font-weight:700; color:var(--ink-2); padding-top:9px; border-bottom:1px solid var(--rule); }
table.find td.abn{ color:var(--abn); font-weight:700; background:var(--abn-bg); }
.q-menu{ padding:12px 16px 14px; }
.exam-menu{ display:flex; flex-wrap:wrap; gap:5px; margin:4px 0 10px; }
.exam-menu h4{ flex-basis:100%; font:700 12.5px var(--sans); letter-spacing:.05em; text-transform:uppercase; color:var(--ink-3); margin:8px 0 0; }
.exam-menu button[aria-pressed="true"]{ border-color:var(--rule); color:var(--ink-3); background:var(--tint); }
.exam-card{ margin:0 0 10px; } .exam-card h4{ font:700 15px var(--sans); margin:0 0 5px; display:flex; justify-content:space-between; gap:8px; }
.exam-card h4 small{ font-weight:600; color:var(--ink-3); font-size:12.5px; }
.ddx{ font-size:14.5px; } .ddx b.big{ font-family:var(--serif); font-size:24px; font-weight:500; margin-right:5px; font-variant-numeric:tabular-nums; }

/* ---------- the map pane ---------- */
/* laid out to give the figure all the room there is: the rail of diagrams beside the plate, one row above, one bar below */
.mf{ display:flex; flex-direction:column; min-height:0; flex:1; position:relative; }
.mf-head{ display:flex; flex-wrap:wrap; align-items:center; gap:4px 14px; margin:0 0 6px; min-height:30px; }
.mf-views{ flex-wrap:wrap; max-width:100%; }
.mf-views button{ white-space:nowrap; }
.mf-controls{ display:flex; flex-wrap:wrap; gap:4px 16px; }
.mf-ctl{ display:flex; align-items:center; gap:8px; font-size:13px; color:var(--ink-3); }
.mf-ctl .row-btns{ margin:0; gap:4px; }
.mf-body{ flex:1; min-height:0; display:flex; gap:8px; }
/* the rail: every diagram one click away, the one in hand marked, and after the answer a dot on those the lesion is drawn on */
.mf-rail{ display:flex; flex-direction:column; gap:2px; flex:none; overflow-y:auto; scrollbar-width:none; }
.mf-rail button{ appearance:none; border:0; background:none; color:var(--ink-3); width:56px; padding:5px 2px 4px; border-radius:9px; cursor:pointer; position:relative;
  display:flex; flex-direction:column; align-items:center; gap:1px; font:600 10.5px/1.2 var(--sans); letter-spacing:.01em; transition:background .12s, color .12s; }
.mf-rail svg{ width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round; }
.mf-rail button:hover{ background:var(--tint); color:var(--ink); }
.mf-rail button[aria-current="true"]{ background:var(--ink); color:var(--sheet); }
.mf-rail button.hinted{ box-shadow:inset 0 0 0 2px var(--partly); color:var(--ink); }
.mf-rail button.holds::after{ content:''; position:absolute; top:4px; right:9px; width:8px; height:8px; border-radius:50%; background:var(--les); box-shadow:0 0 0 2px var(--sheet); }
.mf-stage{ flex:1; min-width:0; min-height:240px; display:flex; align-items:center; justify-content:center; padding:8px; overflow:hidden;
  background:var(--plate); border:1px solid var(--grid); border-radius:12px; }
.mf-stage > svg{ width:100%; height:100%; max-height:100%; display:block; }
.mf-stage.zoomed{ overflow:auto; align-items:flex-start; justify-content:flex-start; overscroll-behavior:contain; cursor:grab; scrollbar-width:thin; }
.mf-stage.zoomed > svg{ flex:none; max-height:none; margin:auto; }
.mf-stage.dragging{ cursor:grabbing; user-select:none; } .mf-stage.dragging *{ cursor:grabbing !important; }
.m-svg.m-in{ animation:m-in .22s ease-out 1; }
@keyframes m-in{ from{ opacity:0; transform:scale(.985); } to{ opacity:1; transform:none; } }
/* a zone is only something to click while answering: afterwards it must not sit in the way of the structures under it */
.m-svg:not([data-mode="answer"]) .m-place.zone{ pointer-events:none; }
.mf-ping{ position:absolute; z-index:4; pointer-events:none; border-radius:50%; border:2.5px solid var(--les); animation:mf-ping 1.5s ease-out 1 both; }
@keyframes mf-ping{ 0%{ transform:scale(.35); opacity:0; } 18%{ opacity:.95; } 60%{ transform:scale(1); opacity:.7; } 100%{ transform:scale(1.25); opacity:0; } }
@media (prefers-reduced-motion: reduce){ .mf-ping{ display:none; } }
/* the bar under the plate: the answer and Submit while answering, otherwise what a click does and the key */
.mf-bar{ display:flex; flex-wrap:wrap; align-items:center; gap:6px 10px; min-height:46px; margin:8px 0 0; padding:5px 6px 5px 12px; border:1px solid var(--grid); border-radius:10px;
  font-size:14px; color:var(--ink-2); position:relative; }
.mf-bar.pick{ border:1px dashed var(--rule); font-size:15px; }
.mf-bar.pick.has{ border-style:solid; border-color:var(--focus); background:color-mix(in srgb, var(--focus) 7%, var(--sheet)); color:var(--ink); }
.mf-status{ flex:1 1 170px; min-width:0; line-height:1.3; }
.mf-status .lab{ display:block; font-size:11px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-3); }
.mf-bar.pick.has .mf-status b{ font-family:var(--serif); font-weight:500; font-size:17.5px; }
.mf-legend{ font-size:13px; white-space:nowrap; } .mf-legend:empty{ display:none; }
.mf-legend .k{ display:inline-block; width:13px; height:13px; border-radius:3px; vertical-align:-2px; margin:0 5px 0 12px; }
.mf-legend .k:first-child{ margin-left:0; }
.mf-legend .k.les{ background:var(--les); } .mf-legend .k.gho{ border:2px dashed var(--ghost); }
.mf-find{ position:relative; flex:0 1 150px; min-width:110px; }
.mf-find input{ width:100%; font:14px var(--sans); color:var(--ink); background:var(--paper); border:1px solid var(--rule); border-radius:8px; padding:5px 9px; }
.mf-find ul{ list-style:none; margin:0; padding:5px; position:absolute; right:0; bottom:calc(100% + 8px); width:min(330px, 78vw); z-index:7; display:flex; flex-direction:column; gap:1px;
  background:var(--sheet); border:1px solid var(--rule); border-radius:10px; box-shadow:0 12px 30px -12px rgba(0,0,0,.45); }
.mf-find ul:empty{ display:none; }
.mf-find li button{ appearance:none; width:100%; text-align:left; border:0; background:none; color:var(--ink); border-radius:7px; padding:6px 9px; font:600 14px/1.3 var(--sans); cursor:pointer; }
.mf-find li button:hover, .mf-find li button:focus-visible{ background:var(--tint); }
.mf-find li.none{ font-size:13.5px; color:var(--ink-3); padding:6px 9px; }
.mf-zoomer{ display:inline-flex; flex:none; border:1px solid var(--rule); border-radius:8px; overflow:hidden; }
.mf-zoomer button{ appearance:none; border:0; background:var(--paper); color:var(--ink-2); font:600 13.5px/1 var(--sans); padding:7px 10px; cursor:pointer; min-width:32px; }
.mf-zoomer button + button{ border-left:1px solid var(--rule); }
.mf-zoomer button:hover:not(:disabled){ color:var(--ink); background:var(--tint); }
.mf-zoomer button:disabled{ color:var(--ink-3); opacity:.5; cursor:default; }
.mf-submit{ flex:none; }
.mf-list{ list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:6px; align-content:flex-start; align-self:flex-start; }
/* the name of whatever is under the pointer, and for some maps a card of what it supplies */
.mf-tip{ position:absolute; left:0; top:0; z-index:6; pointer-events:none; max-width:250px; padding:4px 9px; border-radius:7px; background:var(--ink); color:var(--sheet);
  font:600 13px/1.35 var(--sans); box-shadow:0 6px 18px -8px rgba(0,0,0,.45); }
.mf-tip.card{ width:236px; max-width:none; padding:10px 12px 11px; background:var(--sheet); color:var(--ink); border:1px solid var(--rule); font-weight:400; box-shadow:0 12px 30px -12px rgba(0,0,0,.45); }
.mf-tip.card h5{ margin:0 0 2px; font:700 14px/1.25 var(--sans); }
.mf-tip.card p{ margin:5px 0 0; font-size:12.5px; line-height:1.4; color:var(--ink-2); }
.mf-tip.card p b{ color:var(--ink); font-weight:700; }
.mf-tip.card svg{ display:block; width:100%; height:auto; margin:6px 0 0; }
.mf-tip p.pick{ margin:6px 0 0; padding-top:5px; border-top:1px solid var(--rule); font-size:12.5px; line-height:1.35; }
.mf-tip:not(.card) p.pick{ border-top-color:color-mix(in srgb, var(--sheet) 35%, transparent); font-weight:400; }
.mf-tip .rt{ display:inline-block; font-size:11.5px; font-weight:700; padding:0 4px; margin:3px 3px 0 0; border-radius:4px; color:var(--c); border:1px solid var(--c); line-height:1.4; }
.mf-tip .rt.min{ font-weight:400; border-style:dotted; }
/* a phone: the rail lies along the top of the plate, and the bar takes two lines */
@media (max-width:560px){
  .mf-body{ display:contents; }
  .mf-rail{ order:1; flex-direction:row; overflow-x:auto; overflow-y:hidden; gap:2px; margin:0 0 6px; }
  .mf-head{ order:2; } .mf-stage{ order:3; } .mf-bar{ order:4; }
  .mf-rail button{ width:auto; min-width:50px; padding:4px 6px 3px; flex:none; }
  .mf-stage{ padding:6px; min-height:56vh; }
  .mf-status{ flex-basis:100%; }
  .mf-find{ flex:1 1 110px; }
}

/* ---------- what every map is drawn with ---------- */
.m-svg{ font-family:var(--sans); overflow:visible; }
.m-svg .m-out{ fill:var(--sheet); stroke:var(--ink-3); stroke-width:1.2; stroke-linejoin:round; }
.m-svg .m-bg{ fill:color-mix(in srgb, var(--ink) 7%, var(--plate)); stroke:none; }
.m-svg .m-mid{ stroke:var(--rule); stroke-width:1; stroke-dasharray:3 3; fill:none; }
.m-svg .m-rule{ stroke:var(--rule); stroke-width:1; fill:none; }
.m-svg .m-label{ font-size:11px; font-weight:600; fill:var(--ink-2); pointer-events:none; }
.m-svg .m-label.sm{ font-size:9.5px; font-weight:400; fill:var(--ink-3); }
.m-svg .m-label.side{ font-size:13px; font-weight:700; fill:var(--ink-3); }
.m-svg .m-label.head{ font-size:12.5px; font-weight:700; fill:var(--ink); }
/* a structure is tinted by what it does: add s-motor, s-touch, s-pain, s-cbl or s-auto beside m-el (or to a label);
   any other colour by setting --c on the element */
.m-svg .m-el{ --c:var(--ink); --mix:9%; fill:color-mix(in srgb, var(--c) var(--mix), var(--sheet)); stroke:color-mix(in srgb, var(--c) 45%, var(--ink-3)); stroke-width:.9; stroke-linejoin:round;
  transition:fill .2s, stroke .2s, stroke-width .12s; }
.m-svg .s-motor{ --c:var(--sys-motor); --mix:20%; } .m-svg .s-touch{ --c:var(--sys-touch); --mix:18%; } .m-svg .s-pain{ --c:var(--sys-pain); --mix:20%; }
.m-svg .s-cbl{ --c:var(--sys-cbl); --mix:17%; } .m-svg .s-auto{ --c:var(--sys-auto); --mix:22%; }
.m-svg .m-el[style*="--c:"]{ --mix:18%; }
.m-svg .s-motor, .m-svg .s-touch, .m-svg .s-pain, .m-svg .s-cbl, .m-svg .s-auto, .m-svg .m-el[style*="--c:"]{ --lc:color-mix(in srgb, var(--c) 78%, var(--ink-2)); }
/* tinted by blood supply instead (the frame's "By blood supply", and the small brains of the arteries map) */
.m-svg .m-el.sup-aca{ --c:var(--sup-aca) !important; --mix:30%; } .m-svg .m-el.sup-mca{ --c:var(--sup-mca) !important; --mix:26%; } .m-svg .m-el.sup-lsa{ --c:var(--sup-lsa) !important; --mix:30%; }
.m-svg .m-el.sup-acha{ --c:var(--sup-acha) !important; --mix:34%; } .m-svg .m-el.sup-pca{ --c:var(--sup-pca) !important; --mix:30%; } .m-svg .m-el.sup-pm{ --c:var(--sup-pm) !important; --mix:30%; }
.m-svg .m-el.sup-circ{ --c:var(--sup-circ) !important; --mix:28%; } .m-svg .m-el.sup-asa{ --c:var(--sup-asa) !important; --mix:30%; } .m-svg .m-el.sup-psa{ --c:var(--sup-psa) !important; --mix:28%; }
.m-svg .m-el[class*="sup-"]{ --lc:color-mix(in srgb, var(--c) 78%, var(--ink-2)); }
.m-svg .m-el.grey[class*="sup-"]:not(.hit){ fill:color-mix(in srgb, var(--c) var(--mix), var(--sheet)); }
.mf-legend .k.sup{ background:color-mix(in srgb, var(--c) 60%, var(--sheet)); margin-left:8px; }
.mf-legend .g-aca{ --c:var(--sup-aca); } .mf-legend .g-mca{ --c:var(--sup-mca); } .mf-legend .g-lsa{ --c:var(--sup-lsa); } .mf-legend .g-acha{ --c:var(--sup-acha); } .mf-legend .g-pca{ --c:var(--sup-pca); }
.mf-legend .g-pm{ --c:var(--sup-pm); } .mf-legend .g-circ{ --c:var(--sup-circ); } .mf-legend .g-asa{ --c:var(--sup-asa); } .mf-legend .g-psa{ --c:var(--sup-psa); }
.m-svg .m-el.grey{ fill:color-mix(in srgb, var(--ink) 20%, var(--sheet)); }
.m-svg .m-el.line{ fill:none; stroke:var(--lc, var(--ink-2)); stroke-width:2.4; stroke-linecap:round; }
.m-svg text.s-motor, .m-svg text.s-touch, .m-svg text.s-pain, .m-svg text.s-cbl, .m-svg text.s-auto{ fill:color-mix(in srgb, var(--c) 72%, var(--ink)); }
.m-svg .m-key{ font-size:9.5px; fill:var(--ink-2); } .m-svg .m-key-sw{ stroke:none; fill:color-mix(in srgb, var(--c) 55%, var(--sheet)); }
/* a lit structure keeps the name written on it legible: the lesion colour never quite fills it */
.m-svg .m-el.hit{ fill:color-mix(in srgb, var(--les) calc(22% + var(--sev, 1) * 46%), var(--sheet)); stroke:var(--les); stroke-width:1.6; }
.m-svg .m-el.line.hit{ fill:none; stroke:color-mix(in srgb, var(--les) calc(35% + var(--sev, 1) * 65%), var(--ink-3)); stroke-width:3.4; }
.m-svg .m-el.ghost{ stroke:var(--ghost); stroke-width:2; stroke-dasharray:4 3; }
.m-svg .m-el.hl{ stroke:var(--hl); stroke-width:2.6; }
.m-svg .m-el.line.hl{ stroke:var(--hl); stroke-width:4.4; }
.m-svg .m-place{ cursor:default; }
.m-svg .m-place.zone{ fill:transparent; stroke:none; }
.m-svg[data-mode="answer"] .m-place, .m-svg[data-mode="answer"] [data-go], .m-svg[data-mode="neutral"] [data-go]{ cursor:pointer; }
.m-svg[data-mode="answer"] .m-place:hover, .m-svg[data-mode="answer"] [data-go]:hover, .m-svg[data-mode="neutral"] [data-go]:hover{ stroke:var(--focus); stroke-width:2; }
.m-svg[data-mode="answer"] .m-place:not(.line):not(.zone):hover{ fill:color-mix(in srgb, var(--focus) 16%, var(--sheet)); }
.m-svg[data-mode="answer"] .m-place.zone:hover{ fill:color-mix(in srgb, var(--focus) 14%, transparent); }
.m-svg .m-place.sel{ stroke:var(--focus); stroke-width:2.6; fill:color-mix(in srgb, var(--focus) 34%, var(--sheet)); filter:drop-shadow(0 0 3px color-mix(in srgb, var(--focus) 55%, transparent)); }
.m-svg .m-place.line.sel{ fill:none; stroke:var(--focus); stroke-width:4.4; }
.m-svg .m-place.zone.sel{ fill:color-mix(in srgb, var(--focus) 22%, transparent); }
.m-svg[data-mode="answer"] .m-place.sel{ animation:m-pick .32s ease-out 1; }
@keyframes m-pick{ from{ filter:drop-shadow(0 0 9px var(--focus)); } to{ filter:drop-shadow(0 0 3px color-mix(in srgb, var(--focus) 55%, transparent)); } }
.m-svg .m-el.hit{ animation:m-lit .7s ease-out 1; }
@keyframes m-lit{ from{ filter:drop-shadow(0 0 7px var(--les)); } to{ filter:drop-shadow(0 0 0 transparent); } }
.m-svg [data-mode] :focus-visible, .m-svg :focus-visible{ outline:2px solid var(--focus); outline-offset:2px; }
.m-svg[data-mode="reveal"] .m-el, .m-svg[data-mode="play"] .m-el{ cursor:pointer; }
/* what a structure serves, drawn beside it: a muscle, a patch of skin, a reflex */
.m-svg .m-tgt{ fill:var(--ink-3); stroke:none; }
.m-svg text.m-tgt{ font-size:9.5px; fill:var(--ink-3); }
.m-svg .m-tgt.abn{ fill:var(--abn); } .m-svg text.m-tgt.abn{ font-weight:700; }
.m-svg .m-go{ fill:var(--paper); stroke:var(--rule); stroke-width:1; }
.m-svg .m-go.on{ fill:var(--ink); stroke:var(--ink); } .m-svg .m-go.on + .m-label, .m-svg .m-label.on{ fill:var(--sheet); }

/* an experiment from the atlas, embedded */
.ex{ display:flex; flex-direction:column; flex:1; min-height:0; }
.ex iframe{ flex:1; min-height:420px; width:100%; border:1px solid var(--rule); border-radius:8px; background:var(--paper); }
.ex .ex-note{ font-size:14px; color:var(--ink-2); margin:0 0 6px; display:flex; justify-content:space-between; gap:10px; flex-wrap:wrap; }

@media (prefers-reduced-motion: reduce){ .q-prog i, .m-svg .m-el{ transition:none; } .m-svg .m-el.hit, .m-svg.m-in, .m-svg .m-place.sel{ animation:none !important; } }
