.rw-heading { align-items: end; }
.rw-heading h1 { font: 400 clamp(36px,4.1vw,58px)/1.09 var(--serif); letter-spacing: -.035em; }
.rw-standalone .section { padding-block: clamp(28px,4vw,60px); }
.rw-standalone .rw-back { display: inline-block; margin-bottom: 24px; color: var(--muted); font-size: 14px; }
.rw-lab { --panel: #13232d; --edge: #354852; --fg: #f0f4f2; --sub: #b4c8cb; color: var(--fg); background: var(--panel); border: 1px solid var(--edge); border-radius: 6px; overflow: hidden; font-family: var(--sans, sans-serif); }
.rw-lab button, .rw-lab select { font: inherit; color: inherit; background: #1e323d; border: 1px solid #4b626c; border-radius: 4px; min-height: 38px; padding: 4px 11px; cursor: pointer; }
.rw-lab button:hover, .rw-lab select:hover { border-color: #a1c9c6; }
.rw-lab button:focus-visible, .rw-lab select:focus-visible, .rw-lab canvas:focus-visible, .rw-lab input:focus-visible { outline: 2px solid #a7f2df; outline-offset: -2px; }
.rw-lab button[aria-pressed=false] { color: var(--sub); }
.rw-lab select:disabled { opacity: .62; cursor: default; }
.rw-head, .rw-options, .rw-time { display: flex; align-items: center; gap: 14px; padding: 12px 16px; font-size: 14px; }
.rw-head { border-bottom: 1px solid var(--edge); background: #182c36; }
.rw-modes, .rw-layers, .rw-tools { display: flex; align-items: center; gap: 4px; }
.rw-modes button[aria-pressed=true] { background: #bcddd7; border-color: #bcddd7; color: #132c32; font-weight: 650; }
.rw-note { line-height: 1.4; color: #cbd8d8; }
.rw-layout { display: grid; grid-template-columns: minmax(126px,16%) minmax(0,1fr); }
.rw-input { padding: 12px; display: grid; gap: 8px; align-content: start; background: #182a35; border-right: 1px solid var(--edge); }
.rw-input header { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px; }
.rw-input header span { color: var(--sub); font-size: 12px; }
.rw-input figure { position: relative; margin: 0; }
.rw-input img { display: block; width: 100%; height: auto; border-radius: 3px; }
.rw-input figcaption { position: absolute; left: 5px; bottom: 4px; background: #12242de8; padding: 1px 4px; color: #fff; font: 600 12px/1.45 var(--sans,sans-serif); border-radius: 3px; }
.rw-world { position: relative; min-height: 360px; overflow: hidden; background: #101d28; }
.rw-world canvas, .rw-preview { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rw-preview { object-fit: contain; }
.rw-world canvas { touch-action: none; cursor: grab; opacity: 0; }
.rw-world canvas:active { cursor: grabbing; }
.rw-lab[data-ready=true] canvas { opacity: 1; }
.rw-lab[data-ready=true] .rw-preview { visibility: hidden; }
.rw-lab:not([data-ready=true]) button, .rw-lab:not([data-ready=true]) select, .rw-lab:not([data-ready=true]) input { pointer-events: none; }
.rw-overlay { position: absolute; left: 12px; top: 10px; display: grid; line-height: 1.45; pointer-events: none; padding: 4px 8px; background: #11212ad9; border-radius: 3px; }
.rw-overlay span { color: #c2d3d4; font-size: 13px; }
.rw-overlay .rw-outcome { color: #b6e8c7; max-width: 30ch; font-weight: 600; }
.rw-overlay .rw-outcome[data-success=false] { color: #ffcc84; }
.rw-outcome[hidden] { display: none; }
.rw-tools { position: absolute; right: 10px; bottom: 10px; }
.rw-tools button { background: #182b35eb; font-size: 13px; min-width: 36px; }
.rw-lab #lab-status { position: absolute; left: 12px; bottom: 10px; margin: 0; max-width: 65%; padding: 4px 7px; background: #152430dd; color: #fff; font: 13px/1.4 var(--sans,sans-serif); }
.rw-time { border-block: 1px solid var(--edge); }
.rw-time button { min-width: 62px; }
.rw-time input { min-width: 48px; flex: 1; accent-color: #9fd9d1; cursor: pointer; }
.rw-time output { min-width: 9em; text-align: right; color: var(--sub); font-variant-numeric: tabular-nums; }
.rw-chapter-select { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; color: var(--sub); }
.rw-chapter-select select { max-width: 15em; min-width: 0; color: var(--fg); }
.rw-chapter-select[hidden], .rw-tools button[hidden] { display: none; }
.rw-lab[data-pending] .rw-time { cursor: progress; }
.rw-options { flex-wrap: wrap; }
.rw-layers i { display: inline-block; width: 18px; vertical-align: middle; margin-right: 6px; }
.rw-layers [data-layer=forecast] i { height: 3px; background: linear-gradient(to right,#ffb960 50%,#57ddd8 50%); }
.rw-layers [data-layer=executed] i { border-top: 2px dashed #ff90c5; }
@media(max-width:650px) {
  .rw-head { align-items: start; flex-direction: column; gap: 6px; }
  .rw-note { font-size: 13px; }
  .rw-layout { display: flex; flex-direction: column; }
  .rw-input { grid-template-columns: repeat(3,minmax(0,1fr)); padding: 10px; border-right: 0; border-bottom: 1px solid var(--edge); }
  .rw-input header { grid-column: 1/-1; justify-content: flex-start; gap: 10px; }
  .rw-world { min-height: 0; height: clamp(255px,76vw,360px); }
  .rw-options, .rw-head, .rw-time { padding: 10px; }
  .rw-time { gap: 7px; }
  .rw-time output { min-width: 0; font-size: 12px; }
  .rw-options { align-items: start; gap: 8px 12px; }
  .rw-tools button { min-height: 34px; padding-inline: 7px; }
  .rw-time:has(.rw-chapter-select:not([hidden])) { display: grid; grid-template-columns: auto minmax(0,1fr) auto; }
  .rw-chapter-select { grid-column: 1/-1; }
  .rw-chapter-select select { max-width: 100%; flex: 1; }
  .rw-tools { gap: 3px; right: 6px; bottom: 6px; }
}
