/* ==========================================================================
   Transformer Duet & Multi-Vector Lab - Design System & Styles
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;700&family=Outfit:wght@400;600;800&display=swap');

:root {
  /* Color Palette - Dark Futuristic Glow */
  --bg-dark: #07090e;
  --bg-card: rgba(15, 23, 42, 0.75);
  --bg-card-hover: rgba(30, 41, 59, 0.85);
  --bg-glass: rgba(255, 255, 255, 0.03);
  --border-color: rgba(255, 255, 255, 0.08);
  --border-glow: rgba(0, 243, 255, 0.3);

  /* Brand Accents */
  --accent-cyan: #00f3ff;
  --accent-magenta: #f43f5e;
  --accent-purple: #a855f7;
  --accent-emerald: #10b981;
  --accent-amber: #f59e0b;
  --accent-blue: #3b82f6;
  
  /* Distractor / Trap word indicator */
  --trap-color: #ef4444;
  --trap-glow: rgba(239, 68, 68, 0.4);

  /* Text Colors */
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --text-dim: #64748b;

  /* Fonts */
  --font-sans: 'Inter', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-heading: 'Outfit', 'Segoe UI Semibold', 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'Cascadia Mono', Consolas, 'Courier New', monospace;

  /* Layout */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glow: 0 0 25px rgba(0, 243, 255, 0.15);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  background-color: var(--bg-dark);
  background-image: 
    radial-gradient(circle at 15% 15%, rgba(168, 85, 247, 0.12) 0%, transparent 40%),
    radial-gradient(circle at 85% 85%, rgba(0, 243, 255, 0.1) 0%, transparent 45%),
    radial-gradient(circle at 50% 50%, rgba(16, 185, 129, 0.05) 0%, transparent 60%);
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
}

/* Header & Navigation */
header {
  background: rgba(7, 9, 14, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 0.85rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1.5rem;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border-radius: var(--radius-sm);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-family: var(--font-heading);
  color: #000;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.logo-text h1 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  background: linear-gradient(90deg, #fff, var(--text-muted));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-text p {
  font-size: 0.75rem;
  color: var(--accent-cyan);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* Phase Navigation Bar */
.phase-nav {
  display: flex;
  background: rgba(15, 23, 42, 0.8);
  padding: 4px;
  border-radius: 50px;
  border: 1px solid var(--border-color);
  gap: 4px;
}

.phase-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.15rem;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.phase-btn .step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  display: inline-grid;
  place-items: center;
  font-size: 0.75rem;
}

.phase-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.05);
}

.phase-btn.active {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-blue));
  color: #000;
  box-shadow: 0 0 15px rgba(0, 243, 255, 0.4);
}

.phase-btn.active .step-num {
  background: #000;
  color: var(--accent-cyan);
}

/* Main Container */
main {
  max-width: 1440px;
  margin: 1.5rem auto;
  padding: 0 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

/* Control Panel (Phrase & Preset Selector) */
.control-panel {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  box-shadow: var(--shadow-glow);
}

.input-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  min-width: 320px;
}

.input-group label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.custom-input {
  flex: 1;
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 1rem;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 0.95rem;
  outline: none;
  transition: var(--transition);
}

.custom-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.25);
}

.presets-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.preset-chip {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
}

.preset-chip:hover, .preset-chip.active {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0, 243, 255, 0.08);
}

.distractors-toggle {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.3);
  padding: 0.4rem 0.85rem;
  border-radius: 50px;
  cursor: pointer;
  transition: var(--transition);
  font-size: 0.8rem;
  color: var(--trap-color);
  font-weight: 600;
}

.distractors-toggle:hover {
  background: rgba(239, 68, 68, 0.18);
  box-shadow: 0 0 12px rgba(239, 68, 68, 0.3);
}

/* Phase Panels (Cards) */
.phase-content {
  display: none;
  animation: fadeIn 0.4s ease-out forwards;
}

.phase-content.active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  position: relative;
  overflow: hidden;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.card-title {
  font-family: var(--font-heading);
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.card-title .badge {
  font-size: 0.7rem;
  padding: 0.2rem 0.6rem;
  border-radius: 50px;
  font-weight: 700;
  text-transform: uppercase;
}

.badge-cyan { background: rgba(0, 243, 255, 0.15); color: var(--accent-cyan); border: 1px solid var(--accent-cyan); }
.badge-purple { background: rgba(168, 85, 247, 0.15); color: var(--accent-purple); border: 1px solid var(--accent-purple); }
.badge-emerald { background: rgba(16, 185, 129, 0.15); color: var(--accent-emerald); border: 1px solid var(--accent-emerald); }
.badge-amber { background: rgba(245, 158, 11, 0.15); color: var(--accent-amber); border: 1px solid var(--accent-amber); }

/* PHASE 1: TOKENIZATION & BINARY */
.tokens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.token-card {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  transition: var(--transition);
  position: relative;
}

.token-card.trap-word {
  border-color: rgba(239, 68, 68, 0.4);
  background: rgba(239, 68, 68, 0.04);
}

.token-card:hover {
  transform: translateY(-3px);
  border-color: var(--accent-cyan);
  box-shadow: 0 4px 20px rgba(0, 243, 255, 0.12);
}

.token-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.token-word {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.token-card.trap-word .token-word {
  color: var(--trap-color);
}

.token-tag {
  font-size: 0.7rem;
  padding: 2px 8px;
  border-radius: 4px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
}

.token-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
  display: flex;
  gap: 0.75rem;
}

.binary-display {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  background: rgba(0, 0, 0, 0.6);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.05);
  color: var(--accent-emerald);
  word-break: break-all;
  letter-spacing: 1px;
}

.binary-display span.bit-one {
  color: var(--accent-cyan);
  font-weight: 700;
}

.binary-display span.bit-zero {
  color: rgba(255, 255, 255, 0.25);
}

/* PHASE 2: MULTI-VECTOR EMBEDDING LAB */
.embeddings-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .embeddings-layout {
    grid-template-columns: 1fr;
  }
}

.canvas-container {
  position: relative;
  width: 100%;
  height: 520px;
  background: rgba(0, 0, 0, 0.45);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  overflow: hidden;
}

#embeddingsCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-toolbar {
  position: absolute;
  top: 1rem;
  right: 1rem;
  display: flex;
  gap: 0.5rem;
  z-index: 10;
}

.btn-tool {
  background: rgba(15, 23, 42, 0.85);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: 0.4rem 0.8rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}

.btn-tool:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
}

.vector-sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sidebar-panel {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
}

.panel-title {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--accent-cyan);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.distance-meter {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.distance-badge {
  background: rgba(0, 243, 255, 0.08);
  border: 1px solid rgba(0, 243, 255, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.65rem;
  font-size: 0.85rem;
}

.distance-badge.trap-alert {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.3);
}

.distance-val {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--accent-cyan);
}

.distance-badge.trap-alert .distance-val {
  color: var(--trap-color);
}

.vector-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.vector-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.8rem;
  cursor: pointer;
  transition: var(--transition);
}

.vector-item:hover, .vector-item.selected {
  background: rgba(0, 243, 255, 0.12);
  border-left: 3px solid var(--accent-cyan);
}

.vector-item.is-trap {
  color: var(--trap-color);
}

.vector-item.is-trap:hover, .vector-item.is-trap.selected {
  background: rgba(239, 68, 68, 0.12);
  border-left: 3px solid var(--trap-color);
}

/* PHASE 3: ATTENTION DUET (TECHNICAL + INSPECTOR SPOTLIGHT) */
.duet-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

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

.duet-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* Technical View: Layers graph & Matrix */
.graph-container {
  height: 260px;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

#attentionGraphSvg {
  width: 100%;
  height: 100%;
}

.matrix-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  background: rgba(0, 0, 0, 0.3);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.matrix-table th, .matrix-table td {
  padding: 0.5rem;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.matrix-table th {
  background: rgba(15, 23, 42, 0.8);
  color: var(--text-muted);
}

.matrix-cell {
  transition: var(--transition);
  cursor: pointer;
}

.matrix-cell:hover {
  outline: 2px solid var(--accent-cyan);
}

/* Interpretative View: Spotlight Inspector */
.inspector-box {
  background: rgba(10, 15, 26, 0.95);
  border: 1px solid var(--accent-purple);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  position: relative;
  box-shadow: 0 0 30px rgba(168, 85, 247, 0.2);
}

.spotlight-stage {
  position: relative;
  background: #040609;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  min-height: 140px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Spotlight Beam Effect overlay */
.spotlight-beam {
  position: absolute;
  top: -50px;
  left: 50%;
  width: 180px;
  height: 250px;
  background: radial-gradient(ellipse at top, rgba(0, 243, 255, 0.35) 0%, rgba(168, 85, 247, 0.15) 50%, transparent 80%);
  pointer-events: none;
  transform: translateX(-50%);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
}

.spotlight-stage.active .spotlight-beam {
  opacity: 1;
}

.spotlight-word {
  position: relative;
  z-index: 5;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.spotlight-word.focused {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  color: #000;
  box-shadow: 0 0 25px rgba(0, 243, 255, 0.6);
  transform: scale(1.1);
}

.spotlight-word.attended-high {
  background: rgba(16, 185, 129, 0.25);
  border-color: var(--accent-emerald);
  box-shadow: 0 0 15px rgba(16, 185, 129, 0.4);
}

.spotlight-word.attended-low {
  opacity: 0.3;
  filter: blur(0.5px);
}

.spotlight-word.attended-trap {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--trap-color);
  opacity: 0.35;
}

/* Explanation Card in Natural Language */
.narrative-card {
  margin-top: 1rem;
  background: rgba(168, 85, 247, 0.08);
  border: 1px solid rgba(168, 85, 247, 0.3);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

.narrative-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-purple);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.narrative-text {
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--text-main);
}

.narrative-text span.highlight {
  color: var(--accent-cyan);
  font-weight: 700;
}

.narrative-text span.trap {
  color: var(--trap-color);
  font-weight: 700;
}

/* PHASE 4: PROBABILITIES & TOKEN GENERATOR */
.generator-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 1.5rem;
}

@media (max-width: 1024px) {
  .generator-layout {
    grid-template-columns: 1fr;
  }
}

.prob-bars-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.prob-row {
  display: grid;
  grid-template-columns: 120px 1fr 70px;
  align-items: center;
  gap: 1rem;
}

.prob-word {
  font-weight: 600;
  font-size: 0.95rem;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.prob-bar-track {
  height: 24px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 50px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  position: relative;
}

.prob-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-cyan), var(--accent-purple));
  border-radius: 50px;
  transition: width 0.4s ease-out;
  box-shadow: 0 0 10px rgba(0, 243, 255, 0.4);
}

.prob-val {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--accent-cyan);
}

.temp-control-panel {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

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

.slider-header {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  font-weight: 600;
}

.temp-slider {
  width: 100%;
  accent-color: var(--accent-cyan);
  cursor: pointer;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  border: none;
  color: #000;
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 0.95rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  box-shadow: 0 0 20px rgba(0, 243, 255, 0.3);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(0, 243, 255, 0.5);
}

/* Footer & Help */
footer {
  text-align: center;
  padding: 1.5rem;
  font-size: 0.8rem;
  color: var(--text-dim);
  border-top: 1px solid var(--border-color);
  margin-top: 2rem;
}

/* Utilities */
.hidden { display: none !important; }


/* ==========================================================================
   FASE 2 · las 16 preguntas
   ========================================================================== */
.explica16{display:flex;gap:14px;align-items:stretch;flex-wrap:wrap;margin:0 0 18px}
.e16{flex:1;min-width:210px;display:flex;gap:14px;align-items:flex-start;
 background:var(--bg-glass);border:1px solid var(--border-color);border-radius:14px;padding:14px 16px}
.e16n{font-family:var(--font-heading);font-size:2rem;font-weight:700;color:var(--accent-cyan);
 line-height:1;text-shadow:0 0 22px rgba(0,243,255,.5);min-width:44px}
.e16 b{color:var(--text-main);font-size:.95rem}
.e16 span{font-size:.82rem;color:var(--text-muted);line-height:1.45}
.e16r .e16n{color:var(--accent-purple);text-shadow:0 0 22px rgba(168,85,247,.5)}
.e16flecha{align-self:center;color:var(--text-dim);font-size:1.3rem}
@media(max-width:820px){.e16flecha{display:none}}

.ejes-control{margin:0 0 16px}
.modo-fila{display:flex;gap:8px;flex-wrap:wrap;align-items:center;margin-bottom:10px}
.btn-tool.on{border-color:var(--accent-cyan);color:var(--accent-cyan);
 box-shadow:0 0 20px -6px var(--accent-cyan)}
.pct-info{margin-left:auto;font-size:.82rem;color:var(--accent-purple)}
.pct-info b{color:var(--accent-purple);font-size:1rem}
.ejes-fila{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:10px}
@media(max-width:820px){.ejes-fila{grid-template-columns:1fr}}
.ejes-fila label{display:flex;flex-direction:column;gap:4px;font-size:.75rem;
 font-family:var(--font-mono);letter-spacing:1px;text-transform:uppercase}
.ejes-fila select{background:var(--bg-card);color:var(--text-main);border:1px solid var(--border-color);
 border-radius:10px;padding:9px 11px;font-family:var(--font-sans);font-size:.85rem;cursor:pointer}
.ejes-fila select:focus{outline:none;border-color:var(--accent-cyan);box-shadow:0 0 0 1px var(--accent-cyan)}

.leyenda-anillo{display:flex;gap:14px;flex-wrap:wrap;justify-content:center;margin-top:10px;
 font-size:.75rem;color:var(--text-muted)}
.pt-c{display:inline-block;width:9px;height:9px;border-radius:50%;margin-right:5px;vertical-align:0}
.pt-anillo{display:inline-block;width:11px;height:11px;border-radius:50%;margin-right:5px;
 border:2px dashed rgba(168,85,247,.85);vertical-align:-1px}

/* ficha de 16 */
.ficha-box{font-size:.8rem}
.ficha-head{color:var(--text-muted);margin-bottom:8px;font-size:.8rem}
.ficha-lista{display:flex;flex-direction:column;gap:3px;max-height:290px;overflow-y:auto;padding-right:4px}
.dim{display:grid;grid-template-columns:20px 1fr 62px 34px;gap:7px;align-items:center;
 padding:3px 5px;border-radius:7px}
.dim.usado{background:rgba(0,243,255,.08);box-shadow:inset 0 0 0 1px rgba(0,243,255,.22)}
.dnum{font-family:var(--font-mono);font-size:.68rem;color:var(--text-dim);text-align:right}
.dnom{font-size:.76rem;color:var(--text-muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.dbar{display:block;height:7px;background:rgba(255,255,255,.07);border-radius:99px;overflow:hidden}
.dbar i{display:block;height:100%;border-radius:99px}
.dval{font-family:var(--font-mono);font-size:.68rem;color:var(--text-muted);text-align:right}
.dchip{grid-column:2/5;font-size:.62rem;font-family:var(--font-mono);letter-spacing:.8px;
 text-transform:uppercase;color:var(--accent-cyan)}
.ficha-pie{margin-top:9px;font-size:.75rem;color:var(--text-dim);line-height:1.45}

/* dos cifras */
.dos-cifras{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin:8px 0}
.dos-cifras>div{background:rgba(255,255,255,.04);border:1px solid var(--border-color);
 border-radius:11px;padding:9px 11px;text-align:center}
.dos-cifras .cifra{display:block;font-family:var(--font-heading);font-size:1.55rem;font-weight:700;
 color:var(--accent-emerald);line-height:1.1}
.dos-cifras .cifra.c3{color:var(--text-muted)}
.dos-cifras small{font-size:.68rem;color:var(--text-dim);line-height:1.3;display:block;margin-top:3px}
.difnota{font-size:.78rem;color:var(--accent-purple);background:rgba(168,85,247,.08);
 border:1px solid rgba(168,85,247,.22);border-radius:10px;padding:8px 10px}

/* lista con residuo */
.enfrase{font-size:.62rem;font-family:var(--font-mono);letter-spacing:.6px;text-transform:uppercase;
 color:var(--accent-cyan);border:1px solid rgba(0,243,255,.3);border-radius:99px;padding:1px 6px}
.resline{font-size:.7rem;color:var(--text-dim);margin-top:4px;display:flex;align-items:center;gap:6px}
.resline b{color:var(--accent-purple)}
.resbar{display:inline-block;width:56px;height:5px;background:rgba(255,255,255,.08);
 border-radius:99px;overflow:hidden}
.resbar i{display:block;height:100%;background:var(--accent-purple)}

/* mapa de calor */
.matriz16{margin-top:22px;border-top:1px solid var(--border-color);padding-top:18px}
.matriz-scroll{overflow-x:auto}
.mat16{border-collapse:collapse;font-size:.72rem}
.mat16 th{color:var(--text-dim);font-family:var(--font-mono);font-weight:500;font-size:.66rem;
 padding:2px 3px;text-align:center}
.mat16 .wn{color:var(--text-muted);padding:2px 9px 2px 2px;white-space:nowrap;cursor:pointer;font-size:.75rem}
.mat16 .wn:hover{color:var(--accent-cyan)}
.mat16 .fila-sel .wn{color:var(--accent-cyan);font-weight:700}
.mat16 .cel{width:20px;height:15px;border:1px solid rgba(7,9,14,.85);border-radius:2px}
.matpie{margin-top:10px;font-size:.75rem;color:var(--text-dim);line-height:1.5}

.honesto{margin-top:20px;background:rgba(245,158,11,.06);border:1px solid rgba(245,158,11,.22);
 border-radius:14px;padding:14px 17px;font-size:.82rem;color:var(--text-muted);line-height:1.55}
.honesto b{color:var(--accent-amber)}
.canvas-col{display:flex;flex-direction:column;min-width:0}
.canvas-col .canvas-container{height:560px}
