/* Layout only; the shared reading theme owns the type scale and palette. */
.orientation-map{display:flex;gap:10px;flex-wrap:wrap;align-items:center;justify-content:center;padding:14px 0}
.orientation-map a{padding:8px 12px;border:1px solid var(--rule);border-radius:6px}
.page-pager{display:flex;justify-content:space-between;gap:20px;margin-top:32px;padding-top:16px;border-top:1px solid var(--rule)}
.page-pager span{display:block}.status-line{margin:10px 0}.tag{font-weight:600}.tag-context,.tag-heuristic{color:var(--muted)}
.tag-proved{color:#216a54}.tag-open{color:#9d4750}.reading-sidebar-body>nav[data-reading-subnav]{border-top:1px solid var(--rule);margin-top:14px;padding-top:10px}
.reading-sidebar .site-cost summary{cursor:pointer}.site-cost div{padding:3px 10px 10px;overflow-wrap:anywhere}
.site-cost p{margin:5px 0}.cost-plot{display:block;width:100%;min-width:500px;height:auto}.cost-plot text,.cube-svg text{font-family:inherit;font-size:var(--body);fill:var(--ink)}
.cost-plot .axis,.cube-svg .cube-edge{stroke:var(--rule);stroke-width:1.5}.cost-plot .token-line{stroke:#276c9f;fill:none;stroke-width:2}.cost-plot .time-break{stroke:#9d4750;stroke-dasharray:4 3}
.cost-plot .point{fill:#276c9f}.roadmap-caption{margin-top:6px}.step-argument>ol>li{margin:12px 0}.stmt{padding:14px 16px;margin:18px 0;border-radius:6px;background:rgba(51,139,222,.07)}
.stmt[data-kind="def"]{background:rgba(92,184,125,.10)}.stmt[data-kind="example"]{background:rgba(255,213,79,.12)}.stmt-head{margin-top:0}.stmt-head .tag{margin-left:8px}
.cube-lab{border:1px solid var(--rule);border-radius:6px;padding:16px;margin:16px 0}.cube-svg{display:block;width:270px;height:220px;max-width:100%;margin:auto}
.cube-svg circle{fill:#fff;stroke:#6b7a83;stroke-width:2}.cube-svg .selected circle{fill:#e3edf5;stroke:#276c9f}.cube-svg .cube-node{cursor:pointer}.cube-svg .cube-node:focus{outline:none}.cube-svg .cube-node:focus circle{stroke:#9d4750;stroke-width:3}
.lab-controls{display:flex;flex-wrap:wrap;gap:8px;margin:12px 0}.lab-controls button,.question-form button{padding:7px 12px;font:inherit;cursor:pointer;border:1px solid var(--rule);border-radius:4px;background:#fff;color:var(--ink)}
.lab-controls button[aria-pressed="true"]{background:#e3edf5}.lab-output{margin:12px 0;padding-top:10px;border-top:1px solid var(--rule)}
.lab-controls label{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.lab-controls select{font:inherit;padding:6px;max-width:100%}
.lab-probability{margin:20px 0 12px}.lab-pairs button{text-align:left}
.threshold-lab{border:1px solid var(--rule);border-radius:6px;padding:16px;margin:18px 0}
.threshold-stages{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:20px 0}
.threshold-stages>[data-stage]{min-width:0;padding:14px;border:1px solid var(--rule);border-radius:6px;transition:background-color .25s,border-color .25s}
.threshold-stages>[data-stage].active{background:rgba(51,139,222,.07);border-color:#276c9f}
.threshold-stages>[data-stage].complete{background:rgba(92,184,125,.10)}
.stage-pending{color:var(--muted)}
#def-model,#def-margin,#def-storage{margin:26px 0;padding:18px}
#def-margin>.math-display,#def-storage>.math-display{margin-top:22px;margin-bottom:22px}
#problem-statement>.definition{margin:24px 0;padding:16px}
.network-lab,.probability-lab{border:1px solid var(--rule);border-radius:6px;padding:16px;margin:20px 0}
.network-picture svg{display:block;width:320px;max-width:100%;height:auto;margin:10px auto}
.network-picture svg text{font-family:inherit;font-size:var(--body);fill:var(--ink)}
.network-edge{stroke-width:2}.network-edge.positive{stroke:#276c9f}.network-edge.negative{stroke:#9d4750;stroke-dasharray:6 3}.network-edge.zero{stroke:#999;stroke-dasharray:2 4}
.network-picture .edge-label{paint-order:stroke;stroke:white;stroke-width:5px;stroke-linejoin:round}
.network-neuron{cursor:pointer}.network-neuron circle{stroke:#276c9f;stroke-width:2;fill:#fff}.network-neuron.on circle{fill:#e3edf5}.network-neuron:focus{outline:none}.network-neuron:focus circle{stroke:#9d4750;stroke-width:3}
.network-parameters{margin:20px 0}.parameter-controls{display:flex;flex-wrap:wrap;gap:12px;margin:14px 0}.parameter-controls label{display:flex;align-items:center;gap:8px}.parameter-controls input{font:inherit;width:72px;padding:5px;border:1px solid var(--rule);border-radius:4px}
.state-image{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:20px;padding:18px;border:1px solid var(--rule);border-radius:6px}.state-image strong{letter-spacing:3px}
.network-lab[data-animation-phase="0"] .network-picture,.network-lab[data-animation-phase="1"] .table-scroll,.network-lab[data-animation-phase="2"] .network-output{background:rgba(51,139,222,.07);outline:2px solid #aac4dc;border-radius:6px}
.subset-cards{display:flex;flex-wrap:wrap;gap:10px;margin:16px 0}.subset-cards button{font:inherit;padding:10px;border:1px solid var(--rule);border-radius:4px;color:var(--ink);cursor:pointer;text-align:left}.subset-cards .storable{background:rgba(92,184,125,.10)}.subset-cards .impossible{background:#fff1f1}.subset-cards [aria-pressed="true"]{outline:2px solid #276c9f;outline-offset:2px}
#network-playground,#symmetry-and-cover{margin:28px 0}#probability-computation{margin-top:28px}#tab-network-fields th:first-child,#tab-network-fields th:last-child{white-space:nowrap}#tab-network-fields td:nth-child(2){min-width:160px}#tab-cover-comparison{min-width:550px}
@media(max-width:600px){.network-lab,.probability-lab{padding:12px}.network-lab .lab-controls label{display:block;width:100%}.network-lab .lab-controls select{display:block;margin-top:6px;width:100%}.state-image{gap:12px}}
@media(max-width:600px){.threshold-stages{grid-template-columns:1fr}.threshold-lab{padding:12px}}
@media(prefers-reduced-motion:reduce){.threshold-stages>[data-stage]{transition:none}}
.question-form label{display:block;margin:10px 0}.question-form textarea{display:block;width:100%;min-height:110px;padding:9px;font:inherit;border:1px solid var(--rule);border-radius:4px}.question-form select{font:inherit;max-width:100%;padding:6px}
.feedback{margin:12px 0}.wide-table{min-width:650px}.numeric-table th,.numeric-table td{text-align:right}.timeline-formula{margin:12px 0}
#tab-hsk-studies,#tab-ht-studies,#tab-next-plan,#tab-proof-directions{min-width:650px}#tab-notation{min-width:800px}#tab-current16{min-width:540px}#tab-current16 th,#tab-current16 td{text-align:right}
#tab-ht-studies th:first-child,#tab-ht-studies td:first-child{min-width:50px;white-space:nowrap}
#tab-hsk-studies caption,#tab-ht-studies caption,#tab-next-plan caption,#tab-proof-directions caption,#tab-notation caption,#tab-current16 caption{width:100%;max-width:calc(100vw - 40px)}
@media(max-width:600px){.page-pager{flex-wrap:wrap}.orientation-map{justify-content:flex-start}.cube-lab{padding:12px}.cost-plot{min-width:520px}}
@media(max-width:899px){#experiment-question,#confidence-explained,#meaning-pnn,#fixed-load-study,#what-figure-tests,#table-one-explained,#problem-statement,#threshold-animation,#def-margin,#main-question-bridge,#problem-playground,#network-playground,#tab-network-fields,#probability-computation,#symmetry-and-cover,#statement-probability,#statement-capacity,#network-literature,#toy-proof .proof-step{scroll-margin-top:72px}}
/* Image and margin definitions share the reading page's type and spacing. */
.image-network-lab,.margin-lab{border:1px solid var(--rule);border-radius:6px;padding:16px;margin:18px 0}
.image-steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;margin:20px 0}
.pixel-grid{display:grid;grid-template-columns:repeat(8,1fr);width:168px;max-width:100%;aspect-ratio:1;border:1px solid var(--rule)}
.pixel-grid .pixel{display:block;min-width:0;min-height:0;padding:0;margin:0;aspect-ratio:1;background:rgb(var(--pixel-shade) var(--pixel-shade) var(--pixel-shade));border:1px solid #dedede;border-radius:0}
.pixel-grid button{cursor:pointer}.pixel.selected{outline:2px solid #276c9f;outline-offset:-2px}.pixel.changed{outline:3px solid #9d4750;outline-offset:-3px}.pixel:focus-visible{outline:3px solid #e38d22;outline-offset:-3px}
.matrix-inspection{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;margin:24px 0}
.matrix-inspection svg{display:block;width:100%;max-width:320px;height:auto;image-rendering:pixelated;border:1px solid var(--rule)}
.matrix-inspection .live-math .math-display{margin:14px 0}
.margin-lab svg{display:block;width:100%;height:auto}.margin-lab text{font:inherit;fill:var(--ink)}.margin-axis{stroke:#888;stroke-width:1}.margin-value{stroke-width:5}.margin-value.positive{stroke:#276c9f}.margin-value.negative{stroke:#9d4750}.margin-value.tie{stroke:#888}.margin-point.positive{fill:#276c9f}.margin-point.negative{fill:#9d4750}.margin-point.tie{fill:#888}
.question{background:#fff1f1;border:1px solid #efd0d0;border-radius:6px;color:#3f2424;padding:12px 16px}
#statement-capacity{margin:26px 0}#state-of-art table{min-width:580px}#tab-current16{min-width:450px}
@media(max-width:600px){.matrix-inspection{grid-template-columns:1fr}.image-steps{gap:10px}.image-steps h4{font-size:var(--small);margin-bottom:8px;min-height:40px}.image-steps p{font-size:var(--small);line-height:1.4}.image-network-lab,.margin-lab{padding:12px}.pixel-grid{width:168px}.matrix-inspection svg{max-width:280px}.margin-lab .lab-controls label{width:100%}.margin-lab input[type=range]{max-width:100%}}

.matrix-inspection svg text{font:inherit;fill:var(--ink)}

.margin-lab svg{max-width:380px;margin:12px auto}
/* Finite-set selection and exact uniform sampling. */
.cube-svg{width:340px;height:auto}.cube-selection{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:24px;align-items:center}.cube-selection .lab-output{border:0;padding:0;margin:0;min-width:0}.cube-legend{color:var(--muted);text-align:center}.selected-set code{white-space:normal;overflow-wrap:anywhere}.storage-verdict{padding:8px 12px;border-radius:6px}.storage-verdict.storable{background:rgba(92,184,125,.10)}.storage-verdict.impossible{background:#fff1f1}.cube-sampling{margin-top:24px;padding-top:18px;border-top:1px solid var(--rule)}.cube-sampling h3{margin-top:0}.cube-sampling .lab-probability{margin:12px 0}.probability-bar{height:10px;background:#eee;border-radius:4px;overflow:hidden;max-width:360px;margin:auto}.probability-bar span{display:block;height:100%;background:#80b796}.lab-probability>p{text-align:center}.lab-pairs{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}.lab-pairs button{font:inherit;padding:6px 10px;border:1px solid var(--rule);border-radius:4px;cursor:pointer;color:var(--ink);max-width:100%;overflow-wrap:anywhere}.lab-pairs .storable{background:rgba(92,184,125,.10)}.lab-pairs .impossible{background:#fff1f1}.lab-pairs [aria-pressed="true"]{outline:2px solid #276c9f;outline-offset:1px}.cube-family .cube-legend{text-align:left}
/* Only the middle image changes during sequential asynchronous updates. */
.image-steps>div{min-width:0}.image-steps h4{margin-top:0}.image-steps p{margin:10px 0 0;color:var(--muted)}
.image-steps>div:nth-child(2) .pixel-grid{outline:2px solid #aac4dc;outline-offset:3px}
.image-network-lab button:disabled{opacity:.5;cursor:default}
@media(max-width:600px){.cube-selection{grid-template-columns:1fr;gap:8px}.cube-lab .lab-controls label{flex-wrap:nowrap}.cube-selection .cube-svg{max-width:300px}.cube-family button{font-size:var(--small)}}

/* Recovery actions remain one compact row at phone widths. */
.image-network-lab .recovery-controls{display:flex;flex-wrap:nowrap;gap:8px}
.image-network-lab .recovery-controls button{flex:0 1 auto;white-space:nowrap;padding:7px 10px}

@media(max-width:899px){#cover,#cover-1965,#cover-network-dictionary,#cover-proof,#cover-proof .proof-step{scroll-margin-top:72px}}
