/* Pixambas v137 — Experiencia Pro Móvil & Tablet + Pantalla Completa Real (100dvh, Swipe-Up Sheet, Edge Sliders, Lupa Gotero, Dedo Preciso). */

/* ==========================================================================
   1. PANTALLA COMPLETA REAL (100dvh, Edge-to-Edge) EN DIBUJO 2D Y PIXEL ART
   ========================================================================== */
body.studio-v2.editor-page.studio-canvas-fullscreen{
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
body.studio-v2.editor-page.studio-canvas-fullscreen #app{
  position:fixed!important;
  inset:0!important;
  width:100vw!important;
  height:100dvh!important;
  max-height:100dvh!important;
  padding:0!important;
  gap:0!important;
  z-index:900!important;
  grid-template-rows:minmax(0,1fr)!important;
  background:var(--ui-bg,#0f111d)!important;
}
body.studio-v2.editor-page.studio-canvas-fullscreen .app-header,
body.studio-v2.editor-page.studio-canvas-fullscreen #opts,
body.studio-v2.editor-page.studio-canvas-fullscreen #studio-mobile-dock,
body.studio-v2.editor-page.studio-canvas-fullscreen .px-focus-exit,
body.studio-v2.editor-page.studio-canvas-fullscreen .studio-edge-tab,
body.studio-v2.editor-page.studio-canvas-fullscreen .studio-seo-guide{
  display:none!important;
}
/* Asomar la barra superior temporalmente dentro de pantalla completa al pulsar ⌄ */
body.studio-v2.editor-page.studio-canvas-fullscreen.px-fs-peek-header .app-header{
  display:flex!important;
  position:fixed!important;
  top:calc(6px + env(safe-area-inset-top,0px))!important;
  left:8px!important;
  right:8px!important;
  z-index:980!important;
  max-height:56px!important;
  overflow:hidden!important;
  border-radius:14px!important;
  box-shadow:0 14px 36px rgba(10,12,28,.34)!important;
}
body.studio-v2.editor-page.studio-canvas-fullscreen.px-fs-peek-header .px-fs-top{
  top:calc(68px + env(safe-area-inset-top,0px))!important;
}
body.studio-v2.editor-page.studio-canvas-fullscreen #app>main{
  grid-template-columns:minmax(0,1fr)!important;
  height:100dvh!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
}
body.studio-v2.editor-page.studio-canvas-fullscreen .canvas-workspace,
body.studio-v2.editor-page.studio-canvas-fullscreen #stage{
  border-radius:0!important;
  border:0!important;
  height:100%!important;
  min-height:0!important;
}
/* Permitir ver #tl dentro de pantalla completa solo si el usuario lo pidió desde el panel */
body.studio-v2.editor-page.studio-canvas-fullscreen.px-fs-tl-open #tl{
  display:flex!important;
  position:fixed!important;
  left:8px!important;
  right:8px!important;
  bottom:calc(62px + env(safe-area-inset-bottom,0px))!important;
  z-index:955!important;
  margin:0!important;
  box-shadow:0 16px 42px rgba(10,12,30,.36)!important;
}
/* Paneles #tools y #side como overlays limpios cuando se abren en pantalla completa */
body.studio-v2.editor-page.studio-canvas-fullscreen.tools-open #tools,
body.studio-v2.editor-page.studio-canvas-fullscreen.side-open #side{
  display:flex!important;
  position:fixed!important;
  top:calc(54px + env(safe-area-inset-top,0px))!important;
  bottom:calc(64px + env(safe-area-inset-bottom,0px))!important;
  width:min(340px,calc(100vw - 16px))!important;
  max-height:none!important;
  z-index:965!important;
  border-radius:18px!important;
  box-shadow:0 20px 54px rgba(8,10,26,.42)!important;
}
body.studio-v2.editor-page.studio-canvas-fullscreen.tools-open #tools{left:8px!important;right:auto!important}
body.studio-v2.editor-page.studio-canvas-fullscreen.side-open #side{right:8px!important;left:auto!important}
body.studio-v2.editor-page.studio-canvas-fullscreen .studio-drawer-shade:not([hidden]){
  display:block!important;
  z-index:940!important;
}
/* Ajustar cápsula de zoom en pantalla completa para que no choque con la pastilla inferior */
body.studio-v2.editor-page.studio-canvas-fullscreen .px-canvas-hud{
  bottom:calc(12px + env(safe-area-inset-bottom,0px))!important;
  right:calc(10px + env(safe-area-inset-right,0px))!important;
  z-index:945!important;
}
@media(max-width:640px){
  body.studio-v2.editor-page.studio-canvas-fullscreen .px-canvas-hud{
    display:none!important;
  }
}

/* ==========================================================================
   2. CONTROLES FLOTANTES DE PANTALLA COMPLETA (Auto-fade al dibujar)
   ========================================================================== */
.px-fs-top,
.px-fs-rail,
.px-fs-pull{
  display:none;
  user-select:none;
  -webkit-user-select:none;
  transition:opacity .18s ease, transform .22s cubic-bezier(.22,1,.36,1);
}
body.studio-v2.editor-page.studio-canvas-fullscreen .px-fs-top{display:inline-flex}
body.studio-v2.editor-page.studio-canvas-fullscreen .px-fs-rail{display:flex}
body.studio-v2.editor-page.studio-canvas-fullscreen .px-fs-pull{display:inline-flex}

/* Atenuar automáticamente mientras el usuario dibuja para 0 distracciones */
body.px-active-stroke .px-fs-top,
body.px-active-stroke .px-fs-rail,
body.px-active-stroke .px-fs-pull,
body.px-active-stroke .px-canvas-hud{
  opacity:.12!important;
  pointer-events:none!important;
}

/* Pastilla superior derecha (Deshacer / Rehacer / Asomar barra / Salir) */
.px-fs-top{
  position:fixed;
  top:calc(10px + env(safe-area-inset-top,0px));
  right:calc(10px + env(safe-area-inset-right,0px));
  z-index:990;
  align-items:center;
  gap:5px;
  padding:4px;
  border-radius:999px;
  background:color-mix(in srgb,var(--ui-surface,#181b2e) 86%,transparent);
  border:1px solid color-mix(in srgb,var(--ui-border-strong,#8e96b8) 70%,transparent);
  box-shadow:0 10px 28px rgba(10,12,30,.24);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
}
.px-fs-top button{
  height:36px;
  min-width:36px;
  padding:0 10px;
  border-radius:999px;
  border:1px solid transparent;
  background:var(--ui-surface-2,rgba(255,255,255,.08));
  color:var(--ui-text,#181b2e);
  font:800 14px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  cursor:pointer;
  touch-action:manipulation;
}
.px-fs-top button:disabled{opacity:.38;cursor:default}
.px-fs-top button.on{
  background:color-mix(in srgb,#6355e8 18%,var(--ui-surface-2));
  border-color:color-mix(in srgb,#6355e8 50%,transparent);
  color:var(--ui-accent-strong,#4f46e5);
}
.px-fs-top .px-fs-exit{
  background:linear-gradient(135deg,#6355e8,#0ea5e9)!important;
  color:#fff!important;
  padding:0 13px;
  font-size:12.5px;
}

/* Riel lateral izquierdo estilo Procreate Pocket / ibisPaint (Tamaño + Opacidad + Color + Borrador) */
.px-fs-rail{
  position:fixed;
  left:calc(8px + env(safe-area-inset-left,0px));
  top:50%;
  transform:translateY(-50%);
  z-index:955;
  align-items:center;
}
.px-fs-rail-body{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:8px;
  padding:8px 6px;
  border-radius:18px;
  background:color-mix(in srgb,var(--ui-surface,#181b2e) 86%,transparent);
  border:1px solid color-mix(in srgb,var(--ui-border-strong,#8e96b8) 70%,transparent);
  box-shadow:0 12px 30px rgba(10,12,30,.22);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  width:46px;
  transition:transform .2s ease, opacity .18s ease, width .2s ease, padding .2s ease;
}
.px-fs-rail.collapsed .px-fs-rail-body{
  width:0;
  padding:0;
  opacity:0;
  overflow:hidden;
  border-width:0;
  pointer-events:none;
}
.px-fs-rail-toggle{
  width:22px;
  height:48px;
  margin-left:3px;
  border-radius:0 11px 11px 0;
  border:1px solid color-mix(in srgb,var(--ui-border-strong,#8e96b8) 70%,transparent);
  background:color-mix(in srgb,var(--ui-surface,#fff) 84%,transparent);
  color:var(--ui-accent-strong,#4f46e5);
  font:900 16px/1 system-ui,sans-serif;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  box-shadow:0 6px 18px rgba(10,12,30,.16);
  backdrop-filter:blur(10px);
  touch-action:manipulation;
}
.px-fs-rail.collapsed .px-fs-rail-toggle{
  margin-left:-8px;
  width:26px;
  height:56px;
}
.px-rail-color{
  width:32px;
  height:32px;
  border-radius:50%;
  border:2.5px solid #fff;
  box-shadow:0 0 0 1.5px rgba(15,18,44,.28), 0 3px 10px rgba(0,0,0,.22);
  background:var(--px-active-color,#14102a);
  cursor:pointer;
  padding:0;
  flex:0 0 auto;
}
.px-rail-btn{
  width:34px;
  height:34px;
  border-radius:11px;
  border:1px solid var(--ui-border);
  background:var(--ui-surface-2);
  color:var(--ui-text);
  font-size:15px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  cursor:pointer;
  padding:0;
  touch-action:manipulation;
}
.px-rail-btn.on{
  background:linear-gradient(135deg,#6355e8,#0ea5e9);
  color:#fff;
  border-color:transparent;
}
.px-vslider{
  position:relative;
  width:34px;
  height:92px;
  border-radius:12px;
  background:color-mix(in srgb,var(--ui-surface-2,#eef1f9) 85%,transparent);
  border:1px solid var(--ui-border);
  overflow:hidden;
  touch-action:none;
  cursor:ns-resize;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:flex-end;
}
.px-vslider-fill{
  position:absolute;
  left:0;
  right:0;
  bottom:0;
  height:30%;
  background:linear-gradient(180deg,#6355e8,#0ea5e9);
  opacity:.78;
  pointer-events:none;
}
.px-vslider-lbl{
  position:relative;
  z-index:2;
  font:850 9.5px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  color:var(--ui-text);
  padding:4px 2px;
  text-shadow:0 1px 2px color-mix(in srgb,var(--ui-surface,#fff) 75%,transparent);
  pointer-events:none;
}
.px-vslider-tag{
  position:absolute;
  top:4px;
  left:0;
  right:0;
  text-align:center;
  font:800 8px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  letter-spacing:.03em;
  color:var(--ui-muted);
  pointer-events:none;
}

/* Pastilla deslizable inferior (tocar o deslizar arriba para abrir Herramientas) */
.px-fs-pull{
  position:fixed;
  left:50%;
  bottom:calc(10px + env(safe-area-inset-bottom,0px));
  transform:translateX(-50%);
  z-index:960;
  align-items:center;
  gap:8px;
  height:42px;
  padding:0 16px 0 11px;
  border-radius:999px;
  border:1px solid color-mix(in srgb,#6355e8 42%,var(--ui-border-strong));
  background:color-mix(in srgb,var(--ui-surface,#181b2e) 90%,transparent);
  color:var(--ui-text);
  font:800 12.5px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  box-shadow:0 10px 30px rgba(10,12,30,.24);
  backdrop-filter:blur(14px);
  -webkit-backdrop-filter:blur(14px);
  cursor:pointer;
  touch-action:none;
  white-space:nowrap;
}
.px-fs-pull-dot{
  width:16px;
  height:16px;
  border-radius:50%;
  border:2px solid #fff;
  box-shadow:0 0 0 1px rgba(0,0,0,.22);
  background:var(--px-active-color,#14102a);
  flex:0 0 auto;
}
.px-fs-pull-arrow{
  font-size:15px;
  font-weight:900;
  color:var(--ui-accent-strong,#6355e8);
  transition:transform .2s ease;
}
body.px-fs-sheet-open .px-fs-pull{opacity:0;pointer-events:none;transform:translate(-50%,16px)}

/* ==========================================================================
   3. CAJÓN INFERIOR RÁPIDO (BOTTOM SHEET — funciona en Fullscreen y Móvil)
   ========================================================================== */
.px-sheet-backdrop{
  position:fixed;
  inset:0;
  z-index:970;
  background:rgba(10,12,28,.24);
  opacity:0;
  pointer-events:none;
  transition:opacity .18s ease;
}
body.px-fs-sheet-open .px-sheet-backdrop{
  opacity:1;
  pointer-events:auto;
}

.px-fs-sheet{
  position:fixed;
  left:50%;
  bottom:0;
  transform:translate(-50%,108%);
  z-index:975;
  width:min(560px,100vw);
  max-height:min(62dvh,470px);
  display:flex;
  flex-direction:column;
  border-radius:22px 22px 0 0;
  background:color-mix(in srgb,var(--ui-surface,#fff) 96%,transparent);
  border:1px solid var(--ui-border-strong);
  border-bottom:0;
  box-shadow:0 -16px 48px rgba(10,12,32,.30);
  backdrop-filter:blur(18px);
  -webkit-backdrop-filter:blur(18px);
  padding-bottom:calc(10px + env(safe-area-inset-bottom,0px));
  transition:transform .24s cubic-bezier(.22,1,.36,1);
  overflow:hidden;
}
body.px-fs-sheet-open .px-fs-sheet{
  transform:translate(-50%,0);
}
.px-sheet-handle-zone{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:40px;
  padding:12px 14px 10px;
  cursor:grab;
  touch-action:none;
  position:relative;
  flex:0 0 auto;
}
.px-sheet-handle{
  width:42px;
  height:4.5px;
  border-radius:999px;
  background:color-mix(in srgb,var(--ui-muted,#888) 48%,transparent);
}
.px-sheet-close{
  position:absolute;
  right:10px;
  top:50%;
  transform:translateY(-50%);
  width:30px;
  height:30px;
  border-radius:50%;
  border:1px solid var(--ui-border);
  background:var(--ui-surface-2);
  color:var(--ui-text);
  font:800 15px/1 system-ui,sans-serif;
  cursor:pointer;
}

/* Pestañas del Bottom Sheet */
.px-sheet-tabs{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:5px;
  padding:4px 12px 8px;
  border-bottom:1px solid var(--ui-border);
}
.px-sheet-tabs button{
  height:36px;
  border-radius:11px;
  border:1px solid var(--ui-border);
  background:var(--ui-surface-2);
  color:var(--ui-text);
  font:800 11.5px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:4px;
  white-space:nowrap;
  touch-action:manipulation;
}
.px-sheet-tabs button.on{
  background:linear-gradient(135deg,#6355e8,#0ea5e9);
  color:#fff;
  border-color:transparent;
  box-shadow:0 4px 14px rgba(99,85,232,.28);
}

.px-sheet-body{
  overflow-y:auto;
  overscroll-behavior:contain;
  padding:11px 13px 8px;
  display:flex;
  flex-direction:column;
  gap:11px;
}
.px-sheet-pane[hidden]{display:none!important}

/* Grid de herramientas rápidas */
.px-quick-tools{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:7px;
}
.px-qtool{
  min-height:50px;
  padding:6px 4px;
  border-radius:13px;
  border:1px solid var(--ui-border-strong);
  background:var(--ui-surface-2);
  color:var(--ui-text);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:3px;
  cursor:pointer;
  touch-action:manipulation;
}
.px-qtool b{font-size:17px;line-height:1;font-weight:700}
.px-qtool span{font:750 10.5px/1.1 'Plus Jakarta Sans',system-ui,sans-serif;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.px-qtool.on{
  background:linear-gradient(135deg,#6355e8,#4f46e5);
  color:#fff;
  border-color:transparent;
  box-shadow:0 4px 12px rgba(99,85,232,.28);
}

.px-sheet-row{
  display:flex;
  flex-wrap:wrap;
  gap:7px;
  align-items:center;
}
.px-sheet-chip{
  flex:1 1 auto;
  min-height:38px;
  padding:0 11px;
  border-radius:11px;
  border:1px solid var(--ui-border-strong);
  background:var(--ui-surface-2);
  color:var(--ui-text);
  font:750 12px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  touch-action:manipulation;
}
.px-sheet-chip.on{
  background:linear-gradient(135deg,#6355e8,#0ea5e9);
  color:#fff;
  border-color:transparent;
}
.px-sheet-chip.accent{
  border-color:color-mix(in srgb,#6355e8 45%,var(--ui-border));
  background:linear-gradient(135deg,color-mix(in srgb,#6355e8 12%,var(--ui-surface)),color-mix(in srgb,#0ea5e9 10%,var(--ui-surface)));
  color:var(--ui-accent-strong,#4f46e5);
}

/* Selector de Color Rápido dentro del Bottom Sheet */
.px-qcolor-top{
  display:grid;
  grid-template-columns:minmax(0,1fr) 82px;
  gap:10px;
  align-items:stretch;
}
.px-qsv-wrap{
  position:relative;
  border-radius:13px;
  overflow:hidden;
  border:1px solid var(--ui-border-strong);
  height:132px;
  touch-action:none;
}
.px-qsv-wrap canvas{
  width:100%;
  height:100%;
  display:block;
}
.px-qsv-cursor{
  position:absolute;
  width:16px;
  height:16px;
  border-radius:50%;
  border:2.5px solid #fff;
  box-shadow:0 0 0 1.5px rgba(0,0,0,.5);
  transform:translate(-50%,-50%);
  pointer-events:none;
}
.px-qcolor-side{
  display:flex;
  flex-direction:column;
  gap:6px;
  justify-content:space-between;
}
.px-qcolor-preview{
  flex:1;
  min-height:84px;
  border-radius:12px;
  border:1px solid var(--ui-border-strong);
  display:flex;
  flex-direction:column;
  overflow:hidden;
}
.px-qcolor-main{flex:1;min-height:30px;background:#14102a}
.px-qcolor-sec{height:18px;flex:0 0 18px;background:#ffffff;border-top:1px solid rgba(0,0,0,.12)}
.px-qcolor-hex{
  flex:0 0 auto;
  font:800 10.5px/1.25 'JetBrains Mono',monospace;
  text-align:center;
  padding:5px 2px;
  background:var(--ui-surface-2);
  color:var(--ui-text);
}
.px-qhue{
  width:100%;
  height:22px;
  border-radius:999px;
  appearance:none;
  -webkit-appearance:none;
  background:linear-gradient(90deg,#ff0000,#ffff00,#00ff00,#00ffff,#0000ff,#ff00ff,#ff0000);
  border:1px solid var(--ui-border-strong);
  outline:none;
  margin:0;
}
.px-qhue::-webkit-slider-thumb{
  -webkit-appearance:none;
  width:24px;
  height:24px;
  border-radius:50%;
  background:#fff;
  border:2.5px solid #14102a;
  box-shadow:0 2px 6px rgba(0,0,0,.3);
}
.px-qswatches{
  display:grid;
  grid-template-columns:repeat(8,minmax(0,1fr));
  gap:6px;
}
.px-qswatch{
  aspect-ratio:1;
  border-radius:10px;
  border:2px solid rgba(255,255,255,.85);
  box-shadow:0 0 0 1px rgba(15,18,44,.22);
  cursor:pointer;
  padding:0;
  touch-action:manipulation;
}
.px-qswatch.on{
  box-shadow:0 0 0 2.5px #6355e8;
  transform:scale(1.06);
}

/* Sliders táctiles cómodos de Pincel en el Bottom Sheet */
.px-slider-card{
  background:var(--ui-surface-2);
  border:1px solid var(--ui-border);
  border-radius:13px;
  padding:9px 11px;
  display:flex;
  flex-direction:column;
  gap:7px;
}
.px-slider-head{
  display:flex;
  justify-content:space-between;
  align-items:center;
  font:800 12px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  color:var(--ui-text);
}
.px-slider-head b{color:var(--ui-accent-strong,#6355e8);font-variant-numeric:tabular-nums}
.px-slider-card input[type="range"]{
  width:100%;
  height:28px;
  accent-color:#6355e8;
  margin:0;
}
.px-preset-row{
  display:grid;
  grid-template-columns:repeat(6,minmax(0,1fr));
  gap:5px;
}
.px-preset-row button{
  height:32px;
  border-radius:8px;
  border:1px solid var(--ui-border-strong);
  background:var(--ui-surface);
  color:var(--ui-text);
  font:800 11px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  cursor:pointer;
}
.px-preset-row button.on{
  background:linear-gradient(135deg,#6355e8,#4f46e5);
  color:#fff;
  border-color:transparent;
}

/* ==========================================================================
   4. LUPA DE GOTERO (LONG-PRESS), TOAST DE GESTOS Y MIRILLA DEDO PRECISO
   ========================================================================== */
.px-gesture-toast{
  position:fixed;
  top:calc(60px + env(safe-area-inset-top,0px));
  left:50%;
  transform:translate(-50%,-10px);
  z-index:2900;
  padding:8px 16px;
  border-radius:999px;
  background:rgba(15,18,40,.88);
  color:#fff;
  border:1px solid rgba(255,255,255,.16);
  font:800 12.5px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  box-shadow:0 10px 28px rgba(0,0,0,.32);
  backdrop-filter:blur(10px);
  pointer-events:none;
  opacity:0;
  transition:opacity .16s ease, transform .18s ease;
}
.px-gesture-toast.show{
  opacity:1;
  transform:translate(-50%,0);
}

.px-eyedropper-loupe{
  position:fixed;
  z-index:2950;
  width:78px;
  height:78px;
  border-radius:50%;
  transform:translate(-50%,-112px);
  pointer-events:none;
  border:5px solid #fff;
  box-shadow:0 10px 30px rgba(0,0,0,.38), 0 0 0 1.5px rgba(0,0,0,.3);
  overflow:hidden;
  display:flex;
  flex-direction:column;
}
.px-eyedropper-loupe[hidden]{display:none!important}
.px-loupe-new{flex:1;width:100%}
.px-loupe-old{height:24px;width:100%;border-top:1px solid rgba(255,255,255,.45)}
.px-loupe-hex{
  position:absolute;
  left:50%;
  top:50%;
  transform:translate(-50%,-50%);
  padding:2px 6px;
  border-radius:6px;
  background:rgba(12,14,28,.78);
  color:#fff;
  font:800 10px/1 'JetBrains Mono',monospace;
  letter-spacing:.03em;
}

/* Mirilla flotante de Modo Dedo Preciso (Pixel Art) */
.px-touch-reticle{
  position:fixed;
  z-index:2800;
  width:24px;
  height:24px;
  margin-left:-12px;
  margin-top:-12px;
  pointer-events:none;
  border:2px solid #6355e8;
  border-radius:4px;
  box-shadow:0 0 0 1.5px #fff, inset 0 0 0 1px rgba(255,255,255,.85);
}
.px-touch-reticle::before{
  content:'';
  position:absolute;
  left:50%;
  top:100%;
  width:2px;
  height:36px;
  transform:translateX(-50%);
  background:linear-gradient(180deg,rgba(99,85,232,.8),rgba(99,85,232,.1));
}
.px-touch-reticle[hidden]{display:none!important}

/* ==========================================================================
   5. MODO NORMAL MÓVIL LIMPIO (<= 640px) Y TABLET CÓMODA (641px - 1060px)
   ========================================================================== */
/* Bloque "Estudio rápido" dentro del menú ⚙ en celular para mantener la barra superior despejada */
.px-prefs-mobile-tools{
  display:none;
  flex-direction:column;
  gap:6px;
  padding-bottom:8px;
  margin-bottom:8px;
  border-bottom:1px solid var(--ui-border);
}
.px-prefs-mobile-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:6px;
}
.px-prefs-mobile-grid button{
  min-height:36px;
  padding:0 8px;
  border-radius:9px;
  border:1px solid var(--ui-border-strong);
  background:var(--ui-surface-2);
  color:var(--ui-text);
  font:750 11.5px/1.1 'Plus Jakarta Sans',system-ui,sans-serif;
  cursor:pointer;
}

/* Círculo de color real y borrador activo en el dock inferior (Celular Y Tablet) */
body.studio-v2.editor-page #studio-mobile-dock .px-mob-color-swatch{
  width:20px;
  height:20px;
  border-radius:50%;
  border:2px solid #fff;
  box-shadow:0 0 0 1.5px rgba(15,18,44,.28);
  background:var(--px-active-color,#14102a);
  display:inline-block;
}
body.studio-v2.editor-page #studio-mobile-dock .studio-mob-btn.px-eraser-active{
  background:linear-gradient(135deg,#6355e8,#0ea5e9)!important;
  color:#fff!important;
  border-color:transparent!important;
}

@media(max-width:640px){
  .px-prefs-mobile-tools{display:flex}

  /* Ocultar pestaña flotante lateral en modo normal móvil (el dock inferior ya controla todo sin estorbar arriba) */
  body.studio-v2.editor-page:not(.studio-canvas-fullscreen) .studio-edge-tab{
    display:none!important;
  }

  /* Despejar la barra superior móvil: solo 7 botones amplios y cómodos (◀, ▤▾, ↶, ↷, ⛶, ⬇, ⚙) */
  body.studio-v2.editor-page .app-header #px-code-open,
  body.studio-v2.editor-page .app-header #pixambas-code-open,
  body.studio-v2.editor-page .app-header #vtuber-studio-open,
  body.studio-v2.editor-page .app-header #vtuber-open-btn,
  body.studio-v2.editor-page .app-header #dibujo-assist-open,
  body.studio-v2.editor-page .app-header #studio-reset-open,
  body.studio-v2.editor-page .app-header #studio-pen-only,
  body.studio-v2.editor-page .app-header #thm,
  body.studio-v2.editor-page .app-header #hlp{
    display:none!important;
  }
  body.studio-v2.editor-page .app-header{
    padding:6px 8px!important;
    gap:6px!important;
    min-height:52px!important;
    flex-wrap:nowrap!important;
    overflow:visible!important;
  }
  body.studio-v2.editor-page .app-header .home,
  body.studio-v2.editor-page .app-header .studio-project-menu>summary,
  body.studio-v2.editor-page .app-header #undo,
  body.studio-v2.editor-page .app-header #redo,
  body.studio-v2.editor-page .app-header #un,
  body.studio-v2.editor-page .app-header #re,
  body.studio-v2.editor-page .app-header #studio-canvas-expand,
  body.studio-v2.editor-page .app-header #studio-quick-export,
  body.studio-v2.editor-page .app-header #studio-prefs-menu>summary{
    height:38px!important;
    min-height:38px!important;
    width:38px!important;
    min-width:38px!important;
    max-width:40px!important;
    padding:0!important;
    border-radius:11px!important;
    overflow:hidden!important;
    white-space:nowrap!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
  }
  body.studio-v2.editor-page .app-header .home{font-size:0!important}
  body.studio-v2.editor-page .app-header .home span{display:none!important}
  body.studio-v2.editor-page .app-header .home::before{content:'◀';font-size:15px;line-height:1}

  body.studio-v2.editor-page .app-header .studio-project-menu>summary{font-size:0!important}
  body.studio-v2.editor-page .app-header .studio-project-menu>summary::before{content:'▤▾';font-size:13px;font-weight:800;line-height:1}

  body.studio-v2.editor-page .app-header #studio-quick-export{font-size:0!important}
  body.studio-v2.editor-page .app-header #studio-quick-export::before{content:'⬇';font-size:16px;font-weight:800;line-height:1}

  body.studio-v2.editor-page .app-header #studio-canvas-expand{
    width:40px!important;
    min-width:40px!important;
    font-size:0!important;
  }
  body.studio-v2.editor-page .app-header #studio-canvas-expand::before{
    display:inline!important;
    content:'⛶'!important;
    font-size:17px!important;
    line-height:1!important;
  }
  body.studio-v2.editor-page.studio-canvas-fullscreen .app-header #studio-canvas-expand::before{
    content:'✕'!important;
  }
  body.studio-v2.editor-page .app-header .studio-view-tools{
    padding:3px 5px!important;
    gap:4px!important;
  }
  body.studio-v2.editor-page .app-header .studio-view-tools .header-history{
    gap:4px!important;
  }
  body.studio-v2.editor-page .app-header .studio-right-zone{
    gap:5px!important;
  }

  /* Barra #opts más delgada y 100% dentro de 390px en Pixel Art móvil */
  body.studio-v2.pixel-page #opts.px-opts-modern{
    min-height:40px!important;
    padding:4px 6px!important;
    gap:4px!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  body.studio-v2.pixel-page #opts.px-opts-modern .px-opts-left,
  body.studio-v2.pixel-page #opts.px-opts-modern .px-opts-right{
    gap:4px!important;
    min-width:0!important;
  }
  body.studio-v2.pixel-page #opts.px-opts-modern .px-pop>summary,
  body.studio-v2.pixel-page #opts.px-opts-modern #px-offset-toggle{
    height:32px!important;
    min-height:32px!important;
    padding:0 7px!important;
    font-size:11px!important;
  }
  body.studio-v2.pixel-page #opts.px-opts-modern #sprite-audit-open,
  body.studio-v2.pixel-page #opts.px-opts-modern #sprite-tester-open{
    width:32px!important;
    min-width:32px!important;
    max-width:32px!important;
    height:32px!important;
    min-height:32px!important;
    padding:0!important;
    font-size:0!important;
    overflow:hidden!important;
  }
  body.studio-v2.pixel-page #opts.px-opts-modern #sprite-audit-open::before{content:'⚑';font-size:14px;line-height:1}
  body.studio-v2.pixel-page #opts.px-opts-modern #sprite-tester-open::before{content:'🎮';font-size:15px;line-height:1}

  /* Dock inferior móvil mejorado */
  body.studio-v2.editor-page #studio-mobile-dock{
    display:grid!important;
    grid-template-columns:repeat(5,minmax(0,1fr))!important;
    gap:5px!important;
    padding:5px 6px!important;
    min-height:56px!important;
  }

  /* Cajones #tools y #side más cómodos en celular (tipo bottom-sheet con respiro arriba) */
  body.studio-v2.editor-page.tools-open #tools,
  body.studio-v2.editor-page.side-open #side{
    top:auto!important;
    left:8px!important;
    right:8px!important;
    bottom:calc(70px + var(--ui-safe-bottom,0px))!important;
    width:auto!important;
    max-height:68dvh!important;
    border-radius:20px!important;
    box-shadow:0 -12px 38px rgba(10,12,30,.28)!important;
  }
}

/* Botón Dedo Preciso dentro de #opts en Pixel Art */
#px-offset-toggle{
  height:32px;
  min-height:32px;
  padding:0 9px;
  border-radius:9px;
  border:1px solid color-mix(in srgb,#6355e8 36%,var(--ui-border));
  background:var(--ui-surface-2);
  color:var(--ui-text);
  font:800 11.5px/1 'Plus Jakarta Sans',system-ui,sans-serif;
  cursor:pointer;
  white-space:nowrap;
  display:none;
  align-items:center;
  gap:4px;
}
#px-offset-toggle.on{
  background:linear-gradient(135deg,#6355e8,#0ea5e9)!important;
  color:#fff!important;
  border-color:transparent!important;
}
@media(max-width:1060px),(pointer:coarse){
  #px-offset-toggle{display:inline-flex}
}

/* Tablet horizontal (>= 900px táctil): ocultar dock inferior duplicado, usar flechitas laterales elegantes */
@media(min-width:901px) and (max-width:1180px) and (pointer:coarse){
  body.studio-v2.editor-page #studio-mobile-dock{display:none!important}
  body.studio-v2.editor-page #app>main{margin-bottom:0!important}
}
