:root {
  --wm-marco: rgba(255, 255, 255, 0.5);
  --wm-marco-sombra: rgba(0, 0, 0, 0.35);
  --demo-fondo: #041628;
  --demo-linea: rgba(255, 255, 255, 0.9);
  --demo-tag: rgba(4, 22, 40, 0.7);
  --tut-velo: rgba(4, 18, 36, 0.55);
  --tag-fondo: rgba(10, 20, 30, 0.6);
  --tag-tinta: #ffffff;
  --brand-sombra: rgba(0, 40, 90, 0.35);
  --switch-ranura-sombra: rgba(0, 0, 0, 0.25);
  --tinta-fuerte: #000000;
  --cerrar-fondo: linear-gradient(180deg, #f2a59a, #d9432f 55%, #c1301d);
  --cerrar-borde: #8f1f12;
  --cerrar-tinta: #ffffff;
}
:root[data-theme="dark"] { --tinta-fuerte: #ffffff; }

.wrap { padding: 16px var(--gutter) 64px; }
main { display: grid; gap: 16px; margin-top: 16px; }
main > .lang-hint { margin: 0; }
.top { padding: 10px 14px; }
.brand img { filter: drop-shadow(0 2px 4px var(--brand-sombra)); }
:root .lang-btn { font-size: 0.8rem; letter-spacing: 0.02em; }

.intro.ae-vidrio { padding: 18px 20px; }
.intro h1 { margin-bottom: 10px; font-size: clamp(1.6rem, 1rem + 2.6vw, 2.3rem); }
.lede { color: var(--ink); }

.texts, .trans, .how { margin-top: 0; }
.texts-head { margin-bottom: 12px; }
.texts-help { display: block; margin: 0 0 12px; color: var(--ink-3); font-size: 0.8rem; }
.foot { margin-top: 16px; }

.upload-row { margin: 0 0 8px; }
.panel-imgs { position: relative; }
:root .btn.clear-all {
  position: absolute;
  top: 8px;
  right: 12px;
  min-height: 0;
  height: 28px;
  padding: 0 12px;
  gap: 6px;
  font-size: 0.8rem;
}
.clear-all[hidden] { display: none; }
.upload-slot {
  background: var(--ae-paper);
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--ae-r-field);
  box-shadow: var(--ae-tarjeta-sombra);
}
.upload-slot.filled { border: 1px solid var(--line); }
.upload-slot:hover, .upload-slot.drag, .upload-slot.drop-target { border-color: var(--accent); }
.upload-slot.drop-target { background: var(--accent-soft); }
.slot-icon { background: var(--ae-paper); color: var(--ink-2); }
.slot-title { color: var(--ink); }
.move-btn, .slot-tools .remove-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--btn-terciario);
  border: 1px solid var(--btn-terciario-borde);
  color: var(--btn-terciario-tinta);
  box-shadow: var(--btn-terciario-sombra);
}
.slot-tools .remove-btn { color: var(--danger); }
.move-btn:hover:not(:disabled), .slot-tools .remove-btn:hover {
  filter: brightness(1.07);
  background: var(--btn-terciario);
  border-color: var(--btn-terciario-borde);
  color: var(--btn-terciario-tinta);
}
.slot-tools .remove-btn:hover { color: var(--danger); }
.move-btn:active:not(:disabled), .slot-tools .remove-btn:active { box-shadow: var(--btn-presionado); filter: brightness(0.88); }
.upload-slot.filled.movable { padding-right: 118px; }

.stage {
  background: var(--ae-paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--ae-r-field);
}
.panel-comp:has(.viewer.fs) {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.progress { background: var(--ae-paper); border: 1px solid var(--line-strong); height: 8px; }
.progress-fill { background: var(--ae-progress); }

:root .btn.ae-btn { font-size: 0.9rem; min-height: 36px; padding: 7px 16px; white-space: nowrap; }
:root .btn.icon.ae-btn { width: 34px; height: 34px; min-height: 0; padding: 0; border-radius: 50%; font-size: 1.1rem; }
:root .dur-ctrl .btn.icon.ae-btn { width: 30px; height: 30px; }
.btn.ae-accion:hover:not(:disabled) { border-color: var(--btn-accion-borde); }
.btn.ae-principal:hover:not(:disabled) { border-color: var(--btn-principal-borde); }
.btn.ae-secundario:hover:not(:disabled) { border-color: var(--btn-secundario-borde); }
.btn.ae-terciario:hover:not(:disabled) { border-color: var(--btn-terciario-borde); }
:root .donate-btn { font-size: 0.875rem; }
:root .donate-btn:hover { background: var(--btn-secundario); border-color: var(--btn-secundario-borde); }
.donate-btn svg { color: currentColor; }

.seg { display: inline-flex; flex-wrap: wrap; gap: 6px; border: 0; border-radius: 0; background: none; overflow: visible; }
.seg button {
  min-height: 32px;
  padding: 0 13px;
  border-radius: var(--ae-r-ctl);
  font-weight: 600;
  background: var(--btn-terciario);
  border: 1px solid var(--btn-terciario-borde);
  color: var(--btn-terciario-tinta);
  text-shadow: var(--btn-terciario-texto);
  box-shadow: var(--btn-terciario-sombra);
  transition: filter 0.12s, box-shadow 0.12s;
}
.seg button:last-child { border-right: 1px solid var(--btn-terciario-borde); }
.seg button:hover { filter: brightness(1.07); }
.seg button:active { box-shadow: var(--btn-presionado); filter: brightness(0.88); }
.seg button[aria-pressed="true"] {
  background: var(--btn-accion);
  border-color: var(--btn-accion-borde);
  color: var(--btn-accion-tinta);
  text-shadow: var(--btn-accion-texto);
  box-shadow: var(--btn-hundido);
  font-weight: 700;
}
.fs-bar .seg { background: none; border: 0; }
.fs-bar .seg button {
  color: var(--btn-terciario-tinta);
  border-right-color: var(--btn-terciario-borde);
}
.fs-bar .seg button[aria-pressed="true"] {
  background: var(--btn-accion);
  color: var(--btn-accion-tinta);
}

.dir-ico {
  border-radius: 10px;
  background: var(--btn-terciario);
  border: 1px solid var(--btn-terciario-borde);
  color: var(--btn-terciario-tinta);
  box-shadow: var(--btn-terciario-sombra);
}
.dir-cell:hover .dir-ico { border-color: var(--btn-terciario-borde); filter: brightness(1.07); }
.dir-cell input:checked + .dir-ico {
  background: var(--btn-accion);
  border-color: var(--btn-accion-borde);
  color: var(--btn-accion-tinta);
  box-shadow: var(--btn-hundido);
}
.dir-cell input:disabled + .dir-ico { opacity: 0.45; }

.switch { color: var(--ink-2); }
.switch-track {
  background: var(--slider-ranura);
  border: 1px solid var(--slider-ranura-borde);
  box-shadow: inset 0 1px 2px var(--switch-ranura-sombra);
}
.switch input:checked + .switch-track { background: var(--slider-lleno); }
.switch-thumb {
  top: 1px;
  left: 1px;
  background: var(--slider-bolita);
  border: 1px solid var(--slider-bolita-borde);
}

.bubble {
  background: var(--ae-franjas), var(--ae-glass);
  border: 1px solid var(--line);
  border-radius: var(--ae-r-field);
  box-shadow: var(--ae-shadow), 0 0 0 1px var(--ae-edge) inset;
  -webkit-backdrop-filter: blur(var(--ae-blur)) saturate(160%);
  backdrop-filter: blur(var(--ae-blur)) saturate(160%);
}
.bubble::before {
  background: var(--ae-glass);
  -webkit-backdrop-filter: blur(var(--ae-blur)) saturate(160%);
  backdrop-filter: blur(var(--ae-blur)) saturate(160%);
}
@media (prefers-reduced-transparency: reduce) {
  .bubble, .bubble::before { background: var(--ae-solido); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
.video-summary { color: var(--ink-2); }

.editbar {
  background: var(--ae-paper);
  border: 1px solid var(--line);
  border-radius: var(--ae-r-field);
  box-shadow: var(--ae-tarjeta-sombra);
}
:root .dur-ctrl input { min-height: 30px; padding: 4px; }
:root .text-field input[type="text"] { min-height: 38px; }
.text-field label { color: var(--ink); }

.how-list { list-style: none; padding: 0; gap: 10px; }
.how-list li { display: flex; align-items: center; gap: 12px; color: var(--ink-2); }

.toolbar .export-group { flex-basis: 100%; }

.top { position: relative; z-index: 20; }
.install-wrap { position: relative; display: inline-flex; }
.install-wrap[hidden] { display: none; }
:root {
  --globo-fondo: linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(205, 238, 255, 0.7));
  --globo-borde: rgba(255, 255, 255, 0.9);
  --globo-tinta: #0b2a45;
  --globo-tinta-2: #2c4e6c;
  --globo-brillo: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0));
  --globo-sombra: 0 14px 30px -8px rgba(0, 50, 100, 0.4), 0 0 0 1px rgba(120, 200, 255, 0.5) inset, inset 0 -8px 18px rgba(120, 220, 255, 0.35), 0 0 24px rgba(255, 255, 255, 0.6);
}
:root[data-theme="dark"] {
  --globo-fondo: linear-gradient(160deg, rgba(30, 95, 140, 0.8), rgba(6, 30, 50, 0.85));
  --globo-borde: rgba(150, 225, 255, 0.6);
  --globo-tinta: #eaf6ff;
  --globo-tinta-2: #b9d8ee;
  --globo-brillo: linear-gradient(180deg, rgba(160, 225, 255, 0.28), rgba(160, 225, 255, 0));
  --globo-sombra: 0 14px 30px -8px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(150, 220, 255, 0.15) inset, inset 0 -8px 18px rgba(60, 180, 255, 0.25), 0 0 22px rgba(60, 180, 255, 0.35);
}
.aero-globo {
  position: absolute;
  z-index: 40;
  width: min(300px, calc(100vw - 32px));
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 34px 12px 12px;
  background: var(--globo-fondo);
  border: 1px solid var(--globo-borde);
  border-radius: 14px;
  box-shadow: var(--globo-sombra);
  color: var(--globo-tinta);
  font-size: 0.875rem;
  line-height: 1.4;
  text-align: left;
  transform-origin: calc(100% - var(--cola, 59px) - 9px) -12px;
  animation: globo-entra 0.45s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.aero-globo[hidden] { display: none; }
.aero-globo::before {
  content: "";
  position: absolute;
  inset: 1px 1px 50%;
  border-radius: 13px 13px 40% 40% / 13px 13px 12px 12px;
  background: var(--globo-brillo);
  pointer-events: none;
}
.aero-globo::after {
  content: "";
  position: absolute;
  top: -9px;
  right: var(--cola, 59px);
  width: 16px;
  height: 16px;
  background: var(--globo-fondo);
  border: 1px solid var(--globo-borde);
  border-right: 0;
  border-bottom: 0;
  border-radius: 4px 0 0 0;
  transform: rotate(45deg);
}
.aero-globo {
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  border-radius: 22px;
}
.aero-globo::after {
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.aero-globo .ae-tile { position: relative; width: 36px; height: 36px; border-radius: 9px; }
.aero-globo-txt { position: relative; display: grid; gap: 2px; }
.aero-globo-txt strong { font-size: 0.95rem; }
.aero-globo-txt span { color: var(--globo-tinta-2); }
.aero-globo-x {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 6px;
  background: none;
  color: var(--globo-tinta-2);
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
}
.aero-globo-x:hover { background: var(--cerrar-fondo); border-color: var(--cerrar-borde); color: var(--cerrar-tinta); }
.aero-globo.saliendo { animation: globo-sale 0.3s ease-in both; }
@keyframes globo-entra {
  from { opacity: 0; transform: translateY(-8px) scale(0.85); }
  to { opacity: 1; transform: none; }
}
@keyframes globo-sale {
  from { opacity: 1; transform: none; }
  to { opacity: 0; transform: translateY(-6px) scale(0.95); }
}
@media (prefers-reduced-motion: reduce) {
  .aero-globo, .aero-globo.saliendo { animation: none; }
}
.bubble { --ink: var(--tinta-fuerte); --ink-2: var(--tinta-fuerte); --ink-3: var(--tinta-fuerte); color: var(--tinta-fuerte); }
:is(.group-label, .texts-help, .edit-help, .field-note, .switch, .adv .check):not(.fs-bar *) { color: var(--tinta-fuerte); }
:root { --ae-wall: url("fondos/aero_2.webp"); }
:root[data-theme="dark"] { --ae-wall: url("fondos/vista_gris.webp"); }
.legal.ae-panel { padding: var(--ae-pad) calc(var(--ae-pad) + 4px); }
.legal h2:first-child { margin-top: 0; }
.legal p { color: var(--ink); }
.vh {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:root .back-btn {
  flex: none;
  width: 40px;
  height: 40px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
}
.back-btn svg { position: relative; }
@media (min-width: 1100px) {
  :root .top .back-btn {
    position: absolute;
    top: 50%;
    right: calc(100% + 14px);
    transform: translateY(-50%);
  }
}
.stage.ready[data-cur="pointer"]:not(.editing) { cursor: pointer; }
.stage[data-kind="blink"] .handle { opacity: 0; }
.stage[data-kind="blink"] .handle:focus-visible { opacity: 1; }
.blink-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 4;
  display: none;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--tag-fondo);
  color: var(--tag-tinta);
  font-size: 0.8rem;
  font-weight: 600;
  pointer-events: none;
}
.stage.ready[data-kind="blink"]:not(.editing) .blink-tag { display: block; }
.dl-kind { display: flex; margin: 2px 2px 8px; }
.dl-kind button { flex: 1; }
:root .tut-btn {
  position: fixed;
  right: 14px;
  bottom: 60px;
  z-index: var(--z-engrane);
  width: 36px;
  height: 36px;
}
.tut-tag {
  position: fixed;
  right: 6px;
  bottom: 104px;
  z-index: var(--z-engrane);
  padding: 2px 9px;
  border: 1px solid var(--globo-borde);
  border-radius: 999px;
  background: var(--globo-fondo);
  box-shadow: var(--globo-sombra);
  color: var(--globo-tinta);
  font-size: 0.75rem;
  font-weight: 700;
  pointer-events: none;
  animation: globo-entra 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.tut-tag[hidden] { display: none; }
.tut { position: fixed; inset: 0; z-index: 1000; }
.tut[hidden] { display: none; }
.tut-spot {
  position: fixed;
  border-radius: 14px;
  box-shadow: 0 0 0 200vmax var(--tut-velo), 0 0 0 3px var(--accent), 0 0 22px 4px var(--accent);
  pointer-events: none;
  transition: left 0.25s, top 0.25s, width 0.25s, height 0.25s;
}
.tut-spot.vacio { box-shadow: 0 0 0 200vmax var(--tut-velo); }
.tut-card {
  position: fixed;
  width: min(360px, calc(100vw - 32px));
  padding: 16px 18px 14px;
  border: 1px solid var(--globo-borde);
  border-radius: 18px;
  background: var(--ae-franjas), var(--ae-glass);
  box-shadow: var(--globo-sombra);
  color: var(--globo-tinta);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
  transition: left 0.25s, top 0.25s;
}
.tut-x { top: 8px; right: 8px; }
.tut-paso { margin: 0 0 2px; color: var(--globo-tinta-2); font-size: 0.75rem; font-weight: 600; }
.tut-titulo { margin: 0 0 6px; font: 700 1.1rem/1.2 var(--font-display); }
.tut-texto { margin: 0 0 14px; font-size: 0.92rem; line-height: 1.45; }
.tut-nav { display: flex; justify-content: flex-end; gap: 8px; }
@media (prefers-reduced-motion: reduce) {
  .tut-spot, .tut-card { transition: none; }
  .tut-tag { animation: none; }
}
.tut-demo {
  --p: 50%;
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  border-radius: inherit;
  background: var(--demo-fondo);
}
.tut-demo[hidden] { display: none; }
.tut-demo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tut-demo-b { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--p)); }
.tut-demo-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--p);
  width: 2px;
  margin-left: -1px;
  background: var(--demo-linea);
}
.tut-demo-knob {
  position: absolute;
  top: 50%;
  left: var(--p);
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--btn-accion);
  border: 1px solid var(--btn-accion-borde);
  box-shadow: var(--btn-accion-sombra);
  color: var(--btn-accion-tinta);
}
.tut-demo-knob svg { width: 22px; height: 22px; stroke: currentColor; }
.tut-demo-tag {
  position: absolute;
  bottom: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--demo-tag);
  color: var(--tag-tinta);
  font-size: 0.85rem;
  font-weight: 600;
}
.tut-demo-tag.izq { left: 14px; }
.tut-demo-tag.der { right: 14px; }
.tut-card::before {
  content: "";
  position: absolute;
  inset: 1px 1px 55%;
  border-radius: 17px 17px 40% 40% / 17px 17px 14px 14px;
  background: var(--globo-brillo);
  pointer-events: none;
}
.tut-card > :not(.tut-x) { position: relative; }
.wm-box {
  position: absolute;
  z-index: 5;
  transform: translate(-50%, -50%);
  cursor: grab;
  touch-action: none;
  user-select: none;
}
.wm-box[hidden], .stage.editing .wm-box, .stage:not(.ready) .wm-box { display: none; }
.wm-box img { display: block; width: 100%; height: auto; pointer-events: none; }
.wm-box.moviendo { cursor: grabbing; }
.wm-box:focus { outline: none; }
.wm-box.sel { outline: 2px dashed var(--wm-marco); outline-offset: 0; box-shadow: 0 0 0 1px var(--wm-marco-sombra); }
.wm-box:focus-visible { outline: 3px solid var(--focus); }
.wm-x {
  position: absolute;
  top: 4px;
  right: 4px;
  display: none;
  width: 26px;
  height: 26px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--cerrar-borde);
  border-radius: 50%;
  background: var(--cerrar-fondo);
  color: var(--cerrar-tinta);
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.wm-box.sel .wm-x { display: grid; }
.stage-area { position: relative; }
.wm-pop {
  position: absolute;
  z-index: 25;
  display: grid;
  gap: 6px;
  width: min(290px, calc(100% - 8px));
  padding: 8px 12px 10px;
  border: 1px solid var(--globo-borde);
  border-radius: 14px;
  background: var(--ae-franjas), var(--ae-glass);
  box-shadow: var(--globo-sombra);
  -webkit-backdrop-filter: blur(14px) saturate(180%);
  backdrop-filter: blur(14px) saturate(180%);
}
.wm-pop:has(.wm-bar-toggle[aria-expanded="false"]) { width: auto; }
.wm-pop::after {
  content: "";
  position: absolute;
  bottom: -8px;
  left: var(--cola, 50%);
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: var(--ae-glass);
  border: 1px solid var(--globo-borde);
  border-top: 0;
  border-left: 0;
  transform: rotate(45deg);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}
.wm-pop.abajo::after { top: -8px; bottom: auto; transform: rotate(225deg); }
.wm-pop[hidden], .wm-bar-body[hidden] { display: none; }
.wm-bar-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 4px;
  border: 0;
  background: none;
  color: var(--tinta-fuerte);
  font: 600 0.9rem/1.2 var(--font-display);
  cursor: pointer;
}
.wm-bar-toggle[aria-expanded="false"] .wm-chev { transform: rotate(-90deg); }
.wm-bar-body { display: grid; gap: 6px; }
.wm-campo { display: grid; grid-template-columns: 72px 1fr auto auto; align-items: center; gap: 8px; color: var(--tinta-fuerte); font-size: 0.85rem; font-weight: 600; }
.wm-campo input[type="range"] { width: 100%; min-width: 70px; }
:root .wm-campo input[type="number"] { width: 58px; min-height: 30px; padding: 2px 6px; }
.wm-pct { margin-left: -4px; }
.wm-pop.dentro::after { display: none; }
