:root{color-scheme:light;--bg:#eef2f3;--panel:#fafcfc;--line:#bfc0c0;--text:#2d3142;--muted:#4f5d75;--cyan:#954423;--purple:#4f5d75;--green:#23604b;--amber:#954423}
html{scroll-behavior:smooth;scroll-padding-top:18px}
body{background:var(--bg);color:var(--text)}
header{max-width:1380px}
main{max-width:1380px}
header,main{padding-left:32px;padding-right:32px}
.chapter-nav{max-width:1380px;gap:8px;padding:12px 32px 28px}
.chapter-nav a{background:#fff;border:1px solid var(--line);border-radius:24px;padding:8px 14px;text-decoration:none;font-size:14px}
.chapter{padding:30px 0 52px;border-top:1px solid var(--line)}
.chapter>h2{max-width:960px;font-size:clamp(28px,3vw,40px);letter-spacing:-.7px}
.chapter>p{max-width:1040px}
.card{background:var(--panel);box-shadow:0 6px 0 #2d314208}
.card ol{padding-left:20px}.card li{margin:8px 0}
button{background:#fff;border-color:#788598;color:var(--text)}
button:hover,button.selected{background:#f9e3da;border-color:#954423;color:var(--text)}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #954423}
.controls select,.controls input[type=text]{background:#fff;color:var(--text)}
.equation{background:#e2e8eb;border-color:#954423;color:var(--text);border-radius:5px;font-size:14px}
.notice{background:#f7ece6;color:var(--text);margin-top:16px}
.contract{line-height:1.6}
.token{background:#e7edee;color:var(--text)}
.token.hit{background:#e2eee7;color:#23604b}
.token.miss{background:#f9e3da;color:#873b1d}
.diagram{background:#e7edee}
.diagram rect{fill:#f8fafb!important;stroke:#4f5d75!important}
.diagram .edge{stroke:#ad4b21}
.diagram marker path{fill:#ad4b21}
.diagram text{fill:#2d3142!important}
.diagram .minor{fill:#4f5d75!important}
.diagram path:not(.edge){stroke:#4f5d75}
.diagram [fill="#65e8f5"],.diagram [fill="#80efb5"],.diagram [fill="#ffd18a"],.diagram [fill="#c3a2ff"]{fill:#4f5d75!important}
.bar{background:#bfc0c0}
.bar .work{background:#ef8354}
.bar .waste{background:#8794a7}
.bar .reused{background:#39765e}
.badge{color:#873b1d}
.error{color:#9e251d;border-color:#9e251d;background:#fff2ee}
.analogy{margin:22px 0;padding:20px 24px;border-left:4px solid #ef8354;background:#fff9f4;border-radius:0 12px 12px 0}
.analogy p{max-width:1060px}
details{padding:18px 22px;background:#fff;border:1px solid var(--line);border-radius:12px;margin:20px 0}
summary{cursor:pointer;font-weight:650}
dt{font-weight:700;margin-top:12px}
dd{margin:4px 0 12px}
.mechanism-article{margin:28px 0;border:1px solid var(--line);border-radius:20px;background:#e8eeef;overflow:hidden}
.world-heading{padding:20px 24px 0;display:flex;justify-content:space-between;align-items:start;gap:16px;flex-wrap:wrap}
.world-heading h3{margin:0}
.world-actions{display:flex;flex-wrap:wrap;gap:8px}
.world-actions button{padding:6px 12px;font-size:14px}
.world-scroll{overflow:auto}
.mechanism-steps{display:flex;flex-wrap:wrap;gap:8px 26px;padding:12px 24px 12px 46px;font-size:14px}
.mechanism-steps li{padding:4px 8px}
.mechanism-steps .active{background:#f9e3da;color:#873b1d;font-weight:700;border-radius:4px}
.mechanism-view{padding:0 12px 22px}
.mechanism-svg{display:block;width:100%;min-width:720px}
.mechanism-svg text{font:15px system-ui,sans-serif;fill:#2d3142}
.mechanism-svg rect{fill:#fafcfc;stroke:#788598}
.mechanism-svg path{fill:none;stroke:#4f5d75;stroke-width:2}
.mechanism-svg circle{fill:#4f5d75}
.mechanism-svg .lifeline,.mechanism-svg .endpoint-guide{stroke:#8794a7;stroke-dasharray:4 6;stroke-width:1}
.mechanism-svg .state-history{stroke-width:8}
.mechanism-svg .new-work{stroke:#ad4b21;stroke-width:8;stroke-dasharray:8 4}
.mechanism-svg .recurrent-updates{stroke-dasharray:4 6}
.mechanism-svg .active rect{stroke:#ad4b21;stroke-width:3;fill:#fff4ed}
.mechanism-svg .active path{stroke:#ad4b21;stroke-width:3}
.mechanism-svg .active text{font-weight:650}
.mechanism-svg .active circle{fill:#ad4b21}
.mechanism-svg .address-clearance,.mechanism-svg .active .address-clearance{stroke:#e8eeef;stroke-width:8}
.mechanism-svg .masked-slot{fill:#d7dfe1;stroke-dasharray:3 3}
.mechanism-view .diagram-note{font-size:13px;color:#4f5d75;margin:12px}
.mechanism-svg .diagram-note{font-size:13px;fill:#4f5d75}
.responsibility-matrix{min-width:800px;width:100%;table-layout:fixed;border-collapse:collapse}
.responsibility-matrix caption{text-align:left;padding:10px;font-size:14px}
.responsibility-matrix th,.responsibility-matrix td{padding:16px 10px;border:1px solid #bfc0c0;overflow-wrap:anywhere}
.responsibility-matrix .active{background:#fff1e8;color:#873b1d;box-shadow:inset 0 -3px #ad4b21}
.tree-step{font-weight:650;margin:12px}
.benchmark-protocol{display:grid;grid-template-columns:1fr 1fr;gap:18px;padding:12px}
.benchmark-protocol>div{border-left:3px solid #bfc0c0;padding:0 18px}
.benchmark-protocol>.active{border-color:#ad4b21;background:#fff8f1}
.benchmark-protocol h4{margin:12px 0}
.measurement-trace{display:flex;flex-wrap:wrap;gap:6px 24px;padding-left:22px}
.measurement-trace li{border-bottom:2px solid #788598;padding:6px 0}
.scroll-hint{display:none;font-size:13px;margin:0 18px 12px;color:#4f5d75}
.mechanism-view:focus-visible{outline:3px solid #954423;outline-offset:-3px}
.world-caption{padding:0 24px 22px;display:grid;grid-template-columns:1fr 1fr;gap:18px}
.world-caption p{margin:0}
.world-caption .contract{padding:12px;background:#fff;border:1px solid var(--line);border-radius:10px}
.world-note{padding:0 24px 14px;font-size:12px;color:#4f5d75}
.radix-svg{display:block;width:100%;min-width:620px}
.radix-tree{overflow:auto}
.radix-svg text{fill:#2d3142;font:13px ui-monospace,monospace}
.radix-svg rect{fill:#e2e8eb;stroke:#4f5d75}
.radix-svg path{stroke:#4f5d75;fill:none}
.radix-svg circle{fill:#ef8354}
.weight-bar{height:8px;background:#ef8354;min-width:2px;border-radius:2px}
.comparison-table{min-width:790px;table-layout:fixed}
.comparison-table th:first-child{width:17%}
.world-readout{font-weight:650}
.paused *{animation-play-state:paused!important}
@media(prefers-reduced-motion:reduce){html{scroll-behavior:auto}*,*::before,*::after{animation:none!important;transition:none!important}}
@media(max-width:850px){header,main{padding-left:18px;padding-right:18px}.chapter-nav{padding-left:18px;padding-right:18px}.world-caption{grid-template-columns:1fr}.world-heading{padding:18px}.world-caption{padding:0 18px 18px}.notice{margin-left:0;margin-right:0}.chapter{padding-top:22px;padding-bottom:32px}.world-note{padding-left:18px;padding-right:18px}}
@media(max-width:600px){.benchmark-protocol{grid-template-columns:1fr}}
@media(max-width:850px){.scroll-hint{display:block}}
