@import url('fonts-local.css');
/* ═══════════════════════════════════════════════════════════════════
 * Editor visual WYSIWYG — Hito 6 F2.1
 *
 * REQUISITO INNEGOCIABLE: paridad visual exacta con el wizard del cliente.
 * Replicamos las reglas de presupuesto.css scopeadas a #edWysiwygRoot
 * para no contaminar el resto del dashboard.
 *
 * Fuentes (Material Symbols Rounded + League Spartan + Montserrat) ya las
 * importa presupuesto.css cuando se sirve el wizard, pero como el editor
 * vive dentro de /app, necesitamos importarlas también aquí.
 * ═══════════════════════════════════════════════════════════════════ */

/* ─── "Foto" del header del wizard cliente — vista raíz "Tipos"
   Replicamos LITERALMENTE las reglas FINALES de presupuesto.css
   (líneas 1198-1285, no las iniciales que son override). Layout grid
   con el logo a la izquierda y el texto a la derecha, alineación
   izquierda en h1/subtítulo/eslogan, eslogan púrpura. */
#edWysiwygRoot .wy-preview-hero {
  border: 1px solid rgba(166, 192, 212, 0.5);
  border-radius: 24px;
  background:
      radial-gradient(460px 180px at 87% 104%, rgba(118, 105, 255, 0.32) 0%, rgba(118, 105, 255, 0) 72%),
      linear-gradient(132deg, rgba(255, 255, 255, 0.94) 0%, rgba(245, 250, 255, 0.9) 55%, rgba(244, 255, 251, 0.88) 100%);
  box-shadow: 0 14px 30px rgba(11, 33, 54, 0.07);
  padding: 22px 26px;
  position: relative;
  overflow: visible;        /* visible para que los lápices flotantes no se corten */
  margin: 0 0 22px;
  /* Mismo grid 2 cols del wizard: logo izq, texto der. Ancho 100% del
     contenedor del editor (no limitamos con max-width para que la
     "foto" ocupe el mismo espacio que el wizard real). */
  display: grid;
  grid-template-columns: minmax(140px, 220px) minmax(0, 1fr);
  grid-template-areas:
      "meta meta"
      "brand title"
      "brand subtitle"
      "brand slogan";
  align-items: center;
  column-gap: 24px;
}
#edWysiwygRoot .wy-preview-hero .hero-meta {
  grid-area: meta;
  margin-bottom: 10px;
  display: flex;
  justify-content: flex-end;
}
#edWysiwygRoot .wy-preview-hero .datetime-badge {
  border: 1px solid rgba(166, 190, 208, 0.46);
  background: rgba(255, 255, 255, 0.74);
  color: #3f5971;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: 999px;
  box-shadow: 0 8px 14px rgba(15, 57, 88, 0.08);
  letter-spacing: .2px;
}
#edWysiwygRoot .wy-preview-hero .brand-lockup {
  grid-area: brand;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  align-self: center;
  /* Convertimos en botón clickable que lleva a Ajustes → Branding. */
  background: transparent;
  border: 1px dashed transparent;
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  transition: background .18s, border-color .18s;
  position: relative;
}
#edWysiwygRoot .wy-preview-hero .brand-lockup:hover,
#edWysiwygRoot .wy-preview-hero .brand-lockup:focus-visible {
  background: rgba(11, 95, 127, 0.05);
  border-color: rgba(11, 95, 127, 0.35);
  outline: none;
}
#edWysiwygRoot .wy-preview-hero .brand-logo {
  width: min(225px, 100%);
  height: auto;
  object-fit: contain;
  border: 0;
  background: transparent;
  pointer-events: none;     /* el botón padre captura todo el click */
}
/* Nombre de empresa debajo del logo — replica el estilo del wizard real
   (presupuesto.css .brand-lockup-name). En el editor está dentro del
   botón clickable; mantenemos pointer-events:none para no robar el click. */
#edWysiwygRoot .wy-preview-hero .brand-lockup-name {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.3px;
  line-height: 1.1;
  color: var(--text, #132d46);
  text-align: center;
  margin-top: 6px;
  pointer-events: none;
}
html[data-theme="dark"] #edWysiwygRoot .wy-preview-hero .brand-lockup-name {
  color: var(--text, #e8eef4);
}
#edWysiwygRoot .wy-preview-hero .wy-brand-edit-hint {
  display: block;
  margin-top: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #0b5f7f;
  opacity: 0;
  transition: opacity .18s;
  pointer-events: none;
}
#edWysiwygRoot .wy-preview-hero .brand-lockup:hover .wy-brand-edit-hint,
#edWysiwygRoot .wy-preview-hero .brand-lockup:focus-visible .wy-brand-edit-hint {
  opacity: 1;
}
/* Los wrappers .wy-heading-editable son los que reciben el grid-area
   (porque envuelven al h1/p). h1/p dentro mantienen tipografía pura. */
#edWysiwygRoot .wy-preview-hero .wy-hero-h1     { grid-area: title; }
#edWysiwygRoot .wy-preview-hero .wy-hero-p      { grid-area: subtitle; }
#edWysiwygRoot .wy-preview-hero .wy-hero-slogan { grid-area: slogan; }
#edWysiwygRoot .wy-preview-hero h1 {
  margin: 0;
  text-align: left;
  font-size: clamp(26px, 2.4vw, 38px);
  letter-spacing: -0.6px;
  color: #0f2740;
  font-family: 'League Spartan', 'Montserrat', system-ui, sans-serif;
  font-weight: 700;
  line-height: 1.15;
}
#edWysiwygRoot .wy-preview-hero p {
  text-align: left;
  margin: 6px 0 0;
  color: #556f85;
  font-size: 16px;
}
#edWysiwygRoot .wy-preview-hero .hero-slogan {
  margin-top: 8px !important;
  text-align: left;
  color: #4c36cb !important;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.2px;
}

/* ── Modo oscuro de la vista previa de cabecera (antes quedaba en blanco) ── */
html[data-theme="dark"] #edWysiwygRoot .wy-preview-hero {
  border-color: rgba(255, 255, 255, 0.10);
  background:
      radial-gradient(460px 180px at 87% 104%, rgba(118, 105, 255, 0.22) 0%, rgba(118, 105, 255, 0) 72%),
      linear-gradient(132deg, rgba(34, 42, 58, 0.96) 0%, rgba(26, 33, 48, 0.94) 100%);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}
html[data-theme="dark"] #edWysiwygRoot .wy-preview-hero .datetime-badge {
  background: rgba(255, 255, 255, 0.06);
  color: #b7c0d4;
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
}
html[data-theme="dark"] #edWysiwygRoot .wy-preview-hero h1 { color: #e8eef4; }
html[data-theme="dark"] #edWysiwygRoot .wy-preview-hero p  { color: #aeb9c9; }
html[data-theme="dark"] #edWysiwygRoot .wy-preview-hero .hero-slogan { color: #a78bfa !important; }

/* Lápices SIEMPRE visibles para que el usuario los descubra sin tener
   que adivinar dónde están. Se posicionan al final del texto, no encima. */
#edWysiwygRoot .wy-preview-hero .wy-heading-editable {
  position: relative;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
/* SIN flex:1 — el h1/p se ajusta al texto y el lápiz queda pegado, no en
   el borde del bloque (Mario reportó "el lápiz está lejísimos" 2026-05-18).
   El wrapper es block-level (display:flex) para que cada bloque editable
   (título, subtítulo) vaya en su propia línea. */
#edWysiwygRoot .wy-preview-hero .wy-heading-editable > h1,
#edWysiwygRoot .wy-preview-hero .wy-heading-editable > p {
  flex: 0 1 auto;
  min-width: 0;
}
#edWysiwygRoot .wy-preview-hero .wy-text-edit-btn {
  flex-shrink: 0;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(11, 95, 127, 0.10);
  color: #0b5f7f;
  border: 1px solid rgba(11, 95, 127, 0.28);
  cursor: pointer;
  font-size: 13px;
  display: flex; align-items: center; justify-content: center;
  transition: background .18s, transform .18s;
}
#edWysiwygRoot .wy-preview-hero .wy-text-edit-btn:hover {
  background: rgba(11, 95, 127, 0.22);
  transform: scale(1.08);
}

/* Mientras editas (input visible): NO oculta el botón Guardar/Cancelar
   que pinta startHeadingEdit. La fila se ve como input + 2 botones
   centrada. */
#edWysiwygRoot .wy-preview-hero .wy-heading-editing {
  display: flex; gap: 8px; align-items: center;
  justify-content: center; padding: 6px 10px;
}
#edWysiwygRoot .wy-preview-hero .wy-heading-editing input.wy-heading-input {
  flex: 1; max-width: 640px;
  padding: 8px 10px; font-size: 16px;
  border: 1px solid #0b5f7f; border-radius: 7px;
  background: #fff; color: #17334c;
}

/* Subtítulos editables genéricos del WYSIWYG (vistas Tipos/Zonas/Trabajos
   tras el header): el <p class="subtitle"> conserva tipografía y márgenes,
   sólo añadimos el lápiz al lado sin chrome alrededor. */
/* Block-level (cada uno en su línea, como el wizard original) pero los
   hijos NO se estiran — el lápiz queda pegado al texto. justify-content:
   flex-start es el default; lo dejamos implícito. */
#edWysiwygRoot .wy-subtitle-editable {
  display: flex; align-items: center; gap: 6px;
  padding: 0; background: transparent; border: 0;
  margin: 0 0 14px;
}
#edWysiwygRoot .wy-subtitle-editable .subtitle { margin: 0; flex: 0 1 auto; }

/* ─── Tab badge "beta" en la pestaña ───────────────────────────── */
.editor-tabs .tab-btn-beta { position: relative; }
.editor-tabs .tab-btn-beta .tab-badge {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: linear-gradient(135deg, #14678b 0%, #19a677 100%);
  color: #fff;
  border-radius: 999px;
  vertical-align: middle;
  text-transform: uppercase;
}

/* ─── Variables CSS (scope local) ──────────────────────────────── */
#edWysiwygRoot {
  --wy-line: #d7e1ea;
  --wy-muted: #617487;
  --wy-primary: #0b5f7f;
  --wy-text: #13283a;
  --wy-brand-display: "League Spartan", "Montserrat", "Segoe UI", Arial, sans-serif;
  --wy-brand-body: "Montserrat", "Segoe UI", Arial, sans-serif;

  font-family: var(--wy-brand-body);
  color: var(--wy-text);
  display: block;
  padding: 0;
}

/* ─── Empty / banners ──────────────────────────────────────────── */
#edWysiwygRoot .wy-empty {
  padding: 48px 24px;
  text-align: center;
  color: var(--wy-muted);
  background: #f9fafb;
  border-radius: 12px;
  margin: 16px 0;
}
#edWysiwygRoot .wy-readonly-banner {
  margin: 16px 0;
  padding: 12px 16px;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #78350f;
  font-size: 14px;
}

/* ─── Topbar / Breadcrumb + navegación ────────────────────────── */
#edWysiwygRoot .wy-topbar {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 16px 0 18px;
  border-bottom: 1px solid var(--wy-line);
  margin-bottom: 22px;
}
#edWysiwygRoot .wy-crumb {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 17px;
  line-height: 1.35;
}
#edWysiwygRoot .wy-crumb-link {
  background: transparent;
  border: 0;
  padding: 6px 12px;
  cursor: pointer;
  color: #14678b;
  border-radius: 8px;
  font: inherit;
  font-weight: 500;
  transition: background 0.15s ease, color 0.15s ease;
}
#edWysiwygRoot .wy-crumb-link:hover {
  background: rgba(20, 103, 139, 0.10);
  color: #0e4f6b;
}
#edWysiwygRoot .wy-crumb-current {
  padding: 6px 14px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, #14678b 0%, #1a7ea8 100%);
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(20, 103, 139, 0.32);
  letter-spacing: 0.2px;
}
#edWysiwygRoot .wy-crumb-sep {
  color: #94a3b8;
  font-size: 18px;
  font-weight: 600;
}

/* Rastro-índice de pasos (Paso N · nombre + acciones ✎ 🗑 ➕ 👁). */
#edWysiwygRoot .wy-crumb-step {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 2px 4px 2px 2px;
}
#edWysiwygRoot .wy-crumb-step .wy-crumb-current { box-shadow: none; }
#edWysiwygRoot .wy-crumb-pasonum {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  opacity: 0.8;
}
#edWysiwygRoot .wy-crumb-acts {
  display: inline-flex;
  align-items: center;
  gap: 1px;
}
#edWysiwygRoot .wy-crumb-act {
  border: 0;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  line-height: 1;
  padding: 5px 6px;
  border-radius: 7px;
  color: #475569;
  transition: background 0.15s ease, color 0.15s ease, transform 0.1s ease;
}
#edWysiwygRoot .wy-crumb-act:hover { background: rgba(20, 103, 139, 0.12); transform: translateY(-1px); }
#edWysiwygRoot .wy-crumb-act[data-crumb-action="delete"]:hover { background: rgba(220, 38, 38, 0.14); }
html[data-theme="dark"] #edWysiwygRoot .wy-crumb-step { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.10); }
html[data-theme="dark"] #edWysiwygRoot .wy-crumb-act { color: #b7c0d4; }

/* Botones Atrás / Adelante debajo del breadcrumb (history del editor). */
#edWysiwygRoot .wy-nav-row {
  display: flex;
  gap: 8px;
}
#edWysiwygRoot .wy-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 600;
  background: #ffffff;
  color: #14678b;
  border: 1px solid rgba(20, 103, 139, 0.32);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}
#edWysiwygRoot .wy-nav-btn:hover:not(:disabled) {
  background: rgba(20, 103, 139, 0.08);
  border-color: rgba(20, 103, 139, 0.55);
}
#edWysiwygRoot .wy-nav-btn:active:not(:disabled) {
  transform: translateY(1px);
}
#edWysiwygRoot .wy-nav-btn:disabled {
  color: #9ca3af;
  border-color: #e5e7eb;
  background: #f9fafb;
  cursor: not-allowed;
}
#edWysiwygRoot .wy-nav-btn span {
  font-size: 16px;
  line-height: 1;
}

/* ─── Step (cabecera de cada nivel) ─────────────────────────── */
#edWysiwygRoot .wy-step { padding: 4px 0 24px; }
#edWysiwygRoot .wy-step h2 {
  font-size: clamp(22px, 1.7vw, 30px);
  letter-spacing: -0.5px;
  color: #132d46;
  font-family: var(--wy-brand-display);
  font-weight: 800;
  margin: 4px 0 6px;
}
#edWysiwygRoot .wy-step .subtitle {
  margin-top: 6px;
  margin-bottom: 16px;
  font-size: 15px;
  color: #60798f;
}

/* ═════════ PARIDAD WIZARD: grid-cards + option-card ═════════════ */

#edWysiwygRoot .grid-cards {
  display: grid;
  gap: 10px;
}
#edWysiwygRoot .reform-grid  { grid-template-columns: repeat(2, 1fr); }
#edWysiwygRoot .chapter-grid { grid-template-columns: repeat(2, 1fr); }

#edWysiwygRoot .option-card {
  position: relative;
  min-height: 104px;
  padding: 10px 12px 10px 70px;
  border: 1px solid rgba(169, 190, 210, 0.58);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.95) 0%, rgba(245, 249, 255, 0.92) 100%);
  box-shadow: 0 6px 12px rgba(11, 42, 67, 0.07);
  transform-origin: center;
  will-change: transform, box-shadow;
  transition: border-color .28s ease, box-shadow .28s ease, transform .2s ease, background .28s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-sizing: border-box;
}

#edWysiwygRoot .option-card::before {
  content: attr(data-icon);
  position: absolute;
  left: 12px;
  top: 14px;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-family: "Material Symbols Rounded", sans-serif;
  font-size: 23px;
  color: #2f5d84;
  background-color: #e5f0fb;
  border: 1px solid rgba(124, 161, 188, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
  transition: background-color 0.5s ease, color 0.5s ease, box-shadow 0.5s ease;
}

#edWysiwygRoot .option-card strong {
  font-size: 19px;
  line-height: 1.08;
  letter-spacing: -0.4px;
  color: #17334c;
  font-family: var(--wy-brand-display);
}
#edWysiwygRoot .reform-grid .option-card strong { font-size: 26px; }
#edWysiwygRoot .chapter-grid .option-card strong { font-size: 19px; }

#edWysiwygRoot .option-card small {
  font-size: 13px;
  line-height: 1.34;
  color: #5e768d;
}

#edWysiwygRoot .option-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 28px rgba(11, 49, 77, 0.13), 0 4px 10px rgba(11, 49, 77, 0.07);
  border-color: rgba(98, 136, 164, 0.58);
}
#edWysiwygRoot .option-card:active,
#edWysiwygRoot .option-card.is-pressed {
  transform: scale(0.965);
  box-shadow: 0 2px 5px rgba(11, 42, 67, 0.10);
  transition: transform .22s cubic-bezier(.4, 0, .2, 1),
              box-shadow .22s cubic-bezier(.4, 0, .2, 1);
}

#edWysiwygRoot .option-card:focus-visible {
  outline: 3px solid rgba(20, 103, 139, 0.35);
  outline-offset: 2px;
}

/* ─── Iconos de acciones por tipo (paridad con presupuesto.css) ─── */
#edWysiwygRoot .option-card.kind-renovar-electricidad::before,
#edWysiwygRoot .option-card.kind-renovar_electricidad::before {
  background-color: #fff0c2;
  color: #a66f00;
}
#edWysiwygRoot .option-card.kind-renovar-fontaneria::before,
#edWysiwygRoot .option-card.kind-renovar_fontaneria::before,
#edWysiwygRoot .option-card.kind-instalar-sanitarios::before {
  background-color: #d9efff;
  color: #1877ad;
}
#edWysiwygRoot .option-card.kind-alisar-paredes::before,
#edWysiwygRoot .option-card.kind-pintar-paredes::before,
#edWysiwygRoot .option-card.kind-pintar-techos::before {
  background-color: #ffdde2;
  color: #bd3558;
}
#edWysiwygRoot .option-card.kind-cambiar-suelo::before,
#edWysiwygRoot .option-card.kind-soleria-porcelanica::before,
#edWysiwygRoot .option-card.kind-soleria-tarima::before {
  background-color: #d9f3dd;
  color: #2d8d57;
}

/* ─── Mode badge "POPULAR" ────────────────────────────────────── */
#edWysiwygRoot .mode-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #d7284e 0%, #b3203f 100%);
  color: #ffffff;
  border: 0;
  border-radius: 8px;
  padding: 5px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .4px;
  box-shadow: 0 8px 14px rgba(164, 22, 51, 0.3);
}

/* ─── Estado: oculto al cliente (overlay específico del editor) ── */
#edWysiwygRoot .option-card-hidden {
  opacity: 0.55;
  background: repeating-linear-gradient(
    45deg, #fafafa, #fafafa 6px, #f3f4f6 6px, #f3f4f6 12px
  );
  border-style: dashed;
}
#edWysiwygRoot .wy-card-flag {
  position: absolute;
  top: 8px;
  right: 8px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}

/* ─── Estado: tarjeta custom ─────────────────────────────────── */
#edWysiwygRoot .option-card-custom {
  border-color: rgba(25, 166, 119, 0.5);
}
#edWysiwygRoot .wy-card-badge-custom {
  position: absolute;
  top: 8px;
  right: 8px;
  background: linear-gradient(135deg, #14678b, #19a677);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
#edWysiwygRoot .option-card-hidden .wy-card-badge-custom { display: none; }

/* ─── Inline price en descripción de acción ──────────────────── */
#edWysiwygRoot .wy-inline-price {
  color: #189f78;
  font-weight: 800;
}

/* ═════════ F2.2: Handles de edición (overlay en hover) ════════════ */

#edWysiwygRoot .wy-handles {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  z-index: 3;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-2px);
  transition: opacity .15s ease, transform .15s ease;
}
#edWysiwygRoot .option-card:hover .wy-handles,
#edWysiwygRoot .option-card:focus-within .wy-handles {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}
#edWysiwygRoot .option-card.option-card-hidden .wy-handles {
  opacity: 1;
  pointer-events: auto;
}

#edWysiwygRoot .wy-handle {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid rgba(15, 32, 48, 0.12);
  background: rgba(255, 255, 255, 0.95);
  color: #2f5d84;
  font-size: 14px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(15, 32, 48, 0.12);
  padding: 0;
  font-family: inherit;
  transition: transform .12s ease, background-color .12s ease, color .12s ease;
}
#edWysiwygRoot .wy-handle:hover {
  background: #14678b;
  color: #fff;
  transform: scale(1.06);
}
#edWysiwygRoot .wy-handle:active {
  transform: scale(0.94);
}
#edWysiwygRoot .wy-handle-drag {
  cursor: grab;
  user-select: none;
}
#edWysiwygRoot .wy-handle-drag:hover { background: rgba(255,255,255,0.95); color: #2f5d84; }

/* Estado del POPULAR badge no debe chocar con los handles */
#edWysiwygRoot .option-card:hover .mode-badge { display: none; }

/* Estado de la tarjeta ORIGEN mientras se arrastra: se queda como hueco
   sutil en su sitio para que se vea de dónde se cogió. El ghost custom
   (.wy-drag-ghost, 100% opaco) hace de imagen sólida que sigue al cursor. */
#edWysiwygRoot .option-card.wy-card-dragging {
  opacity: 0.38;
  transform: scale(0.97);
  filter: saturate(0.6);
  cursor: grabbing;
  transition: opacity .15s, transform .15s, filter .15s;
}

/* Ghost custom 100% opaco que sigue al cursor — montado en document.body
   con position:fixed para escapar de cualquier overflow/stacking. Misma
   estética que el ghost del Presupuesto libre pero con el azul JUMA del
   editor del wizard. */
.wy-drag-ghost {
  position: fixed !important;
  pointer-events: none !important;
  background: var(--card, #ffffff) !important;
  color: var(--text, #0f172a) !important;
  border: 2px solid #14678b !important;
  border-radius: 14px !important;
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.32),
              0 8px 20px rgba(20, 103, 139, 0.45),
              0 0 0 3px rgba(20, 103, 139, 0.18) !important;
  transform: rotate(-1.5deg) scale(1.02) !important;
  opacity: 1 !important;
  z-index: 9999 !important;
  margin: 0 !important;
  /* Top/left vienen del JS — siguen al cursor. */
}
/* Cursor pointer (no grab) en toda la tarjeta — el grab del sistema
   se confunde con el fondo claro. El handle ⇕ sí muestra grab. */
#edWysiwygRoot .option-card[draggable="true"] { cursor: pointer; }
#edWysiwygRoot .option-card[draggable="true"]:active:not(.wy-card-dragging) { cursor: pointer; }

/* Drop zone visual */
#edWysiwygRoot .option-card.wy-card-dropzone {
  outline: 3px dashed rgba(20, 103, 139, 0.6);
  outline-offset: -2px;
  background: linear-gradient(180deg, rgba(20, 103, 139, 0.06) 0%, rgba(245, 249, 255, 0.92) 100%);
}

/* En tarjetas ocultas, mover el flag "oculto" a la izquierda para no
   superponerse a los handles que ahora viven arriba-derecha. */
#edWysiwygRoot .option-card-hidden .wy-card-flag {
  right: auto;
  left: 8px;
  top: 8px;
}
/* Igual con el badge custom */
#edWysiwygRoot .option-card .wy-card-badge-custom {
  right: 8px;
  top: -10px;
}
#edWysiwygRoot .option-card:hover .wy-card-badge-custom { display: none; }

/* ═════════ F2.3 v3: Pane de edición DENTRO del panel del dashboard ═════════
 * Las reglas viven fuera del scope #edWysiwygRoot porque el contenedor real
 * es #dynamicPanelContent (el panel derecho del dashboard). Usamos el prefijo
 * .wy-edit-* para no chocar con otros panels.
 */

/* La pane vive dentro de .bp-card que ya provee padding+gap+animación.
   Solo añadimos lo específico del form de edición. */
#dynamicPanelContent .wy-edit-pane {
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
}

#dynamicPanelContent .wy-edit-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 12px;
  border-bottom: 1px solid #eef2f6;
}
#dynamicPanelContent .wy-edit-head h3 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  color: #132d46;
  font-family: "League Spartan", "Montserrat", "Segoe UI", Arial, sans-serif;
  letter-spacing: -0.3px;
  line-height: 1.15;
  word-break: break-word;
}
#dynamicPanelContent .wy-edit-eyebrow {
  margin: 0 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #14678b;
}
#dynamicPanelContent .wy-edit-close {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  color: #60798f;
  font-size: 14px;
  cursor: pointer;
  flex-shrink: 0;
}
#dynamicPanelContent .wy-edit-close:hover { background: #f3f4f6; color: #132d46; }

#dynamicPanelContent .wy-edit-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
#dynamicPanelContent .wy-edit-form .wy-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#dynamicPanelContent .wy-edit-form .wy-field > span {
  font-size: 13px;
  font-weight: 600;
  color: #4b5563;
}
#dynamicPanelContent .wy-edit-form .wy-field > span small {
  display: block;
  font-weight: 400;
  color: #6b7280;
  font-size: 11.5px;
  margin-top: 2px;
}
#dynamicPanelContent .wy-edit-form input[type="text"],
#dynamicPanelContent .wy-edit-form input[type="number"],
#dynamicPanelContent .wy-edit-form textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: #132d46;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}
#dynamicPanelContent .wy-edit-form input:focus,
#dynamicPanelContent .wy-edit-form textarea:focus {
  outline: none;
  border-color: #14678b;
  box-shadow: 0 0 0 3px rgba(20, 103, 139, 0.18);
}
#dynamicPanelContent .wy-edit-form textarea { resize: vertical; min-height: 52px; }
#dynamicPanelContent .wy-edit-form code {
  background: #f3f4f6;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 12px;
}
#dynamicPanelContent .wy-field-hint {
  font-size: 12px;
  color: #6b7280;
  margin: 4px 0 0;
}

#dynamicPanelContent .wy-edit-foot {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #eef2f6;
}

/* ─── Icono actual + botón "Cambiar icono" ─────────────────── */
#dynamicPanelContent .wy-icon-current-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 4px 0;
}
#dynamicPanelContent .wy-icon-current-preview {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background-color: #e5f0fb;
  border: 1px solid rgba(124, 161, 188, 0.28);
  flex-shrink: 0;
}
#dynamicPanelContent .wy-icon-current-preview::before {
  content: attr(data-icon);
  font-family: "Material Symbols Rounded", sans-serif;
  font-size: 22px;
  color: #2f5d84;
}

/* Grid de iconos dentro del panel del dashboard */
#dynamicPanelContent .wy-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(42px, 1fr));
  gap: 5px;
  max-height: 220px;
  overflow-y: auto;
  margin-top: 8px;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f9fafb;
}
#dynamicPanelContent .wy-icon-option {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
  padding: 0;
}
#dynamicPanelContent .wy-icon-option:hover {
  background: #e5f0fb;
  transform: scale(1.06);
}
#dynamicPanelContent .wy-icon-option.selected {
  border-color: #19a677;
  background: #d4f5e7;
  box-shadow: 0 4px 10px rgba(25, 166, 119, 0.18);
}
#dynamicPanelContent .wy-icon-option-glyph::before {
  content: attr(data-icon);
  font-family: "Material Symbols Rounded", sans-serif;
  font-size: 20px;
  color: #2f5d84;
  line-height: 1;
}
#dynamicPanelContent .wy-icon-option.selected .wy-icon-option-glyph::before { color: #189f78; }

/* ═════════ F2.4: Tarjeta "+ Añadir desde catálogo" en la cuadrícula ════
 * Misma estructura que .option-card (mismo tamaño, posición, layout) pero
 * con borde discontinuo + fondo translúcido + icono "+". Reutiliza todas
 * las reglas de .option-card y solo aplica overrides. */

#edWysiwygRoot .option-card.wy-card-add {
  border-style: dashed;
  border-color: rgba(20, 103, 139, 0.42);
  background: rgba(20, 103, 139, 0.04);
  box-shadow: none;
  cursor: pointer;
}
#edWysiwygRoot .option-card.wy-card-add:hover {
  background: rgba(20, 103, 139, 0.10);
  border-color: rgba(20, 103, 139, 0.7);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(20, 103, 139, 0.10);
}
#edWysiwygRoot .option-card.wy-card-add::before {
  background-color: transparent;
  color: rgba(20, 103, 139, 0.55);
  border: 1.5px dashed rgba(20, 103, 139, 0.42);
  box-shadow: none;
  font-size: 26px;
}
#edWysiwygRoot .option-card.wy-card-add:hover::before {
  color: #14678b;
  border-color: rgba(20, 103, 139, 0.85);
  background-color: rgba(255, 255, 255, 0.55);
}
#edWysiwygRoot .option-card.wy-card-add strong {
  color: #14678b;
  font-weight: 700;
  letter-spacing: -0.2px;
}
#edWysiwygRoot .reform-grid .option-card.wy-card-add strong { font-size: 18px; }
#edWysiwygRoot .chapter-grid .option-card.wy-card-add strong { font-size: 16px; }
#edWysiwygRoot .option-card.wy-card-add small {
  color: #5e7a96;
  opacity: 0.85;
}

/* La tarjeta-add NO debe llevar handles de edición (no es editable) */
#edWysiwygRoot .option-card.wy-card-add .wy-handles { display: none; }

/* Estado deshabilitado (catálogo vacío) — sigue visible pero no clickable */
#edWysiwygRoot .option-card.wy-card-add-disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
#edWysiwygRoot .option-card.wy-card-add-disabled:hover {
  background: rgba(20, 103, 139, 0.04);
  border-color: rgba(20, 103, 139, 0.42);
  transform: none;
  box-shadow: none;
}
#edWysiwygRoot .option-card.wy-card-add-disabled:hover::before {
  color: rgba(20, 103, 139, 0.55);
  border-color: rgba(20, 103, 139, 0.42);
  background-color: transparent;
}

/* ═════════ F3: Tarjeta "+ Crear nuevo" (verde, custom) ═════════ */
#edWysiwygRoot .option-card.wy-card-create {
  border-style: dashed;
  border-color: rgba(25, 166, 119, 0.5);
  background: rgba(25, 166, 119, 0.04);
  box-shadow: none;
  cursor: pointer;
}
#edWysiwygRoot .option-card.wy-card-create:hover {
  background: rgba(25, 166, 119, 0.10);
  border-color: rgba(25, 166, 119, 0.8);
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(25, 166, 119, 0.10);
}
#edWysiwygRoot .option-card.wy-card-create::before {
  background-color: transparent;
  color: rgba(25, 166, 119, 0.7);
  border: 1.5px dashed rgba(25, 166, 119, 0.5);
  box-shadow: none;
  font-size: 26px;
}
#edWysiwygRoot .option-card.wy-card-create:hover::before {
  color: #189f78;
  border-color: rgba(25, 166, 119, 0.9);
  background-color: rgba(255, 255, 255, 0.55);
}
#edWysiwygRoot .option-card.wy-card-create strong {
  color: #189f78;
  font-weight: 700;
  letter-spacing: -0.2px;
}
#edWysiwygRoot .reform-grid .option-card.wy-card-create strong { font-size: 18px; }
#edWysiwygRoot .chapter-grid .option-card.wy-card-create strong { font-size: 16px; }
#edWysiwygRoot .option-card.wy-card-create small {
  color: #4a7361;
  opacity: 0.85;
}
#edWysiwygRoot .option-card.wy-card-create .wy-handles { display: none; }

/* Input con error de validación — sin scope para que funcione tanto en
   el form de creación del catálogo como en el modal del Catálogo. */
.wy-input-error {
  border-color: #b23535 !important;
  box-shadow: 0 0 0 3px rgba(178, 53, 53, 0.16) !important;
}

/* Select del form de creación de capítulo */
#dynamicPanelContent .wy-edit-form select {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #ffffff;
  color: #132d46;
  cursor: pointer;
  box-sizing: border-box;
}
#dynamicPanelContent .wy-edit-form select:focus {
  outline: none;
  border-color: #14678b;
  box-shadow: 0 0 0 3px rgba(20, 103, 139, 0.18);
}

/* Lista de checkboxes (triggerActions) en form de capítulo */
#dynamicPanelContent .wy-trigger-list {
  max-height: 220px;
  overflow-y: auto;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 6px;
  background: #f9fafb;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#dynamicPanelContent .wy-trigger-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background-color .12s ease;
}
#dynamicPanelContent .wy-trigger-row:hover { background: #e5f0fb; }
#dynamicPanelContent .wy-trigger-row input[type="checkbox"] {
  margin: 0;
  flex-shrink: 0;
  cursor: pointer;
}
#dynamicPanelContent .wy-trigger-row span {
  font-size: 13px;
  color: #17334c;
  line-height: 1.3;
}

/* Toolbar arriba de la tabla de capítulos */
#sec-editor section[data-tab-content="chapters"] .chapters-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* Lista del catálogo dentro del panel derecho del dashboard */
#dynamicPanelContent .wy-cat-sub {
  margin: 0 0 12px;
  font-size: 12.5px;
  color: #5e768d;
  line-height: 1.4;
}
#dynamicPanelContent .wy-cat-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: calc(100vh - 360px);
  overflow-y: auto;
}
#dynamicPanelContent .wy-cat-row {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid #e5e9ef;
  border-radius: 10px;
  background: #ffffff;
  transition: border-color .12s ease, background-color .12s ease;
}
#dynamicPanelContent .wy-cat-row:hover {
  border-color: #19a677;
  background: #f5fcf8;
}
#dynamicPanelContent .wy-cat-icon {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background-color: #e5f0fb;
  border: 1px solid rgba(124, 161, 188, 0.28);
  flex-shrink: 0;
}
#dynamicPanelContent .wy-cat-icon::before {
  content: attr(data-icon);
  font-family: "Material Symbols Rounded", sans-serif;
  font-size: 18px;
  color: #2f5d84;
}
#dynamicPanelContent .wy-cat-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
#dynamicPanelContent .wy-cat-text strong {
  font-size: 13.5px;
  font-weight: 700;
  color: #17334c;
  line-height: 1.2;
  word-break: break-word;
}
#dynamicPanelContent .wy-cat-text small {
  font-size: 11.5px;
  color: #6b7280;
  line-height: 1.3;
}
#dynamicPanelContent .wy-cat-add {
  white-space: nowrap;
  padding: 5px 10px;
}
#dynamicPanelContent .wy-cat-empty {
  padding: 24px 16px;
  text-align: center;
  color: #6b7280;
  background: #f9fafb;
  border-radius: 10px;
}
#dynamicPanelContent .wy-cat-empty p { margin: 0; font-size: 13px; }

/* ═════════ F2.5: Sub-nav dentro de "Configuración avanzada" ════════ */

#sec-editor section[data-tab-content="advanced"] .adv-subnav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  margin: 0 0 16px;
  background: #f4f6fa;
  border: 1px solid #e1e6ee;
  border-radius: 12px;
}
#sec-editor section[data-tab-content="advanced"] .adv-subtab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #4b5b73;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color .12s ease, color .12s ease;
  font-family: inherit;
}
#sec-editor section[data-tab-content="advanced"] .adv-subtab .ic { font-size: 14px; line-height: 1; }
#sec-editor section[data-tab-content="advanced"] .adv-subtab:hover {
  background: rgba(255, 255, 255, 0.7);
  color: #14678b;
}
#sec-editor section[data-tab-content="advanced"] .adv-subtab.active {
  background: #ffffff;
  color: #132d46;
  box-shadow: 0 2px 6px rgba(11, 33, 54, 0.08);
}
#sec-editor section[data-tab-content="advanced"] .adv-subcontent > section h2 {
  margin-top: 0;
}

/* ─── Icon picker visual (F2.3) ─────────────────────────────── */

#edWysiwygRoot .wy-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid #cbd5e1;
  border-radius: 10px;
  background: #f9fafb;
}

#edWysiwygRoot .wy-icon-option {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  border: 1.5px solid transparent;
  border-radius: 8px;
  background: #ffffff;
  cursor: pointer;
  transition: transform .12s ease, border-color .12s ease, background-color .12s ease;
  padding: 0;
}
#edWysiwygRoot .wy-icon-option:hover {
  background: #e5f0fb;
  transform: scale(1.06);
}
#edWysiwygRoot .wy-icon-option:focus-visible {
  outline: 0;
  border-color: #14678b;
  box-shadow: 0 0 0 3px rgba(20, 103, 139, 0.18);
}
#edWysiwygRoot .wy-icon-option.selected {
  border-color: #19a677;
  background: #d4f5e7;
  box-shadow: 0 4px 10px rgba(25, 166, 119, 0.18);
}
#edWysiwygRoot .wy-icon-option-glyph::before {
  content: attr(data-icon);
  font-family: "Material Symbols Rounded", sans-serif;
  font-size: 22px;
  color: #2f5d84;
  line-height: 1;
}
#edWysiwygRoot .wy-icon-option.selected .wy-icon-option-glyph::before {
  color: #189f78;
}

/* ─── Detalle (último nivel) ─────────────────────────────────── */
#edWysiwygRoot .wy-detail-card {
  background: #fff;
  border: 1px solid var(--wy-line);
  border-radius: 16px;
  padding: 20px 24px;
  max-width: 640px;
  box-shadow: 0 6px 12px rgba(11, 42, 67, 0.07);
}
#edWysiwygRoot .wy-detail-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 16px;
}
#edWysiwygRoot .wy-detail-icon {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background-color: #e5f0fb;
  border: 1px solid rgba(124, 161, 188, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}
#edWysiwygRoot .wy-detail-icon::before {
  content: attr(data-icon);
  font-family: "Material Symbols Rounded", sans-serif;
  font-size: 30px;
  color: #2f5d84;
}
#edWysiwygRoot .wy-detail-header h3 {
  margin: 0;
  font-size: 22px;
  font-weight: 800;
  color: #132d46;
  font-family: var(--wy-brand-display);
}
#edWysiwygRoot .wy-detail-fields {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 10px 18px;
  margin: 0 0 16px;
}
#edWysiwygRoot .wy-detail-fields dt {
  font-size: 13px;
  color: var(--wy-muted);
  font-weight: 600;
}
#edWysiwygRoot .wy-detail-fields dd {
  margin: 0;
  font-size: 14px;
  color: var(--wy-text);
}
#edWysiwygRoot .wy-detail-fields code {
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12.5px;
}
#edWysiwygRoot .wy-detail-hint {
  margin: 12px 0 0;
  padding: 10px 12px;
  background: rgba(20, 103, 139, 0.06);
  border-left: 3px solid #14678b;
  border-radius: 0 6px 6px 0;
  font-size: 13px;
  color: #4b5563;
}

/* ─── Vista de detalle editable ──────────────────────────────── */
#edWysiwygRoot .wy-detail-badge {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
}
#edWysiwygRoot .wy-detail-badge-custom {
  background: linear-gradient(135deg, #15986c, #19b083);
  color: #fff;
}
#edWysiwygRoot .wy-detail-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}
#edWysiwygRoot .wy-detail-form .wy-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
#edWysiwygRoot .wy-detail-form .wy-field > span {
  font-size: 13px;
  font-weight: 600;
  color: var(--wy-text);
}
#edWysiwygRoot .wy-detail-form .wy-field small {
  font-weight: 400;
  color: var(--wy-muted);
  margin-left: 4px;
}
#edWysiwygRoot .wy-detail-form input[type="text"],
#edWysiwygRoot .wy-detail-form input[type="number"],
#edWysiwygRoot .wy-detail-form textarea {
  padding: 9px 12px;
  font-size: 14px;
  border: 1px solid var(--wy-line);
  border-radius: 8px;
  background: #fff;
  color: var(--wy-text);
  font-family: inherit;
  resize: vertical;
}
#edWysiwygRoot .wy-detail-form input:focus,
#edWysiwygRoot .wy-detail-form textarea:focus {
  outline: none;
  border-color: #14678b;
  box-shadow: 0 0 0 3px rgba(20, 103, 139, 0.16);
}
#edWysiwygRoot .wy-detail-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--wy-line);
}
#edWysiwygRoot .wy-btn-saved {
  background: linear-gradient(135deg, #15986c, #19b083) !important;
  color: #fff !important;
  border-color: #15986c !important;
  cursor: default !important;
  transform: scale(1.02);
  transition: transform 0.18s ease, background 0.18s ease;
}

/* ─── Responsive ─────────────────────────────────────────────── */
@media (max-width: 720px) {
  #edWysiwygRoot .reform-grid,
  #edWysiwygRoot .chapter-grid { grid-template-columns: 1fr; }
  #edWysiwygRoot .option-card { min-height: 92px; padding: 10px 12px 10px 64px; }
  #edWysiwygRoot .option-card::before { width: 38px; height: 38px; font-size: 21px; left: 12px; top: 12px; }
  #edWysiwygRoot .reform-grid .option-card strong { font-size: 22px; }
  #edWysiwygRoot .wy-detail-fields { grid-template-columns: 1fr; }
}

/* ─── Toggle "Saltar este paso en el wizard" ─────────────────── */
#edWysiwygRoot .wy-skip-toggle {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: rgba(20, 103, 139, 0.05);
  border: 1px solid rgba(20, 103, 139, 0.18);
  border-radius: 10px;
}
/* Slot del warning: usa grid-template-rows + transición para que el espacio
   se reserve suavemente al aparecer/desaparecer, sin que la página entera
   "tiemble" con un reflow brusco. */
#edWysiwygRoot .wy-skip-warn-slot {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows .22s ease, margin-top .22s ease;
  margin-top: 0;
  overflow: hidden;
}
#edWysiwygRoot .wy-skip-warn-slot:has(.wy-skip-warn) {
  grid-template-rows: 1fr;
  margin-top: 10px;
}
#edWysiwygRoot .wy-skip-warn {
  min-height: 0;     /* sin esto grid-rows colapsa con overflow visible */
  padding: 10px 12px;
  background: #fff3cd;
  border: 1px solid #ffc107;
  border-left: 4px solid #ff9800;
  border-radius: 6px;
  font-size: 12.5px;
  line-height: 1.45;
  color: #7a5b00;
  font-weight: 500;
}
html[data-theme="dark"] #edWysiwygRoot .wy-skip-warn {
  background: rgba(255, 193, 7, 0.12);
  color: #ffc107;
}

/* Badge "Auto-elegida" sobre la única tarjeta visible cuando el toggle
   "Saltar este paso" está activo. Borde verde + chip flotante. */
#edWysiwygRoot .option-card-auto {
  border-color: #15986c !important;
  box-shadow: 0 0 0 3px rgba(21,152,108,.18), 0 8px 20px rgba(21,152,108,.14) !important;
  position: relative;
}
#edWysiwygRoot .wy-auto-badge {
  position: absolute;
  top: -10px; left: 50%;
  transform: translateX(-50%);
  background: #15986c;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.4px;
  padding: 3px 10px;
  border-radius: 999px;
  box-shadow: 0 2px 6px rgba(21,152,108,.35);
  white-space: nowrap;
  z-index: 2;
  pointer-events: none;
  animation: wyAutoBadgePop .25s ease-out;
}
@keyframes wyAutoBadgePop {
  from { transform: translateX(-50%) translateY(4px) scale(.85); opacity: 0; }
  to   { transform: translateX(-50%) translateY(0)   scale(1);   opacity: 1; }
}
html[data-theme="dark"] #edWysiwygRoot .option-card-auto {
  box-shadow: 0 0 0 3px rgba(21,152,108,.28), 0 8px 20px rgba(21,152,108,.2) !important;
}
#edWysiwygRoot .wy-skip-toggle-label {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}
#edWysiwygRoot .wy-skip-toggle-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
#edWysiwygRoot .wy-skip-switch {
  flex: 0 0 auto;
  position: relative;
  width: 42px;
  height: 24px;
  background: #cbd5e1;
  border-radius: 12px;
  transition: background 0.2s ease;
}
#edWysiwygRoot .wy-skip-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.18);
  transition: transform 0.2s ease;
}
#edWysiwygRoot .wy-skip-toggle-label input:checked ~ .wy-skip-switch {
  background: #14678b;
}
#edWysiwygRoot .wy-skip-toggle-label input:checked ~ .wy-skip-switch .wy-skip-switch-knob {
  transform: translateX(18px);
}
#edWysiwygRoot .wy-skip-toggle-label input:focus-visible ~ .wy-skip-switch {
  outline: 2px solid #14678b;
  outline-offset: 2px;
}
#edWysiwygRoot .wy-skip-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
#edWysiwygRoot .wy-skip-text strong {
  font-size: 14px;
  color: var(--wy-text);
  font-weight: 600;
}
#edWysiwygRoot .wy-skip-text small {
  font-size: 12.5px;
  color: var(--wy-muted);
  line-height: 1.35;
}

/* ─── Placeholder del modo Detallado m² ──────────────────────── */
#edWysiwygRoot .wy-detailed-placeholder {
  padding: 24px 28px;
  background: rgba(20, 103, 139, 0.04);
  border: 1px dashed rgba(20, 103, 139, 0.32);
  border-radius: 12px;
  color: var(--wy-text);
  line-height: 1.5;
}
#edWysiwygRoot .wy-detailed-placeholder p {
  margin: 0 0 12px;
  font-size: 14px;
}
#edWysiwygRoot .wy-detailed-placeholder p:last-child {
  margin-bottom: 0;
  color: var(--wy-muted);
  font-size: 13px;
}

/* ─── Heading editable (lápiz al lado de h2) ─────────────────── */
/* display:flex block-level — el heading queda en su línea (sin compartir
   con el subtítulo, que va debajo). justify-content por defecto deja el
   h2 + lápiz alineados a la izquierda y el espacio sobrante a la derecha. */
#edWysiwygRoot .wy-heading-editable {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}
#edWysiwygRoot .wy-heading-editable h2 {
  margin: 0;
  flex: 0 1 auto;
}
#edWysiwygRoot .wy-heading-edit-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  background: transparent;
  border: 1px solid rgba(20, 103, 139, 0.32);
  border-radius: 50%;
  color: #14678b;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
  flex: 0 0 auto;
}
#edWysiwygRoot .wy-heading-edit-btn:hover {
  background: rgba(20, 103, 139, 0.08);
  transform: scale(1.05);
}
#edWysiwygRoot .wy-heading-editing {
  flex-wrap: wrap;
}
#edWysiwygRoot .wy-heading-input {
  flex: 1 1 280px;
  min-width: 0;
  padding: 8px 12px;
  font-size: 18px;
  font-weight: 600;
  border: 1px solid rgba(20, 103, 139, 0.45);
  border-radius: 8px;
  background: #fff;
  color: var(--wy-text);
}
#edWysiwygRoot .wy-heading-input:focus {
  outline: none;
  border-color: #14678b;
  box-shadow: 0 0 0 3px rgba(20, 103, 139, 0.18);
}

/* ─── Tarjeta de modo (RAPIDO / DETALLADO_M2) ────────────────── */
#edWysiwygRoot .mode-grid .option-card.mode-choice {
  cursor: pointer;
  position: relative;
}
#edWysiwygRoot .mode-grid .mode-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 3px 9px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.6px;
  background: linear-gradient(90deg, #15986c, #19b083);
  color: #fff;
  border-radius: 999px;
  text-transform: uppercase;
}

/* ─── Bloque de multiplicador en el form de detalle ──────────── */
#edWysiwygRoot .wy-multiplier-block {
  margin-top: 14px;
  padding: 14px;
  background: rgba(20, 103, 139, 0.04);
  border: 1px solid rgba(20, 103, 139, 0.18);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
#edWysiwygRoot .wy-multiplier-toggle {
  display: flex;
  align-items: center;
  gap: 14px;
  cursor: pointer;
  user-select: none;
}
#edWysiwygRoot .wy-multiplier-toggle input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
#edWysiwygRoot .wy-multiplier-fields {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 14px;
}
#edWysiwygRoot .wy-multiplier-fields[hidden] {
  display: none;
}
@media (max-width: 520px) {
  #edWysiwygRoot .wy-multiplier-fields {
    grid-template-columns: 1fr;
  }
}

/* ─── Animación de transición entre niveles ────────────────────
   Cuando entras "dentro" de una tarjeta, la pantalla nueva (siguiente
   nivel) aparece con un fade-in suave. Combinado con la animación JS
   de la tarjeta agrandándose, el resultado se siente como un zoom
   continuo. */
@keyframes wy-step-enter-anim {
  0%   { opacity: 0; transform: translateY(8px) scale(0.985); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
#edWysiwygRoot .wy-step.wy-step-enter {
  animation: wy-step-enter-anim 0.36s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* Respeto a usuarios con reduce-motion activado: sin animaciones. */
@media (prefers-reduced-motion: reduce) {
  #edWysiwygRoot .wy-step.wy-step-enter {
    animation: none;
  }
  #edWysiwygRoot .option-card {
    transition: none !important;
  }
}

/* ─── Incompatibilidades entre acciones ──────────────────────── */
.wy-incompat-block {
  margin-top: 12px;
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 12px;
}
.wy-incompat-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 8px; }
.wy-incompat-head strong { font-size: 13px; color: #991b1b; }
.wy-incompat-head small { font-size: 11.5px; color: #7f1d1d; line-height: 1.35; }
.wy-incompat-ctx { font-size: 11px !important; color: #b91c1c !important; font-style: italic; margin-top: 2px; }
.wy-incompat-ctx strong { color: #7f1d1d; font-style: normal; }
.wy-incompat-list { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 10px; max-height: 220px; overflow-y: auto; }
.wy-incompat-row {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: #111827;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
}
.wy-incompat-row:hover { background: rgba(255,255,255,.6); }
.wy-incompat-row input[type="checkbox"] { width: 14px; height: 14px; accent-color: #b91c1c; cursor: pointer; }
@media (max-width: 720px) { .wy-incompat-list { grid-template-columns: 1fr; } }

/* ─── "Reutilizar de tu catálogo" en el modal de crear ────────── */
.wy-reuse-block {
  padding: 14px 16px 0;
  border-bottom: 1px dashed #e5e7eb;
  margin: 0 0 6px;
}
.wy-reuse-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.wy-reuse-title {
  font-size: 12px; font-weight: 700; color: #15986c;
  text-transform: uppercase; letter-spacing: .04em;
}
.wy-reuse-count {
  font-size: 11px; font-weight: 700;
  background: #d1fae5; color: #047857;
  padding: 1px 8px; border-radius: 999px;
}
.wy-reuse-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  margin-bottom: 12px;
}
.wy-reuse-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 8px 12px;
  background: #f8fafc;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  cursor: pointer;
  text-align: left;
  transition: border-color .15s, background .15s, transform .15s;
}
.wy-reuse-card:hover {
  border-color: #15986c;
  background: #ecfdf5;
  transform: translateY(-1px);
}
.wy-reuse-card:active { transform: scale(.985); }
.wy-reuse-label { font-size: 13px; font-weight: 600; color: #111827; }
.wy-reuse-usage { font-size: 10.5px; color: #6b7280; }
.wy-reuse-divider {
  position: relative;
  text-align: center;
  margin: 12px 0 4px;
  color: #9ca3af;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .08em;
}
.wy-reuse-divider::before {
  content: '';
  position: absolute; top: 50%; left: 0; right: 0;
  height: 1px; background: #e5e7eb;
  z-index: 0;
}
.wy-reuse-divider span {
  position: relative; z-index: 1;
  background: #fff;
  padding: 0 12px;
}

/* ═══════════════════════════════════════════════════════════════
   MODO OSCURO — overrides del editor visual (WYSIWYG)
   ═══════════════════════════════════════════════════════════════ */

/* Bloque "Incompatibles con este trabajo" */
html[data-theme="dark"] .wy-incompat-block {
  background: #2a1010;
  border-color: #5a1f1f;
}
html[data-theme="dark"] .wy-incompat-head strong { color: #fca5a5; }
html[data-theme="dark"] .wy-incompat-head small { color: #f87171; }
html[data-theme="dark"] .wy-incompat-ctx { color: #fca5a5 !important; }
html[data-theme="dark"] .wy-incompat-ctx strong { color: #fecaca; }
html[data-theme="dark"] .wy-incompat-row { color: #e2e6f0; }
html[data-theme="dark"] .wy-incompat-row:hover { background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .wy-incompat-row input[type="checkbox"] { accent-color: #ef4444; }

/* "Reutilizar de tu catálogo" */
html[data-theme="dark"] .wy-reuse-block { border-bottom-color: #2c3044; }
html[data-theme="dark"] .wy-reuse-title { color: #34d399; }
html[data-theme="dark"] .wy-reuse-count { background: #0d2218; color: #6ee7b7; }
html[data-theme="dark"] .wy-reuse-card {
  background: #232638; border-color: var(--border, #2c3044);
}
html[data-theme="dark"] .wy-reuse-card:hover { background: #1a3329; border-color: #34d399; }
html[data-theme="dark"] .wy-reuse-label { color: #e2e6f0; }
html[data-theme="dark"] .wy-reuse-usage { color: #8892a8; }
html[data-theme="dark"] .wy-reuse-divider { color: #6a7388; }
html[data-theme="dark"] .wy-reuse-divider::before { background: #2c3044; }
html[data-theme="dark"] .wy-reuse-divider span { background: var(--card, #1c1f2d); }

/* ═══════════════════════════════════════════════════════════════
   MODO OSCURO — Editor visual WYSIWYG
   Pasada amplia para todas las cards/textos/botones del editor
   visual que tienen colores hardcoded en modo claro.
   ═══════════════════════════════════════════════════════════════ */

/* Botones de navegación (adelante / atrás) */
html[data-theme="dark"] #edWysiwygRoot .wy-nav-btn {
  background: #1c1f2d;
  color: #6ee7b7;
  border-color: rgba(110, 231, 183, 0.4);
}
html[data-theme="dark"] #edWysiwygRoot .wy-nav-btn:hover:not(:disabled) {
  background: rgba(110, 231, 183, 0.08);
  border-color: rgba(110, 231, 183, 0.7);
}
html[data-theme="dark"] #edWysiwygRoot .wy-nav-btn:disabled {
  color: #6a7388;
  border-color: var(--border, #2c3044);
  background: #14171f;
}

/* Cabeceras de cada nivel ("Tipos de reforma", "Zonas", "Trabajos", "Detalle") */
html[data-theme="dark"] #edWysiwygRoot .wy-step h2 { color: #e2e6f0; }
html[data-theme="dark"] #edWysiwygRoot .wy-step .subtitle { color: #8892a8; }

/* Tarjetas option-card del editor visual (todas las del wizard interno) */
html[data-theme="dark"] #edWysiwygRoot .option-card {
  background: linear-gradient(180deg, #1c1f2d 0%, #232638 100%);
  border-color: var(--border, #2c3044);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}
html[data-theme="dark"] #edWysiwygRoot .option-card:hover {
  border-color: #34d399;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.45);
}
html[data-theme="dark"] #edWysiwygRoot .option-card.selected {
  background: linear-gradient(180deg, #0d2218 0%, #11302a 100%);
  border-color: #34d399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.2), 0 8px 18px rgba(0, 0, 0, 0.4);
}
html[data-theme="dark"] #edWysiwygRoot .option-card strong,
html[data-theme="dark"] #edWysiwygRoot .option-card h3,
html[data-theme="dark"] #edWysiwygRoot .option-card h4 { color: #e2e6f0; }
html[data-theme="dark"] #edWysiwygRoot .option-card small,
html[data-theme="dark"] #edWysiwygRoot .option-card p,
html[data-theme="dark"] #edWysiwygRoot .option-card .desc { color: #8892a8; }
html[data-theme="dark"] #edWysiwygRoot .option-card.selected strong,
html[data-theme="dark"] #edWysiwygRoot .option-card.selected small { color: #e2e6f0; }

/* Tarjetas wy-card (variantes) */
html[data-theme="dark"] #edWysiwygRoot .wy-card,
html[data-theme="dark"] #edWysiwygRoot .wy-card-add,
html[data-theme="dark"] #edWysiwygRoot .wy-card-create {
  background: linear-gradient(180deg, #1c1f2d 0%, #232638 100%);
  border-color: var(--border, #2c3044);
  color: #e2e6f0;
}
html[data-theme="dark"] #edWysiwygRoot .wy-card:hover {
  border-color: #34d399;
}
html[data-theme="dark"] #edWysiwygRoot .wy-card-add,
html[data-theme="dark"] #edWysiwygRoot .wy-card-create {
  border-style: dashed;
  color: #6ee7b7;
}
html[data-theme="dark"] #edWysiwygRoot .wy-card-add:hover,
html[data-theme="dark"] #edWysiwygRoot .wy-card-create:hover {
  background: rgba(52, 211, 153, 0.06);
  border-color: #34d399;
}
html[data-theme="dark"] #edWysiwygRoot .wy-card-flag,
html[data-theme="dark"] #edWysiwygRoot .wy-card-badge-custom {
  background: rgba(255, 255, 255, 0.1);
}

/* Breadcrumb del editor visual ("Tipos > Cocina > Trabajos") */
html[data-theme="dark"] #edWysiwygRoot .wy-crumb,
html[data-theme="dark"] #edWysiwygRoot .wy-crumbs { color: #8892a8; }
html[data-theme="dark"] #edWysiwygRoot .wy-crumb-current { color: #e2e6f0; background: rgba(52, 211, 153, 0.12); }
html[data-theme="dark"] #edWysiwygRoot .wy-crumb a { color: #6ee7b7; }
html[data-theme="dark"] #edWysiwygRoot .wy-crumbs-sep { color: #6a7388; }

/* Panel lateral derecho de edición (renderEditingIntoDashboardPanel) */
html[data-theme="dark"] .wy-edit-pane {
  background: var(--card, #1c1f2d);
  border-color: var(--border, #2c3044);
  color: #e2e6f0;
}
html[data-theme="dark"] .wy-edit-head h3 { color: #e2e6f0; }
html[data-theme="dark"] .wy-edit-eyebrow { color: #6ee7b7; }
html[data-theme="dark"] .wy-edit-close { color: #8892a8; }
html[data-theme="dark"] .wy-edit-close:hover { background: #232638; color: #e2e6f0; }
html[data-theme="dark"] .wy-edit-form .wy-field span,
html[data-theme="dark"] .wy-edit-form .wy-field label { color: #c8d4e0; }
html[data-theme="dark"] .wy-edit-form .wy-field small { color: #8892a8; }
html[data-theme="dark"] #dynamicPanelContent .wy-edit-form input,
html[data-theme="dark"] #dynamicPanelContent .wy-edit-form select,
html[data-theme="dark"] #dynamicPanelContent .wy-edit-form textarea,
html[data-theme="dark"] .wy-edit-form input,
html[data-theme="dark"] .wy-edit-form select,
html[data-theme="dark"] .wy-edit-form textarea {
  background: #232638;
  border-color: var(--border, #2c3044);
  color: #e2e6f0;
}
html[data-theme="dark"] #dynamicPanelContent .wy-edit-form input::placeholder,
html[data-theme="dark"] #dynamicPanelContent .wy-edit-form textarea::placeholder,
html[data-theme="dark"] .wy-edit-form input::placeholder,
html[data-theme="dark"] .wy-edit-form textarea::placeholder { color: #6a7388; }
html[data-theme="dark"] .wy-field-hint { color: #8892a8; }
html[data-theme="dark"] .wy-input-error { border-color: #ef4444 !important; }

/* Vista detalle central */
html[data-theme="dark"] #edWysiwygRoot .wy-detail-card {
  background: var(--card, #1c1f2d);
  border-color: var(--border, #2c3044);
  color: #e2e6f0;
}
html[data-theme="dark"] #edWysiwygRoot .wy-detail-header h3 { color: #e2e6f0; }
html[data-theme="dark"] #edWysiwygRoot .wy-detail-badge {
  background: #232638;
  color: #c8d4e0;
}
html[data-theme="dark"] #edWysiwygRoot .wy-detail-badge-custom {
  background: #0d2218;
  color: #6ee7b7;
}

/* Bloque multiplier toggle */
html[data-theme="dark"] .wy-multiplier-block {
  background: #14171f;
  border-color: var(--border, #2c3044);
}
html[data-theme="dark"] .wy-multiplier-toggle .wy-skip-text strong { color: #e2e6f0; }
html[data-theme="dark"] .wy-multiplier-toggle .wy-skip-text small { color: #8892a8; }
html[data-theme="dark"] .wy-skip-switch { background: #2c3044; }
html[data-theme="dark"] .wy-multiplier-toggle input:checked ~ .wy-skip-switch { background: #34d399; }

/* Variables del editor visual: en oscuro las redefinimos a tonos claros
   para que cualquier elemento que use var(--wy-text)/var(--wy-muted) se
   vea bien sin tocar regla por regla. */
html[data-theme="dark"] #edWysiwygRoot {
  --wy-text: #e2e6f0;
  --wy-muted: #8892a8;
}

/* Skip toggle individual de niveles — fondo más claro que el card para
   que destaque + sus textos contraseñados con var(--wy-text)/--wy-muted. */
html[data-theme="dark"] #edWysiwygRoot .wy-skip-toggle {
  background: rgba(110, 231, 183, 0.06);
  border-color: rgba(110, 231, 183, 0.28);
}
html[data-theme="dark"] #edWysiwygRoot .wy-skip-text strong { color: #e2e6f0; }
html[data-theme="dark"] #edWysiwygRoot .wy-skip-text small { color: #8892a8; }
html[data-theme="dark"] #edWysiwygRoot .wy-skip-switch { background: #2c3044; }
html[data-theme="dark"] #edWysiwygRoot .wy-skip-toggle-label input:checked ~ .wy-skip-switch { background: #34d399; }
html[data-theme="dark"] #edWysiwygRoot .wy-skip-switch-knob { background: #e2e6f0; }

/* Icon picker grid */
html[data-theme="dark"] #edWysiwygRoot .wy-icon-grid {
  background: #14171f;
  border-color: var(--border, #2c3044);
}
html[data-theme="dark"] #edWysiwygRoot .wy-icon-option {
  background: var(--card, #1c1f2d);
  border-color: var(--border, #2c3044);
  color: #c8d4e0;
}
html[data-theme="dark"] #edWysiwygRoot .wy-icon-option:hover { border-color: #34d399; }
html[data-theme="dark"] #edWysiwygRoot .wy-icon-option.is-current {
  border-color: #34d399;
  background: #0d2218;
}
html[data-theme="dark"] #edWysiwygRoot .wy-icon-current-preview {
  background: #232638;
  border-color: var(--border, #2c3044);
}

/* "Empty" cards (cuando un nivel no tiene items) */
html[data-theme="dark"] #edWysiwygRoot .wy-cat-empty,
html[data-theme="dark"] #edWysiwygRoot .wy-empty {
  background: #14171f;
  border-color: var(--border, #2c3044);
  color: #8892a8;
}

/* Tabs internas del editor visual (modes/types/zones/actions navigators) */
html[data-theme="dark"] #edWysiwygRoot .wy-level-tabs {
  background: #1c1f2d;
  border-color: var(--border, #2c3044);
}
html[data-theme="dark"] #edWysiwygRoot .wy-level-tab { color: #8892a8; }
html[data-theme="dark"] #edWysiwygRoot .wy-level-tab.active { background: #232638; color: #34d399; }

/* F2/D2 — banda de plantillas de negocio en la vista de Tipos */
#edWysiwygRoot .wy-templates-band {
  margin-top: 22px; padding-top: 16px; border-top: 1px dashed var(--wz-border, #e2e8f0);
}
#edWysiwygRoot .wy-templates-head { margin-bottom: 12px; }
#edWysiwygRoot .wy-templates-title { display: block; font-weight: 800; color: #14678b; font-size: 14px; }
#edWysiwygRoot .wy-templates-head small { color: var(--muted, #64748b); font-size: 12.5px; }
#edWysiwygRoot .wy-card-template { cursor: pointer; border-style: dashed; }
#edWysiwygRoot .wy-card-template:hover { border-color: #14678b; transform: translateY(-2px); }
html[data-theme="dark"] #edWysiwygRoot .wy-templates-band { border-top-color: #2a2f42; }
html[data-theme="dark"] #edWysiwygRoot .wy-templates-title { color: #34d399; }

/* ─── Vista previa del hero EN MÓVIL ───────────────────────────────────────
   La "foto" del wizard se portó del editor de PC con un grid de 2 columnas
   (logo izq · texto der). En móvil eso parte el título en una columna estrecha
   (texto vertical) y descuadra todo. Aquí lo APILAMOS y CENTRAMOS, igual que el
   wizard real en móvil, conservando los lápices editables. */
@media (max-width: 820px) {
  #edWysiwygRoot .wy-preview-hero {
    grid-template-columns: 1fr;
    grid-template-areas: "meta" "brand" "title" "subtitle" "slogan";
    column-gap: 0;
    text-align: center;
    padding: 18px 16px 20px;
  }
  #edWysiwygRoot .wy-preview-hero .hero-meta { justify-content: center; }
  #edWysiwygRoot .wy-preview-hero .brand-lockup { align-self: center; margin: 2px auto 8px; }
  #edWysiwygRoot .wy-preview-hero .brand-logo { width: min(150px, 56%); }
  #edWysiwygRoot .wy-preview-hero h1 { font-size: 23px; text-align: center; }
  #edWysiwygRoot .wy-preview-hero p,
  #edWysiwygRoot .wy-preview-hero .hero-slogan { text-align: center; }
  /* El bloque editable (texto + lápiz) se centra como conjunto. */
  #edWysiwygRoot .wy-preview-hero .wy-heading-editable { justify-content: center; flex-wrap: wrap; }
  /* El badge "RECOMENDADO" (.mode-badge, absoluto arriba-dcha) se superponía al
     título de la tarjeta porque las cards del editor NO están en .mode-grid (que
     en el wizard real reserva padding-right). Reservamos el hueco aquí. */
  #edWysiwygRoot .option-card:has(.mode-badge) { padding-right: 112px; }
  /* y que el título no quede pegado al badge en su primera línea */
  #edWysiwygRoot .option-card:has(.mode-badge) strong { line-height: 1.2; }
}
