/* Externality Lab (builder T4): scoped to .xl-*. */
.xl-fig{display:flex;flex-direction:column;gap:8px;min-height:0;align-items:center;}
.ls-root .mic-ls-stage .xl-fig{flex:1;}
.xl-story{margin:0;max-width:42em;text-align:center;font:600 14px/1.45 var(--font-ui);color:var(--muted);}
.xl-story b{color:var(--ink);}
.xl-fig[data-view="pub"] .xl-g,.xl-fig[data-view="ext"] .xl-pg{display:none;}
/* the picture and, under it, the same market drawn only for its shaded loss (same viewBox, so the cells line up) */
.xl-g{flex:1;min-height:0;width:100%;max-width:560px;display:grid;}
.xl-g > *{grid-area:1/1;min-height:0;display:flex;align-items:center;justify-content:center;}
.xl-g .mic-graph-svg{width:100%;height:100%;max-height:100%;}
.xl-read{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px 8px;justify-content:center;}
.xl-read li{padding:5px 12px;border-radius:999px;background:var(--ctint);font:600 13px var(--font-ui);color:var(--ink);}
.xl-read li.is-zero{background:transparent;box-shadow:inset 0 0 0 2px var(--good-text,#1F6E3E);}
.xl-rk{font-weight:800;color:var(--cink);margin-right:4px;}
.xl-ctl{display:flex;flex-direction:column;gap:12px;}
.xl-ctl [hidden]{display:none !important;}
/* public goods (drawn by externality-lab.js): the street, then the stacked steps against MC */
.xl-pg{width:100%;max-width:760px;display:flex;flex-direction:column;align-items:center;gap:6px;flex:1;min-height:0;}
.xl-c0{--pc:var(--cink);} .xl-c1{--pc:#3E7CB1;} .xl-c2{--pc:#C9831C;}
:root[data-theme="dark"] .xl-c1{--pc:#7FB2E5;} :root[data-theme="dark"] .xl-c2{--pc:#E9B25A;}
.xl-street{display:block;width:100%;max-width:640px;height:auto;font-family:var(--font-ui);}
.xl-sky{fill:color-mix(in srgb,#1d2a4a 10%,transparent);}
:root[data-theme="dark"] .xl-sky{fill:color-mix(in srgb,#000 30%,transparent);}
.xl-road{fill:#5b616b;} .xl-lane{stroke:#e8e2c8;stroke-width:2;stroke-dasharray:10 9;fill:none;}
.xl-house path{fill:color-mix(in srgb,var(--pc) 22%,var(--white,#fff));stroke:var(--pc);stroke-width:2;stroke-linejoin:round;}
.xl-house .xl-door{fill:var(--pc);}
.xl-house text{fill:var(--pc);font-weight:900;font-size:13px;}
.xl-pole,.xl-arm{fill:none;stroke:var(--ink);stroke-width:3;stroke-linecap:round;}
.xl-lamp:not(.is-on) .xl-pole,.xl-lamp:not(.is-on) .xl-arm{stroke:var(--muted);stroke-width:2;stroke-dasharray:3 4;}
.xl-bulb{fill:none;stroke:var(--muted);stroke-width:2;stroke-dasharray:2 3;}
.xl-lamp.is-on .xl-bulb{fill:#FFD54A;stroke:#C99A00;stroke-dasharray:none;}
.xl-tree circle{fill:color-mix(in srgb,#2B6A1E 55%,transparent);} .xl-trunk{stroke:#7A5A12;stroke-width:4;fill:none;}
.xl-glow{fill:#FFD54A;opacity:.28;}
.xl-pgw{flex:1;min-height:0;width:100%;display:flex;justify-content:center;}
.xl-pgraph{display:block;width:100%;height:auto;max-height:max(220px,calc(100svh - 390px));font-family:var(--font-ui);overflow:visible;}
.xl-grid{stroke:var(--line);stroke-width:1;fill:none;}
.xl-axis{fill:none;stroke:var(--ink);stroke-width:1.8;}
.xl-step{fill:var(--pc);stroke:var(--white,#fff);stroke-width:1;}
.xl-step.is-off{opacity:.3;}
.xl-sv{fill:#fff;font-weight:800;font-size:12px;}
.xl-sv.is-off{fill:var(--ink);opacity:.6;}
.xl-sum{fill:var(--ink);font-weight:900;font-size:13px;font-variant-numeric:tabular-nums;paint-order:stroke;stroke:var(--white,#fff);stroke-width:4px;stroke-linejoin:round;}
.xl-sum.is-off{fill:var(--muted);}
.xl-msb{fill:none;stroke:var(--ink);stroke-width:2.6;stroke-linejoin:round;}
.xl-msb.xl-c0,.xl-msb.xl-c1,.xl-msb.xl-c2{stroke:var(--pc);}
.xl-mcl{stroke:var(--good-text,#1F6E3E);stroke-width:3;fill:none;}
.xl-qline{stroke:var(--ink);stroke-width:1.4;stroke-dasharray:5 4;fill:none;}
.xl-qdot{fill:var(--ink);stroke:var(--white,#fff);stroke-width:2;}
.xl-tick{fill:var(--muted);font-weight:700;font-size:12px;}
.xl-tick.is-q{fill:var(--ink);font-weight:900;}
.xl-axt{fill:var(--ink);font-weight:800;font-size:12.5px;}
.xl-lab{fill:var(--ink);font-weight:900;font-size:13.5px;}
.xl-lab.is-mc{fill:var(--good-text,#1F6E3E);}
.xl-qlab{fill:var(--ink);font-weight:900;font-size:13px;}
.xl-ptitle{fill:var(--ink);font-weight:900;font-size:13.5px;}
.xl-ptitle.xl-c0,.xl-ptitle.xl-c1,.xl-ptitle.xl-c2{fill:var(--pc);}
.xl-sumbox{fill:color-mix(in srgb,var(--ink) 5%,transparent);stroke:var(--line);}
.xl-keys{margin:0;display:flex;flex-wrap:wrap;gap:6px 14px;justify-content:center;font:700 12.5px var(--font-ui);color:var(--ink);}
.xl-key::before{content:"";display:inline-block;width:12px;height:12px;border-radius:3px;margin-right:6px;vertical-align:-1px;background:var(--pc);}
.xl-key.is-mc::before{width:16px;height:3px;vertical-align:3px;background:var(--good-text,#1F6E3E);}
.xl-ptbl{max-width:600px;}
.xl-qfig{display:flex;flex-direction:column;gap:8px;justify-content:center;align-items:center;}
.xl-qtext{max-width:38em;font:600 17px/1.5 var(--font-ui);color:var(--ink);}
.xl-qfig.has-graph .xl-qtext{font:600 13.5px/1.45 var(--font-ui);color:var(--muted);text-align:center;}
.xl-qscale{margin:0;font:600 12.5px var(--font-ui);color:var(--muted);}
.xl-qtbl{width:100%;max-width:520px;}
.xl-qtbl .xl-qt{width:100%;font-size:14px;}
.xl-qtbl .xl-qt td,.xl-qtbl .xl-qt th{text-align:right;padding:4px 10px;}
.xl-qg{width:100%;}
.xl-qg:empty{display:none;}
