/* Webmusica Maquetador — hoja de estilos de la app.
   Extraida de index.html para poder reutilizarla en preview.php
   (la revision interna usa exactamente el mismo lenguaje visual). */

  :root, [data-theme="dark"] {
    --bg-0: #0a0a0b;
    --bg-1: #121214;
    --bg-2: #18181b;
    --bg-3: #1f1f23;
    --bg-4: #27272c;
    --border: #2a2a30;
    --border-strong: #3a3a42;
    --text-0: #f5f5f7;
    --text-1: #c8c8d0;
    --text-2: #8a8a94;
    --text-3: #5a5a64;
    --accent: #ff6b1a;
    --accent-hover: #ff7d33;
    --accent-dim: #ff6b1a22;
    --accent-glow: #ff6b1a40;
    --accent-2: #ffb800;
    --success: #4ade80;
    --danger: #ef4444;
    --wire-line: #3a3a42;
    --wire-fill: #1c1c20;
    --wire-label: #6a6a74;
    --canvas-glow-1: #18181b;
    --canvas-glow-2: #1a1410;
    --viewport-shadow: 0 40px 80px rgba(0,0,0,.4);
    --boot-veil: rgba(10, 10, 11, .72);
  }
  [data-theme="light"] {
    --bg-0: #f7f7f5;
    --bg-1: #ffffff;
    --bg-2: #f2f2ef;
    --bg-3: #e8e8e4;
    --bg-4: #d8d8d2;
    --border: #e2e2de;
    --border-strong: #c8c8c2;
    --text-0: #0f0f12;
    --text-1: #2a2a30;
    --text-2: #585860;
    --text-3: #8a8a94;
    --accent: #ff6b1a;
    --accent-hover: #e85a0c;
    --accent-dim: #ff6b1a18;
    --accent-glow: #ff6b1a30;
    --accent-2: #ffb800;
    --success: #16a34a;
    --danger: #dc2626;
    --wire-line: #c8c8c2;
    --wire-fill: #f5f5f1;
    --wire-label: #9a9a94;
    --canvas-glow-1: #ececdf;
    --canvas-glow-2: #f1e4d6;
    --viewport-shadow: 0 20px 50px rgba(60,50,40,.12);
    --boot-veil: rgba(247, 247, 245, .75);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }
  html, body { height: 100%; overflow: hidden; }
  @keyframes spin { to { transform: rotate(360deg); } }
  .spinner {
    width: 20px; height: 20px; border-radius: 50%;
    border: 2.5px solid rgba(0,0,0,.2);
    border-top-color: #000;
    animation: spin .7s linear infinite;
  }
  body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-0);
    color: var(--text-0);
    font-size: 13px;
    -webkit-font-smoothing: antialiased;
    line-height: 1.4;
  }

  button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
  input, textarea, select { font-family: inherit; }

  /* === TOP BAR === */
  .topbar {
    height: 52px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 16px;
    z-index: 100;
    position: relative;
  }
  .brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; font-size: 14px; letter-spacing: -0.01em;
  }
  .brand-mark {
    width: 38px; height: 38px;
    display: grid; place-items: center;
    position: relative;
    flex-shrink: 0;
  }
  .brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 8px var(--accent-glow));
  }
  .brand-mark svg { display: block; }
  .brand-text {
    display: flex; flex-direction: column; line-height: 1;
  }
  .brand-text .bt-1 { font-weight: 800; font-size: 14px; letter-spacing: -0.02em; color: var(--text-0); }
  .brand-text .bt-2 { font-size: 9px; color: var(--accent); letter-spacing: 0.14em; text-transform: uppercase; margin-top: 3px; font-weight: 600; }
  .brand-sep { width: 1px; height: 18px; background: var(--border-strong); }
  .brand-sub { color: var(--text-2); font-weight: 500; font-size: 12px; }

  .topbar-center {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 4px;
  }
  .step-pill {
    display: flex; align-items: center; gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    color: var(--text-2);
    font-size: 12px; font-weight: 500;
    transition: all .15s;
  }
  .step-pill.active {
    background: var(--bg-3);
    color: var(--text-0);
  }
  .step-pill .num {
    width: 18px; height: 18px; border-radius: 50%;
    background: var(--bg-4); color: var(--text-2);
    display: grid; place-items: center;
    font-size: 11px; font-weight: 600;
  }
  .step-pill.active .num { background: var(--accent); color: #000; }
  .step-pill.done .num { background: var(--success); color: #000; }
  .step-arrow { color: var(--text-3); font-size: 10px; }

  .topbar-right {
    display: flex; align-items: center; gap: 8px;
  }
  .theme-toggle {
    display: flex;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 3px;
    gap: 2px;
  }
  .theme-toggle button {
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 11px;
    color: var(--text-2);
    display: flex; align-items: center; gap: 5px;
    transition: all .15s;
  }
  .theme-toggle button.active {
    background: var(--bg-4);
    color: var(--text-0);
  }
  [data-theme="light"] .theme-toggle button.active { background: #fff; color: #000; box-shadow: 0 1px 3px rgba(0,0,0,.1); }
  .accent-picker {
    display: flex;
    gap: 4px;
    padding: 4px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
  }
  .accent-dot {
    width: 18px; height: 18px; border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .15s;
  }
  .accent-dot.active { border-color: var(--text-0); transform: scale(1.1); }

  .btn {
    padding: 7px 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
    border: 1px solid transparent;
    white-space: nowrap;
  }
  .btn-ghost { color: var(--text-1); }
  .btn-ghost:hover { background: var(--bg-3); color: var(--text-0); }
  .btn-secondary { background: var(--bg-3); color: var(--text-0); border-color: var(--border); }
  .btn-secondary:hover { background: var(--bg-4); border-color: var(--border-strong); }
  .btn-primary {
    background: var(--accent); color: #000;
    font-weight: 600;
  }
  .btn-primary:hover { background: var(--accent-hover); }
  .btn-icon {
    width: 32px; height: 32px;
    display: grid; place-items: center;
    border-radius: 7px;
    color: var(--text-2);
  }
  .btn-icon:hover { background: var(--bg-3); color: var(--text-0); }

  /* === LAYOUT === */
  .app {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    height: calc(100vh - 52px);
  }

  /* === LEFT: BLOCK LIBRARY === */
  .sidebar-left {
    background: var(--bg-1);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .sidebar-header {
    padding: 16px 16px 12px;
    border-bottom: 1px solid var(--border);
  }
  .sidebar-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-2);
    font-weight: 600;
    margin-bottom: 10px;
  }
  .search-box {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    display: flex; align-items: center; gap: 8px;
    transition: border-color .15s;
  }
  .search-box:focus-within { border-color: var(--accent); }
  .search-box input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: var(--text-0);
    font-size: 12px;
  }
  .search-box input::placeholder { color: var(--text-3); }

  .block-library {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
  }
  .block-group {
    margin-bottom: 16px;
  }
  .block-group-title {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-3);
    font-weight: 600;
    padding: 4px 6px 8px;
  }
  .block-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 9px;
    padding: 10px;
    margin-bottom: 6px;
    cursor: grab;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: all .15s;
    user-select: none;
  }
  .block-card:hover {
    border-color: var(--accent);
    background: var(--bg-3);
    transform: translateX(2px);
  }
  .block-card:active { cursor: grabbing; }
  .block-card.dragging { opacity: 0.4; }
  .block-card-icon {
    width: 32px; height: 32px;
    background: var(--bg-3);
    border-radius: 6px;
    display: grid; place-items: center;
    color: var(--accent);
    flex-shrink: 0;
  }
  .block-card-body { flex: 1; min-width: 0; }
  .block-card-name { font-size: 12px; font-weight: 500; color: var(--text-0); }
  .block-card-desc { font-size: 10.5px; color: var(--text-3); margin-top: 1px; }
  .block-card-drag {
    color: var(--text-3);
    opacity: 0;
    transition: opacity .15s;
  }
  .block-card:hover .block-card-drag { opacity: 1; }

  .open-library-btn {
    margin: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    background: var(--bg-3);
    border: 1px dashed var(--border-strong);
    color: var(--text-1);
    font-size: 12px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all .15s;
  }
  .open-library-btn:hover { border-color: var(--accent); color: var(--accent); }

  /* === CENTER: CANVAS === */
  .canvas-area {
    background: var(--bg-0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
  }
  .canvas-toolbar {
    height: 48px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 16px;
    gap: 12px;
  }
  .device-toggle {
    display: flex;
    background: var(--bg-2);
    border-radius: 8px;
    padding: 3px;
    gap: 2px;
  }
  .device-toggle button {
    padding: 5px 10px;
    border-radius: 6px;
    font-size: 11px;
    color: var(--text-2);
    display: flex; align-items: center; gap: 6px;
    transition: all .15s;
  }
  .device-toggle button.active {
    background: var(--bg-4);
    color: var(--text-0);
  }

  .canvas-info {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-2);
    font-size: 11px;
    font-family: 'JetBrains Mono', monospace;
  }
  .status-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 6px var(--success);
  }

  .canvas-scroll {
    flex: 1;
    overflow: auto;
    padding: 32px;
    display: flex;
    justify-content: center;
    background:
      radial-gradient(circle at 20% 10%, var(--canvas-glow-1) 0%, transparent 50%),
      radial-gradient(circle at 80% 90%, var(--canvas-glow-2) 0%, transparent 50%),
      var(--bg-0);
    background-attachment: local;
  }
  .canvas-scroll::-webkit-scrollbar { width: 10px; height: 10px; }
  .canvas-scroll::-webkit-scrollbar-track { background: transparent; }
  .canvas-scroll::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; }
  .canvas-scroll::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

  .viewport {
    background: var(--bg-1);
    border-radius: 12px;
    box-shadow: var(--viewport-shadow), 0 0 0 1px var(--border);
    overflow: hidden;
    transition: width .3s cubic-bezier(.4,0,.2,1);
    position: relative;
    min-height: 500px;
    height: fit-content;
    margin-bottom: 40px;
  }
  .viewport.desktop { width: 100%; max-width: 1200px; }
  .viewport.tablet { width: 780px; }
  .viewport.mobile { width: 390px; }

  .viewport-bar {
    height: 28px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-3);
  }
  .viewport-dots { display: flex; gap: 5px; }
  .viewport-dots span {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--bg-4);
  }

  .canvas-blocks {
    min-height: 400px;
    position: relative;
  }
  .canvas-empty {
    padding: 80px 40px;
    text-align: center;
    color: var(--text-2);
    transition: background .18s, color .18s;
    border-radius: 12px;
  }
  .canvas-empty.drop-hover {
    background: var(--accent-dim);
    color: var(--text-0);
  }
  .canvas-empty.drop-hover .canvas-empty-mark {
    border-color: var(--accent);
    color: var(--accent);
    transform: scale(1.08);
  }
  .canvas-empty-mark { transition: transform .18s, border-color .18s, color .18s; }
  .canvas-empty-mark {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border: 2px dashed var(--border-strong);
    border-radius: 12px;
    display: grid; place-items: center;
    color: var(--text-3);
  }
  .canvas-empty h3 {
    font-size: 16px;
    color: var(--text-0);
    margin-bottom: 6px;
    font-weight: 600;
  }
  .canvas-empty p {
    font-size: 12px;
    max-width: 320px;
    margin: 0 auto 20px;
  }

  /* === BLOCKS (wireframe style) === */
  .block {
    position: relative;
    transition: outline-color .15s;
    outline: 2px solid transparent;
    outline-offset: -2px;
  }
  .block:hover { outline-color: var(--accent-dim); }
  .block.selected { outline-color: var(--accent); }
  .block-controls {
    position: absolute;
    top: 8px;
    right: 8px;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity .15s;
    z-index: 10;
  }
  .block:hover .block-controls, .block.selected .block-controls { opacity: 1; }
  .block-ctl {
    width: 26px; height: 26px;
    border-radius: 6px;
    background: rgba(10,10,11,.9);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-strong);
    color: var(--text-1);
    display: grid; place-items: center;
    font-size: 11px;
    transition: all .15s;
  }
  .block-ctl:hover { background: var(--accent); color: #000; border-color: var(--accent); }
  .block-ctl.danger:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

  .block-label {
    position: absolute;
    top: 8px; left: 8px;
    padding: 3px 7px;
    background: rgba(10,10,11,.85);
    backdrop-filter: blur(8px);
    border-radius: 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: var(--accent);
    opacity: 0;
    transition: opacity .15s;
    z-index: 5;
    border: 1px solid var(--border);
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .block:hover .block-label, .block.selected .block-label { opacity: 1; }
  [data-theme="light"] .block-ctl {
    background: rgba(255,255,255,.92);
    color: var(--text-0);
  }
  [data-theme="light"] .block-label {
    background: rgba(255,255,255,.88);
  }

  .block-insert {
    height: 12px;
    position: relative;
    transition: height .2s;
  }
  .block-insert:hover { height: 40px; }
  .block-insert-line {
    position: absolute;
    top: 50%; left: 20%; right: 20%;
    height: 1px;
    background: var(--border);
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity .2s;
  }
  .block-insert:hover .block-insert-line { opacity: 1; background: var(--accent); }
  .block-insert-btn {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 28px; height: 28px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    display: grid; place-items: center;
    font-size: 16px; font-weight: 600;
    opacity: 0;
    transition: all .2s;
    box-shadow: 0 4px 16px var(--accent-glow);
  }
  .block-insert:hover .block-insert-btn { opacity: 1; transform: translate(-50%, -50%) scale(1); }

  .drop-indicator {
    height: 3px;
    background: var(--accent);
    border-radius: 2px;
    margin: 0 20px;
    box-shadow: 0 0 12px var(--accent-glow);
    display: none;
  }
  .drop-indicator.active { display: block; }

  /* === RIGHT: INSPECTOR === */
  .sidebar-right {
    background: var(--bg-1);
    border-left: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .inspector-tabs {
    display: flex;
    border-bottom: 1px solid var(--border);
    background: var(--bg-2);
  }
  .inspector-tab {
    flex: 1;
    padding: 12px;
    font-size: 11px;
    font-weight: 500;
    color: var(--text-2);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid transparent;
    transition: all .15s;
  }
  .inspector-tab.active {
    color: var(--text-0);
    border-bottom-color: var(--accent);
  }
  .inspector-tab:hover { color: var(--text-0); }

  .inspector-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
  }
  .inspector-empty {
    padding: 40px 20px;
    text-align: center;
    color: var(--text-3);
    font-size: 12px;
  }
  .inspector-empty-icon {
    width: 40px; height: 40px;
    margin: 0 auto 12px;
    border: 1.5px dashed var(--border-strong);
    border-radius: 8px;
    display: grid; place-items: center;
    color: var(--text-3);
  }

  .field {
    margin-bottom: 14px;
  }
  .field-label {
    font-size: 11px;
    color: var(--text-2);
    font-weight: 500;
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }
  .field input, .field textarea, .field select {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 7px;
    padding: 8px 10px;
    color: var(--text-0);
    font-size: 12px;
    outline: none;
    transition: border-color .15s;
  }
  .field input:focus, .field textarea:focus, .field select:focus {
    border-color: var(--accent);
  }
  .field textarea { resize: vertical; min-height: 60px; font-family: inherit; }

  .variant-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .variant-option {
    background: var(--bg-2);
    border: 1.5px solid var(--border);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all .15s;
    text-align: center;
  }
  .variant-option:hover { border-color: var(--text-3); }
  .variant-option.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
  }
  .variant-preview {
    height: 50px;
    background: var(--bg-3);
    border-radius: 5px;
    margin-bottom: 6px;
    position: relative;
    overflow: hidden;
  }
  .variant-name {
    font-size: 10px;
    color: var(--text-1);
    font-weight: 500;
  }

  .color-row {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
  }
  .color-swatch {
    aspect-ratio: 1;
    border-radius: 6px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all .15s;
  }
  .color-swatch.selected {
    border-color: var(--text-0);
    transform: scale(1.1);
  }

  .image-drop {
    background: var(--bg-2);
    border: 1.5px dashed var(--border-strong);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
    color: var(--text-2);
  }
  .image-drop:hover { border-color: var(--accent); color: var(--accent); }
  .image-drop.has-image {
    padding: 0;
    border-style: solid;
    overflow: hidden;
  }
  .image-drop img { width: 100%; display: block; }

  /* === OUTLINE PANEL === */
  .outline-item {
    padding: 8px 10px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 7px;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all .15s;
    font-size: 12px;
  }
  .outline-item:hover { border-color: var(--border-strong); }
  .outline-item.active {
    border-color: var(--accent);
    background: var(--accent-dim);
  }
  .outline-item-num {
    width: 20px; height: 20px;
    background: var(--bg-3);
    border-radius: 5px;
    display: grid; place-items: center;
    font-size: 10px;
    color: var(--text-2);
    font-family: 'JetBrains Mono', monospace;
    flex-shrink: 0;
  }
  .outline-item.active .outline-item-num { background: var(--accent); color: #000; }
  .outline-item-name { flex: 1; color: var(--text-1); }
  .outline-item.active .outline-item-name { color: var(--text-0); }

  /* === MODAL === */
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.7);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: grid;
    place-items: center;
    padding: 40px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s;
  }
  .modal-backdrop.open { opacity: 1; pointer-events: auto; }
  .modal {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 16px;
    width: 100%;
    max-width: 960px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(.96);
    transition: transform .2s;
    box-shadow: 0 40px 100px rgba(0,0,0,.6);
  }
  .modal-backdrop.open .modal { transform: scale(1); }
  .modal-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .modal-title { font-size: 16px; font-weight: 600; }
  .modal-body { flex: 1; overflow-y: auto; padding: 24px; }
  .modal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
  .modal-block-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    cursor: pointer;
    transition: all .15s;
  }
  .modal-block-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0,0,0,.3);
  }
  .modal-block-preview {
    background: #0a0a0b;
    border-radius: 6px;
    height: 100px;
    margin-bottom: 10px;
    position: relative;
    overflow: hidden;
    border: 1px solid var(--border);
  }
  .modal-block-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 2px;
  }
  .modal-block-desc {
    font-size: 10.5px;
    color: var(--text-3);
  }

  /* === BRIEF SCREEN === */
  .screen { display: none; height: calc(100vh - 52px); overflow-y: auto; overflow-x: hidden; }
  .screen.active { display: block; }
  .screen::-webkit-scrollbar { width: 10px; height: 10px; }
  .screen::-webkit-scrollbar-track { background: transparent; }
  .screen::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; }
  .screen::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

  /* === Scroll-to-top FAB (Brief + Export) === */
  .scroll-top-btn {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 46px; height: 46px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    border: 1px solid rgba(255,255,255,.15);
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 10px 28px var(--accent-glow), 0 2px 8px rgba(0,0,0,.25);
    transition: transform .2s cubic-bezier(.4,0,.2,1), background .15s, box-shadow .2s;
    z-index: 1500;
    animation: scroll-top-in .28s cubic-bezier(.34,1.56,.64,1);
  }
  [data-theme="light"] .scroll-top-btn {
    border-color: rgba(0,0,0,.08);
    box-shadow: 0 10px 24px var(--accent-glow), 0 2px 8px rgba(60,50,40,.15);
  }
  @keyframes scroll-top-in {
    from { opacity: 0; transform: translateY(18px) scale(.8); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
  }
  .scroll-top-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-3px);
    box-shadow: 0 14px 34px var(--accent-glow), 0 4px 12px rgba(0,0,0,.3);
  }
  .scroll-top-btn:active { transform: translateY(-1px) scale(.96); }
  .brief-wrap {
    max-width: 720px;
    margin: 0 auto;
    padding: 60px 40px;
  }
  .brief-wrap h1 {
    font-size: 32px;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
  }
  .brief-wrap .subtitle {
    color: var(--text-2);
    margin-bottom: 40px;
    font-size: 14px;
  }
  .form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .form-grid .full { grid-column: 1 / -1; }
  .big-field {
    margin-bottom: 18px;
  }
  .big-field label {
    display: block;
    font-size: 12px;
    color: var(--text-1);
    font-weight: 500;
    margin-bottom: 8px;
  }
  .big-field label .req { color: var(--accent); }
  .big-field input, .big-field textarea, .big-field select {
    width: 100%;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px 14px;
    color: var(--text-0);
    font-size: 13px;
    outline: none;
    transition: all .15s;
  }
  .big-field input:focus, .big-field textarea:focus, .big-field select:focus {
    border-color: var(--accent);
    background: var(--bg-3);
  }
  .big-field.has-error label { color: var(--danger); }
  .big-field.has-error input,
  .big-field.has-error textarea,
  .big-field.has-error select {
    border-color: var(--danger);
    background: rgba(239,68,68,0.06);
  }
  [data-theme="light"] .big-field.has-error input,
  [data-theme="light"] .big-field.has-error textarea,
  [data-theme="light"] .big-field.has-error select {
    background: rgba(220,38,38,0.05);
  }
  .big-field.has-error input:focus,
  .big-field.has-error textarea:focus,
  .big-field.has-error select:focus {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239,68,68,0.12);
  }
  .big-field .error-msg {
    display: block;
    font-size: 11px;
    color: var(--danger);
    margin-top: 6px;
    font-weight: 500;
  }

  /* === Checkbox términos y condiciones === */
  .terms-check {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: var(--bg-2);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: all .15s;
    font-size: 12.5px;
    color: var(--text-1);
    line-height: 1.55;
    font-weight: 400 !important;
    margin-bottom: 0 !important;
  }
  .terms-check:hover { border-color: var(--text-3); }
  .terms-check.has-error {
    border-color: var(--danger);
    background: rgba(239,68,68,0.06);
  }
  [data-theme="light"] .terms-check.has-error { background: rgba(220,38,38,0.05); }
  .terms-check input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px; height: 20px;
    border: 1.5px solid var(--border-strong);
    border-radius: 5px;
    background: var(--bg-1);
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
    display: grid;
    place-items: center;
    transition: all .15s;
  }
  .terms-check input[type="checkbox"]:hover { border-color: var(--accent); }
  .terms-check input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px var(--accent-glow);
  }
  .terms-check input[type="checkbox"]:checked {
    background-color: var(--accent);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M2 6l3 3 5-6'/%3E%3C/svg%3E");
    background-size: 72%;
    background-position: center;
    background-repeat: no-repeat;
    border-color: var(--accent);
  }
  .terms-check .terms-text { flex: 1; }
  .terms-check a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
    font-weight: 500;
  }
  .terms-check a:hover { color: var(--accent-hover); }
  .terms-check.has-error .terms-text { color: var(--text-0); }
  .terms-check.has-error + .error-msg { margin-top: 8px; }
  .urgency-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
  }
  .urgency-opt {
    background: var(--bg-2);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    padding: 14px 10px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
  }
  .urgency-opt:hover { border-color: var(--text-3); }
  .urgency-opt.selected {
    border-color: var(--accent);
    background: var(--accent-dim);
  }
  .urgency-opt-emoji { font-size: 18px; margin-bottom: 4px; }
  .urgency-opt-label { font-size: 11px; font-weight: 500; }
  .urgency-opt-sub { font-size: 10px; color: var(--text-3); margin-top: 2px; }

  /* === EXPORT SCREEN === */
  .export-wrap {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 40px;
  }
  .export-hero {
    text-align: center;
    padding: 40px 20px;
    background: linear-gradient(135deg, var(--bg-2), var(--bg-1));
    border: 1px solid var(--border);
    border-radius: 16px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
  }
  .export-hero::before {
    content: '';
    position: absolute;
    top: -50%; left: 50%;
    width: 300px; height: 300px;
    background: radial-gradient(circle, var(--accent-glow), transparent 70%);
    transform: translateX(-50%);
    pointer-events: none;
  }
  .check-mark {
    width: 88px; height: 88px;
    margin: 0 auto 16px;
    display: grid; place-items: center;
    position: relative;
    z-index: 1;
  }
  .check-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 24px var(--accent-glow)) drop-shadow(0 8px 20px rgba(0,0,0,0.25));
  }
  .export-hero h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; position: relative; }
  .export-hero p { color: var(--text-2); position: relative; }

  .export-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 24px;
  }
  .export-action {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all .15s;
    text-align: left;
  }
  .export-action:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
  }
  .export-action-icon {
    width: 40px; height: 40px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 10px;
    display: grid; place-items: center;
    margin-bottom: 12px;
  }
  .export-action h3 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
  .export-action p { font-size: 12px; color: var(--text-2); }

  .summary-card {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
  }
  .summary-card h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-2);
    margin-bottom: 12px;
    font-weight: 600;
  }
  .summary-row {
    display: flex;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 12px;
  }
  .summary-row:last-child { border-bottom: none; }
  .summary-row .k { color: var(--text-2); width: 40%; }
  .summary-row .v { color: var(--text-0); flex: 1; }

  /* scrollbars */
  *::-webkit-scrollbar { width: 8px; height: 8px; }
  *::-webkit-scrollbar-track { background: transparent; }
  *::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; }
  *::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

  /* Toast */
  .toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--bg-3);
    border: 1px solid var(--border-strong);
    border-radius: 10px;
    padding: 10px 16px;
    color: var(--text-0);
    font-size: 12px;
    z-index: 2000;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
    transition: transform .3s cubic-bezier(.4,0,.2,1);
  }
  .toast.show { transform: translateX(-50%) translateY(0); }
  .toast-icon {
    width: 18px; height: 18px;
    background: var(--accent);
    border-radius: 50%;
    display: grid; place-items: center;
    color: #000;
  }

  /* === PREVIEW MODE === */
  .pv-root {
    position: fixed;
    inset: 0;
    z-index: 2500;
    background:
      radial-gradient(circle at 15% 0%, rgba(255,107,26,0.06), transparent 60%),
      radial-gradient(circle at 85% 100%, rgba(255,107,26,0.04), transparent 60%),
      var(--bg-0);
    display: flex;
    flex-direction: column;
    animation: pv-fade-in .25s cubic-bezier(.4,0,.2,1);
  }
  @keyframes pv-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .pv-topbar {
    height: 56px;
    background: rgba(18,18,20,0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 16px;
    flex-shrink: 0;
    z-index: 2;
  }
  [data-theme="light"] .pv-topbar { background: rgba(255,255,255,0.85); }

  .pv-topbar-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
  }
  .pv-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-0);
    flex-shrink: 0;
  }
  .pv-brand-mark {
    width: 22px; height: 22px;
    background: linear-gradient(135deg, var(--accent), #ff8c42);
    border-radius: 6px;
    display: grid; place-items: center;
    color: #000;
    box-shadow: 0 0 12px var(--accent-glow);
  }
  .pv-url {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    color: var(--text-1);
    min-width: 0;
    flex: 1;
    max-width: 420px;
  }
  .pv-lock { color: var(--success); display: grid; place-items: center; flex-shrink: 0; }
  .pv-url-sep { color: var(--text-3); }
  .pv-url-dim { color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

  .pv-device-toggle {
    display: flex;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 3px;
    gap: 2px;
    flex-shrink: 0;
  }
  .pv-device-toggle button {
    padding: 6px 12px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-2);
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all .15s;
  }
  .pv-device-toggle button:hover { color: var(--text-0); }
  .pv-device-toggle button.active {
    background: var(--bg-4);
    color: var(--text-0);
    box-shadow: 0 1px 3px rgba(0,0,0,.2);
  }
  [data-theme="light"] .pv-device-toggle button.active { background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

  .pv-topbar-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    justify-content: flex-end;
  }
  .pv-hint {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10.5px;
    color: var(--text-3);
  }
  .pv-hint kbd {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-bottom-width: 2px;
    border-radius: 4px;
    padding: 1px 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-1);
    min-width: 14px;
    text-align: center;
  }
  .pv-hint span { margin-left: 4px; }
  .pv-close-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 12px 7px 14px;
    background: var(--bg-3);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    color: var(--text-0);
    font-size: 12px;
    font-weight: 500;
    transition: all .15s;
  }
  .pv-close-btn:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
  }
  .pv-close-btn kbd {
    background: var(--bg-2);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: var(--text-2);
    transition: all .15s;
  }
  .pv-close-btn:hover kbd {
    background: rgba(0,0,0,0.25);
    border-color: rgba(255,255,255,0.2);
    color: rgba(255,255,255,0.9);
  }

  .pv-stage {
    flex: 1;
    overflow: auto;
    padding: 28px;
    display: flex;
    justify-content: center;
  }
  .pv-stage::-webkit-scrollbar { width: 10px; }
  .pv-stage::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; }

  .pv-frame {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: flex-start;
  }
  .pv-frame-inner {
    background: var(--bg-1);
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0,0,0,0.4), 0 0 0 1px var(--border);
    overflow: hidden;
    transition: width .35s cubic-bezier(.4,0,.2,1), max-width .35s cubic-bezier(.4,0,.2,1);
    min-height: 60vh;
    max-width: 100%;
  }
  .pv-desktop .pv-frame-inner { max-width: 1400px; }
  .pv-tablet .pv-frame-inner { box-shadow: 0 30px 60px rgba(0,0,0,0.5), 0 0 0 8px #0f0f12, 0 0 0 9px var(--border); border-radius: 20px; }
  [data-theme="light"] .pv-tablet .pv-frame-inner { box-shadow: 0 30px 60px rgba(0,0,0,0.2), 0 0 0 8px #d8d8d2, 0 0 0 9px var(--border-strong); }
  .pv-mobile .pv-frame-inner { box-shadow: 0 30px 60px rgba(0,0,0,0.5), 0 0 0 10px #0f0f12, 0 0 0 11px var(--border); border-radius: 28px; }
  [data-theme="light"] .pv-mobile .pv-frame-inner { box-shadow: 0 30px 60px rgba(0,0,0,0.2), 0 0 0 10px #d8d8d2, 0 0 0 11px var(--border-strong); }

  .pv-block { position: relative; }

  .pv-empty {
    padding: 100px 40px;
    text-align: center;
    color: var(--text-2);
  }
  .pv-empty-mark {
    width: 64px; height: 64px;
    margin: 0 auto 16px;
    border: 2px dashed var(--border-strong);
    border-radius: 12px;
    display: grid; place-items: center;
    color: var(--text-3);
  }
  .pv-empty h3 { font-size: 16px; color: var(--text-0); margin-bottom: 6px; font-weight: 600; }
  .pv-empty p { font-size: 12px; max-width: 320px; margin: 0 auto; }

  .pv-esc-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 10px 12px;
    background: rgba(18,18,20,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: var(--text-0);
    font-size: 13px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4), 0 0 0 1px rgba(255,255,255,0.04) inset;
    transition: all .2s cubic-bezier(.4,0,.2,1);
    animation: pv-fab-in .4s cubic-bezier(.34,1.56,.64,1) .15s both;
  }
  [data-theme="light"] .pv-esc-fab { background: rgba(255,255,255,0.95); }
  @keyframes pv-fab-in {
    from { opacity: 0; transform: translateY(20px) scale(.9); }
    to { opacity: 1; transform: translateY(0) scale(1); }
  }
  .pv-esc-fab:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(239,68,68,0.4);
  }
  .pv-esc-fab-icon {
    width: 22px; height: 22px;
    background: var(--bg-3);
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--text-0);
    transition: all .2s;
  }
  .pv-esc-fab:hover .pv-esc-fab-icon {
    background: rgba(255,255,255,0.2);
    color: #fff;
  }
  .pv-esc-fab-kbd {
    background: var(--bg-3);
    border: 1px solid var(--border-strong);
    border-radius: 5px;
    padding: 2px 7px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-2);
    transition: all .2s;
  }
  .pv-esc-fab:hover .pv-esc-fab-kbd {
    background: rgba(0,0,0,0.25);
    border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.95);
  }

  .pv-mobile-devices {
    display: none;
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 10;
    background: rgba(18,18,20,0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
  }
  [data-theme="light"] .pv-mobile-devices { background: rgba(255,255,255,0.95); }
  .pv-mobile-devices button {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: grid; place-items: center;
    color: var(--text-2);
    transition: all .15s;
  }
  .pv-mobile-devices button.active {
    background: var(--accent);
    color: #000;
  }

  /* Preview button in topbar */
  .btn-preview {
    background: var(--bg-3);
    color: var(--text-0);
    border: 1px solid var(--border-strong);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    transition: all .15s;
  }
  .btn-preview:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
  }
  .btn-preview kbd {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: var(--text-3);
    margin-left: 2px;
    transition: all .15s;
  }
  .btn-preview:hover kbd { background: rgba(0,0,0,0.2); color: #000; border-color: rgba(0,0,0,0.2); }

  /* Responsive topbar */
  @media (max-width: 900px) {
    .pv-url { display: none; }
    .pv-hint { display: none; }
    .pv-device-toggle button span { display: none; }
    .pv-device-toggle button { padding: 7px 9px; }
    .pv-close-btn span { display: none; }
    .pv-stage { padding: 16px; }
  }
  @media (max-width: 640px) {
    .pv-topbar { height: 52px; padding: 0 12px; gap: 8px; }
    .pv-device-toggle { display: none; }
    .pv-mobile-devices { display: flex; }
    .pv-brand span { display: none; }
    .pv-close-btn kbd { display: none; }
    .pv-esc-fab-label { display: none; }
    .pv-esc-fab-kbd { display: none; }
    .pv-esc-fab { padding: 12px; }
    .pv-stage { padding: 10px; }
    .pv-frame-inner { border-radius: 10px; }
    .pv-tablet .pv-frame-inner, .pv-mobile .pv-frame-inner {
      box-shadow: 0 10px 30px rgba(0,0,0,0.4), 0 0 0 4px #0f0f12;
    }
  }

  /* === PREVIEW MODE === */
  .btn-preview {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-0);
    transition: all .15s;
  }
  .btn-preview:hover {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
  }
  .btn-preview kbd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    background: var(--bg-4);
    color: var(--text-2);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 2px;
  }
  .btn-preview:hover kbd {
    background: rgba(0,0,0,.25);
    color: #000;
    border-color: transparent;
  }

  .pv-root {
    position: fixed;
    inset: 0;
    background: var(--bg-0);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }
  .pv-topbar {
    height: 56px;
    padding: 0 16px;
    background: var(--bg-1);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 16px;
    z-index: 10;
    position: relative;
    flex-shrink: 0;
  }
  .pv-topbar-left { display: flex; align-items: center; gap: 14px; min-width: 0; }
  .pv-brand {
    display: flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 13px;
    color: var(--text-0);
  }
  .pv-brand-mark {
    width: 24px; height: 24px;
    background: linear-gradient(135deg, var(--accent), #ff8c42);
    border-radius: 6px;
    display: grid; place-items: center;
    color: #000;
  }
  .pv-url {
    display: flex; align-items: center; gap: 8px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 12px;
    font-size: 11.5px;
    color: var(--text-1);
    font-family: 'JetBrains Mono', monospace;
    min-width: 0;
  }
  .pv-lock {
    width: 14px; height: 14px;
    display: grid; place-items: center;
    color: var(--success);
  }
  .pv-url-sep { color: var(--text-3); }
  .pv-url-dim { color: var(--text-2); white-space: nowrap; }

  .pv-device-toggle {
    display: none; /* replaced by floating FAB */
  }
  .pv-topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
  .pv-hint {
    display: flex; align-items: center; gap: 4px;
    font-size: 10.5px;
    color: var(--text-3);
    font-family: 'JetBrains Mono', monospace;
  }
  .pv-hint kbd {
    background: var(--bg-3);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 1px 5px;
    font-size: 9.5px;
    font-family: inherit;
    color: var(--text-1);
    min-width: 14px;
    text-align: center;
  }
  .pv-hint span { margin-left: 6px; }

  .pv-close-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px 7px 10px;
    border-radius: 8px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    color: var(--text-0);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all .15s;
    font-family: inherit;
  }
  .pv-close-btn:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
  }
  .pv-close-btn kbd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    background: var(--bg-4);
    color: var(--text-2);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 1px 5px;
    margin-left: 2px;
  }
  .pv-close-btn:hover kbd {
    background: rgba(0,0,0,.25);
    color: #fff;
    border-color: transparent;
  }

  .pv-stage {
    flex: 1;
    overflow: auto;
    padding: 32px 32px 120px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    background:
      radial-gradient(circle at 20% 10%, var(--canvas-glow-1) 0%, transparent 50%),
      radial-gradient(circle at 80% 90%, var(--canvas-glow-2) 0%, transparent 50%),
      var(--bg-0);
  }
  .pv-stage::-webkit-scrollbar { width: 10px; height: 10px; }
  .pv-stage::-webkit-scrollbar-track { background: transparent; }
  .pv-stage::-webkit-scrollbar-thumb { background: var(--bg-3); border-radius: 10px; }
  .pv-stage::-webkit-scrollbar-thumb:hover { background: var(--bg-4); }

  .pv-viewport {
    background: var(--bg-1);
    border-radius: 12px;
    box-shadow: var(--viewport-shadow), 0 0 0 1px var(--border);
    overflow: hidden;
    transition: width .3s cubic-bezier(.4,0,.2,1);
    position: relative;
    min-height: 500px;
    height: fit-content;
    max-width: 100%;
  }
  .pv-viewport-bar {
    height: 28px;
    background: var(--bg-2);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 12px;
    gap: 8px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-3);
  }
  .pv-viewport-dots { display: flex; gap: 5px; }
  .pv-viewport-dots span {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--bg-4);
  }
  .pv-blocks { min-height: 400px; }
  .pv-block { position: relative; }

  /* Floating device toggle — bottom center */
  .pv-fab-devices {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: rgba(10,10,11,.92);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    padding: 4px;
    gap: 2px;
    z-index: 100;
    box-shadow: 0 12px 40px rgba(0,0,0,.5);
  }
  [data-theme="light"] .pv-fab-devices {
    background: rgba(255,255,255,.95);
    box-shadow: 0 12px 40px rgba(60,50,40,.18);
  }
  .pv-fab-devices button {
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 12px;
    color: var(--text-1);
    display: inline-flex; align-items: center; gap: 7px;
    transition: all .15s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
  }
  [data-theme="light"] .pv-fab-devices button { color: var(--text-0); }
  .pv-fab-devices button:hover { color: var(--text-0); }
  .pv-fab-devices button.active {
    background: var(--accent);
    color: #000;
    font-weight: 600;
    box-shadow: 0 2px 10px var(--accent-glow);
  }

  .pv-empty {
    padding: 80px 40px;
    text-align: center;
    color: var(--text-2);
  }
  .pv-empty-mark {
    width: 72px; height: 72px;
    margin: 0 auto 18px;
    border: 2px dashed var(--border-strong);
    border-radius: 14px;
    display: grid; place-items: center;
    color: var(--text-3);
  }
  .pv-empty h3 { font-size: 16px; color: var(--text-0); margin-bottom: 6px; font-weight: 600; }
  .pv-empty p { font-size: 12.5px; max-width: 340px; margin: 0 auto; }

  .pv-esc-fab {
    position: fixed;
    bottom: 24px;
    right: 24px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px 10px 12px;
    background: rgba(10,10,11,.92);
    backdrop-filter: blur(14px);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    z-index: 100;
    box-shadow: 0 10px 30px rgba(0,0,0,.4);
    transition: all .15s;
    font-family: inherit;
  }
  [data-theme="light"] .pv-esc-fab {
    background: rgba(255,255,255,.95);
    color: var(--text-0);
  }
  .pv-esc-fab:hover {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
    transform: translateY(-2px);
    box-shadow: 0 14px 40px rgba(239,68,68,.4);
  }
  .pv-esc-fab-icon {
    width: 22px; height: 22px;
    display: grid; place-items: center;
    background: var(--danger);
    border-radius: 50%;
    color: #fff;
  }
  .pv-esc-fab:hover .pv-esc-fab-icon {
    background: rgba(255,255,255,.25);
  }
  .pv-esc-fab-kbd {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    background: var(--bg-3);
    color: var(--text-1);
    border: 1px solid var(--border-strong);
    border-radius: 4px;
    padding: 1px 5px;
  }
  .pv-esc-fab:hover .pv-esc-fab-kbd {
    background: rgba(0,0,0,.25);
    color: #fff;
    border-color: transparent;
  }

  .pv-mobile-devices {
    display: none;
  }

  @media (max-width: 900px) {
    .pv-url, .pv-hint { display: none; }
    .pv-brand span { display: none; }
  }
  @media (max-width: 640px) {
    .pv-fab-devices button span { display: none; }
    .pv-fab-devices button { padding: 8px 10px; }
    .pv-esc-fab-label { display: none; }
    .pv-esc-fab-kbd { display: none; }
    .pv-esc-fab {
      padding: 8px;
      border-radius: 50%;
      bottom: 88px;
    }
    .pv-close-btn span { display: none; }
    .pv-close-btn kbd { display: none; }
    .pv-close-btn {
      padding: 8px;
      width: 36px;
      height: 36px;
      display: grid;
      place-items: center;
    }
    .pv-stage { padding: 12px 12px 110px; }
    .pv-topbar { height: 50px; padding: 0 10px; gap: 10px; }
  }

  /* === Mobile block overlay (< 768px) === */
  .mobile-block {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background:
      radial-gradient(circle at 30% 20%, var(--accent-glow), transparent 60%),
      radial-gradient(circle at 70% 80%, var(--accent-dim), transparent 55%),
      rgba(10,10,11,0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    display: grid;
    place-items: center;
    padding: 20px;
    animation: mb-fade-in .25s ease;
  }
  [data-theme="light"] .mobile-block {
    background:
      radial-gradient(circle at 30% 20%, var(--accent-glow), transparent 60%),
      radial-gradient(circle at 70% 80%, var(--accent-dim), transparent 55%),
      rgba(255,255,255,0.96);
  }
  @keyframes mb-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
  }
  .mobile-block-card {
    background: var(--bg-1);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 26px 28px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    box-shadow: 0 30px 80px rgba(0,0,0,0.5);
    animation: mb-pop .35s cubic-bezier(.34,1.56,.64,1);
  }
  [data-theme="light"] .mobile-block-card {
    box-shadow: 0 30px 80px rgba(60,50,40,0.25);
  }
  @keyframes mb-pop {
    from { opacity: 0; transform: scale(.92) translateY(10px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
  }
  .mobile-block-icon {
    width: 72px; height: 72px;
    margin: 0 auto 20px;
    background: var(--accent-dim);
    color: var(--accent);
    border-radius: 18px;
    display: grid; place-items: center;
    box-shadow: 0 0 28px var(--accent-glow), inset 0 0 0 1px var(--accent-dim);
  }
  .mobile-block-card h2 {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.01em;
    margin-bottom: 10px;
    color: var(--text-0);
  }
  .mobile-block-card p {
    font-size: 13.5px;
    color: var(--text-2);
    line-height: 1.55;
    margin-bottom: 22px;
  }
  .mobile-block-card p b { color: var(--text-0); font-weight: 600; }
  .mobile-block-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
    justify-content: center;
    margin-bottom: 10px;
  }
  .mobile-block-link {
    display: block;
    color: var(--accent);
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    padding: 8px;
    transition: color .15s;
  }
  .mobile-block-link:hover { color: var(--accent-hover); text-decoration: underline; }
  .mobile-block-hint {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 10.5px;
    font-family: 'JetBrains Mono', monospace;
    color: var(--text-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }
  .mobile-block-hint b { color: var(--accent); font-weight: 600; }

  /* === Radio Widget (lateral derecho) === */
  .radio-widget {
    position: fixed;
    top: 50%;
    right: 0;
    transform: translateY(-50%);
    z-index: 1800;
    display: flex;
    align-items: stretch;
    pointer-events: none;
    font-family: inherit;
  }
  .radio-widget > * { pointer-events: auto; }

  .radio-panel {
    width: 0;
    overflow: hidden;
    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 14px 0 0 14px;
    transition: width .3s cubic-bezier(.4,0,.2,1), padding .3s cubic-bezier(.4,0,.2,1);
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
  .radio-widget.open .radio-panel {
    width: 240px;
    padding: 14px 16px 12px;
    background: rgba(18,18,20,0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid var(--border-strong);
    border-right: none;
    box-shadow: -14px 0 36px rgba(0,0,0,0.35);
  }
  [data-theme="light"] .radio-widget.open .radio-panel {
    background: rgba(255,255,255,0.95);
    box-shadow: -14px 0 36px rgba(60,50,40,0.15);
  }

  .radio-head {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .radio-logo {
    width: 30px; height: 30px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 0 6px var(--accent-glow));
  }
  .radio-info { flex: 1; min-width: 0; }
  .radio-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-0);
    letter-spacing: -0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .radio-live {
    font-size: 10.5px;
    color: var(--text-3);
    display: flex; align-items: center; gap: 5px;
    margin-top: 2px;
    font-family: 'JetBrains Mono', monospace;
    text-transform: uppercase;
    letter-spacing: 0.08em;
  }
  .radio-live-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: var(--text-3);
    transition: all .2s;
  }
  .radio-live-dot.on {
    background: var(--danger);
    box-shadow: 0 0 8px var(--danger);
    animation: radio-pulse 1.4s ease-in-out infinite;
  }
  @keyframes radio-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .45; }
  }

  .radio-controls {
    display: flex;
    justify-content: center;
  }
  .radio-play-btn {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: #000;
    display: grid; place-items: center;
    cursor: pointer;
    border: none;
    box-shadow: 0 6px 18px var(--accent-glow);
    transition: transform .15s, background .15s, box-shadow .15s;
  }
  .radio-play-btn:hover {
    background: var(--accent-hover);
    transform: scale(1.05);
    box-shadow: 0 8px 24px var(--accent-glow);
  }
  .radio-play-btn:active { transform: scale(.96); }

  .radio-spinner {
    width: 18px; height: 18px;
    border: 2.2px solid rgba(0,0,0,.22);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin .7s linear infinite;
  }

  .radio-volume {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 2px 0;
  }
  .radio-vol-icon {
    background: none;
    border: none;
    padding: 4px;
    color: var(--text-2);
    cursor: pointer;
    display: grid; place-items: center;
    transition: color .15s;
  }
  .radio-vol-icon:hover { color: var(--text-0); }

  .radio-volume input[type="range"] {
    -webkit-appearance: none;
    appearance: none;
    flex: 1;
    height: 4px;
    border-radius: 2px;
    background: linear-gradient(to right, var(--accent) 0%, var(--accent) var(--pct, 70%), var(--bg-3) var(--pct, 70%), var(--bg-3) 100%);
    outline: none;
    cursor: pointer;
  }
  .radio-volume input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-1);
    box-shadow: 0 2px 6px var(--accent-glow);
    cursor: grab;
  }
  .radio-volume input[type="range"]::-moz-range-thumb {
    width: 13px; height: 13px;
    border-radius: 50%;
    background: var(--accent);
    border: 2px solid var(--bg-1);
    cursor: grab;
  }

  .radio-foot {
    text-align: center;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: var(--text-3);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-top: 4px;
    border-top: 1px solid var(--border);
  }

  /* Tab lateral siempre visible — barra naranja vertical */
  .radio-tab {
    width: 34px;
    min-height: 170px;
    background: var(--accent);
    color: #000;
    border: none;
    border-radius: 10px 0 0 10px;
    padding: 14px 0 12px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    box-shadow: -4px 0 16px var(--accent-glow);
    transition: width .18s, padding .18s, transform .18s, box-shadow .18s, background .15s;
  }
  .radio-tab:hover {
    width: 38px;
    background: var(--accent-hover);
    transform: translateX(-1px);
    box-shadow: -6px 0 22px var(--accent-glow);
  }
  .radio-widget.open .radio-tab {
    min-height: 64px;
    width: 26px;
    padding: 0;
  }
  .radio-tab-label {
    writing-mode: vertical-rl;
    white-space: nowrap;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: #000;
    line-height: 1;
  }
  .radio-tab-icon {
    display: grid;
    place-items: center;
    color: #000;
    background: rgba(255,255,255,0.18);
    width: 22px; height: 22px;
    border-radius: 50%;
  }

  /* Mini visualizador de ondas en el tab cuando está sonando y cerrado */
  .radio-tab-wave {
    display: inline-flex;
    align-items: flex-end;
    gap: 2px;
    height: 14px;
  }
  .radio-tab-wave i {
    display: block;
    width: 2px;
    background: currentColor;
    border-radius: 2px;
    animation: radio-bar 0.9s ease-in-out infinite;
  }
  .radio-tab-wave i:nth-child(1) { height: 60%; animation-delay: 0s; }
  .radio-tab-wave i:nth-child(2) { height: 100%; animation-delay: 0.18s; }
  .radio-tab-wave i:nth-child(3) { height: 40%; animation-delay: 0.36s; }
  @keyframes radio-bar {
    0%, 100% { transform: scaleY(.4); }
    50% { transform: scaleY(1); }
  }

  /* Responsive: no tapar el FAB en pantallas chicas */
  @media (max-width: 640px) {
    .radio-widget { top: auto; bottom: 20px; transform: none; }
    .radio-widget.open .radio-panel { width: 220px; }
  }

  /* Ghost while dragging */
  .drag-ghost {
    position: fixed;
    pointer-events: none;
    background: var(--accent);
    color: #000;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    z-index: 9999;
    opacity: 0.9;
    box-shadow: 0 6px 20px var(--accent-glow);
  }

  /* === DISCLAIMER DE BIENVENIDA === */
  .dis-modal { max-width: 560px; }
  .dis-head {
    padding: 28px 28px 0;
    display: flex; align-items: center; gap: 14px;
    flex-shrink: 0;
  }
  .dis-mark {
    width: 46px; height: 46px; flex-shrink: 0;
    display: grid; place-items: center;
    border-radius: 12px; background: var(--accent-dim);
  }
  .dis-mark img { width: 30px; height: 30px; object-fit: contain; display: block; }
  .dis-kicker {
    font-family: 'JetBrains Mono', monospace; font-size: 10px;
    letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent);
    font-weight: 600; margin-bottom: 4px;
  }
  .dis-head h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
  /* El cuerpo es lo único que scrollea: en pantallas bajas el botón
     "Entendido" siempre queda visible al pie. */
  .dis-body {
    padding: 20px 28px 20px;
    font-size: 13.5px; color: var(--text-1); line-height: 1.65;
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .dis-body p { margin-bottom: 14px; }
  .dis-list { list-style: none; display: grid; gap: 10px; margin: 18px 0 4px; }
  .dis-list li {
    display: flex; gap: 10px; align-items: flex-start;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 12px 14px; font-size: 12.5px;
  }
  .dis-list .ic { font-size: 15px; line-height: 1.2; flex-shrink: 0; }
  .dis-list b { color: var(--text-0); font-weight: 600; }
  .dis-foot {
    padding: 18px 28px 22px;
    display: flex; align-items: center; justify-content: space-between; gap: 14px;
    flex-shrink: 0;
    border-top: 1px solid var(--border);
    background: var(--bg-1);
  }
  .dis-foot .note { font-size: 11px; color: var(--text-3); }
  .dis-foot .btn { white-space: nowrap; }
  @media (max-width: 620px) {
    .dis-head, .dis-body, .dis-foot { padding-left: 20px; padding-right: 20px; }
    .dis-foot { flex-direction: column; align-items: stretch; }
  }
  /* Pantallas bajas (portátiles 768px, ventanas a media altura) */
  @media (max-height: 760px) {
    .modal-backdrop { padding: 16px; }
    .dis-head { padding-top: 20px; }
    .dis-body { padding-top: 14px; padding-bottom: 14px; }
    .dis-list { gap: 8px; margin: 14px 0 0; }
    .dis-list li { padding: 10px 12px; }
  }

  /* === SUBIDA DE MATERIAL (paso 2) === */
  .up-zone {
    border: 1.5px dashed var(--border-strong);
    background: var(--bg-2);
    border-radius: 12px;
    padding: 26px 20px;
    text-align: center;
    cursor: pointer;
    transition: all .15s;
  }
  .up-zone:hover, .up-zone.drag {
    border-color: var(--accent);
    background: var(--accent-dim);
  }
  .up-zone-title { font-size: 13.5px; font-weight: 600; color: var(--text-0); margin-bottom: 5px; }
  .up-zone-sub { font-size: 11.5px; color: var(--text-2); line-height: 1.6; }
  .up-zone-sub b { color: var(--text-1); font-weight: 600; }
  .up-icon { font-size: 22px; margin-bottom: 8px; }

  .up-list { display: grid; gap: 8px; margin-top: 12px; }
  .up-item {
    display: flex; align-items: center; gap: 11px;
    background: var(--bg-2); border: 1px solid var(--border);
    border-radius: 10px; padding: 10px 12px;
    position: relative; overflow: hidden;
  }
  .up-item.error { border-color: var(--danger); background: rgba(239,68,68,.07); }
  .up-thumb {
    width: 34px; height: 34px; border-radius: 8px; flex-shrink: 0;
    display: grid; place-items: center; font-size: 15px;
    background: var(--bg-3); color: var(--text-1);
    overflow: hidden;
  }
  .up-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
  .up-meta { flex: 1; min-width: 0; }
  .up-name {
    font-size: 12.5px; color: var(--text-0); font-weight: 500;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .up-sub { font-size: 11px; color: var(--text-3); margin-top: 2px; }
  .up-item.error .up-sub { color: var(--danger); }
  .up-bar {
    position: absolute; left: 0; bottom: 0; height: 2px;
    background: var(--accent); transition: width .18s linear;
  }
  .up-x {
    width: 26px; height: 26px; border-radius: 7px; flex-shrink: 0;
    display: grid; place-items: center; color: var(--text-3);
    font-size: 15px; line-height: 1; transition: all .15s;
  }
  .up-x:hover { background: var(--bg-4); color: var(--danger); }
  .up-total {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 11px; color: var(--text-3); margin-top: 10px;
    font-family: 'JetBrains Mono', monospace; letter-spacing: 0.04em;
  }
  .up-hint {
    margin-top: 10px; font-size: 11.5px; color: var(--text-2);
    background: var(--bg-2); border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: 8px; padding: 10px 12px; line-height: 1.6;
  }

  /* === VISOR INTERNO (preview.php) === */
  .rv-wrap { max-width: 1240px; margin: 0 auto; padding: 32px 20px 60px; }
  .rv-hdr {
    display: flex; align-items: center; gap: 14px;
    padding: 18px 22px; margin-bottom: 22px;
    background: var(--bg-1); border: 1px solid var(--border); border-radius: 14px;
  }
  .rv-hdr img.logo { width: 40px; height: 40px; object-fit: contain; }
  .rv-hdr h1 { font-size: 19px; font-weight: 700; letter-spacing: -0.01em; }
  .rv-hdr .sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }
  .rv-hdr .date {
    margin-left: auto; font-family: 'JetBrains Mono', monospace;
    font-size: 10px; color: var(--text-3); letter-spacing: 0.08em; text-transform: uppercase;
  }
  .rv-tabs { display: flex; gap: 6px; justify-content: center; margin-bottom: 18px; flex-wrap: wrap; }
  .rv-tabs button {
    padding: 8px 16px; border-radius: 999px;
    background: var(--bg-2); color: var(--text-1);
    border: 1px solid var(--border);
    font-size: 12px; font-weight: 500;
    display: inline-flex; align-items: center; gap: 6px; transition: all .15s;
  }
  .rv-tabs button small { font-size: 10px; color: var(--text-3); }
  .rv-tabs button:hover { border-color: var(--accent); }
  .rv-tabs button.active { background: var(--accent); color: #000; border-color: var(--accent); }
  .rv-tabs button.active small { color: rgba(0,0,0,.6); }
  .rv-frame {
    background: var(--bg-1); border-radius: 14px; overflow: hidden;
    box-shadow: 0 30px 80px rgba(0,0,0,.35), 0 0 0 1px var(--border);
    margin: 0 auto 34px;
  }
  .rv-bar {
    height: 28px; background: var(--bg-2); border-bottom: 1px solid var(--border);
    display: flex; align-items: center; padding: 0 12px; gap: 8px;
    font-family: 'JetBrains Mono', monospace; font-size: 10px; color: var(--text-3);
  }
  .rv-dots { display: flex; gap: 5px; }
  .rv-dots span { width: 9px; height: 9px; border-radius: 50%; background: var(--bg-4); }
  .rv-card {
    background: var(--bg-1); border: 1px solid var(--border);
    border-radius: 14px; overflow: hidden; margin-bottom: 18px;
  }
  .rv-card h2 {
    font-size: 11px; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--accent); padding: 16px 20px 10px; font-weight: 600;
  }
  .rv-card table { width: 100%; border-collapse: collapse; }
  .rv-card th, .rv-card td {
    padding: 10px 20px; text-align: left; font-size: 13px;
    border-bottom: 1px solid var(--border); vertical-align: top;
  }
  .rv-card tr:last-child th, .rv-card tr:last-child td { border-bottom: none; }
  .rv-card th { color: var(--text-2); font-weight: 500; width: 170px; background: var(--bg-2); }
  .rv-card td { color: var(--text-0); white-space: pre-wrap; word-break: break-word; }
  .rv-asset {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 20px; border-bottom: 1px solid var(--border);
  }
  .rv-asset:last-child { border-bottom: none; }
  .rv-asset .ic { font-size: 17px; width: 24px; text-align: center; }
  .rv-asset .nm { flex: 1; font-size: 13px; word-break: break-all; }
  .rv-asset .sz { font-family: 'JetBrains Mono', monospace; font-size: 11px; color: var(--text-3); }
  .rv-asset a {
    font-size: 11.5px; font-weight: 600; color: var(--accent);
    text-decoration: none; border: 1px solid var(--accent);
    padding: 5px 12px; border-radius: 999px; white-space: nowrap;
  }
  .rv-asset a:hover { background: var(--accent); color: #000; }
  .rv-zip { padding: 0 20px 14px 56px; }
  .rv-zip summary { cursor: pointer; font-size: 11.5px; color: var(--text-2); }
  .rv-zip ul { margin-top: 8px; padding-left: 16px; }
  .rv-zip li { font-size: 11.5px; color: var(--text-2); font-family: 'JetBrains Mono', monospace; padding: 2px 0; }
  .rv-foot { text-align: center; padding: 24px; color: var(--text-3); font-size: 11px; }

  /* === ONBOARDING: primeros pasos con el lienzo vacío ===================
     Tres señales, todas con los tokens del tema (claro y oscuro):
       1. la biblioteca de bloques late suavemente,
       2. el lienzo vacío apunta hacia ella,
       3. el paso 2 se marca unos segundos para que se vea cómo avanzar. */

  @keyframes wm-hint-left {
    0%, 100% { transform: translateX(0); opacity: .5; }
    50%      { transform: translateX(-7px); opacity: 1; }
  }
  @keyframes wm-hint-ring {
    0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
    70%  { box-shadow: 0 0 0 9px rgba(255, 107, 26, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 26, 0); }
  }
  @keyframes wm-hint-edge {
    0%, 100% { border-color: var(--border); }
    50%      { border-color: var(--accent); }
  }
  @keyframes wm-hint-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* 1. Biblioteca de bloques: título en acento + borde que late */
  .sidebar-header.wm-hint {
    border-bottom-color: var(--accent);
    animation: wm-hint-edge 2.2s ease-in-out infinite;
  }
  .sidebar-header.wm-hint .sidebar-title { color: var(--accent); }
  .sidebar-header.wm-hint .sidebar-title::after {
    content: '— arrastra uno al lienzo';
    margin-left: 6px;
    color: var(--text-3);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 500;
  }
  .block-card.wm-hint {
    border-color: var(--accent);
    background: var(--accent-dim);
  }

  /* 2. Lienzo vacío: pista de arrastre */
  .canvas-empty .empty-hint {
    display: inline-flex; align-items: center; gap: 9px;
    margin-bottom: 18px;
    padding: 7px 15px 7px 11px;
    border: 1px dashed var(--accent);
    border-radius: 999px;
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 12px; font-weight: 600;
  }
  .canvas-empty .empty-hint .arrow {
    font-size: 15px; line-height: 1;
    animation: wm-hint-left 1.5s ease-in-out infinite;
  }
  .canvas-empty p b { color: var(--text-1); font-weight: 600; }
  .canvas-empty.drop-hover .empty-hint {
    border-style: solid;
    background: var(--accent);
    color: #000;
  }

  /* 3. Paso 2 del encabezado, marcado unos segundos */
  .step-slot { position: relative; display: flex; }
  .step-pill.wm-hint {
    background: var(--accent-dim);
    color: var(--text-0);
    animation: wm-hint-ring 1.6s ease-out infinite;
  }
  .step-pill.wm-hint .num { background: var(--accent); color: #000; }
  .step-tip {
    position: absolute;
    top: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    background: var(--bg-1);
    border: 1px solid var(--accent);
    border-radius: 9px;
    padding: 8px 13px;
    font-size: 11.5px;
    color: var(--text-0);
    box-shadow: 0 12px 30px rgba(0, 0, 0, .35);
    animation: wm-hint-in .22s ease-out both;
    z-index: 200;
    pointer-events: none;
  }
  [data-theme="light"] .step-tip { box-shadow: 0 12px 30px rgba(60, 50, 40, .16); }
  .step-tip::before {
    content: '';
    position: absolute;
    top: -5px; left: 50%;
    width: 8px; height: 8px;
    margin-left: -4px;
    transform: rotate(45deg);
    background: var(--bg-1);
    border-left: 1px solid var(--accent);
    border-top: 1px solid var(--accent);
  }

  @media (prefers-reduced-motion: reduce) {
    .sidebar-header.wm-hint,
    .canvas-empty .empty-hint .arrow,
    .step-pill.wm-hint,
    .step-tip { animation: none; }
    .sidebar-header.wm-hint { border-bottom-color: var(--accent); }
  }

  /* === PANTALLA DE CARGA INICIAL ========================================
     Vive en index.html (no en React): tiene que verse mientras se descarga
     Babel y se compilan los .jsx, que es justo cuando React todavia no existe.
     App.jsx la retira al montar. */

  .boot {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: grid;
    place-items: center;
    background: var(--boot-veil);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    transition: opacity .3s ease, visibility .3s;
  }
  .boot.boot-out { opacity: 0; visibility: hidden; }
  .boot-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    padding: 20px;
  }
  .boot-ring {
    position: relative;
    width: 64px; height: 64px;
    display: grid; place-items: center;
  }
  .boot-ring::before,
  .boot-ring::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid transparent;
  }
  .boot-ring::before { border-color: var(--border); }
  .boot-ring::after {
    border-top-color: var(--accent);
    animation: boot-spin .85s linear infinite;
  }
  .boot-ring img {
    width: 30px; height: 30px;
    object-fit: contain;
    display: block;
    filter: drop-shadow(0 0 10px var(--accent-glow));
  }
  .boot-label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--text-3);
  }
  /* Solo aparece si la carga se atasca: en el caso normal el overlay ya no existe. */
  .boot-slow {
    max-width: 260px;
    text-align: center;
    font-size: 11.5px;
    line-height: 1.5;
    color: var(--text-3);
    opacity: 0;
    animation: boot-fade-in .3s ease-out 9s forwards;
  }
  @keyframes boot-spin { to { transform: rotate(360deg); } }
  @keyframes boot-fade-in { to { opacity: 1; } }

  @media (prefers-reduced-motion: reduce) {
    .boot-ring::after { animation-duration: 2.4s; }
  }

  /* === PASO 3: llamar la atencion sobre el boton de enviar ===============
     Al llegar a esta pantalla parecia que el envio ya estaba hecho. El boton
     late hasta que se usa; la animacion se detiene al pasar el mouse y cuando
     el envio esta en curso o terminado. */
  @keyframes wm-send-pulse {
    0%   { box-shadow: 0 0 0 0 var(--accent-glow); }
    70%  { box-shadow: 0 0 0 13px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
  }
  .btn-send-pulse { animation: wm-send-pulse 1.9s ease-out infinite; }
  .btn-send-pulse:hover,
  .btn-send-pulse:focus-visible { animation-play-state: paused; }

  .send-nudge {
    display: inline-flex; align-items: center; gap: 7px;
    margin-bottom: 12px;
    font-size: 11.5px; font-weight: 600;
    color: var(--accent);
  }
  .send-nudge .dot {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--accent);
    animation: wm-send-dot 1.9s ease-in-out infinite;
  }
  @keyframes wm-send-dot {
    0%, 100% { opacity: .35; transform: scale(.85); }
    50%      { opacity: 1;   transform: scale(1); }
  }

  @media (prefers-reduced-motion: reduce) {
    .btn-send-pulse { animation: none; box-shadow: 0 0 0 3px var(--accent-glow); }
    .send-nudge .dot { animation: none; }
  }

  /* Aviso del plan mes a mes en el formulario */
  .plan-banner {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin: -24px 0 28px;
    padding: 13px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-left: 2px solid var(--accent);
    border-radius: 10px;
    font-size: 12.5px; color: var(--text-2); line-height: 1.55;
  }
  .plan-badge {
    flex-shrink: 0;
    padding: 4px 11px; border-radius: 999px;
    background: var(--accent-dim); color: var(--accent);
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px; font-weight: 600;
    letter-spacing: 0.08em; text-transform: uppercase;
  }
