/* Reuse mobile/styles/mobile-battle.css; only adapt preview-specific controls. */
#pixel-toggle-tools { display: none; }
.pixel-back-top { display: grid; place-items: center; min-height: 32px; padding: 5px 9px; color: #c5e5d7; font-size: 12px; text-decoration: none; border: 1px solid #45616e; border-radius: 5px; }
.pixel-back-top:focus-visible { outline: 2px solid #8ce3ad; outline-offset: 2px; }
@media (max-width: 980px) {
  html, body { touch-action: pan-x pan-y; }
  .toolbar { grid-template-columns: minmax(0, 1fr) 78px 58px; padding-top: max(3px, env(safe-area-inset-top)); padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  #zoom-in, #zoom-out, #zoom-label { display: none !important; }
  #pixel-toggle-tools { display: block; grid-column: 3; grid-row: 1; min-height: 36px; height: 36px; padding: 0 6px; font-size: 11px; }
  .toolbar { grid-template-rows: 36px; }
  .controls #toggle-action-emphasis { height: 36px; min-height: 36px; }
  .viewport > .confirm-actions--field { position: absolute; left: 6px; bottom: 6px; z-index: 60; min-width: 96px; height: 44px; padding: 0 14px; touch-action: manipulation; }
  .pixel-preview-controls { display: none; }
  body.pixel-tools-open .pixel-preview-controls {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    left: auto; right: 6px; bottom: 58px; transform: none;
    width: min(300px, calc(100% - 12px)); max-width: none; max-height: calc(100% - 70px);
    overflow-y: auto; overscroll-behavior: contain; gap: 4px; padding: 6px;
  }
  .pixel-preview-controls button, .pixel-back-top { min-height: 44px; padding: 4px; font-size: 11px; }
  .pixel-mob-gallery { top: 6px; bottom: 58px; max-height: none; width: calc(100% - 12px); padding: 6px; }
  .pixel-mob-gallery .pixel-mob-sprite { width: 60px; height: 60px; }
  .pixel-mob-gallery header button { min-height: 36px; padding: 4px 10px; }
  .statusbar { padding-bottom: max(2px, env(safe-area-inset-bottom)); height: calc(18px + env(safe-area-inset-bottom)); }
}
