/* The blackboard: shared by the PoC (web/poc/blackboard) and the math book pages (web/math/page). Colours are variables so a page can theme the board. */
.bb-host{--board:#173f35;--chalk:#f5f1dc;--muted-chalk:#b9c9bc;--amber:#ffe08a;--cancel:#ff9b8f;background:var(--board);border-radius:8px;padding:0 18px}
.bb-board { max-height: 510px; margin: 0; padding: 12px 0 18px; overflow-y: auto; overscroll-behavior: contain; color: var(--chalk); list-style: none; counter-reset: board-line; scrollbar-color: #82998a #173f35; }
.bb-step { display: grid; grid-template-columns: minmax(0, 1fr) minmax(190px, 280px); gap: 22px; align-items: center; padding: 12px 10px 13px; border-bottom: 1px dashed #78908365; }
.bb-step:last-child { border-bottom: 0; }
.bb-step-lines { min-width: 0; overflow-x: auto; padding: 5px 2px 8px; scrollbar-color: #82998a #173f35; }
.bb-line { display: grid; grid-template-columns: 26px minmax(max-content, 1fr); align-items: center; min-height: 50px; counter-increment: board-line; }
.bb-line::before { content: counter(board-line); align-self: start; padding-top: .6em; color: #92a89a; font: .72rem/1 ui-monospace, monospace; }
.bb-math { min-width: max-content; padding: .12em .18em; color: var(--chalk); font-family: "STIX Two Math", "Cambria Math", "Latin Modern Math", Georgia, serif; font-size: 1.55rem; line-height: 1.45; }
.bb-note { position: relative; margin: 0; padding-left: 17px; color: var(--muted-chalk); font: .94rem/1.45 system-ui, sans-serif; }
.bb-note::before { content: ""; position: absolute; top: .15em; bottom: .15em; left: 0; border-left: 2px solid #d6b768; }
.bb-current .bb-step-lines { animation: write-line .32s ease-out; }
.bb-highlight { color: #241d08; background: var(--amber); border-radius: 2px; box-shadow: 0 0 0 2px var(--amber); }
.bb-strike { color: #ffc2b9; text-decoration: line-through; text-decoration-color: var(--cancel); text-decoration-thickness: 2px; }
.bb-highlight.bb-strike { color: #4d2822; }
.bb-column-carry { color: #f3ca67; font-size: .68em; }
.bb-column-carry mtd { padding-bottom: 0; line-height: 1; }
.bb-column-result { color: #c6e6b7; }
.bb-column-rule mtd { border-top: 2px solid currentColor; }
.bb-columns mtd { min-width: 1.2em; padding: 0 .12em; }
@keyframes write-line { from { opacity: .15; transform: translateY(7px); } to { opacity: 1; transform: none; } }
  .bb-board { max-height: 58vh; }
  .bb-step { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 10px 4px; }
  .bb-line { grid-template-columns: 21px minmax(max-content, 1fr); }
  .bb-math { font-size: 1.32rem; }
  .bb-note { margin: 0 8px 4px 23px; font-size: .84rem; }
  .bb-current .bb-step-lines { animation: none; }
@media (max-width: 650px) {
  .bb-host { padding: 0 6px; }
  .bb-board { max-height: 58vh; }
  .bb-step { grid-template-columns: minmax(0, 1fr); gap: 3px; padding: 10px 4px; }
  .bb-line { grid-template-columns: 21px minmax(max-content, 1fr); }
  .bb-math { font-size: 1.32rem; }
  .bb-note { margin: 0 8px 4px 23px; font-size: .84rem; }
}
@media (prefers-reduced-motion: reduce) { .bb-current .bb-step-lines { animation: none; } }

:root{font-family:system-ui,sans-serif;color:#213c36;background:#f8faf8;line-height:1.55}*{box-sizing:border-box}body{margin:0}main,body>header,body>nav,body>footer{max-width:960px;margin:auto;padding:1.2rem}a{color:#165d8a}h1{line-height:1.15;font-size:2.2rem}h2{margin-top:2rem}.ph{border:1px solid #cad9d0;border-radius:10px;padding:1rem;background:white;margin:1rem 0}.ph-controls{display:flex;gap:.7rem;flex-wrap:wrap}.ph label{display:flex;flex-direction:column;gap:.2rem;max-width:100%;font-size:.95rem}.ph input{font:inherit;padding:.45rem;border:1px solid #718b7e;border-radius:4px;min-width:0;width:100%}.ph-controls label{flex:1 1 140px}.ph-bar,.mb-bar{display:flex;gap:.5rem;align-items:center;flex-wrap:wrap;margin:1rem 0}.ph-bar label{flex:1 1 160px}.ph button{font:inherit;padding:.45rem .8rem;min-height:44px;border:1px solid #517764;background:#edf4ef;border-radius:5px;cursor:pointer}.ph button:disabled{opacity:.55;cursor:default}.ph canvas{width:100%;height:auto;display:block}.ph-measure{display:block;padding:.6rem 0;font-variant-numeric:tabular-nums}.ph-exercise{border-top:2px solid #cad9d0;margin-top:1.5rem;padding-top:.5rem}.ph-exercise form{display:flex;align-items:end;gap:.7rem;flex-wrap:wrap}.ph-exercise form label{flex:1 1 180px}.ph-feedback{min-height:1.5rem}.ph-score{font-weight:600}.ph [hidden]{display:none!important}.bb-host{overflow:auto;max-width:100%}.bb-board{padding:0 0 0 1.5rem}.bb-note{font-size:.95rem}.bb-math{font-size:1rem;white-space:normal}.bb-line{overflow:auto;max-width:100%}.ph-solution{border-left:3px solid #bb6228;padding-left:.6rem}footer{display:flex;justify-content:space-between;gap:1rem}button:focus-visible,input:focus-visible{outline:3px solid #b35a16;outline-offset:2px}@media(max-width:600px){main,body>header,body>nav,body>footer{padding:.8rem}.ph{padding:.7rem}h1{font-size:1.8rem}.ph-controls label{flex-basis:100%}.ph-exercise form{align-items:stretch}.ph-exercise form label{flex-basis:100%}}

.ph-thumbnail{width:240px;max-width:100%;height:auto}.ph-assumptions{border-left:3px solid #608276;padding-left:.7rem}

.ph-model table { width:100%; border-collapse:collapse; margin:1rem 0; font-variant-numeric:tabular-nums; }
.ph-model td,.ph-model th { padding:.5rem; border-bottom:1px solid #cbd6d0; text-align:left; overflow-wrap:anywhere; }
.ph-model select { max-width:100%; padding:.4rem; }
.ph-measure { overflow-wrap:anywhere; }


.ph-sensitivity{border-collapse:collapse;width:100%;margin:1rem 0;font-variant-numeric:tabular-nums}.ph-sensitivity th,.ph-sensitivity td{padding:.3rem;border:1px solid #cad9d0;overflow-wrap:anywhere}.ph-sensitivity caption{font-size:.9rem;text-align:left}main,output{overflow-wrap:anywhere}

/* Recorded numerical runs keep provenance available without widening the page. */
[data-real-thing] select{max-width:100%;padding:.45rem;margin:.3rem .5rem .5rem 0}
.ph-real-provenance{margin-top:1rem;padding:.7rem;border:1px solid #c4d3ca}
.ph-real-provenance pre{white-space:pre-wrap;overflow-wrap:anywhere;max-height:24rem;overflow:auto;font-size:.8rem}
[data-real-thing] canvas{width:100%;height:300px}
[data-real-thing] output{display:block;overflow-wrap:anywhere}
