/* Work surfaces for the shared escape engine. Materials frame the evidence;
   controls never encode whether an individual choice is correct. */
dialog.escape-workbench-dialog {
  --ewb-dialog-surface: #17242a;
  width: min(1540px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100dvh - 24px);
  background: var(--ewb-dialog-surface);
  color: #f3ebdb;
  border: 1px solid #a98c5c;
  border-radius: 14px;
  box-shadow: 0 28px 100px #000a;
}
dialog.escape-workbench-dialog[data-workbench-family="optics"] { --ewb-dialog-surface: #171c25; background: var(--ewb-dialog-surface); border-color: #ad9c76; }
dialog.escape-workbench-dialog[data-workbench-family="print"] { --ewb-dialog-surface: #30271f; background: var(--ewb-dialog-surface); border-color: #b89560; }
dialog.escape-workbench-dialog[data-workbench-family="strata"] { --ewb-dialog-surface: #29312a; background: var(--ewb-dialog-surface); border-color: #b6b08d; }
dialog.escape-workbench-dialog[data-workbench-family="relations"] { --ewb-dialog-surface: #302b26; background: var(--ewb-dialog-surface); border-color: #af966e; }
dialog.escape-workbench-dialog[data-workbench-family="volume"] { --ewb-dialog-surface: #252b30; background: var(--ewb-dialog-surface); border-color: #b5a88b; }
.escape-workbench-dialog[data-workbench-family] .modal-head { background: inherit; }
.escape-workbench-dialog .modal-head {
  padding: 16px 24px;
  background: #17242af5;
  border-bottom-color: #b59b674d;
}
.escape-workbench-dialog .modal-head h2 { font-size: clamp(20px, 2.3vw, 28px); line-height: 1.3; }
.escape-workbench-dialog .modal-body { padding: 20px 24px 24px; }
.escape-workbench-dialog .rule-text { max-width: 80ch; margin: 0 0 18px; font-size: 16px; line-height: 1.65; }
.escape-workbench-dialog .puzzle-feedback { line-height: 1.6; padding: 14px 18px; background: #22353a; border-left: 3px solid #c6ab75; border-radius: 3px; }
.ewb {
  --ewb-paper: #ece0c4;
  --ewb-ink: #292c29;
  --ewb-brass: #d7ba7f;
  --ewb-muted: #c4c9bd;
  --ewb-line: #a4916c70;
  --ewb-wood: #544634;
  display: grid;
  gap: 18px;
  min-width: 0;
  color: #f3ebdb;
  font: 17px/1.6 var(--ui-font, system-ui, sans-serif);
  isolation: isolate;
}
.ewb *, .ewb *::before, .ewb *::after { box-sizing: border-box; }
.ewb h3, .ewb h4, .ewb p, .ewb figure { margin: 0; }
.ewb h3 { font-size: 20px; line-height: 1.35; }
.ewb h4 { font-size: 16px; line-height: 1.4; }
.ewb button, .ewb select, .ewb input, .ewb textarea { font: inherit; }
.ewb button {
  min-width: 44px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid #9d916d89;
  border-radius: 7px;
  color: #f3ebdb;
  background: #26373a;
  cursor: pointer;
  line-height: 1.35;
  white-space: normal;
  overflow-wrap: anywhere;
  box-shadow: inset 0 1px 0 #ffffff0a, 0 2px 3px #0002;
  touch-action: manipulation;
}
.ewb button:hover:not(:disabled) { background: #354749; border-color: #dec494; }
.ewb button:active:not(:disabled) { transform: translateY(1px); }
.ewb button[aria-pressed="true"], .ewb button[aria-selected="true"] { border-color: #e8c98b; box-shadow: inset 0 0 0 1px #e8c98b; background: #4a4c3c; }
.ewb button:disabled { opacity: .52; cursor: default; }
.ewb :focus-visible { outline: 3px solid #f1cf87; outline-offset: 3px; }
.ewb .ewb-subtle { font-size: 16px; color: var(--ewb-muted); line-height: 1.5; }
.ewb-topline { display: flex; gap: 12px 24px; align-items: baseline; justify-content: space-between; flex-wrap: wrap; }
.ewb-objective { max-width: 82ch; line-height: 1.65; }
.ewb-readonly { padding: 10px 14px; color: #e2d4b4; background: #ffffff08; border: 1px solid var(--ewb-line); border-radius: 6px; }
.ewb-mobile-tabs { display: none; }
.ewb-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 380px); align-items: start; gap: 22px; min-width: 0; }
.ewb-workspace, .ewb-evidence { min-width: 0; }
.ewb-workspace { display: grid; gap: 16px; }
.ewb-evidence { display: grid; gap: 13px; padding: 16px; border: 1px solid var(--ewb-line); border-radius: 9px; background: #101b1d7a; position: static; max-height: none; overflow: visible; }
.ewb-evidence h3 { font-size: 18px; }
.ewb-evidence-list { display: grid; gap: 8px; }
.ewb-evidence-tab { display: block; text-align: left; width: 100%; }
.ewb-document { font: 17px/1.75 Georgia, serif; color: var(--ewb-ink); padding: 20px; border-radius: 3px 8px 8px 3px; background: linear-gradient(90deg, #b4a17c22, transparent 12%), var(--ewb-paper); box-shadow: 0 5px 15px #0003; }
.ewb-document h4 { color: #3c3d2e; font-size: 17px; margin-bottom: 12px; }
.ewb-document p { white-space: pre-line; line-height: 1.75; overflow-wrap: anywhere; }
.ewb-document img { display: block; width: 100%; max-height: 300px; margin-bottom: 14px; object-fit: contain; border-radius: 2px; }
.ewb-place-reference { padding: 7px; background: #3d3527; border: 1px solid #ad936a; box-shadow: inset 0 0 0 3px #191b1766; overflow: auto; }
.ewb-place-reference img { display: block; width: 100%; height: auto; border: 1px solid #897653; }
.ewb-place-reference figcaption { padding: 8px 3px; color: #d8c59e; font-size: 15px; }
.ewb-place-reference button { width: 100%; font-size: 15px; min-height: 44px; }
.ewb-place-reference.ewb-reference-expanded { max-height: 65dvh; }
.ewb-place-reference.ewb-reference-expanded img { width: 200%; max-width: none; }
.ewb-place-reference.ewb-reference-expanded button { position: sticky; bottom: 0; left: 0; }
.ewb-evidence-empty { line-height: 1.6; color: #d8d4c7; }
.ewb-surface { padding: 18px; border: 1px solid #9c825c; border-radius: 10px; background: radial-gradient(ellipse at 40% 20%, #79694b26, transparent 70%), linear-gradient(140deg, #2f342e, #172526); box-shadow: inset 0 1px 1px #e8d6ae16, inset 0 -8px 18px #0002, 0 5px 15px #0002; min-width: 0; }
.ewb-surface-head { display: flex; flex-wrap: wrap; gap: 8px 18px; justify-content: space-between; align-items: baseline; margin-bottom: 16px; }
.ewb-stage { width: 100%; position: relative; min-width: 0; overflow: hidden; border-radius: 5px; }
.ewb-stage svg { display: block; width: 100%; height: auto; max-height: 460px; }
.ewb-stage svg text { font-family: Georgia, serif; }
.ewb-apparatus { min-width: 0; }
.ewb-apparatus .ewb-stage { overflow: auto; scrollbar-color: #a6976b #172226; }
.ewb-apparatus .ewb-stage[data-zoom="true"] svg { width: 150%; min-width: 620px; max-height: none; }
.ewb button.ewb-zoom { display: block; margin: 9px 0 0 auto; min-height: 44px; padding: 6px 11px; font-size: 15px; background: #ffffff09; border-color: #bcb08a66; }
.ewb-diagram-caption { margin-top: 10px!important; color: #ddd8c8; font-size: 16px; line-height: 1.5; }
.ewb-reference-image { display: block; width: 100%; max-height: 330px; object-fit: contain; border-radius: 4px; }
.ewb-two-views { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: start; }
.ewb-two-views h4 { margin-bottom: 9px; }
.ewb-measurements { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 9px; margin-top: 14px; }
.ewb-measurement { padding: 10px 12px; border: 1px solid #af9e744d; border-radius: 5px; background: #0a141555; min-width: 0; }
.ewb-measurement span { display: block; font-size: 15px; color: #c9c8b8; }
.ewb-measurement strong { font-size: 19px; color: #f1ddb2; font-weight: 400; }
.ewb-tools { display: grid; gap: 12px; }
.ewb-control-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ewb-control-row > label { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ewb-control-row select { color: #f5eedf; background: #253539; border: 1px solid #8b8264; border-radius: 5px; padding: 9px 12px; min-height: 44px; max-width: 100%; }
.ewb-control-row output { min-width: 48px; text-align: center; color: #f1dbac; font-variant-numeric: tabular-nums; }
.ewb-slider { display: grid; grid-template-columns: minmax(100px, 1fr) 44px minmax(90px, 1.5fr) 44px 48px; gap: 9px; align-items: center; }
.ewb-slider input { width: 100%; accent-color: #d6b575; min-width: 0; }
.ewb-slider output { text-align: center; font-variant-numeric: tabular-nums; }
.ewb-bank { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(136px, 100%), 1fr)); gap: 10px; }
.ewb-bank button { min-width: 0; width: 100%; padding: 10px 9px; display: flex; flex-direction: column; align-items: stretch; gap: 8px; text-align: left; border-radius: 5px; background: linear-gradient(140deg, #55513a66, #263638); }
.ewb-bank button[aria-pressed="true"] { background: #55543b; }
.ewb-object-art { display: grid; place-items: center; height: 96px; padding: 4px; border-radius: 4px; background: #111c1d55; overflow: hidden; }
.ewb-object-art img { display: block; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 3px 3px #0006); }
.ewb-object-art svg { display: block; height: 100%; width: 100%; max-height: none; }
.ewb-object-name { line-height: 1.35; font-size: 16px; }
.ewb-object-detail { display: flex; gap: 16px; align-items: start; padding: 14px 16px; border: 1px solid #bcac7770; border-radius: 7px; background: #152529; }
.ewb-object-detail .ewb-object-art { flex: 0 0 110px; height: 90px; }
.ewb-object-detail h4 { margin-bottom: 7px; color: #eed5a6; }
.ewb-object-detail p { font-size: 17px; line-height: 1.7; }
.ewb-object-detail p { white-space: pre-line; }
.ewb-selection-caption { min-height: 24px; font-size: 16px; color: #e2d2ac; }
.ewb-order { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(164px, 100%), 1fr)); gap: 9px; padding: 15px; background: repeating-linear-gradient(0deg, #a4885a0c 0 1px, transparent 1px 6px), #2b2d24; border: 1px solid #8c7653; border-radius: 6px; }
.ewb-order-slot { position: relative; padding: 7px; min-width: 0; border: 1px solid #b99c675e; background: #0d181754; border-radius: 4px; }
.ewb-order-position { display: block; color: #d7c391; font-size: 15px; margin-bottom: 6px; }
.ewb-order-slot > button { width: 100%; min-height: 76px; font-size: 16px; background: #474736; }
.ewb-order-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.ewb-order-controls button { flex: 1; padding: 5px; min-height: 44px; min-width: 44px; font-size: 15px; }
.ewb-sample-grid { display: grid; grid-template-columns: repeat(var(--ewb-cols, 3), minmax(0, 1fr)); gap: 10px; }
.ewb-sample { display: grid; gap: 8px; padding: 11px; min-width: 0; border: 1px solid #9c855980; border-radius: 5px; background: #343c32; }
.ewb-sample .ewb-sample-image { height: 95px; position: relative; overflow: hidden; background: #ded1ac; border-radius: 2px; border: 1px solid #857046; }
.ewb-sample h4 { font-size: 16px; }
.ewb-sample .ewb-sample-image svg { width: 100%; height: 100%; }
.ewb-layer { height: auto; min-height: 36px; margin-top: 3px; border: 1px solid #e4d4ad45; display: flex; align-items: center; padding: 7px 9px; color: #fff; text-shadow: -1px 0 #172226, 0 1px #172226, 1px 0 #172226, 0 -1px #172226; font-size: 15px; line-height: 1.45; overflow-wrap: anywhere; }
.ewb-layer-stack { display: flex; flex-direction: column-reverse; gap: 3px; padding: 9px; background: #152422; min-height: 100px; }
.ewb-optic-controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 9px; }
.ewb-optic-control { padding: 12px; border: 1px solid #a38c6255; background: #122124; border-radius: 7px; display: grid; gap: 8px; }
.ewb-optic-control h4 { font-size: 16px; }
.ewb-optic-control .ewb-control-row { justify-content: space-between; }
.ewb-height-grid { display: grid; grid-template-columns: repeat(var(--ewb-cols, 3), minmax(0, 1fr)); gap: 8px; max-width: 500px; margin-inline: auto; }
.ewb-height-cell { padding: 10px 6px; background: linear-gradient(135deg, #665b40, #333d31); border: 1px solid #b59d6a; border-radius: 3px; text-align: center; display: grid; gap: 7px; }
.ewb-height-cell span { font-size: 15px; }
.ewb-height-cell strong { font-size: 24px; font-weight: 400; color: #f2dca8; }
.ewb-height-cell .ewb-control-row { justify-content: center; }
.ewb-height-cell button { min-width: 44px; min-height: 44px; padding: 5px; }
.ewb-proof-grid { display: grid; grid-template-columns: repeat(var(--ewb-cols, 6), minmax(0, 1fr)); gap: 1px; padding: 9px; border: 9px solid #79633f; background: #e5d8b9; box-shadow: 0 3px 7px #0005; }
.ewb-proof-cell { aspect-ratio: 1; background: #ece1c4; min-width: 0; }
.ewb-proof-grid button.ewb-proof-cell { padding: 0; border: 1px solid #69593d3d; border-radius: 0; min-width: 0; min-height: 44px; color: #f4e3bc; font-size: 15px; }
.ewb-proof-cell[data-ink="1"] { background: #253335!important; }
.ewb-proof-cell[data-ink="2"] { background: #a66345!important; }
.ewb-proof-cell[data-ink="3"] { background: #6d5b67!important; }
.ewb-proof-cell[data-ink="4"] { background: #817753!important; }
.ewb-plate-controls { display: grid; gap: 14px; }
.ewb-plate { padding: 13px; background: #243430; border: 1px solid #a68b5d; border-radius: 6px; display: grid; gap: 11px; }
.ewb-plate h4 { color: #ecd3a1; }
.ewb-active-matrix { width: min(250px, 100%); margin-inline: auto; }
.ewb-ink-swatch { display: inline-block; width: 18px; height: 18px; border-radius: 50%; border: 1px solid #e4ce9c; margin-right: 8px; vertical-align: middle; }
.ewb-print-history { display: flex; flex-wrap: wrap; gap: 8px 28px; padding: 12px 12px 12px 32px; margin: 0; color: #d4cfba; font-size: 16px; }
.ewb-node-bank { display: flex; flex-wrap: wrap; gap: 8px; }
.ewb-node-bank button { flex: 1 1 100px; }

/* A press, an optical bench and a wet sheet have distinct working surfaces.
   All bitmap crops below are the same inspected, unmarked material samples
   used by the calculated SVG objects; no diagram is painted into a texture. */
.ewb[data-family="optics"] .ewb-surface { background: radial-gradient(ellipse at 50% 0, #39444b, #1a2029 68%); border-color: #796c50; padding: 18px 12px; }
.ewb[data-family="optics"] .ewb-stage { background: radial-gradient(ellipse at 50% 85%, #0007, transparent 70%); padding: 8px 0 12px; }
.ewb[data-family="optics"] .ewb-stage svg { max-height: 500px; }
.ewb[data-family="optics"] .ewb-bank { padding: 14px; background: #141a21; border: 1px solid #826d4a; box-shadow: inset 0 4px 15px #0007; }
.ewb[data-family="optics"] .ewb-bank button { background: transparent; border-color: #a5987155; box-shadow: none; }
.ewb[data-family="optics"] .ewb-object-art { height: 96px; background: transparent; }
.ewb[data-family="optics"] .ewb-optic-control { background: #1a2028; border-color: #a6976455; }
.ewb[data-family="optics"] .ewb-object-name { padding: 5px; background: #ddd2b8; color: #292d2a; border-radius: 2px; text-align: center; }
.ewb[data-family="print"] .ewb-surface { background: #403328; border-color: #ac8b5c; }
.ewb[data-family="print"] .ewb-two-views { align-items: end; gap: 20px; }
.ewb[data-family="print"] .ewb-proof-grid { position: relative; gap: 0; padding: 18px; border: 1px solid #ae9971; background: #eee2c7; box-shadow: 2px 4px 2px #2c241d70, 0 0 0 3px #f5e7c840; }
.ewb[data-family="print"] .ewb-proof-grid::after { content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .2; mix-blend-mode: multiply; background-image: url('/adventures/galerie/art/extensions/enluminure/dorure.webp'); background-size: 2500% 3333.334%; background-position: 47.917% 78.351%; }
.ewb[data-family="print"] .ewb-proof-cell { position: relative; box-shadow: inset 0 0 0 .35px #5f59441a; }
.ewb-print-sheet { position: relative; padding: 17px 19px 21px; background-image: linear-gradient(#35251066, #38291c55), url('/adventures/galerie/art/extensions/fauvisme/atelier-uninhabited.webp'); background-size: 100% 100%, 500% 3333.334%; background-position: center, 45% 98.969%; border: 1px solid #b69565; box-shadow: 0 6px 0 #4d3927, 0 9px 14px #0006; }
.ewb-print-sheet::after { content: ''; position: absolute; width: 12px; height: 12px; border-left: 2px solid #332e23; border-bottom: 2px solid #332e23; left: 23px; bottom: 25px; pointer-events: none; }
.ewb-reference-proof .ewb-print-sheet { padding: 28px 17px 21px; background-image: repeating-linear-gradient(0deg, #a2936f15 0 1px, transparent 1px 5px); background-color: #5b5140; border-color: #8e7955; }
.ewb-reference-proof .ewb-print-sheet::before { content: ''; position: absolute; width: 46px; height: 16px; top: 5px; left: calc(50% - 23px); background: linear-gradient(#645135, #c4b18a 40%, #594a34); border: 1px solid #baa476; box-shadow: 0 2px 2px #0006; z-index: 1; }
.ewb-pulled-proof > .ewb-stage { overflow: visible; }
.ewb-pulled-proof > .ewb-stage svg { max-height: 106px; }
.ewb[data-family="print"] .ewb-bank { padding: 14px; background: repeating-linear-gradient(90deg, transparent 0 118px, #171b1780 119px 121px), #392f24; border: 5px ridge #947a4f; }
.ewb[data-family="print"] .ewb-bank button { background: transparent; border-color: transparent; box-shadow: none; }
.ewb[data-family="print"] .ewb-object-art { height: 110px; background: transparent; padding: 0; }
.ewb[data-family="print"] .ewb-object-name { color: #eadcc0; text-align: center; }
.ewb[data-family="print"] .ewb-plate { background: linear-gradient(135deg, #5c4a34, #2e2a22); border: 5px ridge #8a714c; padding: 20px; }
.ewb[data-family="print"] .ewb-active-matrix { width: min(300px, 100%); padding: 8px; }
.ewb[data-family="print"] .ewb-node-bank button { border-radius: 40% 40% 8px 8px; padding: 16px 8px 10px; background: #dad0b6; color: #342e22; border: 3px solid #8c8064; }
.ewb[data-family="print"] .ewb-ink-swatch { width: 25px; height: 20px; border-radius: 50%; border: 3px solid #4c4537; box-shadow: inset 0 3px 4px #0005, 0 1px 0 #fff8; }
.ewb[data-family="strata"] .ewb-surface { background: linear-gradient(125deg, #555747, #303b32); border-color: #bdaf87; }
.ewb[data-family="strata"] .ewb-sample { background: #d4cbb0; color: #2e352d; padding: 12px 8px; border: 1px solid #9e987a; border-radius: 2px; box-shadow: 1px 4px 6px #18251a66; }
.ewb[data-family="strata"] .ewb-sample h4 { color: #373e32; min-height: 38px; }
.ewb[data-family="strata"] .ewb-sample .ewb-subtle { color: #414b3c; }
.ewb[data-family="strata"] .ewb-sample .ewb-stage { background: #73755c; border: 1px solid #bcb495; padding: 4px; }
.ewb[data-family="strata"] .ewb-layer-stack { padding: 8px 4px; min-height: 90px; background: #4a513f; border: 1px solid #777b61; gap: 1px; }
.ewb[data-family="strata"] .ewb-layer { height: auto; min-height: 36px; margin: 0; box-shadow: inset 0 1px 0 #fff3, inset 0 -2px 2px #1113; }
.ewb[data-family="strata"] .ewb-bank { padding: 15px; background: linear-gradient(#33392c, #1a251e); border: 1px solid #959773; box-shadow: inset 0 5px 9px #0005; }
.ewb[data-family="strata"] .ewb-bank button { background: transparent; border-color: #a8aa8a55; box-shadow: none; }
.ewb[data-family="strata"] .ewb-object-art { height: 95px; background: transparent; }
.ewb[data-family="strata"] .ewb-object-name { color: #e7e3c8; text-align: center; }
.ewb-global-treatment { display: block; width: 100%; margin-top: 16px; }
.ewb[data-family="volume"] .ewb-surface { background: linear-gradient(130deg, #42494a, #222d31); border-color: #9d9b83; }
.ewb[data-family="volume"] .ewb-two-views { padding: 15px; background: repeating-linear-gradient(0deg, #b5c7c00a 0 1px, transparent 1px 15px), #1a2c33; border: 1px solid #76938f77; }
.ewb[data-family="network"] .ewb-surface { background: #39453c; border-color: #a7aa87; }
.ewb[data-family="network"] .ewb-object-art { height: 100px; padding: 0; background: transparent; }
.ewb[data-family="network"] .ewb-bank { padding: 14px; background: #26362d; border: 1px solid #829071; box-shadow: inset 0 3px 9px #0006; }
.ewb[data-family="network"] .ewb-bank button { background: transparent; border-color: #a3ac8355; }
.ewb[data-family="sequence"] .ewb-order { border: 7px ridge #8d7048; background: repeating-linear-gradient(0deg, #c5a5780c 0 1px, transparent 1px 6px), #3e3426; }
.ewb[data-family="sequence"] .ewb-order-slot { border: none; background: #171a1455; border-radius: 2px; box-shadow: inset 1px 2px 4px #0005; }
.ewb[data-family="sequence"] .ewb-order-slot > button { background: #d9cdad; color: #33362c; border-color: #a29774; }
.ewb[data-family="relations"] .ewb-surface { background: #e3d4b4; color: #34372f; border: 8px solid #6a5035; border-radius: 4px 12px 12px 4px; box-shadow: inset 17px 0 17px #7d61332b, 0 5px 10px #0005; }
.ewb[data-family="relations"] .ewb-relation-grid { gap: 1px; border: 1px solid #8c7f5d; background: #9b8c6955; }
.ewb[data-family="relations"] .ewb-relation-grid > .ewb-relation-heading { color: #4a4837; background: #e7d9b9; border-bottom: 1px solid #b3a27b; }
.ewb[data-family="relations"] .ewb-relation-cell { padding: 5px; background: #eee2c7; }
.ewb[data-family="relations"] .ewb-relation-cell > button { background: #d6c8a6; color: #303b32; border-color: #b9aa84; box-shadow: 0 2px 2px #8c785033; }
.ewb[data-family="relations"] .ewb-relation-cell .ewb-cell-clear { background: transparent; color: #5a5e49; box-shadow: none; }
.ewb[data-family="relations"] .ewb-diagram-caption { color: #575c48; }
.ewb[data-family="relations"] .ewb-bank button { background: #5a503b; border-color: #b69d6a66; }
.ewb[data-family] .ewb-bank button[aria-pressed="true"] { outline: 2px solid #ead29a; outline-offset: -1px; background-color: #8d795935; }
.ewb-network-edges { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 8px; }
.ewb-network-edge { display: grid; gap: 5px; padding: 9px 12px; background: #243630; border: 1px solid #897b5b; border-radius: 5px; }
.ewb-network-edge label { display: flex; gap: 9px; align-items: center; }
.ewb-network-edge input { width: 21px; height: 21px; accent-color: #d0ad6d; }
.ewb-relation-grid { display: grid; grid-template-columns: minmax(140px, 1.2fr) repeat(var(--ewb-cols, 3), minmax(132px, 1fr)); gap: 6px; min-width: 0; }
.ewb-relation-grid > span { padding: 10px 7px; font-size: 15px; align-content: center; text-align: center; }
.ewb-relation-grid > .ewb-relation-heading { color: #e5c68a; font-weight: 700; }
.ewb-relation-grid button { min-width: 0; padding: 8px 5px; font-size: 16px; background: #2b3d38; }
.ewb-relation-cell { display: grid; gap: 4px; align-content: start; min-width: 0; }
.ewb-relation-cell > button { width: 100%; min-height: 48px; }
.ewb-relation-cell .ewb-cell-clear { min-height: 44px; border-color: transparent; font-size: 15px; padding: 3px; color: #d0cdbd; background: #18292b; }
.ewb-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; padding: 15px 0 0; border-top: 1px solid var(--ewb-line); }
.ewb-actions .ewb-submit { background: #d8be85; color: #1c292b; font-weight: 700; border-color: #e9d5a7; min-height: 47px; padding-inline: 21px; }
.ewb-actions .ewb-submit:hover:not(:disabled) { background: #ecd39e; color: #19282b; }
.ewb-actions .ewb-undo { margin-left: auto; }
.ewb-reset-confirm { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; width: 100%; border: 1px solid #b69b6b; border-radius: 5px; padding: 12px; background: #213337; }
.ewb-trial { padding: 13px 16px; background: #0c181a80; border: 1px solid #82968d60; border-radius: 6px; }
.ewb-trial h4 { font-size: 15px; color: #e5ce9d; margin-bottom: 5px; }
.ewb-trial p { font-size: 16px; line-height: 1.6; }
.ewb-note-caption { margin-top: 8px!important; font-size: 15px; color: #5b5c4c; }
.ewb [hidden] { display: none!important; }

/* The reading room supplies light-paper defaults to every dialog. Keep those
   rules for documents and options, and scope the material workbench palette
   here so headers, instructions and close controls inherit readable ink. */
body.material-ui dialog.escape-workbench-dialog {
  --ui-paper: var(--ewb-dialog-surface);
  --ui-ink: #f3ebdb;
  --ui-muted: #c4c9bd;
  --ui-surface: #26373a;
  --ui-soft: #354749;
  --ui-line: #a4916c70;
  --ui-accent: #d7ba7f;
  --ui-accent-hover: #ecd39e;
  --ui-on-accent: #1c292b;
  --ui-focus: #f1cf87;
  color-scheme: dark;
  background: var(--ewb-dialog-surface);
  width: min(1540px, calc(100vw - 32px));
  max-height: calc(100dvh - 24px);
  color: var(--ui-ink);
}
/* A locked device has no workbench surface yet. Keep its light ink on the
   material dialog background instead of the reading room's paper default. */
body.material-ui dialog.escape-workbench-dialog:not(:has(.ewb)) {
  background: #17242a;
}
body.material-ui .escape-workbench-dialog .modal-head {
  padding: 16px 24px;
  background: inherit;
  color: var(--ui-ink);
  border-top: 0;
  border-bottom-color: var(--ui-line);
}
body.material-ui .escape-workbench-dialog .modal-head h2 {
  color: inherit;
  font-size: clamp(20px, 2.3vw, 28px);
  line-height: 1.3;
}
body.material-ui .escape-workbench-dialog .modal-body { padding: 20px 24px 24px; color: var(--ui-ink); }
body.material-ui .escape-workbench-dialog .rule-text { color: var(--ui-ink); font-size: 16px; line-height: 1.65; margin-bottom: 18px; }
body.material-ui .escape-workbench-dialog .ewb h3 { color: inherit; font-size: 20px; line-height: 1.35; margin: 0; }
body.material-ui .escape-workbench-dialog .ewb-evidence h3 { font-size: 18px; }
body.material-ui .escape-workbench-dialog .puzzle-feedback { color: #f3ebdb; background: #22353a; border-left-color: #c6ab75; }
body.material-ui .escape-workbench-dialog .puzzle-feedback:empty { background: none; }
body.material-ui .escape-workbench-dialog .ewb :focus-visible { outline-color: #f1cf87; }
/* Comfortable instructions belong beside the apparatus, without borrowing
   the small type or decorative textures used inside the calculated drawings. */
dialog.escape-workbench-dialog[open] { display: flex; flex-direction: column; overflow: hidden; }
body.material-ui .escape-workbench-dialog .modal-head { flex: none; position: relative; gap: 18px; padding: 17px 26px; }
body.material-ui .escape-workbench-dialog .modal-head h2 { overflow-wrap: anywhere; }
body.material-ui .escape-workbench-dialog .modal-head button { flex: none; min-width: 44px; min-height: 44px; }
body.material-ui .escape-workbench-dialog .modal-head #close-dialog { flex: 0 0 auto; width: auto; min-width: 70px; height: auto; min-height: 44px; padding: 10px 13px; border: 1px solid #b5a37b; border-radius: 8px; font: 600 16px/1.4 var(--ui-font, system-ui, sans-serif); white-space: normal; background: #26373a; color: #f3ebdb; }
body.material-ui .escape-workbench-dialog .modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-color: #ad9d77 #1b292b;
  scroll-padding-block: 20px 160px;
  padding: 24px 26px 28px;
}
body.material-ui .escape-workbench-dialog .rule-text { max-width: 90ch; font: 17px/1.75 var(--ui-font, system-ui, sans-serif); }
.ewb { row-gap: 22px; }
.ewb :is(p, h3, h4, span, label, output) { overflow-wrap: anywhere; }
.ewb h3 { font-family: Georgia, serif; }
.ewb h4 { font-family: inherit; font-weight: 650; }
.ewb button { font-size: 16px; }
.ewb button:disabled { opacity: .7; }
.ewb :is(button, input, select, summary):focus-visible { outline: 3px solid #f1cf87; outline-offset: 3px; }
.ewb-guide { display: grid; gap: 16px; min-width: 0; }
.ewb-goal { padding: 20px 24px; border: 1px solid #b7a47c; border-left: 4px solid #e4c68c; border-radius: 8px; background: #26383b; }
body.material-ui .escape-workbench-dialog .ewb-goal h3 { margin-bottom: 9px; color: #f6dca6; font-size: 19px; }
.ewb-goal p { max-width: 90ch; font-size: 18px; line-height: 1.7; color: #fff8e9; }
.ewb-goal .ewb-start { margin-top: 14px; }
.ewb-guide:has(> .ewb-instructions:not([open])) { gap: 10px; }
.ewb-guide:has(> .ewb-instructions:not([open])) .ewb-goal { padding: 16px 20px; }
.ewb-guide:has(> .ewb-instructions:not([open])) .ewb-goal p { font-size: 17px; line-height: 1.6; }
.ewb-instructions { padding: 18px 22px 20px; border: 1px solid #86958970; border-radius: 8px; background: #132327; }
body.material-ui .escape-workbench-dialog .ewb-instructions h3 { font-size: 19px; margin-bottom: 16px; color: #efe6d1; }
.ewb-instructions > summary { cursor: pointer; min-height: 44px; padding: 8px 3px; color: #f3e8d0; font-size: 18px; font-weight: 650; line-height: 1.5; }
.ewb-instructions[open] > summary { margin-bottom: 15px; }
.ewb-instructions > summary:hover { color: #ffe3aa; }
.ewb-instructions:not([open]) { padding: 0 18px; }
.ewb-instructions:not([open]) > summary { padding: 12px 2px; }
.ewb-instructions ol { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr)); gap: 18px 25px; margin: 0; padding: 0; list-style: none; counter-reset: ewb-step; }
.ewb-instructions li { position: relative; padding-left: 40px; counter-increment: ewb-step; min-width: 0; }
.ewb-instructions li::before { content: counter(ewb-step); position: absolute; left: 0; top: 0; display: grid; place-items: center; width: 28px; height: 28px; border: 1px solid #c7b58e; border-radius: 50%; color: #eed5a3; background: #26383b; font-size: 16px; font-weight: 650; }
.ewb-instructions li h4 { margin: 0 0 6px; color: #f5e9ce; font-size: 17px; line-height: 1.5; }
.ewb-instructions li p { color: #dce2d8; font-size: 16px; line-height: 1.7; }
.ewb-guide-note { margin: 12px 0 0!important; font-size: 16px; line-height: 1.65; color: #cfd9cb; }
.ewb-guide-toggle, .ewb-document-toggle { min-width: 0; }
.ewb-guide-toggle > summary, .ewb-document-toggle > summary { cursor: pointer; min-height: 44px; padding: 10px 12px; border: 1px solid #9d916d89; border-radius: 6px; color: #efe5d1; background: #25373b; font-size: 16px; line-height: 1.5; }
.ewb-guide-toggle[open] > summary, .ewb-document-toggle[open] > summary { margin-bottom: 14px; }
.ewb-evidence { padding: 18px; gap: 16px; background: #152226; border-color: #b09d765c; }
.ewb-evidence-list { gap: 10px; }
.ewb-evidence-tab { padding: 12px 14px; line-height: 1.5; }
.ewb-document-chooser > summary { min-height: 48px; padding: 12px 14px; border: 1px solid var(--ewb-line); border-radius: 7px; background: #25373b; color: #f5ebd9; font: 16px/1.5 system-ui, sans-serif; cursor: pointer; }
.ewb-document-chooser[open] > summary { margin-bottom: 10px; }
.ewb-document-nav { display: flex; flex-wrap: wrap; gap: 10px; }
.ewb-document-nav button { flex: 1 1 100px; min-height: 44px; font-size: 16px; }
.ewb-document { padding: 22px; }
.ewb-document p { font-size: 17px; line-height: 1.8; }
.ewb-place-reference figcaption, .ewb-place-reference button { font-size: 16px; }
.ewb-surface { padding: 20px; }
.ewb-workspace { gap: 22px; }
.ewb-tools { gap: 15px; }
.ewb-bank { gap: 12px; }
.ewb-bank button { padding: 12px; gap: 10px; }
.ewb-bank .ewb-object-name { font-size: 16px; line-height: 1.5; }
.ewb[data-family] .ewb-bank button[aria-pressed="true"] { outline: 3px solid #f1d497; outline-offset: -2px; background-color: #535c48; }
.ewb[data-family] .ewb-bank button:focus-visible { outline: 3px solid #fff2c9; outline-offset: 3px; }
.ewb-object-detail { padding: 18px; background: #16292d; }
.ewb-object-detail h4 { font-size: 18px; }
.ewb-object-detail p { font-size: 17px; }
.ewb-control-row { gap: 10px; }
.ewb-control-row > label { max-width: 100%; }
.ewb-control-row > button { min-height: 44px; }
.ewb :is(.ewb-selection, .ewb-selection-caption) { min-height: 26px; font-size: 16px; line-height: 1.6; color: #f0d9aa; }
.ewb :is(.ewb-selection, .ewb-selection-caption):empty { display: none; }
.ewb-slider { gap: 10px; grid-template-columns: minmax(120px, 1fr) 44px minmax(90px, 1.5fr) 44px 56px; }
.ewb-slider input { min-height: 44px; }
.ewb-ledger-scroll { width: 100%; min-width: 0; overflow-x: auto; overscroll-behavior-x: contain; padding-bottom: 12px; scrollbar-color: #86714b #d6c6a2; }
.ewb-relation-grid { width: max(100%, calc(140px + var(--ewb-cols, 3) * 132px)); }
.ewb-relation-grid > span, .ewb-relation-grid button { font-size: 16px; line-height: 1.5; }
.ewb-relation-grid > .ewb-relation-heading { padding: 14px 10px; }
.ewb-relation-cell > button { min-height: 54px; padding: 11px 8px; }
.ewb-relation-cell .ewb-cell-clear { min-height: 44px; font-size: 15px; }
.ewb[data-family="strata"] .ewb-sample { padding: 14px 12px; }
.ewb[data-family="strata"] .ewb-layer { min-height: 36px; }
.ewb-layer-label { display: inline-block; padding: 3px 6px; border-radius: 3px; background: #1d2b2d; color: #fff7e6; text-shadow: none; font-size: 15px; line-height: 1.5; }
.ewb-height-grid { width: 100%; max-width: 620px; }
.ewb-height-cell { gap: 10px; }
.ewb-height-cell .ewb-control-row { gap: 6px; }
.ewb-height-cell button { min-width: 44px; min-height: 44px; }
.ewb-height-cell span { font-size: 15px; line-height: 1.5; }
.ewb :is(.ewb-trial, .ewb-readonly) { padding: 17px 20px; }
.ewb-trial h4 { font-size: 17px; }
.ewb-trial p { font-size: 16px; }
.ewb-footer { position: sticky; bottom: -1px; z-index: 4; display: grid; gap: 12px; padding: 14px 18px; border: 1px solid #a6926c; border-radius: 9px; background: #1b2b2e; box-shadow: 0 -8px 24px #0b171e55; }
.ewb-footer .ewb-actions { padding: 0; border: 0; }
.ewb-footer :is(.ewb-selection, .ewb-selection-caption) { margin: 0; }
.ewb-actions { gap: 12px; }
.ewb-actions .ewb-submit { min-height: 48px; }
.ewb-reset-confirm p { flex: 1 1 100%; font-size: 16px; }

/* Definitions use the shared investigation component. A glossary term remains
   an inline word, never a full-size command inside a sentence. */
.escape-workbench-dialog .glossary-word { white-space: nowrap; }
.escape-workbench-dialog button.glossary-term {
  display: inline;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 0;
  padding: 0 1px;
  margin: 0;
  border: 0;
  border-radius: 2px;
  box-shadow: none;
  background: transparent;
  color: inherit;
  font: inherit;
  line-height: inherit;
  text-align: inherit;
  white-space: inherit;
  overflow-wrap: normal;
  text-decoration: underline dotted #ddc08b;
  text-decoration-thickness: 1.5px;
  text-underline-offset: .22em;
  cursor: help;
  vertical-align: baseline;
}
.escape-workbench-dialog button.glossary-term:hover,
.escape-workbench-dialog button.glossary-term[aria-expanded="true"] { background: #f0d29d24; color: inherit; border: 0; box-shadow: none; }
.escape-workbench-dialog button.glossary-term:active { transform: none; }
.escape-workbench-dialog .ewb-document button.glossary-term,
.escape-workbench-dialog .ewb[data-family="relations"] .ewb-surface button.glossary-term,
.escape-workbench-dialog .ewb[data-family="strata"] .ewb-sample button.glossary-term { text-decoration-color: #65512e; }
.escape-workbench-dialog .ewb-document button.glossary-term:hover { background: #71572c1c; }
.escape-workbench-dialog :is(.glossary-tip, .glossary-tooltip) {
  position: fixed;
  z-index: 100;
  max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 32px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px 20px;
  border: 1px solid #c7ab75;
  border-radius: 9px;
  background: #fff7e4;
  color: #28332e;
  box-shadow: 0 10px 36px #0008;
  font: 17px/1.7 var(--ui-font, system-ui, sans-serif);
  pointer-events: auto;
  text-align: left;
}
.escape-workbench-dialog .glossary-definition { display: block; white-space: normal; }
.escape-workbench-dialog .glossary-visual { display: block; height: 150px; background-repeat: no-repeat; margin-bottom: 12px; }
.escape-workbench-dialog .ewb-definition-title { display: block; margin-bottom: 7px; color: #343c2d; font-size: 19px; line-height: 1.4; }

/* Keep the material to move next to its destination. The drawing and its
   palette have independent heights, but share the dialog's single scroll. */
.ewb-worktable { display: grid; grid-template-columns: minmax(0, 1fr) 280px; align-items: start; gap: 18px; min-width: 0; }
.ewb-worktable > :is(.ewb-tools, .ewb-relation-palettes) { min-width: 0; }
.ewb-worktable > .ewb-tools > .ewb-surface-head,
.ewb-relation-palettes > .ewb-tools > .ewb-surface-head { margin-bottom: 0; }
.ewb-worktable .ewb-bank { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; }
.ewb-worktable .ewb-bank > button { min-width: 44px; padding: 9px 7px; }
.ewb-worktable .ewb-bank .ewb-object-name { font-size: 16px; line-height: 1.45; }
.ewb-worktable .ewb-bank .ewb-object-art { height: 84px; }
.ewb-worktable > .ewb-tools > .ewb-object-detail,
.ewb-relation-palettes .ewb-object-detail { flex-direction: column; gap: 12px; padding: 15px; }
.ewb-worktable > .ewb-tools > .ewb-object-detail > .ewb-object-art,
.ewb-relation-palettes .ewb-object-detail > .ewb-object-art { flex-basis: auto; width: 100%; height: 100px; }
.ewb-worktable .ewb-object-detail > div { min-width: 0; }
.ewb-order-card { display: flex; flex-direction: column; gap: 9px; align-items: stretch; text-align: left; }
.ewb-order-card .ewb-object-art { height: 100px; background: #f6e8c799; }
.ewb-order-card > span:last-child { display: block; padding: 4px 2px; line-height: 1.5; }

/* Focus and drag feedback show the current gesture, never whether a piece
   belongs here. Preserve the actual colours and lines inside every SVG. */
.ewb .ewb-direct-control { cursor: pointer; outline: none; }
.ewb .ewb-direct-control:focus-visible,
.ewb .ewb-direct-control[aria-pressed="true"],
.ewb .ewb-direct-control[aria-selected="true"] { outline: 3px solid #f8d28b; outline-offset: 4px; filter: drop-shadow(0 0 3px #171f23); }
.ewb .ewb-direct-control[aria-disabled="true"] { cursor: default; }
.ewb [data-ewb-drag] { touch-action: none; cursor: grab; user-select: none; -webkit-user-select: none; -webkit-user-drag: none; }
.ewb [data-ewb-drag] :is(img, svg) { -webkit-user-drag: none; user-select: none; }
.ewb.ewb-dragging, .ewb.ewb-dragging [data-ewb-drag] { cursor: grabbing; }
.ewb .ewb-drag-source { opacity: .55; }
.ewb .ewb-drop-active { outline: 3px dashed #f8d28b; outline-offset: 3px; }
.ewb[data-family="relations"] .ewb-specimen-slot.ewb-drop-active,
.ewb[data-family="strata"] .ewb-touch-surface.ewb-drop-active { outline-color: #735322; }
.ewb-drag-ghost { position: fixed; z-index: 2147483647; pointer-events: none; max-width: min(300px, calc(100vw - 16px)); color: #fff3d8; background: #203337; border: 2px solid #f1cf87; border-radius: 8px; font: 600 16px/1.4 var(--ui-font, system-ui, sans-serif); overflow-wrap: anywhere; }

.ewb-alternative-controls { min-width: 0; border: 1px solid #a4936b80; border-radius: 8px; background: #17272a; padding: 5px 14px 6px; }
.ewb-alternative-controls > summary { min-height: 44px; padding: 11px 2px; color: #f0e2c7; cursor: pointer; font-size: 16px; line-height: 1.5; }
.ewb-alternative-controls[open] { padding-bottom: 16px; }
.ewb-alternative-controls[open] > summary { margin-bottom: 12px; border-bottom: 1px solid #8d88674d; }
.ewb-alternative-controls > .ewb-tools > .ewb-surface-head { margin-bottom: 0; }
.ewb-volume-tools { display: flex; flex-wrap: wrap; align-items: stretch; gap: 12px; margin: 0 0 16px; }
.ewb-volume-tools > button { display: flex; align-items: center; justify-content: center; gap: 12px; min-height: 64px; padding: 10px 16px; flex: 1 1 170px; }
.ewb-volume-tools .ewb-block-source svg { flex: 0 0 66px; display: block; width: 66px; height: 63px; }
.ewb-volume-tools .ewb-block-return { border-style: dashed; background: #1a2b30; }
.ewb button.ewb-touch-surface { display: block; min-width: 44px; min-height: 100px; width: 100%; padding: 4px; border: 2px solid #6c6d55; background: #3f4d3c; box-shadow: none; }
.ewb button.ewb-touch-surface:hover:not(:disabled) { border-color: #574b2e; background: #596047; }
.ewb[data-family="strata"] .ewb-touch-surface .ewb-stage { padding: 0; border: 0; }
.ewb-layer-detail { min-width: 0; border-top: 1px solid #9d987d; }
.ewb-layer-detail > summary { min-height: 44px; padding: 11px 0; color: #343d30; cursor: pointer; font-size: 16px; line-height: 1.5; }
.ewb-layer-detail[open] > summary { margin-bottom: 5px; }
.ewb-layer-detail .ewb-layer-stack { overflow: visible; }

/* Each support is a specimen with visible areas to fill, rather than a row
   in the previous fixed-width ledger. */
.ewb[data-family="relations"] .ewb-relation-grid.ewb-specimen-tray { width: 100%; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px; padding: 0; border: 0; background: transparent; align-items: start; }
.ewb-specimen { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; min-width: 0; padding: 12px; border: 1px solid #a49372; border-radius: 6px; background: #f4e9d1; box-shadow: 0 3px 6px #594c3029; }
.ewb-specimen > h4 { grid-column: 1 / -1; padding: 3px 2px 10px; margin: 0; color: #30382e; font-size: 18px; line-height: 1.4; border-bottom: 1px solid #b6a787; }
.ewb[data-family="relations"] .ewb-specimen > .ewb-relation-cell { min-width: 0; gap: 7px; padding: 0; background: transparent; }
.ewb-specimen-category { display: flex; align-items: center; min-height: 44px; color: #494c3d; font-size: 15px; line-height: 1.45; }
.ewb[data-family="relations"] .ewb-specimen .ewb-specimen-slot { display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px; min-width: 44px; min-height: 128px; padding: 8px 5px; border: 1px dashed #887b5b; border-radius: 5px; background: #e5d9bd; color: #303b32; font-size: 16px; line-height: 1.45; }
.ewb[data-family="relations"] .ewb-specimen .ewb-specimen-slot:has(.ewb-object-art) { border-style: solid; background: #fff4db; }
.ewb[data-family="relations"] .ewb-specimen .ewb-specimen-slot:hover:not(:disabled) { background: #f9edcf; border-color: #6e5931; }
.ewb-specimen-slot .ewb-object-art { width: 100%; height: 72px; padding: 0; background: #e2d5b654; }
.ewb-specimen-slot > span:last-child { min-width: 0; text-align: center; }
.ewb[data-family="relations"] .ewb-specimen .ewb-cell-clear { min-width: 44px; min-height: 44px; padding: 8px 3px; color: #424a39; font-size: 15px; }
.ewb-relation-palettes { display: grid; gap: 14px; }
.ewb-palette-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.ewb-palette-tabs > button { flex: 1 1 80px; min-width: 44px; min-height: 48px; padding: 9px 7px; font-size: 16px; line-height: 1.45; }

.ewb button.ewb-press-handle { display: flex; flex-direction: column; align-items: stretch; width: 100%; min-height: 44px; gap: 8px; margin: 0 0 12px; padding: 7px 10px 11px; background: #2d2923; border-color: #c9ac75; }
.ewb button.ewb-press-handle:hover:not(:disabled) { background: #4a4032; }
.ewb-press-handle .ewb-stage { overflow: visible; }
.ewb-press-handle .ewb-stage svg { max-height: 106px; }
.ewb-press-handle > span { display: block; padding-top: 3px; color: #f6e3bb; font-size: 16px; line-height: 1.45; }
.ewb-proof-grid[data-ewb-drop] { touch-action: none; }
.ewb .ewb-proof-cell[data-preview="true"]::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(135deg, var(--ewb-preview-ink, #263737) 0 2px, transparent 2px 6px); opacity: .65; }

@media (min-width: 900px) and (min-height: 950px) {
  .ewb:is([data-family="optics"], [data-family="network"]) .ewb-worktable > .ewb-surface { position: sticky; top: 12px; }
}
@media (min-width: 900px) {
  .ewb-guide:has(> .ewb-instructions:not([open])) .ewb-goal { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 24px; align-items: start; }
  .ewb-guide:has(> .ewb-instructions:not([open])) .ewb-goal > :is(h3, p) { grid-column: 1; }
  .ewb-guide:has(> .ewb-instructions:not([open])) .ewb-goal .ewb-start { grid-column: 2; grid-row: 1 / span 2; align-self: center; margin-top: 0; max-width: 240px; }
}
@media (max-width: 1319px) {
  .ewb-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ewb-mobile-tabs { display: flex; gap: 10px; }
  .ewb-mobile-tabs button { flex: 1; min-height: 48px; }
  .ewb[data-panel="workspace"] .ewb-evidence { display: none; }
  .ewb[data-panel="evidence"] .ewb-workspace { display: none; }
  .ewb-evidence { padding: 20px; }
  .ewb-document { max-width: 78ch; width: 100%; margin-inline: auto; }
  .ewb-evidence-list { grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); }
  .ewb-place-reference { max-width: 500px; width: 100%; margin-inline: auto; }
}
@media (max-width: 899px) {
  .ewb-worktable { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .ewb-worktable > .ewb-surface { position: static; }
  .ewb-worktable > .ewb-tools,
  .ewb-worktable > .ewb-relation-palettes { gap: 12px; }
  .ewb-worktable .ewb-bank {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: 132px;
    align-items: stretch;
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 12px;
    padding: 12px;
    scrollbar-color: #c0a773 #1b2a2b;
    touch-action: pan-x pan-y;
  }
  .ewb-worktable .ewb-bank > button { scroll-snap-align: start; padding: 8px; }
  .ewb-worktable .ewb-bank .ewb-object-art { height: 76px; }
  .ewb-worktable .ewb-bank .ewb-object-name { font-size: 16px; line-height: 1.4; }
  .ewb-worktable > .ewb-tools > .ewb-object-detail,
  .ewb-relation-palettes .ewb-object-detail { flex-direction: row; align-items: start; }
  .ewb-worktable > .ewb-tools > .ewb-object-detail > .ewb-object-art,
  .ewb-relation-palettes .ewb-object-detail > .ewb-object-art { flex: 0 0 86px; width: 86px; height: 86px; }
  .ewb[data-family="relations"] .ewb-relation-grid.ewb-specimen-tray {
    grid-template-columns: none;
    grid-auto-flow: column;
    grid-auto-columns: min(310px, 94%);
    gap: 14px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    padding: 3px 3px 14px;
    scrollbar-color: #8b7144 #e3d4b4;
  }
  .ewb-specimen { scroll-snap-align: start; padding: 10px; }
  .ewb-palette-tabs { gap: 8px; }
  .ewb-palette-tabs > button { flex-basis: 90px; }
  .ewb.ewb-dragging :is(.ewb-bank, .ewb-specimen-tray, .ewb-sample-grid, .ewb-order) { scroll-snap-type: none; }
}
@media (max-width: 760px) {
  dialog.escape-workbench-dialog, body.material-ui dialog.escape-workbench-dialog { width: calc(100vw - 12px); max-height: calc(100dvh - 12px); border-radius: 9px; }
  body.material-ui .escape-workbench-dialog .modal-head { padding: 12px 16px; gap: 12px; }
  body.material-ui .escape-workbench-dialog .modal-head h2 { font-size: 23px; }
  body.material-ui .escape-workbench-dialog .modal-body { padding: 16px 14px 20px; scroll-padding-block: 14px; scrollbar-gutter: auto; }
  .ewb { font-size: 17px; gap: 18px; }
  .ewb-goal { padding: 17px 18px; }
  .ewb-goal p { font-size: 17px; }
  .ewb-instructions { padding: 16px 18px; }
  .ewb-instructions ol { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .ewb-instructions li { padding-left: 39px; }
  .ewb-surface { padding: 15px; }
  .ewb-evidence { padding: 15px; }
  .ewb-bank { grid-template-columns: repeat(auto-fill, minmax(min(132px, 100%), 1fr)); gap: 10px; }
  .ewb-bank button { padding: 10px; }
  .ewb-two-views { gap: 14px; }
  .ewb-document { padding: 20px; }
  .ewb-slider { grid-template-columns: 44px minmax(70px, 1fr) 44px 50px; gap: 8px; }
  .ewb-slider > label { grid-column: 1 / -1; }
  .ewb-footer { position: static; padding: 14px; }
  .ewb-actions .ewb-submit { flex: 1 1 100%; }
  .ewb-actions .ewb-undo { margin-left: 0; flex: 1 1 160px; }
  .ewb-actions > button:last-of-type { flex: 1 1 160px; }
  .ewb-height-cell { padding: 10px 5px; }
  .ewb-order { padding: 12px; }
  .ewb-worktable .ewb-order { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(210px, 88%); gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; scrollbar-color: #c0a773 #302d22; }
  .ewb-order-slot { scroll-snap-align: start; }
  .ewb-worktable .ewb-sample-grid { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: min(270px, 88%); gap: 12px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 3px 3px 14px; scrollbar-color: #c0b487 #334437; }
  .ewb-sample { scroll-snap-align: start; }
}
@media (max-width: 520px) {
  .ewb-two-views { grid-template-columns: minmax(0, 1fr); }
  .ewb-sample-grid { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .ewb-optic-controls { grid-template-columns: minmax(0, 1fr); }
  .ewb-object-detail { flex-direction: column; gap: 12px; }
  .ewb-object-detail .ewb-object-art { width: 120px; flex-basis: auto; }
  .ewb-evidence-list { grid-template-columns: minmax(0, 1fr); }
  .ewb-height-cell .ewb-control-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 7px; }
  .ewb-height-cell button { width: 100%; }
  .ewb[data-family="print"] .ewb-bank, .ewb[data-family="strata"] .ewb-bank, .ewb[data-family="optics"] .ewb-bank, .ewb[data-family="network"] .ewb-bank { padding: 10px; }
  .ewb[data-family="volume"] .ewb-two-views { padding: 10px; }
  .ewb[data-family="relations"] .ewb-surface { border-width: 4px; }
  .ewb-document { padding: 18px; }
}
@media (max-height: 560px) and (orientation: landscape) {
  dialog.escape-workbench-dialog, body.material-ui dialog.escape-workbench-dialog { max-height: calc(100dvh - 8px); }
  body.material-ui .escape-workbench-dialog .modal-head { padding-block: 7px; }
  .ewb-stage svg { max-height: 280px; }
  .ewb-footer { position: static; }
}
@media (prefers-reduced-motion: reduce) {
  .ewb *, .ewb *::before, .ewb *::after { animation: none!important; transition: none!important; scroll-behavior: auto!important; }
}
