.mb-work {--line:#aec5c9; --paper:#f7faf9; --ink:#17384a; --wash:#e2eceb; --accent:#065c64; background:var(--paper); color:var(--ink); padding:clamp(.85rem,2vw,1.4rem); border:1px solid var(--line); border-radius:14px; scroll-margin-top:1.5rem; color-scheme:light}
.mb-work .mb-controls,.mb-play {display:flex; align-items:center; gap:.6rem 1.55rem; flex-wrap:wrap}
.mb-controls label {display:flex; align-items:center; gap:.5rem; cursor:pointer; font-weight:600; margin:0}
.mb-work input {accent-color:var(--accent); cursor:pointer}
.mb-work input[type=checkbox] {width:19px; height:19px; flex-shrink:0; margin:0}
.mb-work input:disabled {cursor:default}
.mb-work select,.mb-work button {font:inherit; background:var(--paper); color:var(--ink); border:1px solid #728e95; border-radius:6px; padding:.3rem .65rem; min-height:36px; cursor:pointer}
.mb-work :focus-visible,.mb summary:focus-visible {outline:3px solid #e17f09; outline-offset:2px}
.mb-work button:hover {text-decoration:underline}
.mb-pair {display:grid; grid-template-columns:1.27fr 1fr; gap:1.4rem; margin-top:1rem}
.mb-pair > * {min-width:0; margin:0}
.mb svg {display:block; width:100%; height:auto}
.mb .mb-label {fill:#eff8f2; font:600 18px system-ui,sans-serif; text-anchor:middle}
.mb-work figcaption {font:500 .92rem/1.4 system-ui,sans-serif; color:var(--ink); margin:.44rem 0 .8rem}
.mb-play {gap:.65rem}
.mb-play label {font-weight:bold; font-variant-numeric:tabular-nums}
.mb #mb-play {background:var(--accent); color:white; width:5rem; font-weight:600}
.mb #mb-t {width:100%; margin:.25rem 0; display:block; min-height:28px}
.mb-clock {display:grid; grid-template-columns:3fr 3fr 2fr 4fr 2fr 4fr 2fr; gap:2px}
.mb-clock button {padding:1px; border:0; min-width:0; font-size:.85rem; background:var(--wash)}
.mb-clock .mb-done {background:#1c5463; color:#fff}
.mb-clock .mb-done:nth-child(2n+3) {background:#106963}
.mb-work table {color:var(--ink); border:0; border-collapse:collapse; margin:0; width:100%; font-variant-numeric:tabular-nums}
.mb-work caption {text-align:left; font-size:1.13rem; font-weight:bold; color:var(--ink); padding-bottom:.55rem}
#handover table :is(th,td) {border:0; border-bottom:1px solid var(--line); text-align:left; color:var(--ink); background:var(--paper); padding:.41rem .46rem}
#handover table thead th {font-size:.875rem; background:var(--wash)}
.mb-progress {display:flex; justify-content:space-between; margin:.86rem 0; gap:1rem}
.mb-progress dt {font-size:.92rem}
.mb-progress dd {font-weight:700; font-size:1.5rem; margin:0}
.mb-call {padding:.7rem .92rem; border-left:4px solid var(--accent); background:var(--wash); line-height:1.4}
.mb-call strong {display:block; font-size:1.1rem; margin-bottom:.16rem}
.mb summary {cursor:pointer; padding:.55rem 0; font-weight:650}
.mb-options {margin-top:1rem; border-top:1px solid var(--line)}
.mb-options table {max-width:550px}
.mb-work .mb-hint {max-width:none; margin-bottom:0}
html[data-site-theme="dark"] .mb-work {--line:#607f87; --paper:#122635; --ink:#eef8fa; --wash:#213e50; color-scheme:dark}
html[data-site-theme="dark"] .mb-work input {accent-color:#85d9d7}
html[data-site-theme="dark"] .mb-call {border-left-color:#85d9d7}
@media(max-width:800px) {
  .mb-pair {grid-template-columns:1fr; gap:.95rem}
  .mb-controls label {min-height:35px}
  .mb-pair {gap:1.3rem}
}
@media(max-width:520px) {
  .mb {padding-inline:0}
  .mb-work {padding:.65rem; width:calc(100vw - 1rem); margin-left:calc(50% - 50vw + .5rem)}
  .mb-controls {font-size:.9rem}
  .mb .mb-label {font-size:23px}
  .mb-work table {font-size:.88rem}
  #handover table :is(th,td) {padding:.38rem .15rem}
  .mb-clock button {font-size:.7rem}
  .mb-play {gap:.46rem; font-size:.83rem}
  .mb #mb-play {width:4.1rem}
  .mb-work .mb-controls {gap:.2rem}
  .mb-work .mb-controls label {width:100%}
}
@media print {
  .mb .mb-play,.mb-clock,.mb #mb-t {display:none}
  .mb-work {break-inside:avoid}
}
:root {
  --pw-bg:#fbfaf6; --pw-ink:#203d36; --pw-line:#b3c5be; --pw-green:#195847;
  --pw-ochre:#a65d18; --surface:#fffefa; --soft:#e5efea;
}
@media screen {
  html[data-site-theme="dark"] {
    --pw-bg:#172422; --pw-ink:#eff4ec; --pw-line:#618379; --pw-green:#b2e7cf;
    --pw-ochre:#ffcb82; --surface:#203531; --soft:#29443e; color-scheme:dark;
  }
}
* {box-sizing:border-box}
body {margin:0; background:var(--pw-bg); color:var(--pw-ink); font:16px/1.48 system-ui,sans-serif}
a {color:var(--pw-green); text-underline-offset:.18em}
h2,h3,p {margin:0}
h2 {font:400 clamp(25px,2.65vw,37px)/1.12 Georgia,serif; letter-spacing:-.025em}
button,select {font:inherit; cursor:pointer}
:focus-visible {outline:3px solid var(--pw-ochre); outline-offset:2px}
[hidden] {display:none}
.skip {position:absolute; left:-9999px}
.skip:focus {left:1em; background:var(--surface); z-index:4}
.mb.pw-home.essai-reader {margin:auto; max-width:1230px; padding:0 clamp(12px,3vw,40px) 24px}
.mb .fe-nav {display:flex; flex-wrap:wrap; border-bottom:1px solid var(--pw-line)}
.mb .fe-nav a {display:inline-flex; align-items:center; font-weight:650}
.mb .fe-heading p {text-transform:uppercase}
.mb .fe-heading h1 {max-width:none; font-size:clamp(31px,3.7vw,50px)}
.mb .fe-return {border-top:1px solid var(--pw-line); padding-top:.8rem; font-size:.92rem}
.mb .opening {display:grid; grid-template-columns:minmax(0,.78fr) minmax(0,1.22fr); grid-template-areas:"story plate" "links plate"; gap:1.2rem 2.4rem; align-items:start}
.opening-story {grid-area:story}
.opening-story p {margin-top:.73rem}
.op-board {grid-area:plate; padding:clamp(14px,1.8vw,24px); border-radius:12px; background:var(--surface); border:1px solid var(--pw-line)}
.switch {display:flex;align-items:center; gap:.65rem; font-weight:650; cursor:pointer}
.switch input {accent-color:var(--pw-green); width:1.22rem; height:1.22rem; margin:0}
.files {display:grid; grid-template-columns:1fr 1fr; gap:.96rem; margin:1rem 0}
.files h3 {font-size:1rem; margin-bottom:.35rem}
.files p {font-size:.92rem; margin:.55rem 0 .14rem}
.files strong {color:var(--pw-green)}
#op-caption {font-size:.92rem; border-top:1px solid var(--pw-line); padding-top:.68rem}
.mb .files .mb-label {font-size:26px}
.opening-routes {grid-area:links; display:flex; flex-wrap:wrap; gap:.6rem 1rem; align-items:center; font-size:.96rem; font-weight:600}
.opening-routes .go {background:var(--pw-green); color:var(--pw-bg); border-radius:5px; padding:.65rem .8rem; text-decoration:none}
.go:hover {text-decoration:underline}
.mb-options p,.mb-work .mb-hint {margin-top:.4rem}
.mb-work .mb-hint {font-size:.93rem}
.atlas:not([hidden]) {display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:clamp(24px,5vw,68px)}
.atlas p,.atlas label {display:block; margin:.55rem 0}
.atlas label,.atlas caption {font-weight:650}
.atlas select,.atlas button {padding:.4rem; color:var(--pw-ink); background:var(--surface); border:1px solid var(--pw-line); border-radius:5px; max-width:100%}
.atlas select {width:100%}
.atlas-answer {border-inline-start:4px solid var(--pw-green); padding-inline-start:.95rem; margin-top:1rem}
#peers {font-size:1.24rem}
#pattern {font-weight:650; color:var(--pw-green)}
#world-grid {border-spacing:2px; width:100%; text-align:center; font-size:.93rem}
#world-grid caption {margin:.3rem 0}
#world-grid th {font-weight:600}
#world-grid tbody th {font-family:ui-monospace,monospace; white-space:pre}
#world-grid button {font-size:.88rem; padding:.27rem; min-height:32px; width:100%}
#world-grid button.match {background:var(--soft); color:var(--pw-ink); border-color:var(--pw-green); font-weight:600}
#world-grid button[aria-pressed=true] {background:var(--pw-green); color:var(--pw-bg)}
.mb .reader-prose {line-height:1.62; font-size:1.08rem}
.mb .reader-prose section + section {margin-top:1.8rem}
.wiring,.criterion {padding:.85rem 1rem; background:var(--soft); margin:1rem 0}
.mb .wiring p {margin:0}
.audit {width:100%; border-collapse:collapse; text-align:left; font-size:.94rem; margin:1rem 0}
.audit :is(td,th) {border-bottom:1px solid var(--pw-line); padding:.45rem}
.audit thead {background:var(--soft)}
@media screen and (min-width:801px) and (max-height:760px) {
  .mb .fe-heading {margin:8px 0 5px}
  .mb .fe-heading h1 {font-size:clamp(28px,3.4vw,41px)}
  .mb [data-reader-panel] {padding:14px 0}
  .mb .mb-work {padding:.7rem 1rem}
  .mb-pair {margin-top:.64rem; grid-template-columns:1.05fr 1fr}
  .mb-pair svg {max-height:172px; background:#092f42; border-radius:10px}
  .mb-work figcaption {margin:.3rem 0 .4rem}
  .mb-progress {margin:.45rem 0}
  .mb-progress dd {font-size:1.2rem}
  #handover table :is(th,td) {padding:.26rem .4rem}
  .mb-call {padding:.5rem .7rem}
  .mb-options {margin-top:.55rem}
  .mb-work .mb-hint {margin-top:0}
}
@media (max-width:800px) {
  .mb .opening,.atlas:not([hidden]) {display:flex; flex-direction:column}
  .op-board,.atlas>div {width:100%}
  .mb .reader-tabs a {font-size:14px}
  .mb .reader-prose {font-size:1rem}
}
@media (max-width:532px) {
  .mb .reader-tabs {display:grid; grid-template-columns:repeat(3,1fr)}
  .mb .reader-tabs a {justify-content:center; margin:0; padding-inline:0}
  .files {grid-template-columns:1fr}
  .audit {font-size:.81rem; line-height:1.38}
  .audit :is(th,td) {padding:.4rem .2rem}
}
@media print {
  .skip,.fe-return,.fe-nav,.reader-tabs,.opening-routes,.switch,#atlas,.mb-controls,.mb-options,.mb-hint {display:none!important}
  .mb .opening {display:block}
  .files {max-width:40rem}
  #main, #evidence {padding-bottom:0;margin-bottom:0}
  .mb .reader-prose p + p {margin-top:.65em}
  .mb h2 {break-after:avoid}
  .mb .reader-prose {font-size:10.5pt; line-height:1.37}
  .audit,.wiring,.op-board {break-inside:avoid}
}

/* Keep the survey tabs and return links in place on a landscape display.
   The active panel remains keyboard-scrollable when its evidence is long. */
@media screen and (min-width:960px) and (min-height:540px) and (orientation:landscape) {
  #main.mb[data-reader-view] {
    display:grid; box-sizing:border-box; height:100vh; height:100dvh; padding-block:0;
    grid-template-areas:"foray siblings" "title title" "tabs tabs" "content content" "return return";
    grid-template-columns:minmax(0,1fr) auto;
    grid-template-rows:auto auto auto minmax(0,1fr) auto;
  }
  #main.mb > .fe-nav {grid-area:foray; margin:0; padding:0}
  #main.mb > #site-level-navigation {grid-area:siblings; margin:0; align-self:center}
  #main.mb > .fe-heading {grid-area:title}
  #main.mb > .reader-tabs {grid-area:tabs}
  #main.mb > #read-all {grid-area:content; min-height:0; min-width:0}
  #main.mb [role=tabpanel]:is(#read-all,[data-reader-panel]) {
    box-sizing:border-box; height:100%; overflow:auto; scrollbar-gutter:stable;
  }
  #main.mb > .fe-return {grid-area:return; margin:0; padding:.4rem 0}
  @media (max-height:760px) {
    #main.mb > .fe-nav a,.mb .reader-tabs a {min-height:36px}
    #main.mb .fe-heading h1 {font-size:clamp(28px,2.95vw,37px)}
    #main.mb [data-reader-panel] {padding-block:.5rem}
    #main.mb .mb-work {padding-block:.5rem}
    #main.mb .mb-pair {margin-top:.4rem}
    #main.mb .mb-options {margin-top:.35rem}
  }
}
