/* Fondos · estilos propios */
body { overflow: hidden; }
.shell { display: grid; height: 100dvh; grid-template-columns: 280px minmax(0, 1fr); grid-template-rows: 48px minmax(0, 1fr); grid-template-areas: "top top" "side stage"; }
.topbar { grid-area: top; }
.top-mid { margin: 0 auto; display: flex; align-items: center; gap: 4px; }
.top-mid kbd { margin: 0 1px; }
.topbar .top-actions { margin-left: 0; }
.side { grid-area: side; overflow: auto; display: flex; flex-direction: column; gap: 14px; padding: 14px 16px; border-right: 1px solid var(--border); }
.field-l b { color: var(--text); margin-left: 4px; }
.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.styles button { height: 32px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel); font-size: 12.5px; color: var(--text-2); }
.styles button:hover { background: var(--hover); color: var(--text); }
.styles button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; }
input[type="range"] { width: 100%; }
.hue { -webkit-appearance: none; appearance: none; height: 12px; border-radius: 6px; background: linear-gradient(90deg, hsl(0 80% 60%), hsl(60 80% 60%), hsl(120 80% 50%), hsl(180 80% 50%), hsl(240 80% 60%), hsl(300 80% 60%), hsl(360 80% 60%)); }
.hue::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 1px 4px rgba(0,0,0,.3); }
.stage { grid-area: stage; display: flex; flex-direction: column; gap: 14px; min-height: 0; padding: 16px; overflow: auto; }
.frame { flex: 0 1 auto; align-self: center; max-width: 100%; max-height: calc(100dvh - 48px - 170px); aspect-ratio: 16 / 9; border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-md), 0 0 0 1px var(--border); background: var(--sunken); }
.frame canvas { display: block; width: 100%; height: 100%; }
.frame { flex: none; min-width: 0; }
.actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.btn.xl { height: 38px; min-width: 150px; font-size: 14px; }
.favs { display: grid; gap: 6px; }
.fav-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.fav { position: relative; flex: none; }
.fav-img { display: block; padding: 0; border: 0; border-radius: 8px; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.fav-img canvas { display: block; width: 128px; height: 72px; }
.fav-x { position: absolute; top: -6px; right: -6px; width: 20px; height: 20px; padding: 0; border: 1px solid var(--border-2); border-radius: 50%; background: var(--panel); color: var(--text-2); opacity: 0; }
.fav:hover .fav-x, .fav-x:focus-visible { opacity: 1; }
@media (max-width: 900px) {
  body { overflow: auto; }
  .shell { height: auto; grid-template-columns: minmax(0, 1fr); grid-template-rows: 48px auto auto; grid-template-areas: "top" "stage" "side"; }
  .side { border-right: 0; border-top: 1px solid var(--border); }
  .top-mid { display: none; } .topbar .top-actions { margin-left: auto; }
  .frame { max-height: 60vh; }
}

/* Pantallas táctiles: el fondo se desliza con el dedo (el desplazamiento vertical sigue funcionando) */
#frame { touch-action: pan-y; }
.swipe-hint { margin: -2px 0 0; color: var(--text-3); font-size: 12.5px; text-align: center; }
