/* ==========================================================================
   Plásticos Delicias / Carbón del Mezquital
   Animación ASCII Orgánica y Fluida (Sin marcos ficticios de navegador)
   Paleta Determinista Oficial, Colores Semánticos y Switcher UI
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Distribución Split-Hero en Landing Page
   -------------------------------------------------------------------------- */
.hero-split-layout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  max-width: 1320px;
  gap: 3.5rem;
  z-index: 5;
  margin: 0 auto;
}

.hero-split-layout .hero-content {
  flex: 1 1 480px;
  max-width: 560px;
}

.hero-ascii-wrapper {
  flex: 1 1 520px;
  max-width: 580px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  /* Efecto plano / liso sin degradado ni marco */
  background: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  padding: 0.5rem;
}

/* --------------------------------------------------------------------------
   2. Viewport del Lienzo ASCII (Limpio, Nativo, Sin Bordes Ficticios)
   -------------------------------------------------------------------------- */
.ascii-canvas,
.ascii-campfire {
  font-family: "SF Mono", "Fira Code", "Courier New", Courier, monospace;
  letter-spacing: 0.02em;
  background: transparent;
  margin: 0;
  padding: 0.75rem 0.5rem;
  white-space: pre;
  overflow: visible;
  user-select: none;
  display: block;
  text-align: center;
  filter: none;
}

.ascii-canvas {
  /* Escala adaptada para 40-46 columnas (Logo oficial y Carbón 3D) */
  font-size: clamp(8.5px, 1.15vw, 13.5px);
  line-height: 1.08;
}

.ascii-campfire {
  /* Escala para 84 columnas (Fogata de alta resolución) */
  font-size: clamp(5.6px, 0.72vw, 8.6px);
  line-height: 1.05;
}

.ascii-campfire[data-density="2x"] {
  /* Doble densidad: 168 cols x 100 filas ocupan exactamente el MISMO tamaño físico que 84 cols x 50 filas */
  font-size: clamp(5.6px, 0.72vw, 8.6px);
  line-height: 1.05;
  zoom: 0.5;
  -webkit-text-size-adjust: 100%;
}

@supports not (zoom: 0.5) {
  .ascii-campfire[data-density="2x"] {
    transform: scale(0.5);
    transform-origin: top center;
    margin-bottom: -50%;
  }
}

/* --------------------------------------------------------------------------
   3. Tonalidades Oficiales: Marca Corporativa, Carbón, Madera y Llamas
   -------------------------------------------------------------------------- */

/* A. Identidad Corporativa Plásticos Delicias (#0000E0 / #D40500 / #FFFFFF) */
.p-blue,
.c-blue {
  color: #001fd6;
  font-weight: 800;
  text-shadow: 0 0 1px rgba(0, 31, 214, 0.35);
}

.p-red,
.c-red {
  color: #d40500;
  font-weight: 800;
  text-shadow: 0 0 1px rgba(212, 5, 0, 0.35);
}

.p-white,
.c-white {
  color: #ffffff;
  font-weight: 800;
  /* Delineado nítido para máximo contraste sobre fondo arena claro */
  text-shadow: 0 0 1px #3a3229, 0 1px 2px rgba(25, 20, 15, 0.45);
}

/* B. Trozo de Carbón de Mezquite e Incandescencia */
.c-deep {
  color: #111113;
  /* Núcleo de carbón oscuro profundo */
  font-weight: 900;
}

.c-matte {
  color: #27272a;
  /* Carbón mate sólido */
  font-weight: 800;
}

.c-ember {
  color: #9a3412;
  /* Brasa quemada profunda */
  font-weight: 800;
  text-shadow: 0 0 2px rgba(154, 52, 18, 0.4);
}

.c-glow {
  color: #ea580c;
  /* Brasa ámbar viva */
  font-weight: 800;
  text-shadow: 0 0 5px rgba(234, 88, 12, 0.7);
}

.c-hot {
  color: #facc15;
  /* Máxima incandescencia amarilla/oro */
  font-weight: 900;
  text-shadow: 0 0 7px rgba(250, 204, 21, 0.85);
}

.c-spark {
  color: #fbbf24;
  /* Micro-chispa flotante */
  font-weight: 900;
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.85);
}

/* C. Troncos de Madera (Leños de Mezquite con Nueva Base #7a4900) */
.w-deep {
  color: #523100;
  font-weight: 900;
}

.w-bark {
  color: #7a4900;
  /* Base cálida de madera de mezquite para contraste nítido con el carbón #111113 */
  font-weight: 900;
  text-shadow: 0 0 1px rgba(122, 73, 0, 0.35);
}

.w-streak {
  color: #a36300;
  /* Cortes y vetas doradas visibles sobre fondo claro */
  font-weight: 800;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
}

.w-ring {
  color: #9a8a7c;
  /* Anillos concéntricos de corte transversal */
  font-weight: 800;
}

/* D. Llamas de Fogata Clásica */
.f-core {
  color: #ffffff;
  font-weight: 900;
  text-shadow: 0 0 6px rgba(254, 240, 138, 0.9);
}

.f-bright {
  color: #facc15;
  font-weight: 800;
  text-shadow: 0 0 4px rgba(234, 179, 8, 0.6);
}

.f-warm {
  color: #f59e0b;
  font-weight: 700;
  text-shadow: 0 0 3px rgba(245, 158, 11, 0.45);
}

.f-mid {
  color: #d97706;
  font-weight: 700;
}

.f-soft {
  color: #c2410c;
  font-weight: 600;
}

.f-spark {
  color: #fbbf24;
  font-weight: 900;
  text-shadow: 0 0 6px rgba(245, 158, 11, 0.85);
}

/* --------------------------------------------------------------------------
   4. Adaptación a Modo Oscuro y Contenedores Contrastados
   -------------------------------------------------------------------------- */
@media (prefers-color-scheme: dark) {

  .p-blue,
  .c-blue {
    color: #38bdf8;
    text-shadow: 0 0 6px rgba(56, 189, 248, 0.65);
  }

  .p-red,
  .c-red {
    color: #f87171;
    text-shadow: 0 0 6px rgba(248, 113, 113, 0.65);
  }

  .p-white,
  .c-white {
    color: #ffffff;
    text-shadow: 0 0 3px rgba(255, 255, 255, 0.55);
  }

  .c-deep {
    color: #52525b;
  }

  .c-matte {
    color: #71717a;
  }

  .w-deep {
    color: #926d4f;
  }

  .w-bark {
    color: #78604b;
  }

  .w-streak {
    color: #f5ede4;
    text-shadow: 0 0 3px rgba(245, 237, 228, 0.5);
  }

  .w-ring {
    color: #b8aba0;
  }

  .ascii-switcher {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.14);
  }

  .ascii-switch-btn {
    color: #a1a1aa;
  }

  .ascii-switch-btn:hover {
    color: #f4f4f5;
    background: rgba(255, 255, 255, 0.12);
  }

  .ascii-switch-btn.active {
    background: #f4f4f5;
    color: #09090b;
  }
}

.dark-theme .p-blue,
.dark-theme .c-blue,
[data-theme="dark"] .p-blue,
[data-theme="dark"] .c-blue {
  color: #38bdf8;
  text-shadow: 0 0 6px rgba(56, 189, 248, 0.65);
}

.dark-theme .p-red,
.dark-theme .c-red,
[data-theme="dark"] .p-red,
[data-theme="dark"] .c-red {
  color: #f87171;
  text-shadow: 0 0 6px rgba(248, 113, 113, 0.65);
}

.dark-theme .p-white,
.dark-theme .c-white,
[data-theme="dark"] .p-white,
[data-theme="dark"] .c-white {
  color: #ffffff;
  text-shadow: 0 0 3px rgba(255, 255, 255, 0.55);
}

.dark-theme .c-deep,
[data-theme="dark"] .c-deep {
  color: #52525b;
}

.dark-theme .c-matte,
[data-theme="dark"] .c-matte {
  color: #71717a;
}

.dark-theme .w-deep,
[data-theme="dark"] .w-deep {
  color: #926d4f;
}

.dark-theme .w-bark,
[data-theme="dark"] .w-bark {
  color: #78604b;
}

.dark-theme .w-streak,
[data-theme="dark"] .w-streak {
  color: #f5ede4;
  text-shadow: 0 0 3px rgba(245, 237, 228, 0.5);
}

.dark-theme .w-ring,
[data-theme="dark"] .w-ring {
  color: #b8aba0;
}

.dark-theme .ascii-switcher,
[data-theme="dark"] .ascii-switcher {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.14);
}

.dark-theme .ascii-switch-btn,
[data-theme="dark"] .ascii-switch-btn {
  color: #a1a1aa;
}

.dark-theme .ascii-switch-btn:hover,
[data-theme="dark"] .ascii-switch-btn:hover {
  color: #f4f4f5;
  background: rgba(255, 255, 255, 0.12);
}

.dark-theme .ascii-switch-btn.active,
[data-theme="dark"] .ascii-switch-btn.active {
  background: #f4f4f5;
  color: #09090b;
}

/* --------------------------------------------------------------------------
   5. Switcher Interactivo de Arte ASCII (Brand / Carbón 3D / Fogata)
   -------------------------------------------------------------------------- */
.ascii-view-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.ascii-switcher {
  display: inline-flex;
  gap: 0.35rem;
  background: rgba(40, 35, 30, 0.07);
  border: 1px solid rgba(40, 35, 30, 0.12);
  border-radius: 9999px;
  padding: 0.25rem 0.35rem;
  margin-bottom: 0.75rem;
  backdrop-filter: blur(4px);
  z-index: 10;
}

.ascii-switch-btn {
  background: transparent;
  border: none;
  padding: 0.35rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: #555048;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  line-height: 1.2;
}

.ascii-switch-btn:hover {
  color: #1b1f23;
  background: rgba(255, 255, 255, 0.55);
}

.ascii-switch-btn.active {
  background: #1b1f23;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.ascii-viewport {
  position: relative;
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 260px;
}

/* --------------------------------------------------------------------------
   5.1. Emblema ASCII Oficial de Plásticos Delicias en Botón de Logout (Sin Bordes, 100% Orgánico)
   -------------------------------------------------------------------------- */
.btn-logout-emblem {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  box-shadow: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  overflow: visible;
  user-select: none;
  text-decoration: none;
  line-height: 0;
  vertical-align: middle;
}

.btn-logout-emblem:hover {
  background: transparent;
  border: none;
  transform: scale(1.06);
  filter: drop-shadow(0 4px 12px rgba(0, 31, 214, 0.18));
}

.btn-logout-emblem:active {
  transform: scale(0.98);
  filter: none;
}

.btn-logout-emblem:focus-visible {
  outline: 2px solid rgba(0, 31, 214, 0.4);
  outline-offset: 4px;
  border-radius: 4px;
}

.ascii-canvas-emblem {
  font-family: "JetBrains Mono", "SF Mono", "Fira Code", monospace;
  font-size: 6px;
  line-height: 1.0;
  letter-spacing: 0;
  white-space: pre;
  user-select: none;
  display: block;
  text-align: center;
  margin: 0;
  padding: 0;
  pointer-events: none;
  zoom: 0.25;
  -webkit-text-size-adjust: 100%;
}

@supports not (zoom: 0.25) {
  .ascii-canvas-emblem {
    transform: scale(0.25);
    transform-origin: center center;
  }
}

.btn-logout-emblem .p-blue {
  color: #001fd6;
  font-weight: 800;
  text-shadow: 0 0 1px rgba(0, 31, 214, 0.35);
}

.btn-logout-emblem .p-red {
  color: #d40500;
  font-weight: 800;
  text-shadow: 0 0 1px rgba(212, 5, 0, 0.35);
}

.btn-logout-emblem .p-white {
  color: #ffffff;
  font-weight: 800;
  text-shadow: 0 0 1px #3a3229, 0 1px 2px rgba(25, 20, 15, 0.45);
}

/* --------------------------------------------------------------------------
   6. Responsividad (Móviles & Tablets)
   -------------------------------------------------------------------------- */
@media (max-width: 900px),
(orientation: portrait) and (max-width: 1024px) {
  .hero-split-layout {
    flex-direction: column-reverse;
    text-align: center;
    gap: 2rem;
    margin-top: 1rem;
  }

  .hero-split-layout .hero-content {
    width: 100%;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
  }

  .hero-ascii-wrapper {
    width: 100%;
    max-width: 440px;
    background: transparent;
  }

  .ascii-canvas {
    font-size: clamp(6.8px, 1.6vw, 9.8px);
    padding: 0.5rem 0.25rem;
  }

  .ascii-campfire {
    font-size: clamp(4.4px, 0.95vw, 6.4px);
    padding: 0.5rem 0.25rem;
  }

  .ascii-campfire[data-density="2x"] {
    font-size: clamp(4.4px, 0.95vw, 6.4px);
    padding: 0.5rem 0.25rem;
    zoom: 0.5;
  }

  .ascii-switch-btn {
    padding: 0.3rem 0.65rem;
    font-size: 0.74rem;
  }
}

/* --------------------------------------------------------------------------
   7. Laboratorio de Pruebas: Fogata ASCII (/lab-fogata)
   -------------------------------------------------------------------------- */
.lab-container {
  max-width: 1200px;
  margin: 1.5rem auto 3rem;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: 100%;
}

.lab-header {
  text-align: center;
  margin-bottom: 0.5rem;
}

.lab-title {
  font-size: 1.85rem;
  font-weight: 800;
  color: var(--text-main, #18191b);
  letter-spacing: -0.02em;
}

.lab-subtitle {
  font-size: 0.95rem;
  color: var(--text-muted, #6b665f);
  margin-top: 0.25rem;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.lab-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
  align-items: start;
}

.lab-stage-card {
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(40, 35, 30, 0.12);
  border-radius: 1rem;
  padding: 1.25rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(8px);
  min-height: 480px;
  max-height: 520px;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.lab-controls-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  background: rgba(255, 255, 255, 0.65);
  border: 1px solid rgba(40, 35, 30, 0.12);
  border-radius: 1rem;
  padding: 1.25rem;
  backdrop-filter: blur(8px);
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.lab-control-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.lab-control-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b665f);
}

.lab-btn-group {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.lab-control-btn {
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 0.5rem;
  border: 1px solid rgba(40, 35, 30, 0.16);
  background: #ffffff;
  color: var(--text-main, #18191b);
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1.2;
}

.lab-control-btn:hover {
  background: var(--bg-sand-darker, #eae1d6);
  transform: translateY(-1px);
}

.lab-control-btn.active {
  background: #1b1f23;
  color: #ffffff;
  border-color: #1b1f23;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.lab-switch-label {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}

.lab-switch-label input[type="checkbox"] {
  width: 1.1rem;
  height: 1.1rem;
  cursor: pointer;
}

.lab-guide-card {
  margin-top: 0.25rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(40, 35, 30, 0.1);
}

.lab-guide-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  max-height: 280px;
  overflow-y: auto;
}

.lab-guide-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.35rem 0.65rem;
  border-radius: 0.4rem;
  background: rgba(40, 35, 30, 0.04);
  font-size: 0.82rem;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
  user-select: none;
}

.lab-guide-item:hover,
.lab-guide-item:focus {
  background: rgba(40, 35, 30, 0.09);
  outline: none;
}

.lab-guide-item.active {
  background: rgba(40, 35, 30, 0.14);
  box-shadow: inset 0 0 0 1px rgba(40, 35, 30, 0.2);
}

.lab-guide-symbol {
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.1em;
  transition: transform 0.15s ease;
}

.lab-guide-item:hover .lab-guide-symbol,
.lab-guide-item:focus .lab-guide-symbol,
.lab-guide-item.active .lab-guide-symbol {
  transform: scale(1.18);
}

/* Modos de Contraste para el Laboratorio */
.lab-stage-card.dark-theme,
.lab-stage-card[data-theme="dark"] {
  background: #111113;
  border-color: rgba(255, 255, 255, 0.14);
}

.dark-theme .lab-stage-card,
.dark-theme .lab-controls-panel,
[data-theme="dark"] .lab-stage-card,
[data-theme="dark"] .lab-controls-panel {
  background: rgba(24, 24, 27, 0.85);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
}

.dark-theme .lab-title,
[data-theme="dark"] .lab-title {
  color: #fafafa;
}

.dark-theme .lab-subtitle,
[data-theme="dark"] .lab-subtitle {
  color: #a1a1aa;
}

.dark-theme .lab-control-btn,
[data-theme="dark"] .lab-control-btn {
  background: #27272a;
  color: #e4e4e7;
  border-color: #3f3f46;
}

.dark-theme .lab-control-btn:hover,
[data-theme="dark"] .lab-control-btn:hover {
  background: #3f3f46;
}

.dark-theme .lab-control-btn.active,
[data-theme="dark"] .lab-control-btn.active {
  background: #f4f4f5;
  color: #09090b;
  border-color: #f4f4f5;
}

.dark-theme .lab-guide-item,
[data-theme="dark"] .lab-guide-item {
  background: rgba(255, 255, 255, 0.06);
}

.dark-theme .lab-guide-item:hover,
.dark-theme .lab-guide-item:focus,
[data-theme="dark"] .lab-guide-item:hover,
[data-theme="dark"] .lab-guide-item:focus {
  background: rgba(255, 255, 255, 0.12);
}

.dark-theme .lab-guide-item.active,
[data-theme="dark"] .lab-guide-item.active {
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
}

@media (max-width: 900px) {
  .lab-grid {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   8. Editor de Máscaras y Laboratorio ASCII (/lab-ascii/{figura})
   -------------------------------------------------------------------------- */
.lab-editor-container {
  max-width: 1400px;
}

.lab-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 1.5rem;
  align-items: stretch;
}

.lab-editor-card,
.lab-preview-card,
.lab-info-card {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(40, 35, 30, 0.12);
  border-radius: 1rem;
  padding: 1.25rem;
  backdrop-filter: blur(8px);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

.lab-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(40, 35, 30, 0.08);
}

.lab-card-title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main, #18191b);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}

.lab-card-badge {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: rgba(40, 35, 30, 0.08);
  color: var(--text-muted, #6b665f);
  font-family: "SF Mono", "Fira Code", monospace;
}

.editor-toolbar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.editor-toolbar-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.editor-layer-selector-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  width: 100%;
}

.editor-toolbar-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-main, #18191b);
}

.lab-select-control {
  flex: 1;
  min-width: 260px;
  max-width: 100%;
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 0.45rem;
  border: 1px solid rgba(40, 35, 30, 0.18);
  background: #ffffff;
  color: var(--text-main, #18191b);
  cursor: pointer;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.lab-select-control:focus {
  outline: none;
  border-color: #001fd6;
  box-shadow: 0 0 0 3px rgba(0, 31, 214, 0.12);
}

.editor-toolbar-title {
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b665f);
  width: 100%;
}

.editor-textarea-wrapper {
  position: relative;
  width: 100%;
}

.ascii-mask-editor {
  width: 100%;
  box-sizing: border-box;
  font-family: "SF Mono", "Fira Code", "Courier New", monospace;
  font-size: 10.5px;
  line-height: 1.22;
  letter-spacing: 0.05em;
  white-space: pre;
  overflow: auto;
  tab-size: 4;
  height: 420px;
  min-height: 340px;
  max-height: 600px;
  resize: vertical;
  border: 1px solid rgba(40, 35, 30, 0.16);
  border-radius: 0.6rem;
  padding: 0.85rem;
  background: #ffffff;
  color: #18191b;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.ascii-mask-editor:focus {
  outline: none;
  border-color: #001fd6;
  box-shadow: 0 0 0 3px rgba(0, 31, 214, 0.12);
}

.editor-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.45rem 0.85rem;
  border-radius: 0.5rem;
  background: rgba(40, 35, 30, 0.04);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted, #6b665f);
  user-select: none;
}

.editor-status-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.editor-status-badge {
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 700;
  padding: 0.1rem 0.4rem;
  border-radius: 0.3rem;
  background: rgba(40, 35, 30, 0.08);
  color: var(--text-main, #18191b);
}

.lab-info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}

.lab-table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.lab-data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
  text-align: left;
}

.lab-data-table th {
  padding: 0.55rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted, #6b665f);
  background: rgba(40, 35, 30, 0.04);
  border-bottom: 1px solid rgba(40, 35, 30, 0.12);
  white-space: nowrap;
}

.lab-data-table td {
  padding: 0.55rem 0.75rem;
  border-bottom: 1px solid rgba(40, 35, 30, 0.06);
  vertical-align: middle;
  line-height: 1.35;
}

.lab-data-table tr:hover td {
  background: rgba(40, 35, 30, 0.03);
}

.lab-data-table tr[data-code] {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.lab-data-table tr[data-code].selected-layer td {
  background: rgba(234, 88, 12, 0.08);
}

.lab-data-table .code-cell {
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 800;
  font-size: 0.95rem;
  text-align: center;
  width: 60px;
}

.lab-data-table .glyph-preview {
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 800;
  font-size: 0.92rem;
  letter-spacing: 0.06em;
}

.lab-data-table .badge-zone {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 0.35rem;
  font-size: 0.75rem;
  font-weight: 700;
  background: #fef08a;
  color: #854d0e;
  border: 1px solid #fde047;
}

.lab-anatomy-codes {
  margin-top: 0.85rem;
  padding: 0.75rem 1rem;
  background: rgba(40, 35, 30, 0.03);
  border-left: 3px solid #ea580c;
  border-radius: 0 0.5rem 0.5rem 0;
  font-size: 0.82rem;
  line-height: 1.5;
}

.lab-anatomy-codes ul {
  margin: 0.35rem 0 0 1.25rem;
  padding: 0;
}

.lab-anatomy-codes li {
  margin-bottom: 0.2rem;
}

.lab-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #18191b;
  color: #ffffff;
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}

.lab-toast.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Modos oscuros para el editor */
.dark-theme .lab-editor-card,
.dark-theme .lab-preview-card,
.dark-theme .lab-info-card,
[data-theme="dark"] .lab-editor-card,
[data-theme="dark"] .lab-preview-card,
[data-theme="dark"] .lab-info-card {
  background: rgba(24, 24, 27, 0.88);
  border-color: rgba(255, 255, 255, 0.12);
  color: #f4f4f5;
}

.dark-theme .lab-card-title,
[data-theme="dark"] .lab-card-title {
  color: #fafafa;
}

.dark-theme .ascii-mask-editor,
[data-theme="dark"] .ascii-mask-editor {
  background: #111113;
  color: #f4f4f5;
  border-color: #3f3f46;
}

.dark-theme .ascii-mask-editor:focus,
[data-theme="dark"] .ascii-mask-editor:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.dark-theme .lab-select-control,
[data-theme="dark"] .lab-select-control {
  background: #18191b;
  color: #f4f4f5;
  border-color: #3f3f46;
}

.dark-theme .lab-select-control:focus,
[data-theme="dark"] .lab-select-control:focus {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.dark-theme .editor-toolbar-label,
[data-theme="dark"] .editor-toolbar-label {
  color: #f4f4f5;
}

.dark-theme .lab-data-table tr[data-code].selected-layer td,
[data-theme="dark"] .lab-data-table tr[data-code].selected-layer td {
  background: rgba(234, 88, 12, 0.2);
}

.dark-theme .editor-status-bar,
[data-theme="dark"] .editor-status-bar {
  background: rgba(255, 255, 255, 0.05);
  color: #a1a1aa;
}

.dark-theme .editor-status-badge,
[data-theme="dark"] .editor-status-badge {
  background: rgba(255, 255, 255, 0.1);
  color: #f4f4f5;
}

.dark-theme .lab-data-table th,
[data-theme="dark"] .lab-data-table th {
  background: rgba(255, 255, 255, 0.05);
  border-bottom-color: rgba(255, 255, 255, 0.1);
  color: #a1a1aa;
}

.dark-theme .lab-data-table td,
[data-theme="dark"] .lab-data-table td {
  border-bottom-color: rgba(255, 255, 255, 0.06);
}

.dark-theme .lab-data-table tr:hover td,
[data-theme="dark"] .lab-data-table tr:hover td {
  background: rgba(255, 255, 255, 0.04);
}

.dark-theme .lab-anatomy-codes,
[data-theme="dark"] .lab-anatomy-codes {
  background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 1080px) {
  .lab-editor-grid {
    grid-template-columns: 1fr;
  }

  .lab-info-grid {
    grid-template-columns: 1fr;
  }
}