.lab-page .gm-wrap { max-width:1120px; }
.lab-page .gm-board { box-sizing:border-box; }
.lab-page #gm-workspace button, .lab-page #gm-workspace select,
.lab-page #gm-workspace input:not([type="checkbox"]) { min-height:44px; }
.lab-page #gm-workspace [hidden] { display:none !important; }
.lab-page main :focus-visible { outline:3px solid #6b42d1; outline-offset:3px; }
.lab-page .lab-screen :focus-visible, .lab-page .sz-preview-area :focus-visible { outline-color:#c9ffeb; }
.lab-page .pro-split, .lab-page .pro-fields {
  display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; min-width:0;
}
.lab-page .pro-split { margin-block:12px; align-items:start; }
.lab-page .pro-fields { margin-block:8px; }
.lab-page .pro-fields :is(input[type="color"],input[type="range"]) { border:1px solid #a59ab9; border-radius:8px; }
.lab-page input[type="range"] { accent-color:#5d3faf; }
.lab-page .pro-field output, .lab-page .lab-field output { font-variant-numeric:tabular-nums; }
.lab-page .lab-check { cursor:pointer; }
.lab-page .lab-card h3 { margin:0 0 8px; }
.lab-page .lab-card :where(ol,ul) { padding-inline-start:1.35rem; }
.lab-page .lab-card :where(p,li,td,summary), .lab-page .pro-grid p { overflow-wrap:anywhere; }
.lab-page .lab-metrics { grid-template-columns:repeat(auto-fit,minmax(min(100%,104px),1fr)); }
.lab-page .gm-board .pro-tokens { display:flex; gap:6px; flex-wrap:wrap; padding:0; margin-block:10px; list-style:none; }
.lab-page .pro-tokens li { border-radius:8px; background:#eee6fa; color:#332152; font-size:.88rem; padding:5px 7px; }
.lab-page .gm-board .pro-tokens button { padding:6px 10px; border:1px solid #ac99ce; border-radius:7px; background:#fff; color:#352354; text-align:start; font:inherit; cursor:pointer; max-width:100%; }
.lab-page .pro-tokens button[aria-pressed="true"] { background:#523387; border-color:#523387; color:#fff; }
.lab-page .pro-table { max-width:100%; overflow:auto; border:1px solid #dbd3e9; border-radius:9px; }
.lab-page .pro-table table { border-collapse:collapse; width:100%; font-size:.89rem; }
.lab-page .pro-table :is(th,td) { border-bottom:1px solid #e5ddee; text-align:start; padding:9px 10px; vertical-align:top; }
.lab-page .pro-table th { background:#f2edf9; color:#352354; }
.lab-page .pro-table tbody tr:last-child td { border-bottom:0; }
.lab-page .pro-chart { display:block; width:100%; height:auto; min-height:65px; background:#eee7f8; border-radius:8px; color:#54368c; }
.lab-page .pro-chart line { stroke:#9b8aac; }
.lab-page .pro-chart rect { fill:#6744ab; }
.lab-page .pro-chart rect.is-fast { fill:#873e24; }
.lab-page .pro-chart polyline { fill:none; stroke:currentColor; stroke-width:2; vector-effect:non-scaling-stroke; }

.lab-page .sz-pro {
  display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1.12fr);
  grid-template-areas:"options preview" "layers preview" "report report"; gap:12px; align-items:start;
}
.lab-page .sz-pro-options { grid-area:options; }
.lab-page .sz-tools { grid-area:layers; }
.lab-page .sz-report-area { grid-area:report; }
.lab-page .sz-preview-area {
  grid-area:preview; min-width:0; align-self:start; position:sticky; top:86px;
  border:1px solid #534669; border-radius:16px; background:#201b34; color:#f6f1ff; padding:clamp(8px,1.5vw,18px); text-align:center;
}
.lab-page .sz-preview-area .lab-tip { color:#e1d7f4; max-width:46ch; margin:8px auto 0; }
.lab-page .sz-pro-previews { display:grid; justify-content:center; gap:7px; min-width:0; }
.lab-page .sz-pro-previews[data-multi="true"] { grid-template-columns:repeat(3,minmax(0,1fr)); }
.lab-page .sz-pro-preview { margin:0; min-width:0; }
.lab-page .sz-pro-preview figcaption { margin-top:6px; font-size:clamp(.70rem,1.1vw,.82rem); line-height:1.3; overflow-wrap:anywhere; }
.lab-page .sz-pro-stage {
  position:relative; isolation:isolate; overflow:hidden; width:min(100%,280px);
  min-width:0; box-sizing:border-box; aspect-ratio:9/16; background:#211e37; border:2px solid #8e7ba7;
  border-radius:9px; cursor:move; touch-action:none; margin-inline:auto;
}
.lab-page .sz-pro-previews:not([data-multi="true"]) { grid-template-columns:minmax(0,280px); }
.lab-page .sz-pro-stage > :is(canvas,svg) { position:absolute; inset:0; width:100%; height:100%; display:block; pointer-events:none; }
.lab-page .sz-pro-outline { position:absolute; border:2px dashed #b9ffe4; pointer-events:none; box-sizing:border-box; }
.lab-page .sz-pro-outline > [data-corner] {
  position:absolute; width:44px; height:44px; transform:translate(-50%,-50%);
  display:grid; place-items:center; pointer-events:auto; touch-action:none; cursor:nwse-resize;
}
.lab-page .sz-pro-outline > [data-corner]::after { content:""; width:10px; height:10px; border-radius:50%; background:#ccffe9; border:1px solid #193b32; }
.lab-page .sz-pro-outline > [data-corner^="n"] { top:0; }
.lab-page .sz-pro-outline > [data-corner^="s"] { top:100%; }
.lab-page .sz-pro-outline > [data-corner$="w"] { left:0; }
.lab-page .sz-pro-outline > [data-corner$="e"] { left:100%; }
.lab-page .sz-pro-outline > :is([data-corner="ne"],[data-corner="sw"]) { cursor:nesw-resize; }
.lab-page #sz-video { display:none; }
.lab-page #sz-report { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,220px),1fr)); gap:8px; }
.lab-page #sz-report > div { background:#f0eafa; border-radius:9px; padding:10px; }
.lab-page #sz-report h3 { margin-bottom:4px; }

.lab-page .kb-device-note { font-size:.92rem; margin-top:0; }
.lab-page .kb-board { width:100%; box-sizing:border-box; max-width:100%; grid-template-columns:minmax(0,15fr) minmax(0,3.1fr) minmax(0,4.1fr); }
.lab-page .kb-board[data-layout="65"] { grid-template-columns:minmax(0,15fr) minmax(0,3.1fr); }
.lab-page .kb-board[data-layout="60"] { grid-template-columns:minmax(0,1fr); }
.lab-page .kb-board .kb-group { min-width:0; }
.lab-page .kb-row { position:relative; }
.lab-page .kb-key { position:relative; overflow:visible; container-type:inline-size; box-sizing:border-box; }
.lab-page .kb-key > span { max-width:100%; overflow:hidden; text-overflow:clip; padding-inline:1px; font-size:clamp(.52rem,55cqi,.82rem); }
.lab-page .kb-key.kb-key-blank { visibility:hidden; }
.lab-page .kb-key.kb-iso-enter::after {
  content:""; position:absolute; top:calc(100% - 2px); right:-1px; width:67%; height:calc(100% + 6px);
  background:inherit; border:1px solid #76658c; border-top:0; border-radius:0 0 5px 5px; z-index:1;
}
.lab-page .kb-key.kb-heat-on.is-tested:not(.is-held) {
  background:color-mix(in srgb,#332b4d,#8150bd calc(var(--key-heat,0) * 100%));
}
.lab-page .pro-locks { display:flex; flex-wrap:wrap; gap:7px; }
.lab-page .pro-locks span { background:#352949; color:#fff; padding:6px 10px; border-radius:8px; }
.lab-page #kb-event-log td { font-variant-numeric:tabular-nums; }
.lab-page .pro-sentence { color:#261936; background:#f1ebf9; padding:8px; border-radius:8px; white-space:pre-wrap; }
.lab-page .pro-sentence :is(.kb-letter-doubled,.kb-letter-extra,.kb-letter-missing,.kb-letter-different) { background:#ffeadb; color:#662f18; }

.lab-page .mt-pro-stage #mt-pad { min-height:clamp(192px,30vw,380px); }
.lab-page .mt-pro-stage.lab-expanded #mt-pad { min-height:min(64dvh,650px); }
.lab-page .mt-pro-path { position:absolute; display:block; inset:0; width:100%; height:100%; color:#aff6d9; pointer-events:none; opacity:.7; }
.lab-page .mt-pro-stage .mt-diagram { z-index:1; }
.lab-page .mt-pro-stage .lab-tip { z-index:1; }
.lab-page #mt-wheel-warning:not(:empty) { margin-block:6px; }

.lab-page .space-arena,.lab-page .space-arena.lab-expanded { grid-template-rows:none; align-content:start; }
.lab-page .space-main { display:grid; min-width:0; gap:6px; }
.lab-page .space-arena .gm-pad,.lab-page .space-arena.lab-expanded .gm-pad {
  position:relative; display:grid; place-content:center; justify-items:center; gap:16px;
  text-align:center; width:100%; box-sizing:border-box; min-height:170px; height:auto;
  border:1px solid #806aac; font-size:clamp(1rem,3.2vw,1.65rem); line-height:1.25;
}
.lab-page .space-arena.lab-expanded .gm-pad { min-height:clamp(175px,38dvh,540px); }
.lab-page .space-key-art {
  width:clamp(100px,23vw,300px); height:clamp(34px,7vw,70px);
  background:linear-gradient(#c8b5f7,#a58bdb); border-radius:11px; border:2px solid #efe6ff;
  box-shadow:0 7px 0 #5a4187,0 11px 18px #0d082d9c;
  transition:transform 65ms ease,box-shadow 65ms ease;
}
.lab-page .space-pressed .space-key-art { transform:translateY(6px); box-shadow:0 1px 0 #5a4187; }
.lab-page .space-input-check { margin:0; color:#c9ffeb; font-weight:720; }
.lab-page .space-bars { display:flex; align-items:end; gap:3px; list-style:none; padding:4px; margin:0; min-height:46px; background:#28223c; border-radius:8px; }
.lab-page .space-bars li { flex:1 0 0; min-width:2px; height:max(2px,var(--press-height)); background:#aff2d2; border-radius:3px 3px 0 0; }
.lab-page .space-bars { height:48px; box-sizing:border-box; }
.lab-page .space-arena .gm-countdown:not([hidden]) { display:flex; flex-wrap:wrap; gap:12px; align-items:center; padding:8px; }
.lab-page .space-arena .lab-actions button,.lab-page .lab-screen-top button { background:#f0e4ff; color:#382557; }

.lab-page .pro-hub-section { padding-block:clamp(14px,4vw,32px); }
.lab-page .pro-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:14px; }
.lab-page .pro-grid h3 a { color:#422674; }
.lab-page .pro-grid article { display:grid; gap:8px; }
.lab-page .pro-grid a.gm-button { justify-self:start; }
.lab-page .pro-guide-hero p { max-width:68ch; }
.lab-page .pro-guide { max-width:800px; margin-inline:auto; }
.lab-page .pro-quick { padding:14px; border-inline-start:4px solid #7552b7; background:#f5effb; border-radius:8px; }

@media (max-width:840px) {
  .lab-page .sz-pro { grid-template-columns:minmax(0,1fr); grid-template-areas:"preview" "options" "layers" "report"; }
  .lab-page .sz-preview-area { position:static; }
  .lab-page .sz-pro-previews:not([data-multi="true"]) { grid-template-columns:minmax(0,172px); }
  .lab-page .kb-board[data-layout] { grid-template-columns:minmax(0,1fr); }
  .lab-page .kb-board[data-layout] .kb-group:not(:first-child) { width:min(100%,230px); }
  .lab-page .kb-board .kb-key > span { font-size:clamp(.51rem,56cqi,.76rem); }
  .lab-page .pro-grid { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (max-width:590px) {
  .lab-page .pro-split,.lab-page .pro-grid { grid-template-columns:minmax(0,1fr); }
  .lab-page .lab-compact-options { gap:4px; }
  .lab-page .kb-row { gap:2px; }
  .lab-page .kb-board { padding:4px; gap:6px; }
  .lab-page .lab-expanded { padding:10px; }
  .lab-page .lab-screen .lab-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
}
@media (prefers-reduced-motion:reduce) {
  .lab-page .space-key-art { transition:none; }
  .lab-page .space-pressed .space-key-art { transform:none; }
}

.lab-page .kb-letter-missing { text-decoration:line-through; }
.lab-page .kb-letter-doubled,.lab-page .kb-letter-extra { text-decoration:underline; }

.sz-inspector{border:1px solid #e6e6ef;border-radius:14px;padding:12px 14px 14px;margin:12px 0 0;min-width:0;background:#fff}.sz-inspector>legend{padding:0 6px;font-weight:700;font-size:.95rem}
.pro-guide-hero .gm-wrap,.pro-guide-hero h1,.pro-guide-hero p{text-align:left}
