:root {
  --ink:#182530; --muted:#52616a; --paper:#f3f3ec; --white:#fdfcf7;
  --navy:#11232d; --navy-deep:#101e28; --mint:#9debd0; --teal:#195b51; --line:#ccd2c9;
  --heat:#b84122; --air:#17704f; --vapour:#694799; --water:#1567a7;
  font-family:"Segoe UI",system-ui,sans-serif; color:var(--ink); background:var(--paper);
  font-synthesis:none; line-height:1.5;
}
*,*::before,*::after {box-sizing:border-box}
body {margin:0}
[hidden] {display:none !important}
button,input,select {font:inherit}
button,a,summary,input,select {touch-action:manipulation}
button {cursor:pointer}
a {color:var(--teal);text-underline-offset:.2em}
:focus-visible {outline:3px solid #a94818;outline-offset:3px}
.masthead :focus-visible {outline-color:var(--mint)}
h1,h2,h3,h4,p {margin:0}
h2,h3,h4 {line-height:1.2}
p + p {margin-top:.65rem}
.wrap {width:min(100% - 76px, 1376px);margin-inline:auto}
.skip {position:fixed;top:8px;left:8px;z-index:4;clip-path:inset(50%);background:white;padding:10px}
.skip:focus {clip-path:none}
.masthead {background:var(--navy-deep);color:white;border-bottom:1px solid #38505a}
.mast-inner {min-height:68px;display:flex;align-items:center;justify-content:space-between;gap:12px}
.brand {display:flex;align-items:center;gap:11px}
.brand svg {width:32px;flex:none;fill:none;stroke:var(--mint);stroke-width:1.35;stroke-linejoin:round}
.brand h1 {font-size:1rem;font-weight:680;line-height:1.2}
.brand span {font: .77rem/1.5 Consolas,monospace;color:#bccdd0;letter-spacing:.08em}
.brand b {font-weight:400;color:var(--mint);margin-inline:.15em}
.wall-board {padding-top:18px}
.board-grid {display:grid;grid-template-columns:minmax(0,1fr) minmax(230px,280px);gap:12px;align-items:start}
.board-side {border:1px solid var(--line);border-radius:8px;padding:12px;background:var(--white);min-width:0}
.board-side-heading {display:flex;justify-content:space-between;align-items:center;gap:7px;margin:0 0 9px}
.board-side-heading h3 {font-size:.98rem}
.board-side-heading span {font-size:.76rem;color:var(--muted)}
.drawing-card {color:var(--ink);background:var(--white);border:1px solid #96a9a1;border-radius:8px;overflow:hidden;min-width:0}
.drawing-head {display:flex;align-items:center;justify-content:space-between;gap:10px;padding:15px 18px 13px}
.drawing-kicker {font:700 .75rem/1.3 Consolas,monospace;color:var(--teal);letter-spacing:.09em;margin-bottom:5px}
.drawing-head h2,.drawing-head h3 {font-size:1.1rem;letter-spacing:-.015em}
.zoom {display:flex;gap:3px;align-items:center;flex:none}
.icon-button {display:inline-grid;place-items:center;min-width:40px;min-height:40px;padding:3px 9px;color:var(--ink);border:1px solid var(--line);background:var(--white);border-radius:6px;line-height:1;font-size:1.15rem}
.fit {font-size:.86rem;font-weight:650}
button:disabled {cursor:default;opacity:.42}
.icon-button:not(:disabled):hover,.cite:hover {background:#e3efe8}
.overlay-bar {display:flex;align-items:center;gap:9px;border-top:1px solid var(--line);padding:7px 14px;background:#f7f8f1}
.toolbar-label {font:700 .78rem/1.2 Consolas,monospace;color:var(--muted);text-transform:uppercase;letter-spacing:.06em}
.overlay-buttons {display:flex;gap:5px;flex-wrap:wrap}
.overlay {--trace:var(--ink);padding:5px 10px;min-height:34px;display:inline-flex;align-items:center;gap:7px;border:1px solid var(--line);border-radius:5px;color:var(--ink);background:var(--white);font-size:.86rem;font-weight:650}
.overlay[data-control="heat"],.function.heat {--trace:var(--heat)}
.overlay[data-control="air"],.function.air {--trace:var(--air)}
.overlay[data-control="vapour"],.function.vapour {--trace:var(--vapour)}
.overlay[data-control="water"],.function.water {--trace:var(--water)}
.overlay[aria-pressed="true"] {border-color:var(--trace);color:var(--trace);background:color-mix(in srgb,var(--trace) 9%,white)}
.overlay:hover {border-color:var(--trace)}
.swatch {width:19px;border-top:3px solid var(--trace)}
[data-control="air"] .swatch {border-top-style:dashed}
[data-control="vapour"] .swatch {border-top-style:dotted}
[data-control="water"] .swatch {border-top:4px double var(--trace)}
.viewport {position:relative;overflow:auto;overscroll-behavior:contain;border-block:1px solid #b9c8c3;background:#e9eee7}
.viewport:focus-visible {outline-offset:-3px}
.wall-viewport {height:clamp(285px,32vw,452px)}
.detail-viewport {height:clamp(245px,37vw,490px)}
.viewport svg {display:block;width:var(--zoom,100%);height:var(--zoom,100%);min-height:100%;max-width:none}
.sheet {fill:#e9eee7}
.diagram text {user-select:none}
.diagram .guide-mark {fill:#425c5a;font:700 15px Consolas,monospace;letter-spacing:1.5px}
.diagram .sheet-note {fill:#405c59;font:700 13px Consolas,monospace;letter-spacing:1px}
.diagram .leader {fill:none;stroke:#48625e;stroke-width:1.1;vector-effect:non-scaling-stroke}
.diagram .dimension {stroke-dasharray:3 4}
.diagram .separator {stroke:#24443e;stroke-width:1;fill:none}
.diagram .hit {cursor:pointer;outline:none}
.diagram .layer-top {stroke:#263a34;stroke-width:1.2;vector-effect:non-scaling-stroke}
.diagram .layer-side {stroke:#263a34;stroke-width:1.1;vector-effect:non-scaling-stroke}
.diagram .layer-marker {fill:#fdfcf7;stroke:#45615b;stroke-width:1.3;vector-effect:non-scaling-stroke}
.diagram .layer-number {fill:#1b3834;font:700 20px Consolas,monospace;text-anchor:middle;dominant-baseline:central}
.diagram .hit:hover .layer-top,.diagram .hit:focus .layer-top,.diagram .hit.is-selected .layer-top {stroke:#9a431a;stroke-width:2.8}
.diagram .hit:hover .layer-marker,.diagram .hit:focus .layer-marker,.diagram .hit.is-selected .layer-marker {fill:#a6ead2;stroke:#163933;stroke-width:2.6}
.diagram .watch-label {font:700 14px "Segoe UI",sans-serif;fill:#263c34}
.diagram .watch-box {fill:#fbf0d2;stroke:#8a6432;stroke-width:1}
.diagram .watch-node {fill:#fbce69;stroke:#513d22;stroke-width:1.2}
.diagram .hit:hover .watch-box,.diagram .hit:focus .watch-box,.diagram .hit.is-selected .watch-box {fill:#ffcf63;stroke-width:2.4}
.diagram .trace {display:none;pointer-events:none}
.diagram .trace.on {display:inline}
.diagram .trace path,.diagram .trace line {fill:none;stroke-width:4;stroke-linejoin:round;stroke-linecap:round;vector-effect:non-scaling-stroke}
.diagram .trace.heat path {stroke:var(--heat);stroke-width:5}
.diagram .trace.air path {stroke:var(--air);stroke-dasharray:11 6}
.diagram .trace.vapour path {stroke:var(--vapour);stroke-dasharray:1 7}
.diagram .trace path.halo {stroke:#fcfff0;stroke-width:6}
.diagram .trace.water path {stroke:var(--water);stroke-width:5}
.diagram .trace.water .inner {stroke:#e9f4f7;stroke-width:1.35}
.diagram .detail-part {stroke:#334d47;stroke-width:1.15;vector-effect:non-scaling-stroke}
.diagram .step-highlight circle {fill:#fbce69;fill-opacity:.27;stroke:#9c5022;stroke-width:2;stroke-dasharray:4 4;vector-effect:non-scaling-stroke}
.figure-foot {display:flex;justify-content:space-between;align-items:center;gap:10px;padding:7px 13px;font-size:.82rem;color:#41544f;min-height:41px}
.cite {display:inline-flex;align-items:center;justify-content:center;padding:4px 9px;min-height:29px;border:1px solid #afc2b7;border-radius:5px;color:#174e42;background:#ecf4ed;font-size:.79rem;font-weight:700;white-space:nowrap;vertical-align:middle}
.cite::before {content:"≡";margin-right:.35em;font-weight:700}
.cite.compact {font-size:.76rem}
.mast-cite {background:#203943;color:#d0f5e9;border-color:#54736e}
.mast-cite:hover {background:#365b5d}
.mast-cite {min-height:36px}
.mobile-watches {display:none;margin-top:7px}
.layer-keys {display:grid;gap:5px}
.layer-key {display:flex;gap:7px;align-items:center;min-height:39px;padding:6px 8px;text-align:left;line-height:1.15;background:#fbfbf5;border:1px solid var(--line);border-radius:5px;color:var(--ink);font-size:.86rem;font-weight:650}
.layer-key span {font:700 .78rem/1 Consolas,monospace;color:#182530;background:color-mix(in srgb,var(--material,#e1ede4) 53%,white);padding:5px;border-radius:3px;flex:none}
.layer-key:hover,.layer-key[aria-pressed="true"] {border-color:#468375;background:#deefe4}
.inspector {padding:10px;margin-top:9px;border:1px solid #9eb5a8;background:#f4f8ed;border-radius:6px;font-size:.88rem}
.inspector h3 {font-size:1rem;margin:.3rem 0 .4rem}
.inspector p {max-width:75ch}
.inspector-head {display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.inspector-head .icon-button {min-width:34px;min-height:34px}
.inspector details {margin-top:5px}
.inspector summary {cursor:pointer;padding:8px 0;color:var(--teal);font-weight:700}
.function {display:inline-block;font-weight:700;color:var(--trace);background:color-mix(in srgb,var(--trace) 8%,white);border-left:3px solid var(--trace);padding:2px 7px;border-radius:3px;margin:0 4px 8px 0;font-size:.84rem}
.workspace {padding-block:16px 32px}
.workspace-head {display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:8px}
.back-to-wall {font-size:.83rem;font-weight:650}
.legend {display:flex;gap:6px;flex-wrap:wrap}
.tag {display:inline-block;align-self:start;font:700 .71rem/1.4 Consolas,monospace;padding:4px 7px;border-radius:4px;letter-spacing:.02em}
.tag.brief {background:#deebf1;color:#244c64}
.tag.evidence {background:#dceee3;color:#245944}
.tag.example {background:#f4e8cb;color:#6f441c}
.tabs {display:grid;grid-template-columns:repeat(5,1fr);gap:5px;background:#dde4db;border:1px solid var(--line);padding:5px;border-radius:9px}
.tabs button,.choices button {background:transparent;border:1px solid transparent;border-radius:5px;color:#273b35;font-size:.92rem;font-weight:700;padding:9px 8px;min-height:44px}
.tabs button:hover,.choices button:hover {background:#edf6eb}
.tabs button[aria-selected="true"] {background:var(--navy);color:#f6fff8}
.tab-panel {padding-top:12px}
.brief-strip,.study-strip {display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;margin:6px 0 12px}
.brief-strip > span:not(.tag) {padding:5px 8px;border:1px solid var(--line);border-radius:4px;background:var(--white);font-size:.85rem}
.visual-cards {display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px;margin:0 0 10px}
.visual-card {display:grid;grid-template-columns:minmax(72px, .7fr) minmax(0,1.3fr);align-items:center;gap:10px;padding:10px;border:1px solid var(--line);border-radius:6px;background:var(--white);min-width:0}
.visual-card h3,.visual-card h4 {font-size:1rem;margin-bottom:3px}
.visual-card p {font-size:.87rem;color:var(--muted)}
.visual-card details {margin-top:4px;font-size:.84rem}
.visual-card summary {cursor:pointer;font-weight:650;color:var(--teal);padding-block:5px}
.visual-card details > .plain-action {margin-top:8px}
.mini-drawing {display:block;width:100%;height:auto;max-height:100px;border:1px solid #bdcec4;background:#e7eee5;border-radius:5px}
.step-link {margin-top:5px;padding:3px 0;color:var(--teal);font-weight:680;text-decoration:underline;text-underline-offset:.18em;background:none;border:0;min-height:35px}
.study-strip .choices {margin:0}
.comparison-figures {display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-block:8px 10px}
.comparison-figures figure {margin:0;padding:10px;border:1px solid var(--line);border-radius:6px;background:var(--white)}
.comparison-figures figcaption {font-size:.9rem;margin-top:6px}
.comparison-figures .mini-drawing {max-height:140px}
.energy-figure {display:grid;grid-template-columns:minmax(100px,.8fr) minmax(0,1.2fr);gap:10px;align-items:center;margin-top:10px}
.precedents {display:grid;grid-template-columns:repeat(3,1fr);gap:12px;margin-bottom:18px}
.card,.fold,.callout,.precedent {border:1px solid var(--line);border-radius:8px;background:var(--white);min-width:0}
.card,.callout {padding:16px}
.card h3,.card h4,.callout h3 {margin:.3rem 0 .42rem}
.card h3,.card h4,.callout h3,.path-heading {font-size:1.03rem}
.card p,.callout p {margin-bottom:.3rem}
.card p:last-child,.callout p:last-child {margin-bottom:0}
.warning {border-left:4px solid #bd7a25;background:#fff5dc;margin-block:12px}
.fold {margin-bottom:10px}
.fold > summary {cursor:pointer;font-weight:700;padding:13px 16px;min-height:47px}
.fold > summary::marker {color:var(--teal)}
.fold > .fold-body {padding:0 16px 15px}
.fold-body ul,.fold-body ol {padding-left:1.3rem;margin:.6rem 0}
.fold-body li + li {margin-top:.25rem}
.checklist {list-style:none;padding:0 !important}
.checklist li {padding:5px 0}
.checklist label {cursor:pointer}
.checklist input {accent-color:var(--teal);width:18px;height:18px;margin:0 8px 0 0;vertical-align:middle}
.checklist label:has(input:checked) {color:#315f4c}
.check-progress {font-size:.85rem;color:var(--muted)}
.path-heading {margin:14px 0 7px}
.plain-action,.primary-action {display:inline-flex;align-items:center;justify-content:center;min-height:42px;padding:7px 12px;border-radius:5px;border:1px solid #2e6b5d;background:#e9f4ed;color:#204f44;font-weight:700;font-size:.92rem;text-decoration:none}
.primary-action {background:var(--teal);color:white}
.plain-action:hover {background:#d8eee2}
.primary-action:hover {background:#114b41}
.card .plain-action {margin-top:10px}
.work-grid {display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.input-row {display:flex;gap:12px;flex-wrap:wrap;margin-block:8px}
.input-row label {display:grid;gap:3px;font-weight:650}
input[type="text"],select {padding:8px 10px;color:var(--ink);background:white;border:1px solid #9ab0a3;border-radius:5px;max-width:100%;min-width:12rem}
.formula {font-family:Consolas,monospace;padding:8px 12px;background:#edf2e9;border-radius:5px;margin-block:8px;overflow-wrap:anywhere}
.choices {display:flex;flex-wrap:wrap;gap:5px;margin:0 0 12px}
.choices button {border-color:var(--line);background:var(--white);padding-inline:12px}
.choices button[aria-pressed="true"] {border-color:var(--teal);background:#dfefe6;color:#154b40}
.detail-layout {display:grid;grid-template-columns:minmax(0,1.75fr) minmax(260px,1fr);gap:12px;align-items:start;margin-bottom:12px}
.detail-layout .drawing-card {box-shadow:none}
.detail-notes {min-width:0}
.detail-notes .card {margin-bottom:8px}
.sequence {display:flex;gap:5px;flex-wrap:wrap;margin:9px 0}
.sequence button {min-width:43px;font-weight:700}
.sequence [aria-pressed="true"] {background:var(--teal);border-color:var(--teal);color:white}
#step-copy summary {cursor:pointer;color:var(--teal);font-weight:650;padding-block:6px}
.detail-trace-list {margin:0;padding-left:1.1rem}
.detail-trace-list li {margin-block:5px}
.detail-trace-list b {color:var(--trace)}
.matrix-scroll {overflow:auto;border:1px solid #aebeb4;border-radius:8px;background:var(--white);margin-bottom:10px}
.matrix {border-collapse:collapse;width:100%;min-width:720px;table-layout:fixed}
.matrix th,.matrix td {padding:10px 12px;text-align:left;vertical-align:top;border-bottom:1px solid #d3dcd2;overflow-wrap:anywhere}
.matrix thead th {background:#dbe9df;font-size:.94rem}
.matrix thead th:first-child,.matrix tbody th {width:21%}
.matrix tbody th {font-size:.9rem;background:#edf2e9}
.matrix td {font-size:.9rem}
.matrix td .cite,.matrix thead .cite {margin-top:4px}
.matrix tr:last-child > * {border-bottom:0}
.matrix small {display:block;font-size:.79rem;color:var(--muted);margin-top:2px}
.matrix .basis {color:#784719;font-weight:700}
.matrix .basis-mark {color:#784719;font-weight:800}
.method-toggle {display:inline-flex;align-items:center;gap:4px;min-height:36px;font-size:.88rem;font-weight:650;cursor:pointer}
.method-toggle input {accent-color:var(--teal);width:16px;height:16px}
#panel-compare:not(:has(#matrix-methods:checked)) .test-method {display:none}
.matrix .unreported {font-style:italic;color:var(--muted)}
.matrix-hint {font-size:.84rem;color:var(--muted);margin-bottom:8px}
.scroll-hint {display:none}
.precedent {overflow:hidden;display:flex;flex-direction:column}
.precedent figure {border-bottom:1px solid var(--line);margin:0;background:#e8eee6}
.precedent figure svg {display:block;width:100%;height:136px}
.precedent figcaption {padding:4px 10px;color:#384f47;font:700 .71rem/1.3 Consolas,monospace}
.precedent-drawing text {fill:#29483f;stroke:none;font:700 11px Consolas,monospace}
.precedent-drawing .accent {stroke:#a76529;stroke-width:2;stroke-dasharray:4 3}
.precedent-content {padding:15px;display:flex;flex-direction:column;gap:8px;flex:1}
.precedent-content h3 {font-size:1.04rem}
.precedent-content .location {color:var(--muted);font-size:.87rem}
.precedent-content .sources-row {display:flex;gap:6px;flex-wrap:wrap;margin-top:auto;align-items:center}
.precedent-content details summary {min-height:40px;padding-block:8px;cursor:pointer;color:var(--teal);font-weight:700}
.precedent-content details p {margin:0 0 8px}
.footer {display:flex;gap:12px;align-items:center;border-top:1px solid var(--line);padding-block:13px 18px;font-size:.83rem;color:#496059}
.footer span:first-child {font:700 .79rem Consolas,monospace;letter-spacing:.08em}
.footer .cite {margin-left:auto}
dialog {width:min(440px,calc(100% - 28px));padding:17px 20px 20px;border:1px solid #7a9e92;border-radius:10px;background:var(--white);color:var(--ink);box-shadow:0 12px 36px #111f26aa}
dialog::backdrop {background:#101e28a8}
.dialog-top {display:flex;justify-content:space-between;align-items:start;gap:10px}
dialog h2 {margin:.45rem 0;font-size:1.16rem}
dialog dl {display:grid;grid-template-columns:5.4rem 1fr;gap:4px 8px;margin:12px 0}
dialog dt {color:var(--muted)}
dialog dd {margin:0;font-weight:650}
#source-note {margin-bottom:11px}
.secondary-link {display:inline-block;padding:8px;font-size:.88rem}
@media(max-width:1050px) {
  .wrap {width:calc(100% - 48px)}
  .board-grid {grid-template-columns:minmax(0,1fr) minmax(195px,230px)}
}
@media(max-width:780px) {
  .wrap {width:calc(100% - 28px)}
  .mast-inner {min-height:58px}
  .board-grid {grid-template-columns:1fr;gap:8px}
  .layer-keys {grid-template-columns:repeat(4,minmax(0,1fr))}
  .wall-viewport {height:clamp(230px,55vw,420px)}
  .detail-layout {grid-template-columns:1fr}
  .workspace-head {align-items:start;gap:7px}
  .tabs {grid-template-columns:repeat(3,minmax(0,1fr))}
  .tabs button {padding-inline:12px}
  .precedents,.visual-cards {grid-template-columns:1fr}
  .visual-card {grid-template-columns:minmax(70px,105px) minmax(0,1fr)}
  .scroll-hint {display:inline}
}
@media(max-width:500px) {
  .brand svg {width:28px}
  .brand h1 {font-size:.82rem}
  .brand span,.mast-cite {font-size:.72rem}
  .drawing-head {padding:9px 9px 8px}
  .drawing-kicker {font-size:.63rem}
  .drawing-head h2 {font-size:1.12rem}
  .zoom .icon-button {min-width:33px;min-height:36px;padding-inline:6px}
  .overlay-bar {padding:5px 6px;gap:4px}
  .overlay-buttons {gap:3px}
  .overlay {min-height:39px;padding:4px 6px;gap:4px;font-size:.78rem}
  .swatch {width:13px}
  .toolbar-label {font-size:.65rem}
  .figure-foot {padding-inline:7px;font-size:.74rem}
  .figure-foot .cite {font-size:.7rem}
  .layer-keys {grid-template-columns:repeat(2,1fr)}
  .mobile-watches {display:block}
  .mobile-watches .choices {margin:0}
  .tabs {grid-template-columns:repeat(2,minmax(0,1fr))}
  .tabs button:last-child {grid-column:1/-1}
  .work-grid {grid-template-columns:1fr}
  .inspector {padding:12px}
  .workspace {padding-top:13px}
  .back-to-wall {display:none}
  .comparison-figures {gap:6px}
  .comparison-figures figure {padding:6px}
  .footer {gap:6px;font-size:.72rem}
  .footer span:first-child {font-size:.67rem}
}
