/* Artificial Selection Lab. Everything is scoped under .as so site.css can't collide. */
.as {
  --as-ink: #14263a; --as-muted: #4b6075; --as-paper: #eef5f0; --as-card: #ffffff; --as-line: #cddcd2;
  --as-accent: #1d6b45; --as-accent-ink: #ffffff; --as-sun: #d99a1e; --as-soft: #f2f7f3; --as-ok: #1f7a3d; --as-no: #b3261e;
  --as-shadow: 0 1px 2px rgba(16, 40, 30, .06), 0 8px 24px rgba(16, 40, 30, .07);
  color: var(--as-ink); font: 16px/1.5 "Atkinson Hyperlegible", system-ui, sans-serif;
  background: radial-gradient(ellipse 90% 60% at 50% -10%, #d9eedf, var(--as-paper) 70%);
  padding: 0 clamp(12px, 2vw, 28px) 56px; min-height: 70vh;
}
html[data-theme="dark"] .as {
  --as-ink: #e6efe9; --as-muted: #aac2b4; --as-paper: #0f1b16; --as-card: #172a21; --as-line: #33503f;
  --as-accent: #5fcf8f; --as-accent-ink: #06210f; --as-sun: #f0b64a; --as-soft: #1d3329; --as-ok: #7fdc9a; --as-no: #ff9b93;
  --as-shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .25);
  background: radial-gradient(ellipse 90% 60% at 50% -10%, #173a28, var(--as-paper) 70%);
}
.as *, .as *::before, .as *::after { box-sizing: border-box; }
.as [hidden] { display: none !important; }
.as h1, .as h2, .as h3, .as h4 { color: var(--as-ink); font-family: inherit; }
.as small { font-size: 16px; }
.as-eyebrow { margin: 0; font-size: 16px; font-weight: 800; letter-spacing: .08em; color: var(--as-accent); }
.as-muted { color: var(--as-muted); }

/* title bar */
.as-bar { max-width: 1500px; margin: 0 auto; display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; padding: 8px 0 6px; }
.as-titles { flex: 1 1 260px; }
.as-bar h1 { margin: 0; font-size: 26px; line-height: 1.1; }
.as-level { padding: 4px 12px; border-radius: 999px; background: var(--as-soft); border: 1px solid var(--as-line); font-weight: 700; }
.as-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.as-signin { max-width: 1500px; margin: 0 auto; }
.as-signin:empty { display: none; }

/* buttons */
.as .as-btn { appearance: none; font: 700 16px/1.2 "Atkinson Hyperlegible", system-ui, sans-serif; min-height: 44px; padding: 9px 14px; border-radius: 10px; border: 1px solid var(--as-line); background: var(--as-card); color: var(--as-ink); cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; gap: 6px; }
.as .as-btn:hover { border-color: var(--as-accent); }
.as .as-btn:disabled { opacity: .5; cursor: not-allowed; }
.as .as-btn--pri { background: var(--as-accent); border-color: var(--as-accent); color: var(--as-accent-ink); }
.as .as-btn--ghost { background: transparent; }
.as .as-btn--small { min-height: 44px; padding: 6px 12px; margin-top: 6px; }
.as button:focus-visible, .as a:focus-visible, .as input:focus-visible, .as select:focus-visible, .as textarea:focus-visible, .as canvas:focus-visible, .as summary:focus-visible { outline: 3px solid #eaa33d; outline-offset: 2px; }
.as-more { position: relative; }
.as-more summary { list-style: none; }
.as-more summary::-webkit-details-marker { display: none; }
.as-more-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; display: flex; flex-direction: column; gap: 6px; padding: 10px; border-radius: 12px; background: var(--as-card); border: 1px solid var(--as-line); box-shadow: var(--as-shadow); min-width: 240px; }

/* start screen */
.as-gate { max-width: 1500px; margin: 8px auto 0; padding: clamp(16px, 4vw, 44px); border-radius: 22px; background: linear-gradient(140deg, #0c2418, #1f5a36 50%, #c9a23f); }
.as-gate-card { max-width: 880px; margin: 0 auto; padding: clamp(20px, 4vw, 40px); border-radius: 18px; background: var(--as-card); box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.as-gate-card h2 { font-size: clamp(28px, 3.6vw, 40px); margin: 6px 0; }
.as-gate-lede { font-size: 18px; color: var(--as-muted); }
.as-how { margin: 10px 0; padding-left: 26px; font-size: 18px; }
.as-gate-note { margin: 10px 0; padding: 10px 12px; border-radius: 12px; background: var(--as-soft); border-left: 4px solid var(--as-sun); }
.as-gate-pick { margin: 16px 0 0; font-weight: 800; font-size: 18px; }
.as-gate-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 10px; }
.as-gate-grid button { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 6px; padding: 16px 18px; border: 2px solid var(--as-line); border-radius: 14px; cursor: pointer; background: var(--as-soft); color: var(--as-ink); }
.as-gate-grid button:hover, .as-gate-grid button:focus-visible { border-color: var(--as-accent); box-shadow: 0 0 0 3px rgba(29, 107, 69, .25); }
.as-gate-grid button:disabled { opacity: .45; cursor: not-allowed; }
.as-gate-grid button.is-first { border-color: var(--as-accent); background: var(--as-card); }
.as-gate-grid b { font-size: 21px; }
.as-gate-grid span { color: var(--as-muted); }
.as-gate-grid em { order: -1; font-style: normal; font-weight: 700; color: var(--as-accent); }

/* modes + tabs */
#workspace { max-width: 1500px; margin: 0 auto; }
.as-modes { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 0 6px; }
.as-modes-label { font-weight: 800; margin-right: 4px; }
.as-modes button, .as-tabs button { appearance: none; font: 700 16px/1.2 "Atkinson Hyperlegible", system-ui, sans-serif; min-height: 44px; padding: 8px 13px; border-radius: 10px; border: 2px solid var(--as-line); background: var(--as-card); color: var(--as-ink); cursor: pointer; }
.as-modes button.is-on { border-color: var(--as-accent); background: var(--as-accent); color: var(--as-accent-ink); }
.as-modes-note { color: var(--as-muted); }
.as-tabs { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 0 8px; }
.as-tabs button { border-radius: 999px; border-width: 1px; white-space: nowrap; }
.as-tabs button.is-on { background: var(--as-ink); color: var(--as-card); border-color: var(--as-ink); }

/* bench */
#benchTest { display: flex; flex-direction: column; gap: 14px; }
.as-stage { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 14px; align-items: start; }
.as-stage.as-stage--solo { grid-template-columns: minmax(0, 1fr); }
.as-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.as-scene { background: #0d1a14; border-radius: 16px; overflow: hidden; box-shadow: var(--as-shadow); color: #e8f2ec; }
.as-scene canvas { display: block; width: 100%; }
#flat { touch-action: manipulation; cursor: pointer; }
.as-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 20px; padding: 10px 14px; background: #12261c; border-bottom: 1px solid rgba(255, 255, 255, .08); }
.as-controls:not(:has(> :not([hidden]))) { display: none; }
.as-ctl { display: flex; flex-direction: column; gap: 2px; font-weight: 700; min-width: 170px; flex: 1 1 170px; max-width: 300px; color: #e8f2ec; }
.as-ctl input[type=range] { width: 100%; min-height: 44px; margin: 0; accent-color: #f3b54a; }
.as-ctl output { font-weight: 800; color: #ffd27a; font-variant-numeric: tabular-nums; margin-left: 4px; }
.as-ctl--seg, .as-ctl--treat { max-width: none; flex: 1 1 100%; }
.as-ctl-label { font-weight: 800; color: #ffd27a; }
.as-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.as-seg label { position: relative; cursor: pointer; }
.as-seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.as-seg span { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .28); background: #173326; color: #eef7f1; font-weight: 700; }
.as-seg input:checked + span { background: #f3b54a; border-color: #f3b54a; color: #1a1408; }
.as-seg input:checked + span::before { content: "●\00a0"; }
.as-seg input:focus-visible + span { outline: 3px solid #eaa33d; outline-offset: 2px; }
.as-seg input:disabled + span { opacity: .6; cursor: not-allowed; }
.as-fixed { margin: 0; flex: 1 1 100%; font-weight: 700; color: #e8f2ec; }
.as-transport { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 14px; background: #12261c; border-top: 1px solid rgba(255, 255, 255, .08); }
.as-scene .as-btn { background: #1b3a2b; border-color: rgba(255, 255, 255, .22); color: #eef7f1; }
.as-scene .as-btn:hover { border-color: #f3b54a; }
.as .as-btn--go { background: #3fbf72; border-color: #3fbf72; color: #06210f; font-size: 18px; padding: 10px 18px; }
.as .as-btn--go.as-btn--rec { background: #f3b54a; border-color: #f3b54a; color: #1a1408; }
.as-gens { list-style: none; display: flex; gap: 4px; margin: 0 0 0 auto; padding: 0; }
.as-gens li { padding: 4px 10px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .22); color: #b9cdc1; font-weight: 700; }
.as-gens li.is-done { background: #2c5a40; color: #fff; border-color: #6fd6b0; }
.as-gens li.is-done::before { content: "✓ "; }
.as-gens li.is-off { opacity: .4; }
.as-transport--test #runAll, .as-transport--test #newRun { display: none; }
.as-caption { margin: 0; padding: 8px 14px 10px; color: #e8f2ec; min-height: 3.4em; }
.as-duo { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); gap: 10px; padding: 0 10px 10px; }
.as-fig { margin: 0; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.as-fig .as-canvas-wrap { border-radius: 12px; overflow: hidden; }
.as-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; color: #e8f2ec; padding: 0 4px; }
.as-legend span { display: inline-flex; align-items: center; gap: 6px; }
.as-sw { display: inline-block; width: 22px; height: 14px; border-radius: 3px; border: 1px solid rgba(255, 255, 255, .5); }
.as-sw--par { background: repeating-linear-gradient(45deg, #ffc247 0 4px, #c88a10 4px 6px); }
.as-eq { margin: 0; padding: 8px 10px; border-radius: 10px; background: #173326; color: #ffe2a0; font-weight: 800; font-size: 17px; }

/* readouts */
.as-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.as-metric { background: var(--as-card); border: 1px solid var(--as-line); border-left: 4px solid #2f8fd8; border-radius: 12px; padding: 7px 10px; box-shadow: var(--as-shadow); line-height: 1.3; min-width: 0; }
.as-metric--g { border-left-color: var(--as-sun); }
.as-metric--t { border-left-color: var(--as-accent); }
.as-metric span, .as-metric small { display: block; font-size: 16px; color: var(--as-muted); }
.as-metric span { font-weight: 700; color: var(--as-ink); }
.as-metric b { display: block; font-size: 20px; line-height: 1.25; color: var(--as-ink); }

/* coach */
.as-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.as-coach { background: var(--as-card); border: 1px solid var(--as-line); border-radius: 14px; padding: 12px 14px; box-shadow: var(--as-shadow); }
.as-next { display: flex; flex-direction: column; gap: 6px; margin-top: 6px; padding: 8px 10px; border-radius: 10px; background: var(--as-soft); border-left: 4px solid var(--as-sun); font-size: 17px; }
.as-next .as-btn { align-self: flex-start; }
.as-recline { margin: 8px 0 0; }
.as-stepchecks { list-style: none; margin: 8px 0; padding: 0; }
.as-stepchecks li { padding: 2px 0; color: var(--as-muted); }
.as-stepchecks li.done { color: var(--as-ok); font-weight: 700; }
.as-ch summary, .as-pick summary { cursor: pointer; font-weight: 800; min-height: 44px; display: flex; align-items: center; }
.as-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.as-cards li { border: 1px dashed var(--as-line); border-radius: 10px; padding: 8px 10px; }
.as-cards li span { display: block; color: var(--as-muted); }
.as-cards li.done { border-style: solid; border-color: var(--as-ok); background: rgba(31, 122, 61, .08); }
.as-compare { margin-top: 10px; padding: 8px 10px; border: 1px dashed var(--as-line); border-radius: 10px; }
.as-compare--done { border-style: solid; border-color: var(--as-ok); }
.as-compare p { margin: 4px 0 6px; }
.as-compare-out { margin: 6px 0 0; font-weight: 700; }
.as-compare-out.no { color: var(--as-no); } .as-compare-out.ok { color: var(--as-ok); }
.as-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; align-items: center; }
.as-row--calc label { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.as-compare input[type=text] { font: 700 16px "Atkinson Hyperlegible", system-ui, sans-serif; min-height: 44px; width: 96px; padding: 6px 8px; border-radius: 8px; border: 2px solid var(--as-accent); background: var(--as-card); color: var(--as-ink); }
.as-rowpick { display: flex; gap: 8px; align-items: center; min-height: 44px; padding: 2px 0; cursor: pointer; }
.as-rowpick input { width: 22px; height: 22px; margin: 0; flex: none; accent-color: var(--as-accent); }
.as-later { margin: 8px 0 0; }
.as-fit { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: var(--as-soft); border-left: 4px solid var(--as-ok); font-weight: 700; }
.as-msg { margin: 8px 0; padding: 8px 10px; border-radius: 10px; background: var(--as-soft); border-left: 4px solid var(--as-accent); font-weight: 700; }
.as-flash { animation: asFlash 2.4s ease-out; }
@keyframes asFlash { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 184, 0, 0); } 15%, 55% { box-shadow: 0 0 0 5px #ffb800; } }

/* panels: pre-lab, data, CER */
.as-panel { background: var(--as-card); border: 1px solid var(--as-line); border-radius: 16px; padding: 16px 18px; box-shadow: var(--as-shadow); }
.as-panel h2 { margin: 4px 0 8px; font-size: 22px; line-height: 1.2; }
.as-panel h3 { margin: 16px 0 6px; font-size: 18px; }
.as-qbox { padding: 12px 14px; border-radius: 12px; background: var(--as-soft); border-left: 5px solid var(--as-accent); margin: 10px 0; }
.as-qbox small { display: block; color: var(--as-muted); font-weight: 700; }
.as-qbox b { font-size: 19px; }
.as-prelab-grid { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 24px; }
.as-vocab { display: flex; flex-wrap: wrap; gap: 8px; }
.as .as-term { position: relative; appearance: none; font: inherit; color: var(--as-accent); font-weight: 800; background: none; border: 0; border-bottom: 2px dotted currentColor; padding: 0 1px; cursor: help; }
.as-vocab .as-term { border: 1px solid var(--as-line); border-radius: 999px; padding: 6px 12px; background: var(--as-soft); min-height: 44px; }
.as-tip { display: none; position: absolute; left: 0; top: calc(100% + 6px); z-index: 20; width: min(320px, 80vw); padding: 10px 12px; border-radius: 10px; background: #10253b; color: #fff; font-weight: 500; text-align: left; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
.as-term:hover .as-tip, .as-term:focus .as-tip { display: block; }
.as-safety { padding-left: 0; list-style: none; }
.as-safety li { padding: 6px 10px; margin: 6px 0; border-radius: 8px; background: #fff4d6; color: #5a3b00; }
html[data-theme="dark"] .as-safety li { background: #3d2c0b; color: #ffe2a8; }
.as-practice { display: flex; gap: 10px; align-items: flex-start; margin: 12px 0; padding: 10px 12px; border-radius: 12px; background: var(--as-soft); border-left: 4px solid var(--as-accent); }
.as-practice span[aria-hidden] { font-size: 26px; line-height: 1; }
.as-practice b { display: block; }
.as-practice a { color: var(--as-accent); font-weight: 800; }
.as-frame { display: grid; gap: 8px; font-size: 17px; min-width: 0; }
.as-frame-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; min-width: 0; }
.as-frame-row > * { min-width: 0; max-width: 100%; }
.as-frame select { font: 700 16px "Atkinson Hyperlegible", system-ui, sans-serif; min-height: 44px; border-radius: 8px; border: 2px solid var(--as-accent); background: var(--as-card); color: var(--as-ink); padding: 4px 8px; }
.as-because { display: flex; flex-direction: column; font-weight: 700; margin-top: 10px; }
.as-because textarea, .as-cer-grid textarea { font: 16px/1.45 "Atkinson Hyperlegible", system-ui, sans-serif; min-height: 80px; padding: 10px; margin-top: 4px; border: 1px solid var(--as-line); border-radius: 10px; background: var(--as-card); color: var(--as-ink); resize: vertical; }
.as-varpool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 60px; padding: 8px; border: 1px dashed var(--as-line); border-radius: 12px; }
.as-varbins { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 10px; }
.as-varbin { min-height: 120px; padding: 8px; border: 2px solid var(--as-line); border-radius: 12px; background: var(--as-soft); display: flex; flex-wrap: wrap; align-content: flex-start; gap: 6px; cursor: pointer; }
.as-varbin h4 { flex: 1 1 100%; margin: 0 0 4px; }
.as .as-varchip { appearance: none; font: 700 16px "Atkinson Hyperlegible", system-ui, sans-serif; min-height: 44px; padding: 6px 12px; border-radius: 999px; border: 2px solid var(--as-line); background: var(--as-card); color: var(--as-ink); cursor: pointer; text-align: left; max-width: 100%; }
.as .as-varchip.picked { border-color: var(--as-sun); box-shadow: 0 0 0 3px rgba(217, 154, 30, .35); }
.as .as-varchip.right { border-color: var(--as-ok); } .as .as-varchip.wrong { border-color: var(--as-no); }
.as-data-head, .as-cer-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 8px 16px; }
.as-table { overflow-x: auto; border: 1px solid var(--as-line); border-radius: 10px; margin-bottom: 8px; }
.as table { width: 100%; border-collapse: collapse; font-size: 16px; }
.as th, .as td { padding: 7px 10px; border-bottom: 1px solid var(--as-line); text-align: right; color: var(--as-ink); }
.as th { background: var(--as-soft); font-weight: 800; white-space: normal; min-width: 90px; vertical-align: bottom; }
.as td { white-space: nowrap; }
.as th:first-child, .as td:first-child, .as th:nth-child(2), .as td:nth-child(2) { text-align: left; }
.as-empty { text-align: center !important; color: var(--as-muted) !important; }
.as-graph { margin: 14px 0 0; max-width: 820px; }
.as-graph canvas { display: block; width: 100%; border-radius: 10px; }
.as-keys { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 6px; }
.as-key { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.as-checklist { list-style: none; margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--as-soft); min-width: 0; flex: 0 1 420px; }
.as-checklist li { padding: 2px 0; color: var(--as-muted); }
.as-checklist li.done { color: var(--as-ok); font-weight: 700; }
.as-pick { margin: 10px 0; border: 1px solid var(--as-line); border-radius: 12px; padding: 4px 12px 8px; }
#rowPick { max-height: 300px; overflow: auto; }
.as-cer-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.as-cer-grid label { display: flex; flex-direction: column; font-weight: 800; min-width: 0; }
.as-cer-grid small { font-weight: 500; color: var(--as-muted); }
.as-cer-grid textarea { min-height: 130px; }
.as-turnin { margin-top: 12px; }
.as-done { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(31, 122, 61, .10); border: 2px solid var(--as-ok); }

/* test */
.as-test { max-width: 980px; }
.as-test-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 20px; }
.as-test-head h2 small { font-size: 18px; color: var(--as-muted); }
.as-progress { flex: 0 1 260px; height: 10px; background: var(--as-soft); border-radius: 999px; overflow: hidden; border: 1px solid var(--as-line); }
.as-progress i { display: block; height: 100%; background: var(--as-accent); }
.as-tag { display: inline-block; margin: 8px 0 0; padding: 3px 10px; border-radius: 999px; background: #fff1d6; color: #6b4300; font-weight: 700; }
html[data-theme="dark"] .as-tag { background: #4a3510; color: #ffe2a8; }
.as-q { font-size: 19px; font-weight: 700; margin: 12px 0; }
.as-q b { color: var(--as-accent); }
.as-run { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 12px 0; }
.as-readout { flex: 1 1 100%; margin: 0; padding: 10px 12px; border-left: 4px solid var(--as-sun); background: var(--as-soft); border-radius: 8px; }
.as-choices { border: 0; padding: 0; margin: 0; display: grid; gap: 8px; min-width: 0; }
.as-choice { position: relative; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 10px 12px; border: 2px solid var(--as-line); border-radius: 12px; cursor: pointer; background: var(--as-card); }
.as-choice input { position: absolute; opacity: 0; pointer-events: none; }
.as-choice:focus-within { outline: 3px solid #eaa33d; outline-offset: 2px; }
.as-choice.is-picked { border-color: var(--as-accent); background: var(--as-soft); }
.as-choice.ok { border-color: var(--as-ok); } .as-choice.no { border-color: var(--as-no); }
.as-choice em { margin-left: auto; font-style: normal; font-weight: 900; font-size: 20px; }
.as-choice.ok em { color: var(--as-ok); } .as-choice.no em { color: var(--as-no); }
.as-letter { flex: 0 0 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; background: var(--as-soft); border: 1px solid var(--as-line); }
.as-choices:disabled .as-choice { cursor: default; }
.as-numans { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: flex-end; }
.as-numans label { display: flex; flex-direction: column; gap: 4px; font-weight: 700; }
.as-numans input, .as-numans select { font: 700 17px "Atkinson Hyperlegible", system-ui, sans-serif; min-height: 48px; padding: 6px 10px; border-radius: 10px; border: 2px solid var(--as-accent); background: var(--as-card); color: var(--as-ink); }
.as-numans input { width: 140px; }
.as-testfig { margin: 10px 0; max-width: 640px; }
.as-testfig canvas { display: block; width: 100%; border-radius: 12px; }
.as-testfig figcaption { color: var(--as-muted); margin-top: 4px; }
.as-table--test { max-width: 640px; margin: 10px 0; }
.as-explain { padding: 10px 12px; border-radius: 10px; background: var(--as-soft); }
.as-explain.ok { border-left: 4px solid var(--as-ok); } .as-explain.no { border-left: 4px solid var(--as-no); }
.as-test-nav { display: flex; justify-content: space-between; gap: 8px; margin-top: 14px; }
.as-test-nav .as-btn--pri { margin-left: auto; }
.as-review { padding-left: 22px; }
.as-review li { margin: 8px 0; }
.as-review li.ok > b { color: var(--as-ok); } .as-review li.no > b { color: var(--as-no); }

/* dialogs */
.as-dialog { max-width: 720px; border: 0; border-radius: 16px; padding: 22px 26px; color: #14263a; background: #fff; box-shadow: 0 20px 70px rgba(0, 0, 0, .4); font: 16px/1.55 "Atkinson Hyperlegible", system-ui, sans-serif; }
html[data-theme="dark"] .as-dialog { background: #172a21; color: #e6efe9; }
html[data-theme="dark"] .as-dialog a { color: #8fe0b0; }
.as-dialog::backdrop { background: rgba(6, 21, 14, .7); }
.as-dialog h2 { margin-top: 0; min-height: 44px; overflow: hidden; display: flow-root; }
.as-x { float: right; font-size: 28px; line-height: 1; min-width: 44px; min-height: 44px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.as-links { display: grid; gap: 6px; }
.as-links a { display: block; min-height: 28px; font-weight: 700; }

/* responsive */
@media (max-width: 1180px) { .as-stage { grid-template-columns: minmax(0, 1fr); } .as-duo { grid-template-columns: minmax(0, 1fr); } .as-fig--lens .as-canvas-wrap { max-width: 520px; margin: 0 auto; width: 100%; } }
@media (max-width: 1100px) { .as-prelab-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .as-gate-grid, .as-cer-grid, .as-varbins { grid-template-columns: minmax(0, 1fr); }
  .as-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .as-bar h1 { font-size: 24px; }
  .as-ctl { max-width: none; flex-basis: 100%; }
  .as-gens { margin-left: 0; }
  .as-duo { padding: 0 6px 8px; }
  .as-frame-row select { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .as * { transition: none !important; animation: none !important; } }
@media print {
  .tlg-header, .tlg-footer, .as-bar .as-actions, .as-modes, .as-tabs, #stageWrap, .as-pick, .as-turnin, #testCard, .as-gate { display: none !important; }
  .as { background: #fff; color: #000; }
  #tab-data, #tab-cer { display: block !important; box-shadow: none; }
}
