/**
 * Estilos canónicos del Simulador interactivo de la máquina Enigma (M3 y M4)
 * fijate.com - Estándares canónicos
 */

:root {
  --enigma-wood-base: #1e1713;
  --enigma-wood-border: #3d2f25;
  --enigma-chassis-bg: #18191c;
  --enigma-chassis-card: #202227;
  --enigma-brass: #d4af37;
  --enigma-brass-dim: #9c8027;
  --enigma-lamp-off: #272a30;
  --enigma-lamp-off-text: #6b7280;
  --enigma-lamp-glow: #fbbf24;
  --enigma-lamp-halo: rgba(251, 191, 36, 0.45);
  --enigma-key-bg: #1c1d22;
  --enigma-key-border: #4a4d57;
  --enigma-key-text: #f3f4f6;
  --enigma-key-pressed: #0f1012;
  --text-main: #f3f4f6;
  --text-muted: #9ca3af;
  --border-subtle: #2e323b;
  --accent-primary: #eab308;
  --accent-glow: rgba(234, 179, 8, 0.25);
  --bg-input: #121316;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --font-title: 'Outfit', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="light"] {
  --enigma-wood-base: #2a201a;
  --enigma-wood-border: #4a382d;
  --enigma-chassis-bg: #f8fafc;
  --enigma-chassis-card: #ffffff;
  --enigma-brass: #b45309;
  --enigma-brass-dim: #78350f;
  --enigma-lamp-off: #e2e8f0;
  --enigma-lamp-off-text: #64748b;
  --enigma-lamp-glow: #d97706;
  --enigma-lamp-halo: rgba(217, 119, 6, 0.35);
  --enigma-key-bg: #ffffff;
  --enigma-key-border: #cbd5e1;
  --enigma-key-text: #0f172a;
  --enigma-key-pressed: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #475569;
  --border-subtle: #e2e8f0;
  --accent-primary: #d97706;
  --accent-glow: rgba(217, 119, 6, 0.15);
  --bg-input: #ffffff;
}

/* Reset y estructura general */
* {
  box-sizing: border-box;
}

body {
  overflow-x: clip;
  width: 100%;
  max-width: 100%;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: #0d0e11;
  color: var(--text-main);
  font-family: var(--font-body);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
}

[data-theme="light"] body {
  background-color: #f1f5f9;
}

.tool-layout {
  max-width: 1200px;
  width: 100%;
  margin: 1.5rem auto 3rem;
  padding: 0 1rem;
}

.tool-with-sidebar {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  width: 100%;
}

.tool-main-content {
  flex: 1 1 0%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Barra superior de telemetría y selector de preset */
.enigma-top-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--enigma-chassis-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
}

.preset-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  flex: 1 1 320px;
}

.preset-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.preset-select {
  flex: 1 1 200px;
  min-width: 0;
  max-width: 100%;
  padding: 0.55rem 2.5rem 0.55rem 0.85rem;
  background-color: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-body);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Botones genéricos de la herramienta */
.btn-primary, .btn-secondary, .btn-danger {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 42px;
  padding: 0 1.2rem;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  border: none;
}

.btn-primary {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #0f172a;
  box-shadow: 0 2px 4px rgba(217, 119, 6, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.05);
  border-color: var(--text-muted);
}

.btn-danger {
  background: #ef444415;
  color: #ef4444;
  border: 1px solid #ef444430;
}

.btn-danger:hover {
  background: #ef444425;
}

.btn-icon-square {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
}

.btn-icon-square:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

.btn-icon-square.is-muted {
  color: #ef4444;
  border-color: #ef444450;
}

/* Chasis central de la máquina Enigma (Efecto madera y metal) */
.enigma-machine-casing {
  background: radial-gradient(circle at 50% 0%, #2a2c33 0%, var(--enigma-chassis-bg) 100%);
  border: 3px solid #3d2f25;
  border-radius: var(--radius-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
  position: relative;
}

[data-theme="light"] .enigma-machine-casing {
  background: #ffffff;
  border: 3px solid #78350f;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* Placa conmemorativa de Enigma */
.casing-badge {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 2px solid var(--border-subtle);
  padding-bottom: 0.85rem;
  margin-bottom: -0.25rem;
}

.casing-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--enigma-brass);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.casing-subtitle {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.05em;
}

/* Sección 1: Ensamblado de Rotores y Reflector (Walzen) */
.rotors-assembly-section {
  background: var(--enigma-chassis-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.section-legend {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--enigma-brass);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.rotors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1rem;
  align-items: stretch;
}

.rotor-col {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-align: center;
}

.rotor-header {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.rotor-select, .ring-select {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 0.4rem 1.8rem 0.4rem 0.5rem;
  background-color: var(--enigma-chassis-card);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: var(--font-mono);
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.4rem center;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* Ventana de visualización del rotor (Sichtfenster) */
.rotor-wheel-box {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: #111215;
  border: 2px solid #374151;
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.25rem;
}

[data-theme="light"] .rotor-wheel-box {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.rotor-btn-step {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--enigma-chassis-card);
  color: var(--text-main);
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s;
}

.rotor-btn-step:hover {
  background: var(--accent-primary);
  color: #000000;
}

.rotor-window {
  min-width: 44px;
  height: 44px;
  background: #000000;
  color: #ffffff;
  border: 2px solid #9c8027;
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.5rem;
  font-weight: 800;
  box-shadow: inset 0 2px 5px rgba(0, 0, 0, 0.8);
}

[data-theme="light"] .rotor-window {
  background: #1e293b;
  color: #f8fafc;
}

/* Sección 2: Panel de bombillas (Glühlampenfeld) */
.lampboard-section {
  background: #151619;
  border: 2px solid #23252b;
  border-radius: var(--radius-md);
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: inset 0 4px 12px rgba(0, 0, 0, 0.6);
}

[data-theme="light"] .lampboard-section {
  background: #f1f5f9;
  border-color: #cbd5e1;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.05);
}

.keyboard-row, .lampboard-row {
  display: flex;
  justify-content: center;
  gap: 0.65rem;
}

.enigma-lamp {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--enigma-lamp-off);
  color: var(--enigma-lamp-off-text);
  border: 2px solid #374151;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
  transition: all 0.08s ease;
  user-select: none;
}

/* Iluminación de bombilla (efecto filamento de tungsteno) */
.enigma-lamp.is-lit {
  background: radial-gradient(circle, #fffbeb 0%, #fde68a 35%, #f59e0b 80%, #b45309 100%);
  color: #451a03;
  border-color: #fef08a;
  box-shadow: 0 0 25px 8px var(--enigma-lamp-glow), inset 0 0 8px rgba(255, 255, 255, 0.8);
  transform: scale(1.08);
  text-shadow: 0 0 2px #ffffff;
}

/* Sección 3: Teclado de pulsación táctil/mecánico (Tastatur) */
.keyboard-section {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 0.5rem 0;
}

.enigma-key {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--enigma-key-bg);
  color: var(--enigma-key-text);
  border: 3px solid var(--enigma-key-border);
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  user-select: none;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.4), inset 0 1px 2px rgba(255, 255, 255, 0.15);
  transition: transform 0.06s ease, box-shadow 0.06s ease, background-color 0.06s;
  outline: none;
  touch-action: manipulation;
}

.enigma-key:hover {
  border-color: var(--accent-primary);
}

.enigma-key:active, .enigma-key.is-pressed {
  background: var(--enigma-key-pressed);
  transform: translateY(3px) scale(0.96);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.6), inset 0 3px 6px rgba(0, 0, 0, 0.7);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Sección 4: Clavijero frontal (Steckerbrett) */
.steckerbrett-section {
  background: var(--enigma-chassis-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
}

.stecker-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.stecker-counter-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--enigma-brass);
  background: rgba(212, 175, 55, 0.1);
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  border: 1px solid rgba(212, 175, 55, 0.2);
}

.stecker-counter-badge.limit-blink {
  animation: blink-limit 0.4s ease 2;
}

@keyframes blink-limit {
  0%, 100% { background: rgba(212, 175, 55, 0.1); }
  50% { background: rgba(239, 68, 68, 0.4); color: #ef4444; border-color: #ef4444; }
}

.stecker-workspace {
  position: relative;
  min-height: 180px;
  padding: 0.5rem 0;
}

.stecker-sockets-matrix {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  position: relative;
  z-index: 2;
}

.stecker-row {
  display: flex;
  justify-content: center;
  gap: 0.75rem;
}

.stecker-socket {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
  touch-action: manipulation;
  outline: none;
}

.socket-label {
  font-family: var(--font-title);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  transition: color 0.15s;
}

.socket-hole {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #0f1012;
  border: 2px solid #4b5563;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.8);
  transition: all 0.2s ease;
}

.socket-hole::after {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #000000;
  border: 1px solid #1f2937;
}

/* Estados de selección y conexión del Steckerbrett */
.stecker-socket:hover .socket-hole {
  border-color: var(--accent-primary);
  transform: scale(1.1);
}

.stecker-socket.is-selecting .socket-hole {
  border-color: #f59e0b;
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.6);
  animation: pulse-socket 1s infinite alternate;
}

@keyframes pulse-socket {
  0% { transform: scale(1.05); }
  100% { transform: scale(1.18); }
}

.stecker-socket.is-connected .socket-label {
  color: var(--cable-color, var(--accent-primary));
}

.stecker-cables-svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

/* Badges de cables conectados */
.stecker-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--border-subtle);
  align-items: center;
}

.stecker-empty-notice {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}

.stecker-cable-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
}

.cable-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

.btn-disconnect-cable {
  background: none;
  border: none;
  color: inherit;
  font-size: 1.1rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.15rem;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.btn-disconnect-cable:hover {
  opacity: 1;
}

/* Sección 5: HUD de telemetría y circuito de corriente paso a paso */
.circuit-trace-section {
  background: var(--enigma-chassis-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.trace-flow-container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.trace-node {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 80px;
  flex: 1 1 0%;
}

.trace-node-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.trace-node-val {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--accent-primary);
  margin-top: 0.2rem;
}

.trace-arrow {
  color: var(--text-muted);
  font-size: 1rem;
  user-select: none;
}

.trace-footer-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 0.85rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.8rem;
  color: var(--text-muted);
}

.trace-step-notice {
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-muted);
}

.trace-step-notice.is-double-step {
  color: #f59e0b;
  font-weight: 800;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

/* Sección 6: Cinta de teletipo y salida de texto */
.tape-and-text-section {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

.ticker-tape-container {
  background: #fef08a;
  color: #1c1917;
  border: 2px dashed #ca8a04;
  border-radius: var(--radius-sm);
  padding: 0.85rem 1.25rem;
  font-family: var(--font-mono);
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.25em;
  text-align: right;
  overflow: hidden;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.text-blocks-card {
  background: var(--enigma-chassis-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.text-box-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.cipher-textarea {
  width: 100%;
  height: 110px;
  background: var(--bg-input);
  color: var(--text-main);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  font-family: var(--font-mono);
  font-size: 1rem;
  letter-spacing: 0.1em;
  resize: vertical;
  line-height: 1.5;
}

.cipher-textarea:focus {
  outline: 2px solid var(--accent-primary);
  border-color: transparent;
}

.text-actions-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.actions-left, .actions-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

/* Modales canónicos de confirmación */
.enigma-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.enigma-modal.is-open {
  display: flex;
}

.modal-content-card {
  background: var(--enigma-chassis-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  animation: modal-pop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modal-pop {
  0% { transform: scale(0.95); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}

.modal-title {
  font-family: var(--font-title);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.modal-text {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

/* Toast flotante */
.enigma-toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: #1e293b;
  color: #f8fafc;
  border: 1px solid #475569;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  z-index: 2000;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: all 0.2s ease;
}

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

/* Guía didáctica SEO canónica */
.seo-guide-section {
  background: var(--enigma-chassis-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2rem 1.5rem;
  margin-top: 1.5rem;
}

.seo-guide-header {
  text-align: center;
  margin-bottom: 2rem;
}

.seo-authority-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(234, 179, 8, 0.1);
  color: var(--enigma-brass);
  border: 1px solid rgba(234, 179, 8, 0.25);
  border-radius: 9999px;
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}

.seo-guide-title {
  font-family: var(--font-title);
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.5rem 0;
}

.seo-guide-subtitle {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 650px;
  margin: 0 auto;
  line-height: 1.6;
}

.seo-guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.seo-guide-card {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.guide-card-icon {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: rgba(234, 179, 8, 0.12);
  color: var(--enigma-brass);
  display: flex;
  align-items: center;
  justify-content: center;
}

.seo-guide-card h3 {
  font-family: var(--font-title);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.seo-guide-card p {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
  margin: 0;
}

.guide-table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin: 1rem 0;
}

.guide-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
  text-align: left;
}

.guide-table th, .guide-table td {
  padding: 0.65rem 0.85rem;
  border-bottom: 1px solid var(--border-subtle);
}

.guide-table th {
  background: rgba(255, 255, 255, 0.04);
  font-family: var(--font-title);
  font-weight: 700;
  color: var(--text-main);
}

.guide-table td code {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--enigma-brass);
}

/* Acordeón de FAQ */
.seo-faq-section {
  margin-top: 2rem;
}

.seo-faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.seo-faq-item {
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.seo-faq-question {
  padding: 1rem 1.25rem;
  font-family: var(--font-title);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  user-select: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--text-main);
}

.seo-faq-question::-webkit-details-marker {
  display: none;
}

.seo-faq-answer {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted);
}

/* Reglas responsivas para móviles */
@media (max-width: 768px) {
  .tool-layout {
    margin: 1rem auto 2rem;
    padding: 0 0.75rem;
  }

  .enigma-machine-casing {
    padding: 1rem 0.75rem;
    gap: 1.25rem;
  }

  .rotors-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .enigma-lamp {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  .enigma-key {
    width: 34px;
    height: 34px;
    font-size: 0.95rem;
  }

  .lampboard-row, .keyboard-row {
    gap: 0.3rem;
  }

  .stecker-row {
    gap: 0.35rem;
  }

  .socket-hole {
    width: 24px;
    height: 24px;
  }

  .socket-label {
    font-size: 0.8rem;
  }

  .trace-flow-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }

  .trace-arrow {
    display: none;
  }

  .text-actions-bar, .actions-left, .actions-right {
    flex-direction: column;
    width: 100%;
  }

  .btn-primary, .btn-secondary, .btn-danger {
    width: 100%;
  }
}
