/* ============================================================
   edutec 3D bench pages — light lab look (matches the
   Gas Collection Practical reference chrome)
   Used by heat.html; later electricity/magnetism/light.
   ============================================================ */
* { margin:0; padding:0; box-sizing:border-box; }
html, body { height:100%; overflow:hidden; }
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:#f0f0f0; color:#333;
}

/* ── Loading screen ── */
#loading-screen {
  position:fixed; inset:0; z-index:9999;
  background:linear-gradient(135deg,#66c18e,#45825d);
  display:flex; flex-direction:column; justify-content:center; align-items:center;
  transition:opacity .5s ease;
}
#loading-screen.fade-out { opacity:0; pointer-events:none; }
#loading-screen img { height:80px; margin-bottom:20px; animation:pulse 2s infinite; }
.loading-progress-track {
  width:280px; height:6px; background:rgba(255,255,255,.3); border-radius:999px;
  position:relative; overflow:hidden;
}
.loading-progress-bar {
  position:absolute; top:0; left:-40%; height:100%; width:38%; background:#fff;
  border-radius:999px; animation:loadSlide 1.4s ease-in-out infinite;
}
@keyframes loadSlide { 0%{left:-40%} 50%{left:55%} 100%{left:100%} }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.06)} }

/* ── Header ── */
.header {
  background:#45825d; height:64px; padding:0 24px;
  display:flex; align-items:center; position:relative;
  box-shadow:0 2px 10px rgba(0,0,0,.15);
}
.logo-wrap { display:flex; align-items:center; gap:10px; }
.logo-img { height:54px; width:auto; }
.header-title {
  position:absolute; left:50%; transform:translateX(-50%);
  font-size:26px; font-weight:700; color:#fff;
}
.header-right { margin-left:auto; display:flex; align-items:center; gap:10px; z-index:1; }
/* The title is centred against the whole header, so once a window is narrow enough the
   Curriculum button at the right edge would sit on top of it. Below that width the title
   joins the flex row instead of floating over it, so it gives way and ellipsises rather
   than colliding. A projector at 1280 still gets the full centred 26px. */
@media (max-width: 900px) {
  .header { padding:0 14px; }
  .header-title {
    position:static; transform:none; flex:1 1 auto; min-width:0; margin-left:14px;
    text-align:left; font-size:19px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  }
}
.hbtn {
  background:rgba(255,255,255,.14); color:#fff;
  border:1.5px solid rgba(255,255,255,.5); border-radius:20px;
  padding:9px 18px; font-size:13.5px; font-weight:700; cursor:pointer;
  transition:all .2s ease; white-space:nowrap; font-family:inherit; text-decoration:none;
}
.hbtn:hover { background:rgba(255,255,255,.28); border-color:#fff; transform:translateY(-1px); }
.hbtn.off { opacity:.55; }

/* ── Main 3-panel layout ── */
.main-container { display:flex; height:calc(100vh - 64px); }

.left-panel {
  width:270px; flex-shrink:1; min-width:180px; background:rgba(255,255,255,.97); padding:18px 16px;
  box-shadow:2px 0 10px rgba(0,0,0,.08);
  display:flex; flex-direction:column; overflow:hidden;
}
.panel-title {
  font-size:16px; font-weight:700; color:#222; margin-bottom:14px;
  padding-bottom:10px; border-bottom:2.5px solid #45825d;
}
.module-button {
  width:100%; background:#fff; border:2px solid #e0e0e0; border-radius:10px;
  padding:13px 14px; margin-bottom:9px; cursor:pointer; transition:all .25s ease;
  text-align:left; display:flex; align-items:center; font-family:inherit;
}
.module-button:hover { transform:translateX(4px); border-color:#45825d; box-shadow:0 3px 10px rgba(69,130,93,.2); }
.module-button.active { background:linear-gradient(135deg,#45825d 0%,#66c18e 100%); border-color:#45825d; color:#fff; }
.module-icon { font-size:22px; margin-right:11px; }
.module-name { font-weight:700; font-size:13px; margin-bottom:2px; }
.module-desc { font-size:11px; opacity:.75; }

/* ── Center stage ── */
/* The floor is what keeps the simulation on screen: with flex:1 and min-width:0 the two
   side panels out-negotiate the stage and it collapses to 0 px in a narrow window, which
   reads as a blank sim. 380px is the least the bench can hold — the stats card and the
   legend clear each other at that width. */
.center-panel {
  flex:1; min-width:380px; background:#e8e8e8; position:relative; overflow:hidden;
}
#bench-view { position:absolute; inset:0; cursor:grab; touch-action:none; user-select:none; -webkit-user-select:none; }
#bench-view:active { cursor:grabbing; }
#bench-view canvas { display:block; width:100%; height:100%; }

.td-hint-banner {
  position:absolute; top:14px; left:14px; z-index:25;
  max-width:calc(100% - 152px);
  background:rgba(255,255,255,.95); border-radius:10px; padding:9px 16px;
  font-size:12.5px; color:#45825d; font-weight:400;
  box-shadow:0 2px 8px rgba(0,0,0,.12);
}
.td-reset-btn {
  position:absolute; top:14px; right:14px; z-index:25;
  background:#fff; border:1.5px solid #ddd; border-radius:8px;
  padding:8px 14px; font-size:12px; font-weight:400; color:#45825d;
  cursor:pointer; box-shadow:0 2px 8px rgba(0,0,0,.1); font-family:inherit;
}
.td-reset-btn:hover { border-color:#45825d; background:#edf7f0; }

.td-label-tag {
  position:absolute; z-index:30; pointer-events:none; left:0; top:0;
  background:#2c2c2c; color:#fff; font-size:11.5px; font-weight:600;
  padding:5px 10px; border-radius:6px; white-space:nowrap;
  transform:translate(-50%,-130%); opacity:0; transition:opacity .15s;
  box-shadow:0 3px 10px rgba(0,0,0,.3);
}
.td-label-tag.visible { opacity:1; }
.td-label-tag::after {
  content:""; position:absolute; top:100%; left:50%; transform:translateX(-50%);
  border:5px solid transparent; border-top-color:#2c2c2c;
}

.td-badge {
  position:absolute; left:0; top:0; z-index:24; pointer-events:none;
  background:#f7f4ee; color:#c8352a; border:2px solid #c8352a; border-radius:6px;
  font-size:12px; font-weight:800; padding:2px 8px; white-space:nowrap;
}
.td-badge.green { background:#edf7f0; border-color:#45825d; color:#2e7d4f; }
.td-badge.dark { background:#2c2c2c; border-color:#2c2c2c; color:#fff; }
.td-badge.red { background:#fdecea; border-color:#e74c3c; color:#c0392b; }

/* Stats / legend cards */
.stats-box {
  position:absolute; left:14px; bottom:14px; z-index:20;
  background:rgba(255,255,255,.95); border:2px solid #45825d; border-radius:10px;
  padding:10px 16px; font-size:12px; min-width:190px;
}
.stats-title { font-weight:700; font-size:13px; color:#45825d; margin-bottom:6px; }
.stats-row { margin:3px 0; color:#444; }
.stats-val { font-weight:600; color:#333; }
.legend-box {
  position:absolute; right:14px; bottom:14px; z-index:20;
  background:rgba(255,255,255,.95); border:1.5px solid #ccc; border-radius:10px;
  padding:10px 14px; font-size:12px; min-width:160px;
}
.legend-title { font-weight:700; font-size:13px; margin-bottom:6px; color:#333; }
.legend-item { display:flex; align-items:center; gap:8px; margin:4px 0; }
.legend-dot { width:14px; height:14px; border-radius:50%; flex-shrink:0; border:1.5px solid rgba(0,0,0,.15); }

/* graph card (2D overlay on the 3D stage) */
.graph-card {
  position:absolute; right:14px; top:56px; z-index:20; display:none;
  background:rgba(255,255,255,.95); border:1.5px solid #ccc; border-radius:10px;
  padding:8px; box-shadow:0 2px 8px rgba(0,0,0,.1);
}
.graph-card.visible { display:block; }
.graph-card canvas { display:block; }

/* ── Right panel ── */
.right-panel {
  /* 290 is the width the electricity page's two-column parts tray was laid out for; let
     it shrink and the symbol + name rows crowd each other, and a clipped tray means a
     part no one can add. */
  width:290px; flex-shrink:1; min-width:290px; background:rgba(255,255,255,.97); padding:14px 12px;
  box-shadow:-2px 0 10px rgba(0,0,0,.08);
  display:flex; flex-direction:column; overflow:hidden;
}
.right-panel .scroll-area { overflow:hidden auto; flex:1; min-height:0; }
.right-panel .scroll-area::-webkit-scrollbar,
.left-panel::-webkit-scrollbar { width:6px; }
.right-panel .scroll-area::-webkit-scrollbar-thumb,
.left-panel::-webkit-scrollbar-thumb { background:#45825d; border-radius:4px; }
.right-panel .scroll-area::-webkit-scrollbar-track { background:#f1f1f1; }
* { scrollbar-width:none; }

.rp-label {
  font-weight:700; font-size:10px; color:#333; margin:8px 0 4px; display:block;
  text-transform:uppercase; letter-spacing:.04em;
}
.rp-divider { height:1px; background:#eee; margin:6px 0; }

.spec-grid { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
.spec-card {
  background:#f8f8f8; border:2px solid #ddd; border-radius:9px; padding:6px 4px;
  cursor:pointer; transition:all .2s; text-align:center; font-family:inherit;
}
.spec-card:hover { border-color:#45825d; background:#edf7f0; }
.spec-card.active { border-color:#45825d; background:linear-gradient(135deg,#edf7f0,#d4f0e2); }
.spec-card-img { font-size:16px; display:block; margin-bottom:1px; }
.spec-card-name { font-size:10.5px; font-weight:700; color:#333; display:block; line-height:1.2; }
.spec-card.active .spec-card-name { color:#45825d; }

.ctl-row { display:flex; flex-wrap:wrap; gap:6px; }
.ctl-btn {
  flex:1 1 auto; background:#f0f0f0; border:1.5px solid #ccc; border-radius:8px;
  padding:7px 10px; font-size:12px; font-weight:700; cursor:pointer; transition:all .2s;
  color:#444; font-family:inherit;
}
.ctl-btn:hover { border-color:#45825d; background:#edf7f0; }
.ctl-btn.active { background:linear-gradient(135deg,#45825d,#66c18e); border-color:#45825d; color:#fff; }
/* A stepper that has run out of range goes grey and stops taking the press, so a
   silent limit never reads as a frozen simulation. */
.ctl-btn:disabled, .ctl-btn:disabled:hover {
  opacity:.4; cursor:default; background:#f0f0f0; border-color:#ccc; color:#444;
}

/* Live readings — stats card, legend, floating badges and the graph card are all
   hidden until the teacher presses the toggle pinned to the right panel. */
.center-panel.readings-off .stats-box,
.center-panel.readings-off .legend-box,
.center-panel.readings-off .td-badge,
.center-panel.readings-off .graph-card { display:none !important; }
/* A diagram summoned by a control is not a live reading: the teacher asked for it, so
   the readings toggle must not be able to eat it. Centred on the bench it reads as a
   pop-up instead of as something that should have been standing on the table. */
.center-panel.readings-off .graph-card.pop.visible { display:block !important; }
.graph-card.pop {
  left:50%; right:auto; top:50%; transform:translate(-50%,-50%);
  z-index:26; border:2px solid #45825d; box-shadow:0 12px 34px rgba(0,0,0,.3);
}
/* The two bench switches stack, narration under live readings, and the row stops short of the
   bottom-right corner: the coach button is a 64px circle fixed 30px from that corner, and a
   full-width button ran straight under it, so the narrator was clickable only beside the icon. */
.rp-live-row { flex-shrink:0; padding-top:8px; margin-top:6px; border-top:1px solid #eee;
  display:flex; flex-direction:column; gap:6px; padding-right:88px; }
.rp-live-row .ctl-btn { flex:none; width:100%; }

.tipbox {
  font-size:11px; color:#45825d; margin-top:6px; line-height:1.4;
  padding:6px 8px; background:#edf7f0; border-radius:6px;
}
/* One visible next step keeps the panel focused on the bench. The complete lesson is
   retained in coach-only notes so the AI can still give a precise explanation on request. */
.sim-focus { margin-top:4px; padding:6px 8px; }
.edutec-coach-notes { display:none !important; }
.hint-chip {
  font-size:11px; color:#b7810a; background:#fff8e6; border-radius:6px;
  padding:6px 10px; margin-top:6px; line-height:1.45;
}
/* A chip is a note, not a slot: with nothing to say it must take up no room at all, or a
   filled-in band of pale colour reads on the board as a control that has lost its label. */
.hint-chip:empty { display:none; }

/* Quiz card (right panel) */
.quiz-card { background:#fff; border:1.5px solid #ddd; border-radius:12px; padding:12px; margin-top:8px; }
.quiz-q { font-size:12.5px; font-weight:600; margin-bottom:8px; }
.quiz-opt {
  display:block; width:100%; background:#f8f8f8; border:1.5px solid #ddd; border-radius:8px;
  padding:7px 10px; font-size:12px; text-align:left; cursor:pointer; margin-bottom:5px;
  transition:all .2s; color:#333; font-family:inherit;
}
.quiz-opt:hover { border-color:#45825d; background:#edf7f0; }
.quiz-opt.ok { background:#edf7f0; border-color:#45825d; color:#2e7d4f; font-weight:600; }
.quiz-opt.no { background:#fdecea; border-color:#e74c3c; color:#c0392b; }
.quiz-why { display:none; margin-top:8px; padding:8px 10px; border-radius:8px; font-size:11.5px; line-height:1.5; }
.quiz-why.ok { display:block; background:#edf7f0; border-left:4px solid #45825d; color:#2e7d4f; }
.quiz-why.no { display:block; background:#fdecea; border-left:4px solid #e74c3c; color:#922b21; }

.formula-box { background:#fff; border:1.5px solid #ddd; border-radius:12px; padding:12px 14px; margin-top:8px; }
.formula-line {
  background:#edf7f0; border-radius:6px; padding:7px 12px; font-size:13px;
  font-weight:600; color:#2e7d4f; margin:5px 0; font-family:monospace;
}

/* ── Quiz module (right panel) ─────────────────────────────── */
.qz-intro { font-size:12px; line-height:1.55; color:#555; margin:6px 0 12px; }
.qz-field { display:block; margin-bottom:10px; }
.qz-field span { display:block; font-size:11px; font-weight:700; color:#666; margin-bottom:4px; }
.qz-field input, .qz-field select {
  width:100%; padding:8px 10px; font-size:13px; font-family:inherit; color:#333;
  background:#fff; border:1.5px solid #ddd; border-radius:8px;
}
.qz-field input:focus, .qz-field select:focus { outline:none; border-color:#45825d; }
.hint-chip.show { border-color:#e74c3c; color:#c0392b; background:#fdecea; }
.ctl-btn.primary { background:#45825d; border-color:#45825d; color:#fff; }
.ctl-btn.primary:hover { background:#3a6e4e; border-color:#3a6e4e; }
.qz-top { display:flex; align-items:baseline; justify-content:space-between; gap:8px; }
.qz-tag {
  font-size:10.5px; font-weight:700; color:#2e7d4f; background:#edf7f0;
  border-radius:999px; padding:2px 9px; white-space:nowrap;
}
.qz-dots { display:flex; flex-wrap:wrap; gap:3px; margin:8px 0 10px; }
.qz-dots i { width:9px; height:9px; border-radius:50%; background:#ddd; }
.qz-dots i.done { background:#a8cbb6; }
.qz-dots i.now { background:#45825d; transform:scale(1.35); }
.quiz-opt.picked { border-color:#45825d; background:#edf7f0; color:#2e7d4f; font-weight:600; }
.quiz-opt b { display:inline-block; width:15px; color:#888; font-weight:700; }
.quiz-opt.picked b { color:#45825d; }
.qz-nav { margin-top:10px; align-items:center; }
.qz-nav .qz-page { font-size:11px; font-weight:700; color:#555; white-space:nowrap; }
.qz-rq .qz-tag { margin-right:6px; }
.qz-score { display:flex; align-items:baseline; gap:4px; margin:8px 0 2px; }
.qz-score b { font-size:40px; line-height:1; color:#2e7d4f; }
.qz-score span { font-size:18px; color:#888; }
.qz-score em { margin-left:auto; font-style:normal; font-size:15px; font-weight:700; color:#45825d; }
.qz-verdict { font-size:12px; color:#555; line-height:1.5; }
.qz-review { margin-top:10px; }
.qz-r { border-left:3px solid #ddd; padding:6px 0 6px 10px; margin-bottom:8px; }
.qz-r.ok { border-color:#45825d; }
.qz-r.no { border-color:#e74c3c; }
.qz-rq { font-size:12px; font-weight:600; line-height:1.45; }
.qz-rq i {
  display:inline-block; width:17px; height:17px; margin-right:5px; border-radius:50%;
  background:#eee; color:#555; font-style:normal; font-size:10.5px; font-weight:700; text-align:center; line-height:17px;
}
.qz-r.ok .qz-rq i { background:#edf7f0; color:#2e7d4f; }
.qz-r.no .qz-rq i { background:#fdecea; color:#c0392b; }
.qz-ra { font-size:11.5px; color:#444; margin-top:3px; line-height:1.45; }
.qz-r.no .qz-ra { color:#c0392b; }
.qz-rw { font-size:11px; color:#666; margin-top:3px; line-height:1.5; font-style:italic; }

/* ── The papers on the stage ───────────────────────────────── */
/* Quiz and Results both stand the whole bench down: the paper hangs where the bench was, so the
   readings, the legend, the chips and the bench's own buttons must not show round its edge.
   The same idiom the live-readings toggle already uses. */
.center-panel.paper-on .stats-box,
.center-panel.paper-on .legend-box,
.center-panel.paper-on .graph-card,
.center-panel.paper-on .td-badge,
.center-panel.paper-on .td-hint-banner,
.center-panel.paper-on .td-reset-btn { display:none !important; }
/* The type is set from the height of the stage rather than from fixed px: a class reads it
   from the back of the room on a projector, and the same sheet still fits a short window.
   The stage never scrolls — it is centred, and every size below is a clamp. */
.quiz-stage {
  position:absolute; inset:0; z-index:60; display:none;
  flex-direction:column; align-items:center; justify-content:center;
  gap:2px; padding:2.5vh 5vw; overflow:hidden;
  background:#eceee9;
}
.center-panel.paper-on .quiz-stage { display:flex; }
.quiz-stage > * { width:100%; max-width:900px; }
.quiz-stage .rp-label { font-size:clamp(11px, 1.8vh, 14px); }
.quiz-stage .qz-intro, .quiz-stage .qz-field, .quiz-stage .hint-chip { max-width:620px; }
.quiz-stage .qz-intro { font-size:clamp(12.5px, 2.1vh, 16px); line-height:1.6; }
.quiz-stage .qz-field span { font-size:clamp(11px, 1.8vh, 14px); }
.quiz-stage .qz-field input, .quiz-stage .qz-field select {
  padding:clamp(7px, 1.3vh, 12px) 12px; font-size:clamp(13px, 2.1vh, 17px);
}
.quiz-stage .qz-top { margin-bottom:clamp(4px, 1vh, 10px); }
.quiz-stage .qz-tag { font-size:clamp(10.5px, 1.7vh, 14px); padding:3px 11px; }
.quiz-stage .qz-dots { gap:clamp(3px, .8vh, 7px); margin:0 0 clamp(8px, 1.8vh, 18px); }
.quiz-stage .qz-dots i { width:clamp(9px, 1.5vh, 14px); height:clamp(9px, 1.5vh, 14px); }
.quiz-stage .quiz-card {
  padding:clamp(12px, 2.6vh, 26px) clamp(14px, 2.6vw, 30px);
  border-width:2px; border-color:#d3d8d2; margin-top:0;
}
.quiz-stage .quiz-q { font-size:clamp(16px, 3vh, 23px); line-height:1.35; margin-bottom:clamp(9px, 1.9vh, 18px); }
.quiz-stage .quiz-opt {
  font-size:clamp(13.5px, 2.3vh, 17.5px); line-height:1.35;
  padding:clamp(8px, 1.5vh, 14px) clamp(10px, 1.6vw, 18px); margin-bottom:clamp(5px, 1.1vh, 10px);
  border-radius:10px;
}
.quiz-stage .quiz-opt b { width:clamp(17px, 2.6vh, 24px); }
/* The Results checkpoint is answered off the same board, so its verdict line has to carry as
   much weight as the question it answers. */
.quiz-stage .quiz-why {
  margin-top:clamp(8px, 1.6vh, 16px); padding:clamp(9px, 1.8vh, 18px) clamp(12px, 2vh, 20px);
  font-size:clamp(13px, 2.2vh, 17px); line-height:1.5; border-left-width:5px;
}
.quiz-stage .hint-chip { font-size:clamp(11.5px, 1.9vh, 15px); line-height:1.5; }
/* Results lives on the board now, so the entries spread into columns instead of scrolling a
   list inside the paper, and their type follows the height of the stage like the quiz does. */
.results-summary {
  display:grid; grid-template-columns:repeat(auto-fit, minmax(250px, 1fr));
  gap:clamp(7px, 1.4vh, 14px); width:100%; max-width:1060px;
}
.results-entry { background:#fff; border:1px solid #d6ddd7; border-radius:9px; padding:clamp(8px, 1.5vh, 15px) clamp(10px, 1.5vw, 16px); }
.results-entry-title { font-weight:700; color:#2e7d4f; margin-bottom:clamp(4px, .9vh, 8px); font-size:clamp(12.5px, 2.1vh, 17px); }
.results-reading {
  display:flex; justify-content:space-between; gap:clamp(8px, 1.4vw, 18px);
  font-size:clamp(11.5px, 1.9vh, 15px); padding:clamp(2px, .5vh, 5px) 0; color:#555;
}
.results-reading b { color:#222; text-align:right; }
.quiz-stage .tipbox { font-size:clamp(12.5px, 2.1vh, 16px); line-height:1.55; }
.quiz-stage .ctl-row { max-width:640px; margin:clamp(8px, 1.6vh, 16px) auto 0; gap:clamp(6px, 1.2vh, 12px); }
.quiz-stage .ctl-btn { padding:clamp(8px, 1.5vh, 14px) 16px; font-size:clamp(12.5px, 2vh, 16px); }
.quiz-stage .qz-nav { margin-top:clamp(8px, 1.6vh, 16px); }
.quiz-stage .qz-nav .qz-page { font-size:clamp(11px, 1.8vh, 14px); }
.quiz-stage .qz-score b { font-size:clamp(42px, 8vh, 72px); }
.quiz-stage .qz-score span { font-size:clamp(18px, 3.4vh, 30px); }
/* The panel is a column, so the percentage was pushed to the far edge by margin-left:auto.
   On a board that wide it reads as a second, unrelated number — it stays with the score. */
.quiz-stage .qz-score em { margin-left:clamp(8px, 1.6vw, 22px); font-size:clamp(15px, 2.6vh, 22px); }
.quiz-stage .qz-verdict { font-size:clamp(13px, 2.2vh, 18px); }
.quiz-stage .qz-review { margin-top:clamp(8px, 1.6vh, 16px); }
.quiz-stage .qz-r { padding:clamp(6px, 1.2vh, 12px) 0 clamp(6px, 1.2vh, 12px) clamp(10px, 1.6vh, 16px); margin-bottom:clamp(8px, 1.6vh, 16px); border-left-width:4px; }
.quiz-stage .qz-rq { font-size:clamp(13.5px, 2.2vh, 17.5px); }
.quiz-stage .qz-rq i { width:clamp(19px, 3vh, 25px); height:clamp(19px, 3vh, 25px); line-height:clamp(19px, 3vh, 25px); font-size:clamp(11px, 1.8vh, 13px); }
.quiz-stage .qz-ra { font-size:clamp(12.5px, 2vh, 16px); }
.quiz-stage .qz-rw { font-size:clamp(12px, 1.9vh, 15px); }
.quiz-stage .rp-divider { margin:clamp(6px, 1.4vh, 14px) 0; }

/* ── Edutec document template (print sheet) ────────────────── */
/* The corporate letterhead: logo and wordmark, a green band cut on a diagonal,
   contact rows and a solid foot bar. Sizes are in pt/mm because the only place this
   is ever measured is a sheet of paper. */
#bench-doc-mount { display:none; }
.bd-doc {
  position:relative; width:184mm; margin:0 auto; background:#fff; color:#222;
  font-family:"Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  -webkit-print-color-adjust:exact; print-color-adjust:exact;
}
.bd-head { position:relative; padding-top:2mm; }
.bd-logo { height:52pt; display:block; }
.bd-word { position:absolute; left:78pt; top:14pt; }
.bd-word span { display:block; font-size:13pt; letter-spacing:.06em; color:#111; }
.bd-word b { display:block; font-size:11pt; color:#111; margin-top:3pt; }
.bd-band { position:relative; height:26pt; margin:4pt -13mm 0 -13mm; }
.bd-band::before { content:''; position:absolute; left:0; right:0; bottom:0; height:2.5pt; background:#1f7743; }
.bd-band::after {
  content:''; position:absolute; right:0; bottom:2.5pt; height:24pt; width:44%;
  background:#1f7743; clip-path:polygon(7% 0, 100% 0, 100% 100%, 0 100%);
}
.bd-title { margin:10pt 0 2pt; font-size:17pt; font-weight:700; color:#1f7743; }
.bd-title em { display:block; font-size:10.5pt; font-weight:400; color:#666; font-style:normal; margin-top:2pt; }
.bd-block { margin-top:9pt; }
/* A paper is longer than a page, so blocks must be allowed to break — but never in the
   middle of a row, a score bar or a heading's own first line. */
.bd-h { break-after:avoid; }
.bd-kv, .bd-score, .bd-mrow, .bd-list li, .bd-table tr { break-inside:avoid; }
.bd-h { font-size:11pt; font-weight:700; color:#111; border-bottom:1pt solid #e2e2e2; padding-bottom:2pt; margin-bottom:5pt; }
.bd-kv { display:flex; flex-wrap:wrap; gap:2pt 18pt; }
.bd-kvrow { font-size:10.5pt; min-width:46%; }
.bd-k { color:#666; }
.bd-v { font-weight:700; margin-left:5pt; border-bottom:.75pt solid #bbb; padding:0 4pt; }
.bd-score { display:flex; align-items:center; gap:12pt; background:#f2f8f4; border-left:4pt solid #1f7743; padding:8pt 12pt; }
.bd-num { font-size:30pt; font-weight:700; color:#1f7743; line-height:1; }
.bd-num span { font-size:14pt; color:#666; font-weight:400; }
.bd-meter { flex:1; height:9pt; background:#dfe9e2; border-radius:99pt; overflow:hidden; }
.bd-fill { height:100%; background:#1f7743; }
.bd-verdict { font-size:10pt; color:#333; max-width:44%; line-height:1.45; }
.bd-mastery { display:flex; flex-wrap:wrap; gap:4pt 14pt; }
.bd-mrow { display:flex; align-items:center; gap:6pt; font-size:10pt; width:47%; }
.bd-mrow span:first-child { flex:1; }
.bd-mscore { font-weight:700; color:#1f7743; width:30pt; text-align:right; }
.bd-mbar { width:52pt; height:5pt; background:#e4e4e4; border-radius:99pt; overflow:hidden; }
.bd-mbar i { display:block; height:100%; background:#1f7743; }
.bd-mrow.weak .bd-mscore { color:#c0392b; }
.bd-mrow.weak .bd-mbar i { background:#e74c3c; }
.bd-table { width:100%; border-collapse:collapse; font-size:8.8pt; }
.bd-table th { background:#1f7743; color:#fff; text-align:left; padding:3.5pt 5pt; font-weight:600; }
.bd-table td { border-bottom:.6pt solid #e6e6e6; padding:3pt 5pt; vertical-align:top; }
.bd-table tr:nth-child(even) td { background:#f7f9f7; }
.bd-table td.c0 { width:20pt; color:#666; }
.bd-table td.c1 { width:74pt; color:#444; }
.bd-table td.c4 { width:28pt; font-weight:700; color:#1f7743; text-align:center; }
.bd-list { list-style:none; }
.bd-list li { font-size:9.6pt; line-height:1.5; margin-bottom:5pt; padding-left:10pt; border-left:2.5pt solid #d8e6dc; }
.bd-note { font-size:8.6pt; color:#777; margin-top:10pt; }
.bd-fig { break-inside:avoid; text-align:center; }
/* Full width would blow a 260×170 graph up to half the page, and a definite width with a
   max-height squashes the curve out of proportion. Only maxima, so the ratio holds. */
.bd-fig img { display:block; margin:0 auto; width:auto; max-width:100%; max-height:62mm; border:.75pt solid #ddd; }
.bd-fig figcaption { font-size:8.6pt; color:#666; margin-top:3pt; }
.bd-foot { margin:16pt -13mm 0 -13mm; }
.bd-cols { display:flex; justify-content:space-between; padding:0 13mm; }
.bd-c { font-size:9pt; color:#222; margin-bottom:3pt; display:flex; align-items:center; gap:5pt; }
.bd-i {
  font-style:normal; width:11pt; height:11pt; border-radius:50%; background:#222; color:#fff;
  font-size:6.5pt; line-height:11pt; text-align:center; flex-shrink:0;
}
.bd-bar { height:10pt; background:#1f7743; margin-top:6pt; }

/* ── Responsive bench layout ──────────────────────────────── */
/* On narrow screens keep the complete experiment in one page flow: module picker,
   large touch usable bench, then the controls/readings. The renderer watches the
   stage with ResizeObserver, so it follows these dimensions automatically. */
@media (max-width: 760px) {
  html, body { min-height:100%; height:auto; overflow-x:hidden; overflow-y:auto; }
  .header { height:56px; min-height:56px; padding:0 12px; position:sticky; top:0; z-index:80; }
  .logo-img { height:40px; }
  .header-title { font-size:clamp(15px, 4vw, 19px); margin-left:10px; }
  .main-container { height:auto; min-height:calc(100svh - 56px); display:flex; flex-direction:column; }
  .left-panel { order:0; width:100%; min-width:0; padding:10px 12px; overflow:visible; box-shadow:0 2px 8px rgba(0,0,0,.07); }
  .panel-title { font-size:13px; margin:0 0 8px; padding-bottom:6px; }
  .left-panel { display:block; }
  /* A single horizontal module rail keeps the simulation visible sooner and avoids
     an awkward half-empty column on narrow phones. Cards remain swipeable by touch. */
  .left-panel > .panel-title { margin-bottom:8px; }
  .left-panel { overflow:hidden; }
  .left-panel::after { content:"Swipe for more modules →"; display:block; margin:2px 2px 0; color:#748078; font-size:10px; }
  .left-panel { white-space:normal; }
  .module-button { width:148px; min-width:148px; min-height:62px; margin:0 7px 3px 0; padding:9px 11px; vertical-align:top; display:inline-flex; }
  .left-panel { position:relative; overflow-x:auto; overflow-y:hidden; white-space:nowrap; }
  .module-button { white-space:normal; }
  .left-panel::after { position:sticky; left:0; }
  .module-button:hover { transform:none; }
  .module-name { font-size:12px; }
  .module-desc { font-size:10px; line-height:1.25; }
  .center-panel { order:1; flex:none; width:100%; min-width:0; height:clamp(340px, 68svh, 620px); min-height:340px; }
  .td-hint-banner { top:8px; left:8px; max-width:calc(100% - 112px); padding:8px 10px; font-size:11px; }
  .td-hint-banner { font-size:0; }
  .td-hint-banner::after { content:"Drag to explore · Pinch to zoom"; font-size:11px; }
  .td-reset-btn { top:8px; right:8px; padding:8px 10px; min-height:38px; }
  .stats-box { left:8px; top:auto; bottom:8px; max-width:calc(100% - 16px); }
  .legend-box { right:8px; bottom:8px; min-width:0; max-width:48%; padding:8px 10px; font-size:11px; }
  .graph-card { right:8px; top:54px; max-width:calc(100% - 16px); }
  .graph-card canvas { max-width:100%; height:auto; }
  .right-panel { order:2; width:100%; min-width:0; padding:14px 12px max(24px, env(safe-area-inset-bottom)); overflow:visible; box-shadow:0 -2px 8px rgba(0,0,0,.06); }
  .right-panel .scroll-area { overflow:visible; flex:none; }
  .rp-live-row { padding-right:0; }
  .rp-live-row .ctl-btn, .ctl-btn { min-height:42px; }
  .spec-grid { grid-template-columns:repeat(2, minmax(0, 1fr)); gap:8px; }
  .spec-card { min-width:0; min-height:76px; padding:10px 8px; border-radius:11px; }
  .spec-card-img { font-size:21px; margin-bottom:3px; }
  .spec-card-name { font-size:12px; line-height:1.3; overflow-wrap:anywhere; }
  .quiz-card { padding:14px; border-radius:14px; }
  .quiz-q { font-size:15px; line-height:1.45; }
  .quiz-opt { font-size:14px; line-height:1.4; padding:11px 12px; min-height:44px; }
  .results-entry { min-width:0; padding:12px; border-radius:11px; }
  .results-entry-title { font-size:14px; }
  .results-reading { font-size:13px; line-height:1.4; }
  .quiz-stage { position:fixed; inset:56px 0 0; z-index:75; padding:14px 12px; overflow-y:auto; justify-content:flex-start; }
  .quiz-stage > * { flex-shrink:0; }
  .results-summary { grid-template-columns:1fr; }
}

@media (max-width: 380px) {
  .header { padding:0 8px; }
  .header-title { margin-left:7px; font-size:15px; }
  .module-button { padding:7px 8px; }
  .center-panel { height:58svh; min-height:320px; }
  .stats-box { font-size:10px; }
  .spec-grid { gap:6px; }
  .spec-card { min-height:70px; padding:8px 6px; }
  .spec-card-name { font-size:11px; }
}

/* Landscape phones have plenty of width but very little height. Keep the module
   rail across the top and place the live bench beside its controls. */
@media (max-width: 760px) and (orientation: landscape) and (max-height: 520px) {
  .header { position:relative; }
  .main-container {
    display:grid; grid-template-columns:minmax(0, 1.45fr) minmax(260px, 1fr);
    grid-template-rows:auto minmax(0, 1fr); gap:0;
    height:calc(100svh - 56px); min-height:0;
  }
  .left-panel { grid-column:1 / -1; width:100%; min-width:0; padding:7px 12px 5px; }
  .panel-title { margin-bottom:5px; padding-bottom:4px; font-size:12px; }
  .module-button { width:132px; min-width:132px; min-height:48px; margin-bottom:0; padding:6px 9px; }
  .module-name { font-size:11px; }
  .module-desc { font-size:9px; }
  .left-panel::after { display:none; }
  .center-panel { grid-column:1; grid-row:2; width:auto; min-width:0; height:auto; min-height:0; }
  .right-panel { grid-column:2; grid-row:2; width:auto; min-width:0; height:100%; min-height:0; padding:8px; overflow:hidden; }
  .right-panel .scroll-area { overflow:auto; min-height:0; }
  .rp-live-row { padding-right:0; }
  .spec-grid { gap:5px; }
  .spec-card { min-height:58px; padding:6px 5px; }
  .spec-card-img { font-size:17px; }
  .spec-card-name { font-size:10px; }
  .quiz-stage { inset:0; }
}

@media print {
  @page { size:A4; margin:12mm 13mm 10mm; }
  html, body { height:auto; overflow:visible; background:#fff; }
  body > *:not(#bench-doc-mount) { display:none !important; }
  #bench-doc-mount { display:block !important; padding:0; margin:0; }
  .bd-doc { width:auto; }
}
