/* =============================================================
   ImagenToSVG - hoja de estilos unica
   1 Tokens · 2 Reset · 3 Utilidades · 4 Plato animado · 5 Cabecera
   6 Hero y visor · 7 Botones y controles · 8 Demostracion
   9 Estudio · 10 Editor · 11 Contenido · 12 Anuncios · 13 Pie y avisos
   14 Responsive · 15 Movimiento reducido
   ============================================================= */

/* ===================== 1. TOKENS ===================== */
@property --c-shirt { syntax: "<color>"; inherits: true; initial-value: #2f6fd6; }
@property --c-hair { syntax: "<color>"; inherits: true; initial-value: #5a3420; }

:root {
  /* plato (fondo de estudio) */
  --stage: #1b1d21;
  --stage-2: #25282d;
  --stage-3: #33363c;
  --on-stage: #f4f2ed;
  --on-stage-2: #b9bcc3;
  --on-stage-3: #8b8f97;

  /* papel y mesa de edicion */
  --paper: #f6f3ec;
  --card: #fffdf9;
  --ink: #16171a;
  --ink-2: #3c3f46;
  --muted: #6c7079;
  --line: #e4dfd5;
  --line-strong: #cec8bc;

  /* croma: el verde de los fondos de estudio, y de "quitar el fondo" */
  --key: #2fd27a;
  --key-hover: #4ae08e;
  --key-ink: #04210f;
  --key-text: #087a36;
  --key-soft: rgba(47, 210, 122, .14);
  --rec: #ff4d3d;
  --tungsten: #ffcf8a;
  --daylight: #bfe0ff;
  --danger: #c7352b;

  --radius: 14px;
  --radius-sm: 9px;
  --radius-lg: 22px;
  --shadow-print: 0 1px 2px rgba(0,0,0,.25), 0 18px 40px -16px rgba(0,0,0,.6);
  --shadow-card: 0 2px 6px rgba(20,18,14,.08), 0 30px 70px -30px rgba(0,0,0,.55);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-soft: cubic-bezier(.25, .46, .45, .94);

  --display: "Archivo", "Figtree", system-ui, sans-serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --gutter: clamp(1rem, 4vw, 2rem);
  --maxw: 1320px;
}

/* ===================== 2. RESET ===================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 5rem; }
body {
  font-family: var(--sans); font-size: 16px; line-height: 1.6;
  color: var(--on-stage); background: var(--stage);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  overflow-x: clip; min-height: 100vh;
}
img, svg, canvas, video { display: block; max-width: 100%; }
img { height: auto; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
input, select, textarea, output { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 750; line-height: 1.06; letter-spacing: -.02em; text-wrap: balance; }
code { font-family: var(--mono); font-size: .88em; }
::selection { background: var(--key); color: var(--key-ink); }
:focus-visible { outline: 2px solid var(--key); outline-offset: 3px; border-radius: 6px; }
details > summary { cursor: pointer; }
[hidden] { display: none !important; }

/* ===================== 3. UTILIDADES ===================== */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only, .sr-defs {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -100px; left: 1rem; z-index: 999;
  padding: .6rem 1rem; background: var(--key); color: var(--key-ink); border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: 1rem; }
.section-kicker {
  display: block; font-family: var(--mono); font-size: .76rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--key); margin-bottom: .7rem;
  text-shadow: 0 1px 10px rgba(0, 0, 0, .55);
}
.sheet .section-kicker, .studio .section-kicker { text-shadow: none; }
.accent-ink { color: var(--key-text); }

/* ===================== 4. PLATO ANIMADO ===================== */
/* Un plato de fotografia visto de frente: pared de papel continuo que se
   curva hasta el suelo, dos softboxes sobre tripode que se reorientan
   despacio, sus haces de luz, un charco de luz que recorre el fondo y un
   flash cada 9 s. Todo con gradientes (sin filtros de desenfoque), para que
   se mueva fluido tambien en moviles modestos. */
.set { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; background: #15171a; }
.set > * { position: absolute; }
.set-wall {
  inset: 0;
  background:
    radial-gradient(90% 70% at 50% 32%, #4a4d53 0%, #34373c 38%, #22252a 70%, #17191c 100%);
}
/* Curva del papel continuo: el suelo se aclara y la "esquina" es una curva */
.set-cyc {
  left: -20%; right: -20%; bottom: 0; height: 44vh;
  background:
    radial-gradient(60% 100% at 50% 100%, rgba(236, 228, 214, .20) 0%, rgba(236, 228, 214, .09) 45%, transparent 75%),
    linear-gradient(180deg, transparent 0%, rgba(210, 202, 190, .06) 35%, rgba(210, 202, 190, .10) 100%);
  border-radius: 50% 50% 0 0 / 22% 22% 0 0;
}
/* Charcos de luz que recorren la pared: calido y frio */
.set-pool { border-radius: 50%; mix-blend-mode: screen; will-change: transform, opacity; }
.set-pool-a {
  width: 70vmax; height: 52vmax; left: 4vw; top: -6vh;
  background: radial-gradient(closest-side, rgba(255, 214, 150, .34) 0%, rgba(255, 200, 130, .12) 50%, transparent 100%);
  animation: poolA 21s var(--ease-soft) infinite alternate;
}
.set-pool-b {
  width: 60vmax; height: 46vmax; right: 0; top: 18vh;
  background: radial-gradient(closest-side, rgba(190, 222, 255, .26) 0%, rgba(170, 210, 255, .09) 50%, transparent 100%);
  animation: poolB 26s var(--ease-soft) infinite alternate;
}
@keyframes poolA {
  0%   { transform: translate(-10vw, 0) scale(.95); opacity: .75; }
  50%  { transform: translate(24vw, 10vh) scale(1.1); opacity: 1; }
  100% { transform: translate(44vw, -2vh) scale(.92); opacity: .7; }
}
@keyframes poolB {
  0%   { transform: translate(8vw, 0) scale(1); opacity: .7; }
  50%  { transform: translate(-30vw, -12vh) scale(1.15); opacity: 1; }
  100% { transform: translate(-52vw, 6vh) scale(.95); opacity: .65; }
}
/* Luz que llega al suelo, donde se cruzan los haces */
.set-hit {
  left: 50%; bottom: 4vh; width: 90vmax; height: 20vh; margin-left: -45vmax; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 240, 220, .22), rgba(255, 240, 220, .07) 55%, transparent);
  mix-blend-mode: screen;
  animation: hit 13s var(--ease-soft) infinite alternate;
}
@keyframes hit { from { transform: translateX(-9vw) scaleX(.9); } to { transform: translateX(9vw) scaleX(1.08); } }

/* ---- Softbox: tripode fijo + cabezal que se orienta ---- */
.set-rig { top: 15vh; width: 0; height: 0; }
/* En el margen exterior del contenido, para no tapar nunca el texto */
.set-rig-l { left: clamp(24px, calc((100vw - 1320px) / 2 - 30px), 190px); }
.set-rig-r { right: clamp(24px, calc((100vw - 1320px) / 2 - 30px), 190px); }
.rig-stand {
  position: absolute; left: -3px; top: 0; width: 6px; height: 68vh;
  background: linear-gradient(90deg, #121315, #3a3d43 50%, #121315);
}
.rig-stand::before, .rig-stand::after {
  content: ""; position: absolute; left: 0; top: 100%; width: 5px; height: 16vh;
  background: linear-gradient(90deg, #121315, #34373d, #121315);
  transform-origin: 50% 0;
}
.rig-stand::before { rotate: 26deg; }
.rig-stand::after { rotate: -26deg; }
.rig-yoke { position: absolute; left: 0; top: 0; width: 0; height: 0; will-change: rotate; scale: .82; }
.set-rig-l .rig-yoke { rotate: -48deg; animation: aimL 11s var(--ease-soft) infinite alternate; }
.set-rig-r .rig-yoke { rotate: 48deg; animation: aimR 14s var(--ease-soft) infinite alternate; }
@keyframes aimL { from { rotate: -58deg; } to { rotate: -38deg; } }
@keyframes aimR { from { rotate: 56deg; } to { rotate: 36deg; } }
/* Haz: cono con bordes suaves que nace del difusor y se apaga con la distancia */
.rig-beam {
  position: absolute; left: -70vmax; top: 30px; width: 140vmax; height: 135vh;
  background: conic-gradient(from 158deg at 50% 0%, transparent 0deg, rgba(255, 236, 205, .05) 6deg, rgba(255, 236, 205, .26) 18deg, rgba(255, 244, 226, .30) 22deg, rgba(255, 236, 205, .26) 26deg, rgba(255, 236, 205, .05) 38deg, transparent 44deg);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.75) 35%, transparent 92%);
  mask-image: linear-gradient(180deg, #000 0%, rgba(0,0,0,.75) 35%, transparent 92%);
  mix-blend-mode: screen; opacity: .85;
  animation: beamFlash 9s linear infinite;
}
.set-rig-r .rig-beam {
  background: conic-gradient(from 158deg at 50% 0%, transparent 0deg, rgba(205, 228, 255, .04) 6deg, rgba(205, 228, 255, .22) 18deg, rgba(228, 240, 255, .26) 22deg, rgba(205, 228, 255, .22) 26deg, rgba(205, 228, 255, .04) 38deg, transparent 44deg);
  animation-delay: -4.5s;
}
@keyframes beamFlash { 0%, 86%, 100% { opacity: .85; } 88% { opacity: 1; filter: brightness(1.8); } 93% { opacity: .85; filter: none; } }
/* Cabezal: caja trapezoidal con el difusor luminoso hacia el sujeto */
.rig-head {
  position: absolute; left: -80px; top: -74px; width: 160px; height: 96px;
  background: linear-gradient(180deg, #16171a 0%, #2a2c31 62%, #34373d 100%);
  clip-path: polygon(30% 0, 70% 0, 100% 86%, 100% 100%, 0 100%, 0 86%);
}
.rig-head::before { /* anclaje del cabezal al tripode */
  content: ""; position: absolute; left: 50%; top: 58px; width: 16px; height: 16px; margin-left: -8px;
  border-radius: 50%; background: #0e0f11; box-shadow: inset 0 0 0 3px #3a3d43;
}
.rig-panel {
  position: absolute; left: -80px; top: 16px; width: 160px; height: 20px; border-radius: 2px 2px 6px 6px;
  background: linear-gradient(180deg, #ffe7bd, #fffdf6 55%, #ffeccc);
  box-shadow: 0 0 14px 3px rgba(255, 220, 160, .5), 0 16px 44px 10px rgba(255, 210, 150, .22);
  animation: rigGlow 9s linear infinite;
}
.set-rig-r .rig-panel {
  background: linear-gradient(180deg, #d4e6ff, #ffffff 55%, #e2efff);
  box-shadow: 0 0 14px 3px rgba(190, 220, 255, .45), 0 16px 44px 10px rgba(180, 210, 250, .2);
  animation-delay: -4.5s;
}
@keyframes rigGlow {
  0%, 86%, 100% { filter: brightness(1); }
  88% { filter: brightness(1.7); box-shadow: 0 0 60px 26px rgba(255, 244, 220, .9), 0 10px 140px 60px rgba(255, 236, 200, .5); }
  93% { filter: brightness(1); }
}
/* Destello del flash sobre el plato */
.set-flash {
  inset: 0; opacity: 0;
  background: radial-gradient(70% 60% at 30% 40%, rgba(255, 250, 240, .30), rgba(255, 250, 240, .06) 60%, transparent 85%);
  animation: flash 9s linear infinite;
}
@keyframes flash { 0%, 86%, 100% { opacity: 0; } 88% { opacity: 1; } 92% { opacity: 0; } }

/* Motas de polvo que flotan en la luz */
.set-dust {
  left: 0; right: 0; top: 0; height: 200vh; opacity: .5;
  background-image:
    radial-gradient(1.6px 1.6px at 12% 22%, rgba(255,240,215,.9), transparent),
    radial-gradient(1.2px 1.2px at 28% 64%, rgba(255,240,215,.8), transparent),
    radial-gradient(2px 2px at 41% 38%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.4px 1.4px at 57% 81%, rgba(255,240,215,.8), transparent),
    radial-gradient(1.8px 1.8px at 68% 14%, rgba(220,236,255,.9), transparent),
    radial-gradient(1.2px 1.2px at 79% 52%, rgba(220,236,255,.8), transparent),
    radial-gradient(1.6px 1.6px at 90% 30%, rgba(255,255,255,.7), transparent),
    radial-gradient(1.2px 1.2px at 6% 88%, rgba(255,240,215,.7), transparent);
  background-size: 520px 520px;
  -webkit-mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent);
  mask-image: radial-gradient(70% 60% at 50% 45%, #000, transparent);
  animation: dust 40s linear infinite;
}
@keyframes dust { from { transform: translateY(0); } to { transform: translateY(-520px); } }
.set-vignette { inset: 0; background: radial-gradient(120% 95% at 50% 40%, transparent 55%, rgba(8, 9, 11, .55) 100%); }

/* ===================== 5. CABECERA ===================== */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(20, 21, 24, .92); border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 62px; }
.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand-mark {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 9px;
  background: #0d0e10; color: #fff; box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
}
.brand-name { font-family: var(--display); font-weight: 800; font-size: 1.14rem; font-stretch: 112%; letter-spacing: -.01em; }
.brand-name span { color: var(--key); }
.site-nav { display: none; gap: 1.4rem; font-size: .92rem; color: var(--on-stage-2); }
.site-nav a { position: relative; padding: .3rem 0; transition: color .2s var(--ease-out); }
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--key);
  transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease-out);
}
.site-nav a:hover { color: #fff; }
.site-nav a:hover::after { transform: scaleX(1); }
.header-tools { display: flex; align-items: center; gap: .5rem; }
.hub-link {
  display: inline-flex; align-items: center; gap: .45rem; padding: .45rem .8rem; border-radius: 99px;
  font-size: .86rem; font-weight: 600; color: var(--on-stage);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.22);
  transition: box-shadow .2s var(--ease-out), color .2s, transform .2s var(--ease-out);
}
.hub-link svg { color: var(--key); }
.hub-link:hover { box-shadow: inset 0 0 0 1px var(--key); transform: translateY(-1px); }
.nav-toggle { display: grid; gap: 5px; padding: .6rem; border-radius: 8px; }
.nav-toggle-bar { display: block; width: 22px; height: 2px; background: var(--on-stage); border-radius: 2px; transition: transform .28s var(--ease-out), opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.mobile-nav {
  position: absolute; left: 0; right: 0; top: 100%;
  display: grid; gap: .1rem; padding: .5rem var(--gutter) 1rem;
  background: rgba(20, 21, 24, .98); border-bottom: 1px solid rgba(255,255,255,.08);
  animation: menuIn .26s var(--ease-out);
}
.mobile-nav a { padding: .8rem .4rem; border-radius: 8px; font-weight: 600; }
.mobile-nav a:hover { background: rgba(255,255,255,.06); color: var(--key); }
@keyframes menuIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

/* ===================== 6. HERO Y VISOR ===================== */
.hero {
  display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: center;
  padding-block: clamp(2.2rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem);
}
.hero > * { min-width: 0; }
.hero h1 { overflow-wrap: break-word; }
.hero h1 { font-size: clamp(2.1rem, 6.2vw, 4.3rem); font-weight: 800; font-stretch: 108%; letter-spacing: -.035em; }
.hero-accent { color: var(--key); }
.hero-sub { margin-top: 1rem; font-size: clamp(1.05rem, 2.2vw, 1.3rem); color: var(--on-stage-2); max-width: 36ch; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.7rem; }
.hero-facts { display: flex; flex-wrap: wrap; gap: .5rem 1.3rem; margin-top: 1.4rem; }
.hero-fact { display: inline-flex; align-items: center; gap: .4rem; font-size: .88rem; color: var(--on-stage-2); }
.hero-fact svg { color: var(--key); flex-shrink: 0; }
.hero-privacy { margin-top: 1rem; font-size: .84rem; color: var(--on-stage-3); max-width: 52ch; }

.viewfinder {
  position: relative; width: 100%; max-width: 520px; justify-self: center;
  padding: 14px 14px 0; border-radius: 26px;
  background: linear-gradient(160deg, #26282d, #0f1012 70%);
  box-shadow: 0 0 0 1px rgba(255,255,255,.07), 0 40px 90px -30px rgba(0,0,0,.9), 0 0 120px -40px rgba(255, 207, 138, .35);
  transform: rotate(1.2deg);
  transition: transform .5s var(--ease-out), box-shadow .3s;
}
.viewfinder:hover { transform: rotate(0deg) translateY(-3px); }
.viewfinder.is-dragover { box-shadow: 0 0 0 3px var(--key), 0 40px 90px -30px rgba(0,0,0,.9); transform: rotate(0) scale(1.01); }
.vf-screen { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: #efe4cf; }
.vf-art { position: absolute; inset: 0; width: 100%; height: 100%; }
.vf-art-raster { visibility: hidden; }
.vf-pixels {
  position: absolute; inset: 0; width: 100%; height: 100%; image-rendering: pixelated;
  animation: vfReveal 8s var(--ease-soft) infinite;
}
.no-js-canvas .vf-pixels { display: none; }
@keyframes vfReveal {
  0%, 12% { clip-path: inset(0 0 0 0); opacity: 1; }
  58% { clip-path: inset(100% 0 0 0); opacity: 1; }
  88% { clip-path: inset(100% 0 0 0); opacity: 1; }
  89% { clip-path: inset(0 0 0 0); opacity: 0; }
  100% { clip-path: inset(0 0 0 0); opacity: 1; }
}
.vf-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: var(--key); box-shadow: 0 0 18px 4px rgba(47, 210, 122, .75);
  animation: vfScan 8s var(--ease-soft) infinite;
}
@keyframes vfScan {
  0%, 12% { top: 0; opacity: 0; }
  14% { opacity: 1; }
  56% { opacity: 1; }
  58% { top: calc(100% - 3px); opacity: 0; }
  100% { top: 0; opacity: 0; }
}
.vf-corner { position: absolute; width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.9); z-index: 2; }
.vf-tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; border-top-left-radius: 6px; }
.vf-tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; border-top-right-radius: 6px; }
.vf-bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; border-bottom-left-radius: 6px; }
.vf-br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; border-bottom-right-radius: 6px; }
.viewfinder .vf-corner { border-color: rgba(22, 23, 26, .75); }
.vf-focus {
  position: absolute; left: 30%; top: 10%; width: 40%; height: 46%;
  border: 2px solid var(--key); border-radius: 4px; opacity: 0;
  animation: vfFocus 8s var(--ease-out) infinite;
}
@keyframes vfFocus {
  0%, 60% { opacity: 0; transform: scale(1.3); }
  66% { opacity: 1; transform: scale(1); }
  70% { opacity: .35; }
  74%, 84% { opacity: 1; }
  88%, 100% { opacity: 0; transform: scale(1); }
}
.vf-hud {
  position: absolute; left: 50px; right: 50px; display: flex; justify-content: space-between; gap: .5rem;
  font-family: var(--mono); font-size: .68rem; font-weight: 600; color: rgba(22, 23, 26, .78); letter-spacing: .04em;
}
.vf-hud span { padding: 1px 6px; border-radius: 4px; background: rgba(250, 244, 232, .82); }
.vf-hud-top { top: 18px; }
.vf-hud-bottom { bottom: 18px; }
.vf-rec { display: inline-flex; align-items: center; gap: .3rem; }
.vf-rec i { width: 8px; height: 8px; border-radius: 50%; background: var(--rec); animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: .15; } }
.vf-drop {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  padding: 1rem .8rem 1.1rem; color: var(--on-stage-2); font-size: .92rem; cursor: pointer; text-align: center;
  transition: color .2s;
}
.vf-drop strong { color: #fff; }
.vf-drop svg { color: var(--key); transition: transform .25s var(--ease-out); }
.vf-drop:hover { color: #fff; }
.vf-drop:hover svg { transform: translateY(-3px); }

/* ===================== 7. BOTONES Y CONTROLES ===================== */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .72rem 1.15rem; border-radius: var(--radius-sm);
  font-weight: 700; font-size: .93rem; line-height: 1.2; text-align: center; white-space: nowrap;
  transition: transform .2s var(--ease-out), background-color .2s var(--ease-out), box-shadow .2s var(--ease-out), color .2s;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn-key { background: var(--key); color: var(--key-ink); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 8px 22px -10px rgba(47, 210, 122, .8); }
.btn-key:hover { background: var(--key-hover); transform: translateY(-2px); box-shadow: 0 1px 0 rgba(255,255,255,.35) inset, 0 14px 28px -12px rgba(47, 210, 122, .95); }
.btn-line { color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-strong); background: var(--card); }
.btn-line:hover { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(-1px); }
.btn-line-dark { color: var(--on-stage); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.3); }
.btn-line-dark:hover { box-shadow: inset 0 0 0 1.5px #fff; background: rgba(255,255,255,.06); transform: translateY(-2px); }
.btn-lg { padding: .95rem 1.45rem; font-size: 1rem; border-radius: 11px; }
.btn-sm { padding: .5rem .8rem; font-size: .84rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.btn-size { font-family: var(--mono); font-weight: 500; font-size: .74rem; opacity: .75; }
.link-btn { color: var(--key-text); font-weight: 600; font-size: .88rem; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-btn:hover { text-decoration-thickness: 2px; }

.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center; flex-shrink: 0;
  border-radius: 8px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line);
  transition: background-color .18s, color .18s, box-shadow .18s, transform .18s var(--ease-out);
  font-size: 1.1rem; line-height: 1;
}
.icon-btn:hover { background: var(--ink); color: #fff; box-shadow: none; transform: translateY(-1px); }
.icon-btn.icon-danger:hover { background: var(--danger); }
.icon-btn.is-on { background: var(--key-soft); color: var(--key-text); box-shadow: inset 0 0 0 1px var(--key); }

.field { margin-bottom: 1.25rem; }
.field-label { display: flex; justify-content: space-between; gap: .5rem; font-size: .76rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .5rem; }
.field-label output { font-family: var(--mono); color: var(--key-text); text-transform: none; letter-spacing: 0; }
.field-note, .panel-note { color: var(--muted); font-size: .8rem; line-height: 1.45; margin-top: .35rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip {
  padding: .45rem .75rem; border-radius: 8px; font-size: .84rem; font-weight: 600; color: var(--ink-2);
  box-shadow: inset 0 0 0 1.5px var(--line); background: var(--card);
  transition: box-shadow .18s, background-color .18s, color .18s;
}
.chip:hover { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.chip.is-active { background: var(--ink); color: #fff; box-shadow: none; }

input[type="range"] {
  width: 100%; -webkit-appearance: none; appearance: none; height: 4px; border-radius: 99px;
  background: var(--line); margin: .55rem 0; accent-color: var(--key);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%;
  background: var(--key); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.25); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 13px; height: 13px; border-radius: 50%; background: var(--key); border: 3px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,.25); cursor: pointer;
}
.slider-label { display: flex; justify-content: space-between; font-size: .84rem; color: var(--ink-2); margin-top: .45rem; }
.slider-label output { font-family: var(--mono); color: var(--key-text); font-weight: 600; }
.check { display: flex; align-items: flex-start; gap: .5rem; font-size: .85rem; color: var(--ink-2); cursor: pointer; margin-top: .6rem; }
.check input { accent-color: var(--key); width: 16px; height: 16px; margin-top: .15rem; flex-shrink: 0; }

.seg { display: inline-flex; padding: 3px; border-radius: 10px; background: rgba(255,255,255,.08); gap: 2px; }
.seg-btn {
  padding: .42rem .8rem; border-radius: 8px; font-size: .84rem; font-weight: 600; color: var(--on-stage-2);
  transition: background-color .2s var(--ease-out), color .2s;
}
.seg-btn:hover { color: #fff; }
.seg-btn.is-active { background: #fff; color: var(--ink); }
.seg-xs .seg-btn { padding: .3rem .6rem; font-size: .76rem; }

.alert { margin-top: 1rem; padding: .85rem 1rem; border-radius: var(--radius-sm); font-size: .9rem; text-align: left; }
.alert strong { display: block; }
.alert-error { background: #fdeceb; color: #7d1d17; box-shadow: inset 3px 0 0 var(--danger); }
.alert-warn { background: #fff4df; color: #6b4a0a; box-shadow: inset 3px 0 0 #e7a322; }

/* ===================== 8. DEMOSTRACION ===================== */
.pipeline-section { padding-block: 1rem clamp(2.5rem, 6vw, 4rem); }
.pipeline { list-style: none; padding: 0; display: grid; gap: 2.4rem; grid-template-columns: 1fr; max-width: 380px; margin-inline: auto; }
.pipe-step { position: relative; }
.pipe-step:not(:last-child)::after {
  content: ""; position: absolute; left: 50%; bottom: -2.1rem; width: 18px; height: 18px;
  border-right: 3px solid var(--key); border-bottom: 3px solid var(--key);
  transform: translateX(-50%) rotate(45deg); opacity: .9;
  animation: nudgeDown 1.8s var(--ease-soft) infinite;
}
@keyframes nudgeDown { 50% { transform: translate(-50%, 5px) rotate(45deg); } }
.print {
  background: #fffdf8; color: var(--ink); padding: 12px 12px 0; border-radius: 4px;
  box-shadow: var(--shadow-print); transform: rotate(var(--tilt, -1.4deg));
  transition: transform .45s var(--ease-out), box-shadow .3s;
}
.pipe-step:nth-child(2) .print { --tilt: 1.2deg; }
.pipe-step:nth-child(3) .print { --tilt: -.8deg; }
.pipe-step:nth-child(4) .print { --tilt: 1.6deg; }
.print:hover { transform: rotate(0) translateY(-6px); box-shadow: 0 1px 2px rgba(0,0,0,.25), 0 28px 50px -18px rgba(0,0,0,.7); }
.print-frame { position: relative; aspect-ratio: 1; overflow: hidden; background: #efe4cf; }
.print-frame > svg, .print-frame > canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.print-frame canvas { image-rendering: pixelated; }
.print figcaption {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .15rem .5rem;
  padding: .7rem .2rem .85rem; font-family: var(--display); font-weight: 750; font-size: 1rem; letter-spacing: -.01em;
}
.print figcaption small { flex-basis: 100%; font-family: var(--sans); font-weight: 500; font-size: .8rem; color: var(--muted); letter-spacing: 0; }
.print-n { font-family: var(--mono); font-size: .76rem; color: var(--key-text); }

.frame-analysis .posterized { filter: saturate(1.5) contrast(1.15); }
.detect-boxes .db { stroke: var(--key); stroke-dasharray: 1000; stroke-dashoffset: 1000; animation: drawBox 6s var(--ease-out) infinite; }
.db-2 { animation-delay: .5s !important; stroke: var(--rec) !important; }
.db-3 { animation-delay: 1s !important; }
.db-4 { animation-delay: 1.5s !important; stroke: #ffb22e !important; }
@keyframes drawBox { 0% { stroke-dashoffset: 1000; opacity: 1; } 30%, 80% { stroke-dashoffset: 0; opacity: 1; } 95%, 100% { stroke-dashoffset: 0; opacity: 0; } }
.scan-line {
  position: absolute; left: 0; right: 0; top: 0; height: 22%;
  background: linear-gradient(180deg, transparent, rgba(47, 210, 122, .35) 85%, var(--key) 100%);
  animation: scanDown 3s linear infinite;
}
@keyframes scanDown { from { transform: translateY(-100%); } to { transform: translateY(460%); } }

.frame-wire { background: #16171a; }
.frame-wire .wire {
  fill-opacity: 0; stroke: var(--key); stroke-width: 3.5; stroke-linejoin: round;
  stroke-dasharray: 900 900; animation: wireDraw 7s var(--ease-soft) infinite;
}
@keyframes wireDraw {
  0% { stroke-dashoffset: 900; fill-opacity: 0; }
  55% { stroke-dashoffset: 0; fill-opacity: 0; }
  75%, 90% { stroke-dashoffset: 0; fill-opacity: 1; stroke-width: 0; }
  100% { stroke-dashoffset: 0; fill-opacity: 0; stroke-width: 3.5; }
}

.frame-edit .ex { transform-box: view-box; transition: transform .3s; }
.frame-edit .ex-head { animation: exHead 6s var(--ease-out) infinite; }
.frame-edit .ex-arm-l { animation: exArmL 6s var(--ease-out) infinite; }
.frame-edit .ex-arm-r { animation: exArmR 6s var(--ease-out) infinite; }
.frame-edit .ex-legs { animation: exLegs 6s var(--ease-out) infinite; }
.frame-edit .ex-light { animation: exLight 6s var(--ease-out) infinite; }
.frame-edit .ex-shirt { animation: shirtColor 6s steps(1) infinite; }
.frame-edit .ex-hair { animation: hairColor 6s steps(1) infinite; }
@keyframes exHead { 0%, 12%, 88%, 100% { transform: translate(0, 0); } 30%, 70% { transform: translate(0, -34px); } }
@keyframes exArmL { 0%, 12%, 88%, 100% { transform: translate(0, 0); } 30%, 70% { transform: translate(-40px, 0) rotate(-6deg); } }
@keyframes exArmR { 0%, 12%, 88%, 100% { transform: translate(0, 0); } 30%, 70% { transform: translate(40px, 0) rotate(6deg); } }
@keyframes exLegs { 0%, 12%, 88%, 100% { transform: translate(0, 0); } 30%, 70% { transform: translate(0, 26px); } }
@keyframes exLight { 0%, 12%, 88%, 100% { transform: translate(0, 0); } 30%, 70% { transform: translate(-60px, 30px); } }
@keyframes shirtColor { 0% { --c-shirt: #2f6fd6; } 40% { --c-shirt: #2fd27a; } 60% { --c-shirt: #e0567a; } 80% { --c-shirt: #2f6fd6; } }
@keyframes hairColor { 0% { --c-hair: #5a3420; } 45% { --c-hair: #e0a33a; } 75% { --c-hair: #5a3420; } }
.sel-demo rect { stroke: var(--key); }
.sel-demo rect + rect, .sel-demo rect ~ rect { fill: #fff; stroke-width: 4; }
.edit-tag {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  padding: .25rem .55rem; border-radius: 6px; white-space: nowrap;
  background: var(--ink); color: #fff; font-family: var(--mono); font-size: .68rem; font-weight: 600;
}

/* ===================== 9. ESTUDIO ===================== */
.studio-section { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(2.5rem, 6vw, 4rem); }
.studio-head { margin-bottom: 1.4rem; }
.studio-head h2 { font-size: clamp(1.7rem, 4vw, 2.6rem); font-stretch: 106%; }
.flow-steps { list-style: none; padding: 0; margin-top: 1.1rem; display: flex; flex-wrap: wrap; gap: .4rem; counter-reset: flow; }
.flow-steps li {
  counter-increment: flow; display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .7rem .35rem .4rem; border-radius: 99px; font-size: .82rem; font-weight: 600;
  color: var(--on-stage-3); box-shadow: inset 0 0 0 1px rgba(255,255,255,.14);
  transition: color .3s, background-color .3s, box-shadow .3s;
}
.flow-steps li::before {
  content: counter(flow); display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%;
  font-family: var(--mono); font-size: .7rem; background: rgba(255,255,255,.1);
}
.flow-steps li.is-done { color: var(--on-stage-2); }
.flow-steps li.is-done::before { content: "✓"; background: var(--key); color: var(--key-ink); }
.flow-steps li.is-current { color: #fff; box-shadow: inset 0 0 0 1.5px var(--key); background: rgba(47, 210, 122, .1); }
.flow-steps li.is-current::before { background: var(--key); color: var(--key-ink); }

.studio {
  position: relative; color: var(--ink); background: var(--paper);
  border-radius: 26px; padding: clamp(.8rem, 2.4vw, 1.4rem);
  box-shadow: var(--shadow-card), 0 0 0 1px rgba(255,255,255,.05);
}
.stage { display: grid; gap: clamp(.8rem, 2vw, 1.2rem); animation: stageIn .45s var(--ease-out); }
@keyframes stageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.upload-card, .side-card, .preview-card, .settings-card {
  background: var(--card); border-radius: 18px; box-shadow: 0 0 0 1px var(--line), 0 12px 30px -22px rgba(0,0,0,.35);
  padding: clamp(1rem, 2.6vw, 1.5rem);
}
.drop {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .55rem; min-height: 340px;
  padding: 2rem 1rem; border-radius: 14px; text-align: center; cursor: pointer;
  background: var(--card); border: 2px dashed var(--line-strong);
  transition: background-color .25s, border-color .25s, transform .25s var(--ease-out);
}
.drop:hover { background: #fbfff9; border-color: var(--key); }
.is-dragover .drop { transform: scale(1.01); background: #effcf4; border-color: var(--key); }
.drop-lens {
  width: 88px; height: 88px; border-radius: 50%; display: grid; place-items: center; color: var(--ink);
  background: radial-gradient(circle at 35% 30%, #fff, #ece7dc); box-shadow: 0 0 0 1px var(--line), 0 12px 24px -12px rgba(0,0,0,.4);
  transition: transform .35s var(--ease-out);
}
.drop:hover .drop-lens { transform: translateY(-4px) rotate(-6deg); }
.drop-title { font-family: var(--display); font-weight: 800; font-size: clamp(1.25rem, 3vw, 1.6rem); letter-spacing: -.02em; margin-top: .4rem; }
.drop-or { color: var(--muted); font-size: .84rem; }
.drop-hint { color: var(--muted); font-size: .82rem; margin-top: .2rem; }
.privacy-note { display: flex; gap: .5rem; align-items: flex-start; margin-top: 1rem; font-size: .86rem; color: var(--ink-2); }
.privacy-note svg { color: var(--key-text); flex-shrink: 0; margin-top: .15rem; }

.side-card h3 { font-size: 1.02rem; margin-bottom: .5rem; }
.side-note { font-size: .84rem; color: var(--muted); }
.side-divider { height: 1px; background: var(--line); margin: 1.1rem 0; }
.good-with { list-style: none; padding: 0; display: grid; gap: .3rem; margin-bottom: .6rem; font-size: .88rem; color: var(--ink-2); }
.good-with li { display: flex; gap: .5rem; align-items: center; }
.good-with li::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--key); }
.side-card .btn { margin-top: .9rem; }
.recent-list { list-style: none; padding: 0; display: grid; gap: .45rem; margin: .4rem 0 .5rem; }
.recent-item {
  display: flex; align-items: center; gap: .7rem; width: 100%; padding: .45rem; border-radius: 10px; text-align: left;
  box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .18s, transform .18s var(--ease-out);
}
.recent-item:hover { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateX(2px); }
.recent-item img { width: 46px; height: 46px; object-fit: contain; border-radius: 6px; background: #efece6; flex-shrink: 0; }
.recent-item strong { display: block; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-item span { font-size: .76rem; color: var(--muted); }
.recent-item > div { min-width: 0; }

.preview-frame {
  position: relative; border-radius: 12px; overflow: hidden; min-height: 320px; max-height: 62vh;
  display: grid; place-items: center; padding: 2.4rem;
  background: conic-gradient(#e9e5dc 25%, #f7f4ee 0 50%, #e9e5dc 0 75%, #f7f4ee 0) 0 0 / 22px 22px;
}
.preview-frame img { max-height: calc(62vh - 4.8rem); width: auto; max-width: 100%; object-fit: contain; box-shadow: 0 10px 30px -12px rgba(0,0,0,.4); }
.preview-frame .vf-corner { border-color: var(--ink); }
.file-meta { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .3rem 1rem; margin-top: .75rem; font-size: .86rem; }
.file-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.file-meta span { color: var(--muted); font-family: var(--mono); font-size: .78rem; }
.settings-card h3 { font-size: 1.1rem; margin-bottom: 1rem; }
.ready-actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .5rem; margin-top: .9rem; }
.honest-limit { font-size: .8rem; color: var(--muted); }

.processing { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(18, 19, 22, .72); color: #fff; }
.proc-scan {
  position: absolute; left: 0; right: 0; top: 0; height: 30%;
  background: linear-gradient(180deg, transparent, rgba(47, 210, 122, .22) 80%, var(--key));
  animation: scanDown 1.9s linear infinite;
}
.proc-panel {
  position: relative; width: min(340px, 86%); padding: 1.2rem 1.3rem; border-radius: 14px;
  background: #121316; box-shadow: 0 0 0 1px rgba(255,255,255,.1), 0 30px 60px -20px rgba(0,0,0,.8);
}
.proc-label { font-family: var(--display); font-weight: 750; font-size: 1.1rem; }
.proc-bar { height: 8px; border-radius: 99px; background: rgba(255,255,255,.12); margin-top: .7rem; overflow: hidden; }
.proc-bar span { display: block; height: 100%; width: 0; border-radius: 99px; background: var(--key); box-shadow: 0 0 12px rgba(47,210,122,.8); transition: width .35s var(--ease-out); }
.proc-pct { font-family: var(--mono); font-size: .82rem; color: var(--on-stage-2); margin-top: .35rem; }
.proc-steps { list-style: none; padding: 0; margin-top: .8rem; display: grid; gap: .28rem; font-size: .84rem; color: var(--on-stage-3); }
.proc-steps li { display: flex; align-items: center; gap: .5rem; transition: color .25s; }
.proc-steps li::before { content: ""; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.25); flex-shrink: 0; }
.proc-steps li.is-active { color: #fff; }
.proc-steps li.is-active::before { box-shadow: inset 0 0 0 1.5px var(--key); background: radial-gradient(circle, var(--key) 35%, transparent 40%); animation: blink 1s steps(2) infinite; }
.proc-steps li.is-done { color: var(--on-stage-2); }
.proc-steps li.is-done::before { background: var(--key); box-shadow: none; content: "✓"; color: var(--key-ink); font-size: .6rem; font-weight: 800; display: grid; place-items: center; }
.processing.is-finished .proc-label { color: var(--key); }

/* ===================== 10. EDITOR ===================== */
.stage-editor { display: block; }
.editor {
  display: grid; grid-template-rows: auto minmax(0, 1fr) auto;
  height: clamp(640px, 84vh, 920px); border-radius: 18px; overflow: hidden;
  background: #2a2c31; box-shadow: 0 0 0 1px #0e0f11;
}
.editor.is-fullscreen { position: fixed; inset: 0; z-index: 300; height: 100vh; height: 100dvh; border-radius: 0; }
.ed-top, .ed-bottom {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem .8rem;
  padding: .55rem .8rem; background: #151619; color: var(--on-stage);
}
.ed-top { border-bottom: 1px solid #000; }
.ed-bottom { border-top: 1px solid #000; }
.ed-title { display: flex; align-items: center; gap: .55rem; min-width: 0; }
.ed-title strong { font-family: var(--display); font-size: .98rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.ed-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--key); box-shadow: 0 0 10px var(--key); flex-shrink: 0; }
.ed-meta { font-family: var(--mono); font-size: .72rem; color: var(--on-stage-3); white-space: nowrap; }
.ed-exports { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.ed-top .btn-line { background: transparent; color: var(--on-stage); box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.25); }
.ed-top .btn-line:hover { box-shadow: inset 0 0 0 1.5px #fff; }
.png-menu { position: relative; }
.png-options {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 190px;
  display: grid; padding: .35rem; border-radius: 10px; background: var(--card); color: var(--ink);
  box-shadow: 0 0 0 1px var(--line), 0 20px 40px -12px rgba(0,0,0,.5);
}
.png-options button { display: flex; justify-content: space-between; gap: 1rem; padding: .55rem .6rem; border-radius: 7px; font-size: .86rem; font-weight: 600; text-align: left; }
.png-options button:hover { background: var(--key-soft); }
.png-options span { font-family: var(--mono); font-size: .72rem; color: var(--muted); font-weight: 500; }

.ed-body { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 0; position: relative; }
.ed-panel { background: var(--card); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; padding: .9rem; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.panel-head h3 { font-size: 1rem; display: flex; align-items: center; gap: .45rem; }
.count { font-family: var(--mono); font-size: .72rem; padding: .1rem .4rem; border-radius: 6px; background: var(--ink); color: #fff; font-weight: 600; }
.drawer-close { display: none; }

.piece-list { list-style: none; padding: 0; margin: .7rem 0 0; display: grid; gap: 2px; }
.piece-row {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: .6rem;
  padding: .35rem .4rem .35rem .45rem; border-radius: 9px; cursor: pointer;
  transition: background-color .15s;
}
.piece-row:hover, .piece-row.is-hover { background: #f1eee7; }
.piece-row.is-selected { background: var(--key-soft); }
.piece-row.is-selected::before { content: ""; position: absolute; left: 0; top: 6px; bottom: 6px; width: 3px; border-radius: 3px; background: var(--key); }
.piece-row.is-hidden .piece-thumb, .piece-row.is-hidden .piece-name { opacity: .4; }
.piece-thumb {
  width: 40px; height: 40px; border-radius: 7px; padding: 3px;
  background: conic-gradient(#ebe7df 25%, #fbf9f5 0 50%, #ebe7df 0 75%, #fbf9f5 0) 0 0 / 10px 10px;
  box-shadow: inset 0 0 0 1px var(--line);
}
.piece-thumb svg { width: 100%; height: 100%; }
.piece-text { min-width: 0; }
.piece-name { display: block; font-weight: 650; font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.piece-kind { display: flex; align-items: center; gap: .35rem; font-family: var(--mono); font-size: .68rem; color: var(--muted); }
.piece-kind i { width: 9px; height: 9px; border-radius: 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.piece-eye { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 7px; color: var(--muted); }
.piece-eye:hover { background: var(--ink); color: #fff; }

.palette-block { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.palette-block h4, .prop-group h4 { font-size: .74rem; font-family: var(--mono); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.palette { display: grid; grid-template-columns: repeat(auto-fill, minmax(62px, 1fr)); gap: .45rem; margin-top: .7rem; }
.pal-sw { position: relative; display: grid; gap: .2rem; justify-items: center; font-family: var(--mono); font-size: .64rem; color: var(--ink-2); }
.pal-sw i {
  display: block; width: 100%; height: 34px; border-radius: 8px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.14);
  transition: transform .18s var(--ease-out), box-shadow .18s;
}
.pal-sw:hover i { transform: translateY(-2px); box-shadow: inset 0 0 0 1px rgba(0,0,0,.14), 0 6px 14px -6px rgba(0,0,0,.4); }
.pal-sw input { position: absolute; inset: 0; width: 100%; height: 34px; opacity: 0; cursor: pointer; }

.ed-canvas { position: relative; min-width: 0; min-height: 0; background: #2a2c31; }
.viewport {
  position: absolute; inset: 0; overflow: auto; overscroll-behavior: contain;
  display: flex; padding: 28px;
  background:
    radial-gradient(ellipse at 50% 35%, rgba(255, 230, 190, .09), transparent 60%),
    radial-gradient(circle, rgba(255,255,255,.05) 1px, transparent 1.2px) 0 0 / 22px 22px;
}
.viewport:focus-visible { outline-offset: -3px; }
.artboard {
  position: relative; flex-shrink: 0; margin: auto;
  background: conic-gradient(#d7d4cd 25%, #f1eee8 0 50%, #d7d4cd 0 75%, #f1eee8 0) 0 0 / 16px 16px;
  box-shadow: 0 0 0 1px rgba(0,0,0,.4), 0 30px 60px -20px rgba(0,0,0,.8);
}
.svg-host, .svg-host > svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.svg-host > svg { overflow: visible; touch-action: none; }
.svg-host [data-uid] { cursor: pointer; }
.svg-host [data-uid][data-bg="1"] { cursor: default; }
.svg-host .is-dragging { cursor: grabbing; }
.ui-layer { pointer-events: none; }
.ui-layer .h-hit { pointer-events: all; }
.sel-box { fill: none; stroke: var(--key); vector-effect: non-scaling-stroke; }
.hover-box { fill: none; stroke: #fff; stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.handle { fill: #fff; stroke: #0f8f48; vector-effect: non-scaling-stroke; }
.handle-scale { cursor: nwse-resize; }
.handle-scale.ne, .handle-scale.sw { cursor: nesw-resize; }
.handle-rot { cursor: grab; fill: var(--key); }
.rot-stem { stroke: var(--key); vector-effect: non-scaling-stroke; }
.flash-piece { animation: pieceFlash .9s var(--ease-out) 2; }
@keyframes pieceFlash { 50% { opacity: .35; } }

.cmp-original { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; display: none; }
.artboard[data-view="original"] .cmp-original { display: block; }
.artboard[data-view="original"] .svg-host { visibility: hidden; }
.artboard[data-view="compare"] .cmp-original { display: block; clip-path: inset(0 calc(100% - var(--cmp, 50%)) 0 0); }
.artboard[data-view="compare"][data-orient="h"] .cmp-original { clip-path: inset(0 0 calc(100% - var(--cmp, 50%)) 0); }
.cmp-divider { position: absolute; top: 0; bottom: 0; left: var(--cmp, 50%); width: 0; z-index: 3; }
.cmp-divider::before { content: ""; position: absolute; top: 0; bottom: 0; left: -1.5px; width: 3px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.35); }
.artboard[data-orient="h"] .cmp-divider { top: var(--cmp, 50%); bottom: auto; left: 0; right: 0; height: 0; width: auto; }
.artboard[data-orient="h"] .cmp-divider::before { left: 0; right: 0; top: -1.5px; bottom: auto; height: 3px; width: auto; }
.cmp-knob {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  background: #fff; color: var(--ink); box-shadow: 0 6px 18px rgba(0,0,0,.45); cursor: ew-resize; touch-action: none;
}
.artboard[data-orient="h"] .cmp-knob { cursor: ns-resize; }
.artboard[data-orient="h"] .cmp-knob svg { transform: rotate(90deg); }
.cmp-bar {
  position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 5;
  display: flex; align-items: center; gap: .6rem; padding: .3rem .4rem; border-radius: 12px;
  background: rgba(15, 16, 18, .92); color: #fff; box-shadow: 0 10px 24px -10px rgba(0,0,0,.6);
}
.cmp-tag { font-family: var(--mono); font-size: .7rem; font-weight: 600; padding: 0 .3rem; color: var(--on-stage-2); }

.scale-callout {
  position: absolute; left: 14px; bottom: 14px; z-index: 5; max-width: 300px;
  display: grid; gap: .15rem; padding: .7rem .85rem; border-radius: 12px;
  background: #fffdf9; color: var(--ink); font-size: .8rem; box-shadow: 0 16px 34px -14px rgba(0,0,0,.7);
  border-left: 4px solid var(--key); animation: stageIn .4s var(--ease-out);
}
.scale-callout strong { font-family: var(--display); font-size: .92rem; }
.toast {
  position: absolute; left: 50%; top: 16px; transform: translateX(-50%); z-index: 6;
  display: flex; align-items: center; gap: .55rem; padding: .6rem 1rem; border-radius: 12px;
  background: var(--key); color: var(--key-ink); font-weight: 750; font-size: .92rem; white-space: nowrap;
  box-shadow: 0 16px 36px -12px rgba(0,0,0,.6); animation: toastIn .5s var(--ease-out);
}
.toast.is-error { background: #fdeceb; color: #7d1d17; }
.toast.is-info { background: #fffdf9; color: var(--ink); }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, -12px) scale(.96); } to { opacity: 1; transform: translate(-50%, 0); } }

.props-doc, .props-piece { margin-top: .6rem; }
.prop-group { padding: .9rem 0; border-top: 1px solid var(--line); }
.props-doc .prop-group:first-child, .props-piece > .prop-group:nth-child(3) { }
.prop-group h4 { margin-bottom: .6rem; }
.name-field input {
  width: 100%; padding: .5rem .6rem; border-radius: 8px; font-family: var(--display); font-weight: 750; font-size: 1.05rem;
  border: 0; box-shadow: inset 0 0 0 1.5px var(--line); background: #fff;
}
.name-field input:hover { box-shadow: inset 0 0 0 1.5px var(--line-strong); }
.name-field input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--key); }
.piece-actions { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: .25rem; margin: .7rem 0 .2rem; }
.piece-actions .icon-btn { width: 100%; }
.bg-modes { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }
.bg-mode {
  display: grid; justify-items: center; gap: .3rem; padding: .55rem .3rem; border-radius: 10px;
  font-size: .8rem; font-weight: 650; color: var(--ink-2); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: box-shadow .18s, background-color .18s;
}
.bg-mode:hover { box-shadow: inset 0 0 0 1.5px var(--ink-2); }
.bg-mode.is-active { box-shadow: inset 0 0 0 2px var(--key); background: var(--key-soft); color: var(--ink); }
.bgm-sw { width: 34px; height: 24px; border-radius: 5px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.18); }
.bgm-keep { background: linear-gradient(135deg, #efe4cf 50%, #2f6fd6 50%); }
.bgm-remove { background: conic-gradient(#d5d1c9 25%, #fff 0 50%, #d5d1c9 0 75%, #fff 0) 0 0 / 8px 8px; }
.bgm-color { background: var(--bgc, #ffffff); }
.bg-color-row { display: flex; align-items: center; gap: .6rem; margin-top: .7rem; }
.quick-colors { display: flex; gap: .3rem; }
.quick-colors button { width: 24px; height: 24px; border-radius: 6px; background: var(--q); box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); transition: transform .15s var(--ease-out); }
.quick-colors button:hover { transform: scale(1.15); }
input[type="color"] { width: 44px; height: 34px; padding: 2px; border: 0; border-radius: 8px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); cursor: pointer; }

.color-now { display: flex; align-items: center; gap: .7rem; }
.sw-lg { width: 46px; height: 46px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.16); flex-shrink: 0; }
.mini-label { display: block; font-size: .72rem; color: var(--muted); }
.color-now code { font-size: 1rem; font-weight: 600; }
.sub-colors { display: flex; flex-wrap: wrap; gap: .3rem; margin: .6rem 0 0; }
.sub-colors button {
  display: inline-flex; align-items: center; gap: .3rem; padding: .2rem .4rem .2rem .2rem; border-radius: 7px;
  font-family: var(--mono); font-size: .68rem; box-shadow: inset 0 0 0 1px var(--line);
}
.sub-colors button i { width: 16px; height: 16px; border-radius: 4px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.sub-colors button.is-active { box-shadow: inset 0 0 0 2px var(--key); }
.color-edit { display: flex; gap: .6rem; margin: .7rem 0; align-items: flex-start; }
.color-edit input[type="color"] { width: 54px; height: 86px; }
.color-fields { display: grid; gap: .3rem; flex: 1; min-width: 0; }
.color-fields label, .num-grid label { display: grid; grid-template-columns: 40px minmax(0, 1fr); align-items: center; font-family: var(--mono); font-size: .7rem; color: var(--muted); font-weight: 600; }
.color-fields input, .num-grid input, .cmd-form input {
  width: 100%; min-width: 0; padding: .38rem .5rem; border-radius: 7px; border: 0; background: #fff;
  box-shadow: inset 0 0 0 1.5px var(--line); font-family: var(--mono); font-size: .8rem; color: var(--ink);
}
.color-fields input:focus, .num-grid input:focus, .cmd-form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--key); }
.color-fields input.is-invalid { box-shadow: inset 0 0 0 2px var(--danger); }
.num-grid { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem .6rem; margin-bottom: .4rem; }
.num-grid label { grid-template-columns: auto minmax(0, 1fr); gap: .4rem; }
.flip-row { display: flex; flex-wrap: wrap; gap: .35rem; align-items: center; margin-top: .6rem; }
.stroke-row { display: flex; align-items: flex-end; gap: .6rem; }
.stroke-row .slider-label { flex: 1; }
.stroke-row input[type="color"] { width: 36px; height: 28px; }

.detail-box { background: linear-gradient(180deg, #f3fbf6, transparent 70%); margin-inline: -.9rem; padding-inline: .9rem; }
.cmd-form { display: flex; gap: .35rem; margin-top: .6rem; }
.cmd-form input { font-family: var(--sans); font-size: .88rem; padding: .5rem .6rem; }
.cmd-examples { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .5rem; }
.cmd-examples button { font-size: .74rem; padding: .22rem .5rem; border-radius: 6px; color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line); background: #fff; }
.cmd-examples button:hover { box-shadow: inset 0 0 0 1px var(--key); color: var(--ink); }
.cmd-result { font-size: .82rem; margin-top: .5rem; min-height: 1.2em; color: var(--ink-2); }
.cmd-result.is-ok { color: var(--key-text); font-weight: 600; }
.cmd-result.is-error { color: var(--danger); }
.doc-stats dl { display: grid; grid-template-columns: auto 1fr; gap: .2rem .8rem; font-size: .82rem; margin-bottom: .8rem; }
.doc-stats dt { color: var(--muted); }
.doc-stats dd { margin: 0; font-family: var(--mono); font-size: .78rem; text-align: right; }
.doc-stats .link-btn { display: block; margin: .7rem auto 0; }

.zoom-group, .history-group, .misc-group, .drawer-toggles { display: flex; align-items: center; gap: .3rem; }
.ed-bottom .icon-btn { color: var(--on-stage); box-shadow: inset 0 0 0 1px rgba(255,255,255,.2); }
.ed-bottom .icon-btn:hover { background: #fff; color: var(--ink); }
.zoom-presets { display: flex; gap: 2px; padding: 2px; border-radius: 9px; background: rgba(255,255,255,.07); }
.zoom-presets button { padding: .32rem .5rem; border-radius: 7px; font-family: var(--mono); font-size: .72rem; font-weight: 600; color: var(--on-stage-2); }
.zoom-presets button:hover { color: #fff; background: rgba(255,255,255,.08); }
.zoom-presets button.is-active { background: #fff; color: var(--ink); }
.zoom-read { font-family: var(--mono); font-size: .72rem; color: var(--on-stage-3); min-width: 50px; text-align: right; }
.tool-btn {
  display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .65rem; border-radius: 8px;
  font-size: .82rem; font-weight: 600; color: var(--on-stage);
  transition: background-color .15s, color .15s;
}
.tool-btn:hover:not(:disabled) { background: rgba(255,255,255,.1); }
.tool-btn:disabled { opacity: .35; cursor: not-allowed; }
.tool-btn[aria-pressed="true"], .tool-btn.is-on { background: var(--key); color: var(--key-ink); }
.drawer-toggles { display: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 240; background: rgba(0,0,0,.45); }

/* ===================== 11. CONTENIDO ===================== */
.container.sheet { width: calc(100% - 2 * var(--gutter)); max-width: calc(var(--maxw) - 2 * var(--gutter)); }
.sheet {
  color: var(--ink); background: var(--card); border-radius: 26px;
  padding: clamp(1.4rem, 4vw, 3rem); margin-block: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow-card);
}
.sheet h2 { font-size: clamp(1.6rem, 3.8vw, 2.4rem); font-stretch: 106%; }
.sheet .section-kicker { color: var(--key-text); }
.section-sub { color: var(--muted); margin: .5rem 0 1.6rem; max-width: 62ch; }

.scale-grid { display: grid; gap: 2rem; align-items: center; }
.scale-copy p { color: var(--ink-2); margin-top: .9rem; max-width: 56ch; }
.scale-copy .slider-label { margin-top: 1.4rem; max-width: 360px; font-weight: 600; }
.scale-copy input[type="range"] { max-width: 360px; }
.loupes { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(.8rem, 2.5vw, 1.5rem); }
.loupe { display: grid; gap: .6rem; justify-items: center; }
.loupe-lens {
  position: relative; width: 100%; aspect-ratio: 1; border-radius: 50%; overflow: hidden; background: #efe4cf;
  box-shadow: 0 0 0 10px #16171a, 0 0 0 12px #3a3d43, 0 24px 44px -16px rgba(0,0,0,.6);
}
.loupe-lens canvas, .loupe-lens svg { position: absolute; left: 50%; top: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%); }
.loupe-raster canvas { image-rendering: pixelated; max-width: none; }
.loupe figcaption { font-size: .88rem; color: var(--muted); margin-top: .6rem; }
.loupe figcaption strong { font-family: var(--mono); color: var(--ink); }

.steps { list-style: none; padding: 0; display: grid; gap: 0; margin: 1.6rem 0 2.4rem; grid-template-columns: 1fr; border-top: 1px solid var(--line); }
.step { display: grid; grid-template-columns: 3.2rem 1fr; gap: .1rem 1rem; align-content: start; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.step-n { grid-row: span 2; font-family: var(--mono); font-size: 1.4rem; font-weight: 600; color: var(--key-text); line-height: 1.1; }
.step h3 { font-size: 1.08rem; }
.step p { color: var(--muted); font-size: .92rem; }
.prose { max-width: 72ch; }
.prose h3 { font-size: 1.25rem; margin: 2rem 0 .6rem; }
.prose p { color: var(--ink-2); margin-bottom: .9rem; }
.prose strong { color: var(--ink); }
.prose code { background: #f0ede6; padding: .08rem .3rem; border-radius: 4px; }

.faq-list { display: grid; gap: .5rem; max-width: 78ch; margin-top: 1.4rem; }
.faq-item { border-radius: 12px; box-shadow: inset 0 0 0 1px var(--line); transition: box-shadow .2s, background-color .2s; }
.faq-item[open] { background: #faf8f3; box-shadow: inset 0 0 0 1.5px var(--ink); }
.faq-item summary { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: 1rem 1.1rem; font-weight: 650; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-icon { position: relative; width: 22px; height: 22px; flex-shrink: 0; border-radius: 6px; background: var(--ink); transition: transform .3s var(--ease-out), background-color .2s; }
.faq-icon::before, .faq-icon::after { content: ""; position: absolute; left: 6px; right: 6px; top: 10px; height: 2px; background: #fff; border-radius: 2px; transition: transform .3s var(--ease-out); }
.faq-icon::after { transform: rotate(90deg); }
.faq-item[open] .faq-icon { transform: rotate(45deg); background: var(--key); }
.faq-item[open] .faq-icon::before, .faq-item[open] .faq-icon::after { background: var(--key-ink); }
.faq-item p { padding: 0 1.1rem 1.1rem; color: var(--ink-2); font-size: .94rem; }

.more-tools-grid { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.more-tool-card {
  position: relative; display: grid; gap: .25rem; padding: 1rem 2.4rem 1rem 1.1rem; border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line); background: #fff;
  transition: box-shadow .2s, transform .25s var(--ease-out);
}
.more-tool-card::after { content: "→"; position: absolute; right: 1rem; top: 1rem; color: var(--muted); transition: transform .25s var(--ease-out), color .2s; }
.more-tool-card:hover { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(-2px); }
.more-tool-card:hover::after { transform: translateX(4px); color: var(--key-text); }
.more-tool-hub { background: var(--ink); color: #fff; box-shadow: none; }
.more-tool-hub .more-tool-desc { color: var(--on-stage-2); }
.more-tool-hub:hover { box-shadow: 0 0 0 2px var(--key); }
.more-tool-name { font-family: var(--display); font-weight: 750; font-size: 1.02rem; }
.more-tool-desc { color: var(--muted); font-size: .84rem; line-height: 1.45; }

/* ===================== 12. ANUNCIOS ===================== */
.ad-slot {
  min-height: 90px; display: grid; place-items: center; gap: .2rem; margin-block: 1.2rem;
  border: 1px dashed rgba(255,255,255,.22); border-radius: 12px;
  color: var(--on-stage-3); font-size: .78rem; text-align: center; padding: .75rem;
}
.ad-slot strong { font-family: var(--mono); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; font-weight: 600; }
.ad-slot--infeed { min-height: 250px; }

/* ===================== 13. PIE Y AVISOS ===================== */
.site-footer { border-top: 1px solid rgba(255,255,255,.08); background: rgba(14, 15, 17, .94); padding-block: 2rem 1.6rem; margin-top: 2rem; }
.footer-inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.footer-brand { color: var(--on-stage-2); font-size: .9rem; }
.footer-brand strong { color: #fff; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 1.1rem; font-size: .88rem; color: var(--on-stage-2); }
.footer-nav a:hover { color: var(--key); }
.disclaimer { margin-top: 1.2rem; color: var(--on-stage-3); font-size: .78rem; max-width: 90ch; }

.to-top {
  position: fixed; right: 1rem; bottom: 1rem; z-index: 70; width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center; background: var(--key); color: var(--key-ink);
  box-shadow: 0 10px 24px -8px rgba(0,0,0,.6); opacity: 0; transform: translateY(12px);
  transition: opacity .28s var(--ease-out), transform .28s var(--ease-out), background-color .2s;
}
.to-top.is-visible { opacity: 1; transform: none; }
.to-top:hover { background: var(--key-hover); transform: translateY(-3px); }

.consent-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 400; background: #0f1012; color: #fff; padding: 1rem var(--gutter); box-shadow: 0 -12px 30px -12px rgba(0,0,0,.6); border-top: 2px solid var(--key); }
.consent-inner { max-width: var(--maxw); margin-inline: auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.consent-text { font-size: .88rem; max-width: 80ch; color: var(--on-stage-2); }
.consent-text a { color: #fff; text-decoration: underline; text-underline-offset: 2px; }
.consent-actions { display: flex; gap: .5rem; }
.consent-actions .btn-line { background: transparent; color: #fff; box-shadow: inset 0 0 0 1.5px rgba(255,255,255,.35); }

/* Paginas legales */
.page-legal { color: var(--ink); }
.page-legal h1 { font-size: clamp(1.8rem, 4.4vw, 2.5rem); margin-bottom: 1.25rem; }
.page-legal h2 { font-size: 1.15rem; margin: 1.6rem 0 .5rem; }
.page-legal p { color: var(--ink-2); margin-bottom: .8rem; }
.page-legal a { color: var(--key-text); text-decoration: underline; }
.consent-reset-btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .75rem 1.2rem; border-radius: 10px;
  font-weight: 600; font-size: .95rem; cursor: pointer; color: var(--ink); background: none; border: 1px solid var(--line-strong);
  transition: border-color .2s ease, color .2s ease, background-color .2s ease;
}
.consent-reset-btn:hover { border-color: var(--key-text); color: var(--key-text); background: var(--key-soft); }
.consent-reset-msg { margin-top: .6rem; font-size: .88rem; color: var(--key-text); min-height: 1.2em; }

/* ===================== 14. RESPONSIVE ===================== */
@media (min-width: 540px) {
  .pipeline { max-width: 760px; grid-template-columns: 1fr 1fr; gap: 2rem 2.6rem; }
  .pipe-step:not(:last-child)::after { display: none; }
  .loupes { max-width: 520px; }
}
@media (min-width: 720px) {
  .stage-upload { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); }
  .stage-ready { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); align-items: start; }
  .steps { grid-template-columns: 1fr 1fr; column-gap: 2.5rem; }
}
@media (min-width: 960px) {
  .site-nav { display: flex; }
  .nav-toggle { display: none; }
  .mobile-nav { display: none !important; }
  .hero { grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr); }
  .pipeline { max-width: none; grid-template-columns: repeat(4, 1fr); gap: 3rem; }
  .pipe-step:not(:last-child)::after {
    display: block; left: auto; right: -2.15rem; top: 42%; bottom: auto;
    transform: rotate(-45deg); animation: nudgeRight 1.8s var(--ease-soft) infinite;
  }
  .scale-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 3rem; }
  .steps { grid-template-columns: repeat(4, 1fr); column-gap: 1.6rem; }
  .step { grid-template-columns: 1fr; border-bottom: 0; }
  .step-n { grid-row: auto; }

  .ed-body { grid-template-columns: 260px minmax(0, 1fr) 300px; }
  .ed-left { border-right: 1px solid #000; }
  .ed-right { border-left: 1px solid #000; }
}
@keyframes nudgeRight { 50% { transform: translateX(5px) rotate(-45deg); } }
@media (min-width: 1280px) {
  .ed-body { grid-template-columns: 290px minmax(0, 1fr) 330px; }
}

/* Editor en tabletas y moviles: los paneles se abren como cajones */
@media (max-width: 959.98px) {
  .editor { height: clamp(560px, 80vh, 820px); }
  .ed-panel {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 250; max-height: 72vh;
    border-radius: 18px 18px 0 0; box-shadow: 0 -20px 50px -10px rgba(0,0,0,.6);
    transform: translateY(105%); transition: transform .35s var(--ease-out); visibility: hidden;
  }
  .ed-panel.is-open { transform: none; visibility: visible; }
  .drawer-close { display: grid; }
  .drawer-toggles { display: flex; }
  .ed-top .seg { order: 3; width: 100%; justify-content: center; }
  .ed-top .seg-btn { flex: 1; }
  .zoom-presets button[data-zoom="0.25"], .zoom-presets button[data-zoom="4"] { display: none; }
  .misc-group .tool-btn span, .history-group .tool-btn span { display: none; }
  .scale-callout { right: 14px; max-width: none; }
}
@media (max-width: 539.98px) {
  .hub-link span { display: none; }
  .hub-link { padding: .5rem; }
  .ed-exports { width: 100%; }
  .ed-exports .btn { flex: 1; }
  .png-menu { flex: 1; display: flex; }
  .png-menu > .btn { flex: 1; }
  .zoom-read { display: none; }
  .rig-yoke { scale: .5; }
  /* En movil los cabezales quedan tras la cabecera: solo se ven los haces */
  .set-rig { top: 34px; }
  .set-rig-l { left: 10px; }
  .set-rig-r { right: 10px; }
  .section-kicker { font-size: .68rem; letter-spacing: .04em; }
  .consent-inner { flex-direction: column; align-items: stretch; }
  .consent-actions .btn { flex: 1; }
  .drop { min-height: 260px; }
}

/* ===================== 15. MOVIMIENTO REDUCIDO ===================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  /* Se congelan solo los efectos grandes y en bucle del plato y el flash;
     transiciones de botones y cambios de estado se mantienen. */
  .set-pool, .set-hit, .rig-yoke, .rig-beam, .set-dust, .set-flash, .rig-panel { animation: none !important; }
  .set-flash { opacity: 0; }
  .vf-pixels { animation: none; opacity: 0; }
  .vf-scan, .vf-focus, .scan-line, .proc-scan { animation: none; opacity: 0; }
  .frame-wire .wire { animation: none; fill-opacity: 1; stroke-width: 0; }
  .frame-edit .ex, .frame-edit .ex-shirt, .frame-edit .ex-hair, .detect-boxes .db { animation: none; }
  .detect-boxes .db { stroke-dashoffset: 0; }
  .pipe-step::after { animation: none !important; }
}
