/* SPDX-License-Identifier: AGPL-3.0-or-later */
:root{color-scheme:light;--bg:#fff;--ink:#222;--muted:#555;--line:#ddd;--accent:#08689e;font:15px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
:root[data-theme=dark]{color-scheme:dark;--bg:#141414;--ink:#eee;--muted:#ccc;--line:#3c3c3c;--accent:#8dcef5}
*{box-sizing:border-box}html{scroll-padding-top:78px}body{margin:0;background:var(--bg);color:var(--ink)}a{color:var(--accent);text-underline-offset:3px}button{font:inherit;cursor:pointer;color:var(--ink);background:transparent;border:1px solid var(--line);border-radius:4px;padding:7px 10px}a:focus-visible,button:focus-visible,summary:focus-visible{outline:2px solid var(--accent);outline-offset:4px}h1,h2,h3,p,figure{margin:0}p+p{margin-top:10px}h1{font-size:2.15rem;line-height:1.15;letter-spacing:-.03em;font-weight:650}h2{font-size:1.4rem;line-height:1.3;letter-spacing:-.02em;font-weight:600}h3{font-size:1.12rem;line-height:1.4;font-weight:600}.skip{position:fixed;top:-100px;left:16px;background:var(--bg);z-index:100;padding:8px}.skip:focus{top:12px}.site-head{position:sticky;top:0;z-index:10;background:var(--bg);border-bottom:1px solid var(--line)}.head-inner{max-width:1440px;margin:auto;padding:9px 20px;display:flex;align-items:center;gap:14px}.brand{font-weight:650;font-size:1.18rem;letter-spacing:-.04em;text-decoration:none;color:var(--ink)}.brand span{color:var(--accent);margin-right:6px}.return-button{display:flex;align-items:center;justify-content:center;min-height:38px;min-width:240px;margin-left:auto;padding:8px 20px;border-radius:4px;background:var(--ink);color:var(--bg);text-align:center;text-decoration:none}.return-button:hover{opacity:.85}.layout{display:grid;grid-template-columns:170px minmax(0,1fr);gap:32px;max-width:1440px;padding:26px 20px 56px;margin:auto}.sidebar{position:sticky;top:80px;align-self:start;min-width:0}.toc{max-height:calc(100dvh - 100px);overflow-y:auto;display:grid;gap:3px;padding-right:10px}.toc a{color:var(--muted);text-decoration:none;padding:4px 0}.toc a:hover,.toc a[aria-current]{color:var(--accent);text-decoration:underline}main{min-width:0}.subtitle{margin-top:9px}.lede{max-width:78ch;margin-top:14px}.hero{padding:0 0 8px}.panel,.component{padding:20px 0;margin-top:18px;border-top:1px solid var(--line)}.panel>h2,.component h2{margin-bottom:12px}.description{max-width:105ch;margin-bottom:14px}.intro-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px;align-items:center}.intro-figure{background:#fff;color:#222;padding:5px;max-width:360px;justify-self:center}.intro-figure svg{width:100%;height:auto;display:block}.intro-figure text{fill:#202b32;font:14px system-ui,sans-serif}.mapping{margin-top:16px;border-collapse:collapse;width:100%;text-align:left}.mapping td,.mapping th{padding:8px 6px;border-bottom:1px solid var(--line);vertical-align:top}.mapping th{font-weight:500}.note{margin-top:14px}.reference-row{display:grid;grid-template-columns:minmax(0,1fr) 230px;gap:28px;align-items:center}.reference-row:has(.state-pair){grid-template-columns:minmax(0,1fr) 330px}.law-pair{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;margin:14px 0}.law-column{min-width:0}.law-label{color:var(--muted);margin-bottom:10px}.equation{padding:4px 0;min-width:0;border:0;background:transparent}.equation .katex-display{margin:0;text-align:left}.equation .katex-display>.katex{text-align:left}.katex{font-size:1.18em}.mechanism{min-width:0}.mechanism img{display:block;width:100%;height:auto;max-width:250px;margin:auto;background:#fff;border-radius:3px}.states{margin:0}.state-pair{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:auto}.phase{font-size:inherit;text-align:center;margin-top:3px;color:var(--muted)}.variant{margin-top:18px}.variant>p{margin:8px 0 12px}.info,.derivation{margin-top:14px}.info summary{display:flex;align-items:center;gap:8px;list-style:none;color:var(--accent);cursor:pointer;width:fit-content}.info summary::-webkit-details-marker{display:none}.info-icon{display:inline-grid;place-items:center;width:19px;height:19px;flex:none;border:1px solid currentColor;border-radius:50%;font-style:normal;font-weight:400;line-height:1}.info[open] summary{color:var(--ink)}.info p,.derivation p{margin-top:10px}.info h3{margin-top:15px}.derivation summary{cursor:pointer;color:var(--accent);display:flex;align-items:center;gap:8px;list-style:none}.derivation summary::-webkit-details-marker{display:none}.derivation summary::marker{content:""}.chevron{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.5;stroke-linecap:round;stroke-linejoin:round}details[open]>summary>.chevron{transform:rotate(180deg)}.symbols{margin-top:12px}.symbols dt{font-weight:500;float:left;clear:left;margin-right:8px}.symbols dd{margin:0 0 8px;overflow:hidden}.symbol-grid{display:grid;grid-template-columns:1fr 1fr;gap:0 24px}.reading{padding-left:18px}.reading li{margin:10px 0}footer{margin-top:22px;border-top:1px solid var(--line);padding-top:16px;color:var(--muted)}.section-link{color:inherit;text-decoration:none}.section-link:hover{text-decoration:underline}main [id]{scroll-margin-top:78px}.junction-pair{display:grid;grid-template-columns:1fr 1fr;gap:16px}code,small,.small{font:inherit}#connections>figure{max-width:600px;margin:14px auto}#connections .law-pair{margin-top:18px}
@media(max-width:1150px){.reference-row,.reference-row:has(.state-pair){grid-template-columns:minmax(0,1fr)}.mechanism{width:100%;max-width:420px;justify-self:center}.mechanism:has(.state-pair){width:100%;max-width:420px}.intro-grid{grid-template-columns:1fr 1fr}.law-pair{gap:20px}}
@media(max-width:760px){.layout{display:block;padding:18px 16px 40px}.sidebar{position:static;margin-bottom:20px}.toc{display:flex;gap:20px;max-height:none;overflow:auto;padding:0 0 8px;border-bottom:1px solid var(--line)}.toc a{white-space:nowrap}.intro-grid{grid-template-columns:1fr}.panel,.component{padding:18px 0;margin-top:16px}.law-pair{gap:18px}.symbol-grid{grid-template-columns:1fr}.intro-figure{max-width:320px}.reference-row .law-pair{margin-top:4px}.mechanism img{max-width:230px}.reference-row,.reference-row:has(.state-pair){gap:14px}h1{font-size:1.8rem}.mapping td,.mapping th{padding:8px 4px}.head-inner{padding:8px 16px;gap:10px}.return-button{min-width:0;padding:8px 12px}}
@media(max-width:600px){.head-inner{display:grid;grid-template-columns:1fr auto}.return-button{grid-row:2;grid-column:1/-1;width:100%;margin:0}.head-inner button{grid-row:1;grid-column:2}html{scroll-padding-top:120px}main [id]{scroll-margin-top:120px}.law-pair{grid-template-columns:1fr;gap:16px}.reference-row:has(.state-pair) .mechanism{max-width:360px}.junction-pair{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{scroll-behavior:auto!important;animation:none!important;transition:none!important}}
@media print{.site-head,.sidebar,.skip{display:none}.layout{display:block;padding:0}.panel,.component{break-inside:avoid}body{--bg:white;--ink:black;--muted:#333;--line:#aaa;--accent:#06456a}}

.reference-row,.law-pair{min-width:0}@media(max-width:1150px){.reference-row,.reference-row:has(.state-pair){grid-template-columns:minmax(0,1fr)}}

/* Familiar simulator chrome: 46px bar, 28px controls, same logo size. */
.site-head{height:46px}.head-inner{height:46px;max-width:none;padding:0 10px;gap:8px;font-size:12px;display:flex;flex-wrap:nowrap}
.head-inner button,.return-button{height:28px;min-height:28px;font-size:12px;line-height:1.4;padding:4px 10px;border-radius:4px}
.return-button{min-width:200px;margin-left:auto}.brand{font-size:17px;line-height:26px}.head-inner button{white-space:nowrap}
.layout{grid-template-columns:170px minmax(0,1fr);max-width:1360px;gap:30px;padding-top:22px}.sidebar{top:66px}.toc{max-height:calc(100dvh - 82px)}
.reference-row,.reference-row:has(.state-pair){grid-template-columns:minmax(0,1fr) minmax(340px,.78fr);gap:24px;align-items:start}
.law-pair{column-gap:22px;margin:8px 0}.mechanism{width:100%;max-width:none;align-self:center}.mechanism img{width:100%;height:238px;max-width:none;object-fit:contain}
.state-pair{gap:16px}.component{padding:18px 0;margin-top:12px}.description{max-width:90ch;margin-bottom:12px}.info-content{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px 30px;margin:15px 0 6px;padding-left:18px;border-left:1px solid var(--line)}
.info-section{min-width:0;margin:0}.info-section h3{font-size:1rem;font-weight:500;margin:0 0 8px}.info-section p{margin-top:8px}.info-section .equation{margin:12px 0}.definition-list{margin:0;display:grid;gap:10px}.definition-list>div{display:grid;grid-template-columns:minmax(95px,.8fr) minmax(0,2fr);column-gap:14px}.definition-list dt,.definition-list dd{margin:0;min-width:0}.info-content .katex{font-size:1.07em}.info-content .equation .katex{font-size:1.14em}
@media(max-width:1200px){.reference-row,.reference-row:has(.state-pair){grid-template-columns:minmax(0,1fr)}.mechanism{max-width:600px;justify-self:center}.mechanism:has(.state-pair){width:100%;max-width:600px}.law-pair{margin-bottom:0}.reference-row{gap:12px}.mechanism img{height:240px}}
@media(max-width:760px){html{scroll-padding-top:62px}main [id]{scroll-margin-top:62px}.layout{display:block;padding:16px 16px 32px}.sidebar{margin-bottom:16px}.head-inner{display:flex;gap:6px;padding:0 8px}.brand{font-size:16px;flex:none}.return-button{grid-row:auto;grid-column:auto;width:auto;min-width:0;padding:4px 12px;margin-left:auto}.head-inner button{grid-row:auto;grid-column:auto;padding:4px 8px}.reference-row,.reference-row:has(.state-pair){gap:12px}.reference-row:has(.state-pair) .mechanism{width:100%;max-width:600px}.mechanism img{height:230px}.info-content{grid-template-columns:minmax(0,1fr);padding-left:12px;gap:16px}.definition-list>div{grid-template-columns:minmax(90px,.8fr) minmax(0,2fr)}.info-content .equation .katex{font-size:1.08em}}
@media(max-width:600px){.law-pair[data-compact]{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.law-pair .katex{font-size:1.1em}.state-pair{gap:12px}.mechanism img{height:220px}.info-content .katex{font-size:1.02em}}
@media(max-width:350px){.head-inner{gap:4px}.return-button{padding:4px 7px}.head-inner button{padding:4px 6px}.brand{font-size:15px}.definition-list>div{grid-template-columns:minmax(0,1fr)}.definition-list dd{margin-top:4px}}
.brand{display:block;width:104px;height:26px;overflow:hidden;flex:none}.brand img{display:block;width:104px;height:26px;max-width:none}.brand .brand-dark{display:none}:root[data-theme=dark] .brand .brand-light{display:none}:root[data-theme=dark] .brand .brand-dark{display:block}
.mechanism img{height:220px}
#differential .reference-row{grid-template-columns:minmax(0,1fr);gap:12px}#differential .mechanism{grid-row:1;max-width:none}#differential .mechanism img{height:200px}
@media(max-width:760px){#differential .state-pair,#memristor .state-pair{grid-template-columns:minmax(0,1fr);gap:10px}#differential .mechanism img{height:auto;max-height:210px}#memristor .mechanism img{height:230px}.mechanism img{height:210px}}
@media(max-width:350px){.brand{width:28px}}
/* Flow the optional explanations without forcing paired sections to equal heights. */
.info-content{display:block;columns:2;column-gap:30px}.info-section{break-inside:avoid;margin:0 0 18px}.info-section:last-child{margin-bottom:0}
@media(max-width:760px){.info-content{columns:auto}}
