/* Mobile presentation only. Desktop keeps the existing simultaneous instruments. */
.ac-mobile-array,.ac-mobile-flow-pickers,.ac-mobile-matrix-switch,.ac-mobile-status,.ac-mobile-disclosure>[data-ac-disclosure-toggle]{display:none}
.ac-mobile-disclosure-body{display:contents}
@media(max-width:820px){
 systolic-lab.lm-is-mobile .ac-matrix-inputs>summary{display:none}
 systolic-lab.lm-is-mobile .ac-mobile-arithmetic>p{font-size:12px;line-height:1.7;color:var(--ac-muted);padding-bottom:8px}
}
@media(max-width:820px) and (max-height:500px) and (min-width:600px){
 systolic-lab.lm-is-mobile .ac-mobile-array{padding-block:2px}
 systolic-lab.lm-is-mobile .ac-mobile-overview{gap:4px}
}
@media(max-width:820px){
 .lm-is-mobile.ac-mobile-workspace .ac-workbench{overflow:visible}
 .lm-is-mobile.ac-mobile-workspace .ac-heading{display:none}
 .lm-is-mobile.ac-mobile-workspace .ac-gpu-body{display:contents}
 .lm-is-mobile.ac-mobile-workspace .ac-array-body{display:block}
 .lm-is-mobile.ac-mobile-workspace .ac-metrics{padding:10px 8px;gap:6px 14px;font-size:10px}
 .lm-is-mobile .ac-mobile-status{display:block;padding:8px 8px 0;font:11px/1.6 var(--ac-mono);color:var(--ac-muted)}
 systolic-lab.lm-is-mobile .ac-metrics{display:none}
 .lm-is-mobile .ac-mobile-running,.lm-is-mobile .ac-mobile-paused{display:none!important}
 .lm-is-mobile .ac-mobile-array{display:block;padding:12px 6px}
 .ac-mobile-array-heading{display:flex;flex-wrap:wrap;gap:5px 12px;align-items:center;justify-content:space-between}
 .ac-mobile-array-heading h3{font-size:14px;line-height:1.4}
 .ac-mobile-array-heading>span{font:11px/1.6 var(--ac-mono);color:var(--ac-muted)}
 .ac-mobile-directions{font-size:11px;line-height:1.6;color:var(--ac-muted);padding:5px 0 10px}
 .ac-mobile-overview{display:grid;grid-template-columns:repeat(var(--ac-mobile-columns),minmax(0,1fr));gap:7px}
 .ac-workbench .ac-mobile-overview>button{display:flex;flex-direction:column;justify-content:center;align-items:center;gap:1px;padding:5px 2px;min-height:60px;font:10px/1.3 var(--ac-mono);background:var(--ac-paper);border-color:var(--control-border,var(--ac-rule));overflow-wrap:anywhere}
 .ac-mobile-overview strong{font-size:16px;line-height:1.35;font-weight:650}
 .ac-mobile-overview small{font-size:9px;color:var(--ac-muted)}
 .ac-workbench .ac-mobile-overview>.is-active{background:var(--ac-selected);border-color:var(--ac-accent)}
 .ac-workbench .ac-mobile-overview>.is-selected{outline:2px solid var(--ac-accent);outline-offset:1px}
 .ac-mobile-overview>.is-row>span,.ac-mobile-overview>.is-column>span{color:var(--ac-accent)}
 .ac-mobile-selected{padding:12px 2px 5px}
 .ac-mobile-selected h4{font:600 13px/1.5 var(--ac-mono)}
 .ac-mobile-selected>p{font:12px/1.7 var(--ac-mono);margin-top:6px!important;overflow-wrap:anywhere}
 .ac-mobile-selected [data-ac-latest]{color:var(--ac-muted)}
 .ac-mobile-selected [data-ac-latest] strong{color:var(--ac-ink);font-weight:550}
 .ac-mobile-arithmetic{margin-top:6px}
 .ac-mobile-arithmetic summary{min-height:44px;align-content:center;cursor:pointer;color:var(--ac-accent);font-size:12px}
 .ac-mobile-arithmetic ol{max-height:240px;overflow:auto;padding-left:20px;font:11px/1.8 var(--ac-mono)}
 .ac-workbench .ac-mobile-topology-toggle{width:100%;margin-top:3px;text-align:left}
 .lm-is-mobile .ac-array-body.ac-mobile-topology:not(.ac-mobile-topology-open){display:none!important}
 .lm-is-mobile .ac-mobile-matrix-switch{display:flex;gap:8px;padding:12px 14px 0}
 .ac-mobile-matrix-switch>button{flex:1}
 .ac-mobile-matrix-switch>button[aria-pressed=true]{border-color:var(--ac-accent);background:var(--ac-selected)}
 .lm-is-mobile .ac-mobile-matrix-inactive{display:none}
 .lm-is-mobile .ac-input-grids{grid-template-columns:1fr;gap:0}
 .lm-is-mobile .ac-times{display:none}
 .lm-is-mobile .ac-input-table input{font-size:16px}
 .lm-is-mobile .ac-mobile-flow-pickers{display:flex;gap:12px;padding:12px;flex-wrap:wrap}
 .ac-mobile-flow-pickers>label{flex:1;min-width:110px;display:flex;align-items:center;gap:8px;font-size:12px}
 .ac-mobile-flow-pickers select{flex:1;width:100%}
 .lm-is-mobile .ac-mobile-disclosure>[data-ac-disclosure-toggle]{display:block;width:100%;text-align:left;margin:8px 0}
 .lm-is-mobile .ac-mobile-disclosure:not(.is-open)>.ac-mobile-disclosure-body{display:none}
 .lm-is-mobile .ac-mobile-disclosure.is-open>.ac-mobile-disclosure-body{display:block}
 .lm-is-mobile .ac-simd,.lm-is-mobile .ac-program,.lm-is-mobile .ac-output{border:0;min-width:0}
 .lm-is-mobile .ac-output>.ac-pad{display:block}
 .lm-is-mobile .ac-output canvas{width:min(100%,300px);margin:0 auto}
 .lm-is-mobile .ac-output>.ac-reference{border-left:0}
 .lm-is-mobile .ac-workbench textarea[data-source]{font-size:16px;line-height:1.6;min-height:220px}
 .lm-is-mobile .ac-history{padding:10px 12px}
 .lm-is-mobile .ac-workbench :is(section,details,[data-ac-overview]){scroll-margin-top:90px}
}
@media(max-width:820px) and (max-height:500px) and (min-width:600px){
 .lm-is-mobile.ac-mobile-workspace .lm-view-nav{padding-block:0;margin-bottom:0}
 .lm-is-mobile .ac-mobile-array{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 18px;padding-block:4px}
 .ac-mobile-array-heading{grid-column:2;grid-row:1;display:block}
 .ac-mobile-array-heading h3{font-size:12px;line-height:1.3}
 .ac-mobile-array-heading>span{font-size:10px;line-height:1.4}
 .ac-mobile-directions{display:none}
 .ac-mobile-overview{grid-column:1;grid-row:1/5;gap:5px;align-self:start}
 .ac-workbench .ac-mobile-overview>button{position:relative;min-height:44px;padding:3px 2px}
 .ac-mobile-overview small{display:none}
 .ac-mobile-overview>.is-active::after{content:'×';position:absolute;top:2px;right:4px;font:10px/1 var(--ac-mono)}
 .ac-mobile-selected{grid-column:2;grid-row:2;padding-top:0}
 .ac-mobile-topology-toggle{grid-column:2;grid-row:3;align-self:end}
 .lm-is-mobile .ac-output>.ac-pad{display:grid;grid-template-columns:minmax(0,240px) minmax(0,1fr);gap:7px 16px}
 .lm-is-mobile .ac-output canvas{grid-column:1;grid-row:1/8;max-height:240px}
 .ac-mobile-compact-output .ac-output>.ac-panelhead{padding:2px 12px;min-height:0}
 .ac-mobile-compact-output .ac-output>.ac-panelhead h3{display:none}
 .ac-mobile-compact-output .ac-output>.ac-panelhead>span{font-size:10px;line-height:1.5}
 .lm-is-mobile.ac-mobile-compact-output .ac-output>.ac-pad{grid-template-columns:160px minmax(0,1fr);gap:4px 16px;padding:6px 12px}
 .lm-is-mobile.ac-mobile-compact-output .ac-output canvas{width:160px;height:160px;max-height:160px;align-self:start;grid-column:1;grid-row:1/8}
 .ac-mobile-compact-output .ac-output>.ac-pad>:not(canvas){grid-column:2}
 .lm-is-mobile.ac-mobile-compact-output .ac-metrics{padding:2px 0;gap:3px 14px}
 .lm-is-mobile.ac-mobile-compact-output .ac-mobile-status{padding:0}
}

/* Two known token/equation lines and a short history viewport stay stable while clocking. */
@media(max-width:820px){
 systolic-lab.lm-is-mobile .ac-mobile-array{font-variant-numeric:tabular-nums}
 systolic-lab.lm-is-mobile .ac-mobile-selected>:is([data-ac-current],[data-ac-latest]){min-block-size:3.4em}
 systolic-lab.lm-is-mobile .ac-mobile-arithmetic ol{block-size:7.2em;max-block-size:none;scrollbar-gutter:stable}
}
@media(max-width:820px) and (max-height:500px) and (min-width:600px){
 systolic-lab.lm-is-mobile .ac-mobile-selected>[data-ac-current]{min-block-size:1.7em}
}
@media(max-width:350px){
 systolic-lab.lm-is-mobile .ac-mobile-array-heading>span{min-block-size:3lh}
 systolic-lab.lm-is-mobile .ac-mobile-overview strong{font-size:12px;white-space:nowrap}
 systolic-lab.lm-is-mobile .ac-pe-inspector>.ac-panelhead:first-child>h3{flex-basis:100%}
}
