/* BOARD-V2 board view, pairing page and notice pages (learn host). The four classroom designs are frames AROUND the
   reader frame; the reader's own document gets only /teach/board-view.css. Ink rule: near-black text on light frames (every
   design is light, Studio included since round 2), contrast at least 7:1. Touch targets at least 56 px; nothing works on hover only. */
:root{--ink:#102a3a;--muted:#34495a;--accent:#087e83;--strong:#05585c;--pressed:#e3f1f0;--line:#c9d7dc;--bg:#eef3f4;--panel:#fff;--btn:#fff;--btn-ink:#102a3a;--bar:84px}
*{box-sizing:border-box}html,body{height:100%}
body{margin:0;background:var(--bg);color:var(--ink);font-family:Arial,Helvetica,sans-serif}
[hidden]{display:none!important}
button,a.button-link{font:inherit;font-size:17px;font-weight:700;color:var(--btn-ink);min-height:56px;min-width:56px;padding:0 14px;border:2px solid var(--line);border-radius:12px;background:var(--btn);cursor:pointer;touch-action:manipulation;display:inline-flex;align-items:center;justify-content:center;text-decoration:none;white-space:nowrap}
button:disabled{opacity:.45;cursor:default}
button[aria-pressed=true]{background:var(--pressed);border-color:var(--strong);color:var(--strong)}
button:focus-visible,a:focus-visible,[tabindex]:focus-visible{outline:4px solid #b5651d;outline-offset:2px}
.primary,button.primary{background:var(--strong);border-color:var(--strong);color:#fff}
.eyebrow{font-size:14px;letter-spacing:1.6px;font-weight:700;color:var(--muted);margin:0 0 8px}

/* ---- board view ---- */
body.board{overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) auto;height:100dvh}
#loading{position:fixed;inset:0;display:grid;place-items:center;background:var(--bg);z-index:20;font-size:24px;padding:24px;text-align:center}
.stage{min-height:0;display:grid;gap:10px;padding:10px;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr)}
.reader-pane{position:relative;min-width:0;min-height:0;overflow:hidden;background:#fff;border:1px solid var(--line);border-radius:10px}
.reader-scale{position:absolute;left:0;top:0;overflow:hidden}
.reader-scale iframe{display:block;border:0;background:#fff;transform-origin:0 0}
.writing-space{min-width:0;min-height:0;background:#fff;border:1px solid var(--line);border-radius:10px}
body.writing .stage{grid-template-columns:minmax(0,3fr) minmax(0,2fr)}
.board-toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:center;gap:6px;padding:10px 12px;min-height:var(--bar);min-width:0;background:var(--panel);border-top:1px solid var(--line);position:relative}
.board-toolbar .identity{display:flex;flex-direction:column;justify-content:center;min-width:0;max-width:220px;margin-right:auto;padding-right:8px}
.identity strong{font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.identity small{font-size:14px;color:var(--muted);margin-top:3px;white-space:nowrap}.identity b{color:var(--ink)}
.board-toolbar #tool-design{margin-right:auto}
.board-status{position:absolute;right:14px;bottom:calc(100% + 10px);margin:0;max-width:min(560px,80vw);padding:12px 16px;font-size:18px;line-height:1.4;color:#102a3a;background:#fff;border:2px solid var(--line);border-radius:10px;z-index:5}
.board-status:empty{display:none}
.blank-board{position:fixed;inset:0;z-index:40;background:#fff;cursor:pointer;touch-action:manipulation}
.blank-board span{position:absolute;right:20px;bottom:16px;font-size:18px;color:#34495a}
dialog{border:1px solid var(--line);border-radius:14px;padding:26px;width:min(560px,92vw);color:#102a3a;background:#fff}
dialog::backdrop{background:#0c1a2680}
dialog h2{margin:0 0 6px;font-size:28px}dialog p{font-size:18px;line-height:1.5;margin:0 0 14px;color:#34495a}
.dialog-list{display:grid;gap:10px}.dialog-list button{justify-content:flex-start;font-size:20px;min-height:64px}
.dialog-actions{display:flex;gap:10px;flex-wrap:wrap;margin-top:18px}
/* 01 Classic Split: reader left, writing space right, toolbar docked below. */
body[data-model=classic] .reader-pane{border-top:4px solid var(--accent)}
/* 02 Studio (named "Dark Studio" until build 12; design kept): cool blue-grey frame and toolbar, light since round 2 (the app is light-only), blue
   accent line; the reader and the writing space stay white. Frame text 13.7:1 or more, muted 8.9:1, pressed 7.3:1 (tests/board-v2.test.mjs C5). */
body[data-model=studio]{--bg:#e6edf5;--panel:#f6f9fc;--line:#b4c4d6;--btn:#fff;--btn-ink:#0f2236;--muted:#2c4157;--ink:#0f2236;--pressed:#dce7f4;--strong:#1b4a7a}
body[data-model=studio] .reader-pane{border-top:4px solid #285fa6}
/* 03 Presentation: wide reader above, panoramic writing space below. */
body[data-model=presentation]{--bg:#eef2f9;--line:#c7d2e4}
body[data-model=presentation].writing .stage{grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,3fr) minmax(0,2fr)}
body[data-model=presentation] .reader-pane{border-left:6px solid var(--accent)}
/* 04 Warm Classroom: warm paper frame, writing space on the left, reader on the right. */
body[data-model=warm]{--bg:#f3ebdf;--panel:#fffaf2;--line:#d9c9b4;--pressed:#f3e6d7;--strong:#6b3f2a}
body[data-model=warm].writing .stage{grid-template-columns:minmax(0,2fr) minmax(0,3fr)}
body[data-model=warm] .writing-space{order:-1}
body[data-model=warm] .reader-pane,body[data-model=warm] .writing-space{border-radius:4px}
@media(min-width:1800px){:root{--bar:96px}button,a.button-link{font-size:20px;min-height:64px;padding:0 18px}.identity strong{font-size:22px}.identity small{font-size:16px}.board-toolbar{gap:8px}.board-status{font-size:20px}}
/* The toolbar never widens the page (boardv2-browser-01: 1280x800 overflowed): compact buttons up to 1365 px keep one row on
   1280-wide projectors; below that the toolbar wraps to a second row instead of overflowing. */
@media(max-width:1365px){button{font-size:16px;padding:0 10px}.board-toolbar{gap:5px}.board-toolbar .identity{max-width:180px}}
@media(max-width:1250px){.board-toolbar .identity{display:none}.board-toolbar #tool-design{margin-right:0}}
@media print{.board-toolbar{display:none}}

/* ---- notice pages (view ended, not switched on) ---- */
.notice-page{overflow:auto;display:grid;place-items:center;min-height:100%;background:#eef3f4;color:#102a3a}
.notice-page main{max-width:680px;margin:40px 20px;padding:34px;background:#fff;border:1px solid #c9d7dc;border-radius:16px}
.notice-page h1{font-size:clamp(28px,3vw,42px);margin:8px 0 14px}.notice-page p{font-size:19px;line-height:1.6}
.notice-page a.primary{display:inline-flex;align-items:center;min-height:56px;padding:0 20px;border-radius:12px;text-decoration:none;background:#05585c;color:#fff;font-weight:700}
.notice-page .credit,.pair-page .credit{font-size:15px;color:#34495a;margin-top:24px}

/* ---- pairing page (/teach/pair): nobody signs in on the board ---- */
.pair-page{overflow:auto;min-height:100%;background:#eef3f4;color:#102a3a}
.pair-main{max-width:1240px;margin:0 auto;padding:clamp(20px,4vh,48px) clamp(18px,4vw,56px)}
.pair-main h1{font-size:clamp(32px,3.4vw,56px);margin:6px 0 10px;line-height:1.15}
.pair-status{font-size:clamp(19px,1.6vw,26px);line-height:1.5;margin:0 0 20px}
.pair-code-box{display:grid;grid-template-columns:auto minmax(0,1fr);gap:clamp(20px,3vw,48px);align-items:center;background:#fff;border:1px solid #c9d7dc;border-radius:18px;padding:clamp(18px,3vh,36px)}
.pair-qr svg{display:block;width:min(46vh,440px);height:auto}
.pair-steps p{font-size:clamp(18px,1.4vw,24px);line-height:1.5;margin:0 0 12px}
.pair-steps .pair-ask{font-size:clamp(22px,1.9vw,32px);font-weight:700}
.pair-code{font-size:clamp(52px,6vw,104px)!important;font-weight:700;letter-spacing:.08em;margin:8px 0!important;font-variant-numeric:tabular-nums}
.pair-expiry,.pair-note{color:#34495a}
.pair-actions{display:flex;gap:12px;flex-wrap:wrap;margin-top:22px}
.pair-actions button{font-size:20px;min-height:64px;padding:0 24px}
@media(max-width:820px){.pair-code-box{grid-template-columns:1fr}.pair-qr svg{width:min(80vw,360px)}}
