/* Lớp giao diện điện thoại cho các bài thí nghiệm (≤860px) */
.lm-full{display:none}
@media (max-width:860px){
  body #app{grid-template-rows:44dvh minmax(0,1fr)}
  body.lm-big #app{grid-template-rows:minmax(0,1fr) 0}
  body.lm-big #panel{display:none}
  body.lm-big #stage>.ctl{display:none}
  #hint{font-size:13px;max-width:calc(100% - 60px)}
  /* cảnh 3D: hàng nút điều khiển và góc nhìn cuộn ngang, không bị cắt */
  body #stage>.ctl{left:8px;right:8px;top:auto;bottom:52px;height:auto;align-items:center;flex-direction:row;flex-wrap:nowrap;overflow-x:auto;overflow-y:hidden;gap:6px;padding:2px 2px 4px;-webkit-overflow-scrolling:touch;scrollbar-width:none}
  #stage>.ctl::-webkit-scrollbar,#views::-webkit-scrollbar{display:none}
  body #stage>.ctl .b{flex:none;height:auto;min-height:40px;padding:6px 12px;font-size:13px}
  body #views{left:8px;right:8px;bottom:8px;flex-wrap:nowrap;overflow-x:auto;gap:6px;scrollbar-width:none;-webkit-overflow-scrolling:touch}
  body #views .view{flex:none;min-height:38px;padding:6px 12px;white-space:nowrap}
  #status{display:none}
  .lm-full{display:grid;place-items:center;position:absolute;right:8px;top:8px;z-index:6;width:44px;height:44px;border:2px solid #0b3d91;border-radius:12px;background:rgba(255,255,255,.95);color:#0b3d91;font:700 20px system-ui;box-shadow:0 1px 5px rgba(0,0,0,.25);cursor:pointer;padding:0}
  #hud{right:60px}
  /* bảng điều khiển: thanh tab ghim ở đáy màn hình, dễ bấm bằng ngón cái */
  #panel{padding-bottom:calc(60px + env(safe-area-inset-bottom))}
  #tabs{position:fixed;left:0;right:0;bottom:0;z-index:40;background:var(--panel,#fff);border-top:2px solid var(--ink,#111);border-bottom:0;padding-bottom:env(safe-area-inset-bottom)}
  #tabs button{min-height:58px;font-size:15px;border-bottom:0;margin:0;border-top:4px solid transparent}
  #tabs button[aria-selected="true"]{border-top-color:var(--signal,#e5484d)}
  .tabpane{padding:10px 12px 20px}
  /* bước đang làm luôn nằm trên cùng khi cuộn */
  .now{position:sticky;top:-10px;z-index:4;margin:-10px -12px 8px;border-radius:0;padding:10px 12px;box-shadow:0 2px 6px rgba(0,0,0,.12)}
  .now .t{font-size:16px}
  .now .b{min-height:44px;min-width:60px;padding:6px 10px;font-size:13px}
  /* nút và ô nhập đủ lớn để chạm */
  .tabpane .b,.tabpane button.b{min-height:44px}
  .tabpane input[type=text],.tabpane input[type=number],.tabpane select{min-height:44px;font-size:16px}
  .row{flex-wrap:wrap}
  .badge{width:32px;height:32px;font-size:15px}
  #toast{bottom:104px!important}
}
@media (max-width:860px) and (orientation:landscape){
  #app{grid-template-columns:minmax(0,1fr) 46vw;grid-template-rows:minmax(0,1fr)}
  #panel{border-left:2px solid var(--ink,#111);border-top:0}
}
