/**
 * components.css
 * ─────────────────────────────────────────────────────────────────
 * All self-contained UI components. Each section is clearly labelled
 * so new components can be appended without hunting for placement.
 *
 * Components in this file:
 *   1.  Navigation items
 *   2.  Tags / badges
 *   3.  Placeholder blocks
 *   4.  Text utilities (replaces inline styles)
 *   5.  Info cards / card grid
 *   6.  Pipeline flow diagram
 *   7.  Data tables
 *   8.  Code blocks + syntax highlighting
 *   9.  Formula blocks
 *   10. Callout boxes
 *   11. Compare grid (pro/con)
 *   12. Step list (numbered workflow)
 *   13. Mobile sidebar toggle button
 */

/* ════════════════════════════════════════════
   1. NAVIGATION ITEMS
════════════════════════════════════════════ */

.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-dim);
  padding: 0 24px 8px;
}

.nav-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 9px 24px;
  cursor: pointer;
  transition: background 0.15s ease, border-left-color 0.15s ease;
  text-decoration: none;
  border-left: 2px solid transparent;
  color: inherit;
}

.nav-item:hover {
  background: var(--surface2);
  border-left-color: var(--border);
}

/* Active state — set by JS via IntersectionObserver */
.nav-item.active,
.nav-item[aria-current="true"] {
  background: rgba(139, 105, 20, 0.08);
  border-left-color: var(--accent);
}

.nav-item.active .nav-num,
.nav-item[aria-current="true"] .nav-num {
  color: var(--accent);
}

.nav-item.active .nav-label,
.nav-item[aria-current="true"] .nav-label {
  color: var(--text);
}

.nav-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-dim);
  padding-top: 1px;
  flex-shrink: 0;
  width: 20px;
}

.nav-label {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

/* ── Nav group structure (3 research lines) ── */
.nav-group + .nav-group {
  border-top: 1px solid var(--border-soft);
  margin-top: 6px;
  padding-top: 2px;
}

.nav-group-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px 5px;
}

.nav-group-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.nav-group-dot--l1 { background: var(--accent); }
.nav-group-dot--l2 { background: #6B8CAE; }
.nav-group-dot--l3 { background: #7A9E7E; }

.nav-group-label {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  line-height: 1;
}

.nav-group-label--l1 { color: var(--accent); }
.nav-group-label--l2 { color: #5A7A9A;       }
.nav-group-label--l3 { color: #618566;        }

/* Line 2 — active state override */
.nav-item.l2.active,
.nav-item.l2[aria-current="true"] {
  background: rgba(107, 140, 174, 0.08);
  border-left-color: #6B8CAE;
}
.nav-item.l2.active .nav-num,
.nav-item.l2[aria-current="true"] .nav-num  { color: #6B8CAE; }
.nav-item.l2.active .nav-label,
.nav-item.l2[aria-current="true"] .nav-label { color: var(--text); }

/* Line 3 — active state override */
.nav-item.l3.active,
.nav-item.l3[aria-current="true"] {
  background: rgba(122, 158, 126, 0.08);
  border-left-color: #7A9E7E;
}
.nav-item.l3.active .nav-num,
.nav-item.l3[aria-current="true"] .nav-num  { color: #7A9E7E; }
.nav-item.l3.active .nav-label,
.nav-item.l3[aria-current="true"] .nav-label { color: var(--text); }

/* ════════════════════════════════════════════
   2. TAGS / BADGES
════════════════════════════════════════════ */

.tag {
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid;
}

.tag-blue  { color: var(--accent);  border-color: rgba(139, 105,  20, 0.3); background: rgba(139, 105,  20, 0.07); }
.tag-cyan  { color: var(--accent2); border-color: rgba( 74, 112, 128, 0.3); background: rgba( 74, 112, 128, 0.07); }
.tag-green { color: var(--accent3); border-color: rgba( 94, 122,  90, 0.3); background: rgba( 94, 122,  90, 0.07); }
.tag-amber { color: var(--accent4); border-color: rgba(139,  74,  20, 0.3); background: rgba(139,  74,  20, 0.07); }

/* ════════════════════════════════════════════
   3. PLACEHOLDER BLOCKS
════════════════════════════════════════════ */

.placeholder {
  border: 1px dashed rgba(139, 105, 20, 0.28);
  border-radius: 12px;
  padding: 40px 32px;
  text-align: center;
  background: rgba(139, 105, 20, 0.03);
  position: relative;
}

/* Extra bottom margin variant */
.placeholder--mb { margin-bottom: 28px; }

.placeholder-icon {
  font-size: 28px;
  margin-bottom: 12px;
  opacity: 0.5;
}

.placeholder-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.placeholder-hint {
  font-size: 13px;
  color: var(--text-dim);
}

/* ════════════════════════════════════════════
   4. TEXT UTILITIES
   Replaces all inline style="color:var(--text-dim)..." attributes.
════════════════════════════════════════════ */

.text-pending {
  color: var(--text-dim);
  font-size: 12px;
  font-style: italic;
}

/* ════════════════════════════════════════════
   5. INFO CARDS / CARD GRID
════════════════════════════════════════════ */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.card {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 24px 20px;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.card-icon {
  font-size: 22px;
  margin-bottom: 12px;
}

.card-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.card-body {
  font-size: 13px;
  color: var(--text-dim);
  line-height: 1.6;
}

.card-body p {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

/* ════════════════════════════════════════════
   6. PIPELINE / FLOW DIAGRAM
════════════════════════════════════════════ */

.pipeline-wrap {
  margin: 32px 0 40px;
  overflow-x: auto;   /* Allows horizontal scroll on small viewports */
  padding-bottom: 8px;
}

.pipeline {
  display: flex;
  align-items: flex-start;
  min-width: 560px;   /* Minimum before wrapping kicks in */
  gap: 0;
}

.pipeline-node { flex: 1; min-width: 180px; }

/* ── Node box ── */
.pnode-box {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.pnode-box:hover { box-shadow: 0 6px 24px rgba(44, 36, 22, 0.12); }

.pn-panel   .pnode-box:hover { border-color: rgba(139, 105,  20, 0.45); }
.pn-circuit .pnode-box:hover { border-color: rgba( 74, 112, 128, 0.45); }
.pn-element .pnode-box:hover { border-color: rgba( 94, 122,  90, 0.45); }

/* Colored top accent bar per node type */
.pnode-top { height: 3px; }

.pn-panel   .pnode-top { background: linear-gradient(90deg, #8B6914, #C49A30); }
.pn-circuit .pnode-top { background: linear-gradient(90deg, #4A7080, #7AAABB); }
.pn-element .pnode-top { background: linear-gradient(90deg, #5E7A5A, #8AA882); }

/* Node header */
.pnode-head {
  padding: 20px 16px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
}

.pnode-icon  { font-size: 28px; line-height: 1; }

.pnode-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

/* Revit API category label — uses mono because it IS code */
.pnode-revit-cat {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  padding: 3px 9px;
  border-radius: 4px;
}

.pn-panel   .pnode-revit-cat { color: #7A5810; background: rgba(139, 105,  20, 0.1); border: 1px solid rgba(139, 105,  20, 0.22); }
.pn-circuit .pnode-revit-cat { color: #3A6070; background: rgba( 74, 112, 128, 0.1); border: 1px solid rgba( 74, 112, 128, 0.22); }
.pn-element .pnode-revit-cat { color: #4E6A4A; background: rgba( 94, 122,  90, 0.1); border: 1px solid rgba( 94, 122,  90, 0.22); }

/* Node params list */
.pnode-params {
  padding: 14px 18px 20px;
  border-top: 1px solid var(--border-soft);
}

.pnode-params-label {
  font-size: 9.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.pnode-param {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 3px 0;
}

.pnode-bullet {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.pn-panel   .pnode-bullet { background: rgba(139, 105,  20, 0.7); }
.pn-circuit .pnode-bullet { background: rgba( 74, 112, 128, 0.7); }
.pn-element .pnode-bullet { background: rgba( 94, 122,  90, 0.7); }

/* Param name — monospace because it IS an API parameter name */
.pnode-param-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.5;
}

.pnode-param-name em {
  font-style: normal;
  color: var(--text-dim);
  font-size: 10px;
}

/* ── Node description (revealed on hover) ── */
.pnode-desc {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 18px;
  border-top: 1px solid transparent;
  /* Stagger: opacity resolves slightly after height so text fades in after the box expands */
  transition:
    max-height  0.38s ease,
    opacity     0.28s ease 0.08s,
    padding     0.38s ease,
    border-color 0.3s ease;
}

.pnode-box:hover .pnode-desc {
  max-height: 220px;
  opacity: 1;
  padding: 14px 18px 20px;
  border-top-color: var(--border-soft);
}

.pnode-desc-text {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.7;
  font-style: italic;
  margin: 0;
}

/* ── Animated connector arrow ── */
.pipeline-conn {
  flex: 0 0 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 54px;  /* Aligns arrow with the center of the node header */
  gap: 7px;
}

.conn-track {
  width: 100%;
  position: relative;
  height: 2px;
}

/* Flowing gradient line */
.conn-track::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(139, 105,  20, 0.15)  0%,
    rgba(196, 154,  48, 0.70) 50%,
    rgba(139, 105,  20, 0.15) 100%
  );
  background-size: 200% 100%;
  animation: connFlow 2.4s linear infinite;
}

/* Arrowhead */
.conn-track::after {
  content: '';
  position: absolute;
  right: -7px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 8px solid rgba(196, 154, 48, 0.75);
}

@keyframes connFlow {
  0%   { background-position:  200% 0; }
  100% { background-position: -200% 0; }
}

.conn-label {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ════════════════════════════════════════════
   6c. LIMITATIONS & FUTURE VISION (Sections 6 & 7)
════════════════════════════════════════════ */

/* ── Model comparison (ideal vs real) ── */
.model-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 28px 0;
}

.model-col {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}

.model-col-head {
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.model-col-head--ideal { background: rgba(94,122,90,0.07);  color: #3E6A3A; border-bottom-color: rgba(94,122,90,0.18);  }
.model-col-head--real  { background: rgba(139,74,20,0.07);  color: #8B3E10; border-bottom-color: rgba(139,74,20,0.18);  }

.model-col-body { padding: 6px 18px 14px; }

.model-item {
  font-size: 13px;
  color: var(--text-muted);
  padding: 8px 0;
  border-bottom: 1px solid rgba(44,36,22,0.04);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  line-height: 1.5;
}

.model-item:last-child { border-bottom: none; }
.model-item-icon       { font-size: 14px; flex-shrink: 0; margin-top: 1px; }

/* ── Quote / highlight block ── */
.quote-block {
  position: relative;
  background: var(--surface2);
  border-left: 4px solid var(--accent4);
  border-radius: 0 12px 12px 0;
  padding: 22px 28px 22px 28px;
  margin: 28px 0;
  overflow: hidden;
}

/* Decorative opening quote mark */
.quote-block::before {
  content: '\201C';
  position: absolute;
  top: -12px;
  left: 12px;
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 80px;
  color: rgba(139,74,20,0.1);
  line-height: 1;
  pointer-events: none;
}

.quote-text {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16.5px;
  font-style: italic;
  color: var(--text);
  line-height: 1.65;
  position: relative;
}

/* ── Extended approach table (4 rows) ── */
.approach-row--active { background: rgba(139,105,20,0.05) !important; }

.approach-row--active td:first-child {
  border-left: 3px solid var(--accent);
  padding-left: 13px;
}

.approach-cell-name {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.approach-cell-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.approach-cell-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  color: var(--text-dim);
}

.approach-cell-tag {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 20px;
}

.approach-cell-tag--active  { color: var(--accent);  background: rgba(139,105,20,0.1); border: 1px solid rgba(139,105,20,0.22); }
.approach-cell-tag--future  { color: var(--accent2); background: rgba(74,112,128,0.1); border: 1px solid rgba(74,112,128,0.22); }
.approach-cell-tag--research{ color: var(--text-dim); background: var(--bg);           border: 1px solid var(--border-soft);    }

.approach-cell-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

/* Viability progress bar */
.viability-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 90px;
}

.viability-track {
  flex: 1;
  height: 4px;
  background: var(--border-soft);
  border-radius: 2px;
  overflow: hidden;
}

.viability-fill        { height: 100%; border-radius: 2px; background: var(--accent3); }
.viability-fill--med   { background: var(--accent);  }
.viability-fill--low   { background: var(--text-dim); }
.viability-fill--xlow  { background: rgba(139,74,20,0.35); }

.viability-pct {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   6e. EVOLUTION TIMELINE (Sección 05 — Visión)
════════════════════════════════════════════ */

/* ── Progress track ── */
.evolution-track {
  display: flex;
  align-items: center;
  margin: 8px 0 24px;
}

.evo-track-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.evo-track-dot--1 { background: var(--accent);  }
.evo-track-dot--2 { background: var(--accent2); }
.evo-track-dot--3 { background: var(--accent3); }

.evo-track-line { flex: 1; height: 2px; }

.evo-track-line--12 { background: linear-gradient(90deg, var(--accent),  var(--accent2)); }
.evo-track-line--23 { background: linear-gradient(90deg, var(--accent2), var(--accent3)); }

/* ── Evolution cards grid ── */
.evolution-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 0 0 32px;
}

.evo-card {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

.evo-card:hover { box-shadow: 0 6px 20px rgba(44,36,22,0.1); }

.evo-card--1 { border-top: 3px solid var(--accent);  }
.evo-card--2 { border-top: 3px solid var(--accent2); }
.evo-card--3 { border-top: 3px solid var(--accent3); box-shadow: 0 0 0 3px rgba(94,122,90,0.08); }

.evo-phase-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
  align-self: flex-start;
}

.evo-card--1 .evo-phase-badge { color: var(--accent);  background: rgba(139,105,20,0.08); border: 1px solid rgba(139,105,20,0.22); }
.evo-card--2 .evo-phase-badge { color: var(--accent2); background: rgba(74,112,128,0.08); border: 1px solid rgba(74,112,128,0.22); }
.evo-card--3 .evo-phase-badge { color: var(--accent3); background: rgba(94,122,90,0.08);  border: 1px solid rgba(94,122,90,0.22);  }

.evo-icon  { font-size: 28px; margin-bottom: 12px; }

.evo-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 14px;
  line-height: 1.3;
}

.evo-tech {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 16px;
  flex: 1;
}

.evo-tech-item {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg);
  border-radius: 5px;
  border: 1px solid var(--border-soft);
  line-height: 1.4;
}

.evo-result {
  padding: 10px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.5;
  margin-top: auto;
}

.evo-card--1 .evo-result { background: rgba(139,105,20,0.06); border: 1px solid rgba(139,105,20,0.18); color: #7A5710; }
.evo-card--2 .evo-result { background: rgba(74,112,128,0.06); border: 1px solid rgba(74,112,128,0.18); color: #3A5E70; }
.evo-card--3 .evo-result { background: rgba(94,122,90,0.06);  border: 1px solid rgba(94,122,90,0.18);  color: #3A6A3E; }

.evo-result-icon { flex-shrink: 0; }

/* ── Question + answer inside evo-card ── */
.evo-question {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  padding: 11px 12px;
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  background: rgba(139,105,20,0.05);
  margin: 2px 0 12px;
}

.evo-card--2 .evo-question { border-left-color: #6B8CAE; background: rgba(107,140,174,0.05); }
.evo-card--3 .evo-question { border-left-color: #7A9E7E; background: rgba(122,158,126,0.05); }

.evo-answer {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
  margin-bottom: 14px;
}

/* ── Sector chips (use-case tags) ── */
.sector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0;
}

.sector-chip {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 20px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-muted);
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
  cursor: default;
}

.sector-chip:hover {
  border-color: #7A9E7E;
  color: var(--text);
  background: rgba(122,158,126,0.06);
}

/* ── Compact arch diagram modifier ── */
.arch-diagram--compact { max-width: 100%; margin: 0; }
.arch-diagram--compact .arch-node        { padding: 10px 16px; }
.arch-diagram--compact .arch-node-label  { font-size: 13px; }
.arch-diagram--compact .arch-node-sub    { font-size: 10.5px; }
.arch-diagram--compact .arch-branch-item { padding: 8px 5px; font-size: 11px; }
.arch-diagram--compact .arch-branches    { gap: 6px; }
.arch-diagram--compact .arch-connector-line { height: 14px; }

/* ════════════════════════════════════════════
   TAB NAVIGATION SYSTEM
════════════════════════════════════════════ */

/* ── Line content: hide internal dividers, reduce section padding ── */
.line-content hr.divider  { display: none; }
.line-content .section    { padding-top: 40px; }

/* ── Sticky tab bar ── */
.line-tabs {
  position: sticky;
  top: 0;
  z-index: 88;
  background: rgba(253, 250, 244, 0.97);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  margin: 20px -80px 0;
  padding: 0 80px;
  gap: 0;
}

.line-tabs::-webkit-scrollbar { display: none; }

.line-tab {
  padding: 10px 14px 9px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s ease, border-color 0.15s ease;
  margin-bottom: -1px;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.line-tab:hover  { color: var(--text); }
.line-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 2px; }

.tab-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  opacity: 0.7;
}

/* Active tab — per line color */
.line-tabs[data-line="1"] .line-tab.active { color: var(--accent);  border-bottom-color: var(--accent);  font-weight: 600; }
.line-tabs[data-line="2"] .line-tab.active { color: #6B8CAE;        border-bottom-color: #6B8CAE;         font-weight: 600; }
.line-tabs[data-line="3"] .line-tab.active { color: #7A9E7E;        border-bottom-color: #7A9E7E;         font-weight: 600; }

/* ── Sidebar position indicator ── */
.sidebar-position {
  padding: 10px 24px 11px;
  border-bottom: 1px solid var(--border-soft);
  background: rgba(44, 36, 22, 0.02);
}

.sidebar-pos-line {
  font-size: 9.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 4px;
  transition: color 0.4s ease;
}

.sidebar-pos-line.l1 { color: var(--accent); }
.sidebar-pos-line.l2 { color: #6B8CAE;       }
.sidebar-pos-line.l3 { color: #7A9E7E;       }

.sidebar-pos-info { font-size: 11px; color: var(--text-dim); }
.sidebar-pos-sep  { margin: 0 2px; }

.sidebar-pos-title {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.3;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

/* ════════════════════════════════════════════
   6f. CONCLUSION LIST (Sección 06)
════════════════════════════════════════════ */

.conclusion-list {
  display: flex;
  flex-direction: column;
  margin: 28px 0;
}

.conclusion-item {
  display: flex;
  align-items: flex-start;
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--border-soft);
}

.conclusion-item:last-child { border-bottom: none; }

/* Large faded number — editorial feel */
.conclusion-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 40px;
  font-weight: 700;
  color: rgba(139, 105, 20, 0.18);
  line-height: 1;
  flex-shrink: 0;
  min-width: 56px;
  padding-top: 2px;
  user-select: none;
}

.conclusion-text { flex: 1; }

.conclusion-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 10px;
  line-height: 1.3;
}

.conclusion-body {
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.72;
  margin: 0;
}

/* ── Approach table row tooltip (inline expand on hover) ── */
.approach-cell-tip {
  font-size: 12px;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.55;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  margin-top: 0;
  transition:
    max-height 0.35s ease,
    opacity    0.25s ease 0.06s,
    margin-top 0.3s  ease;
}

tbody tr:hover .approach-cell-tip {
  max-height: 80px;
  opacity: 1;
  margin-top: 7px;
}

/* ── Architecture diagram ── */
.arch-diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin: 32px auto;
  width: 100%;
  max-width: 560px;
}

.arch-node {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.arch-node--bim    { background: rgba(139,105,20,0.06); border-color: rgba(139,105,20,0.22); }
.arch-node--engine { background: rgba(74,112,128,0.06); border-color: rgba(74,112,128,0.22); }
.arch-node--output { background: rgba(94,122,90,0.06);  border-color: rgba(94,122,90,0.22);  }

.arch-node-icon  { font-size: 22px; flex-shrink: 0; }

.arch-node-label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: block;
}

.arch-node-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--text-dim);
}

.arch-connector {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 3px 0;
}

.arch-connector-line  { width: 2px; height: 18px; background: var(--border); }

.arch-connector-arrow {
  width: 0;
  height: 0;
  border-left: 6px solid transparent;
  border-right: 6px solid transparent;
  border-top: 8px solid var(--border);
}

.arch-branches {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  width: 100%;
}

.arch-branch-item {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  padding: 10px 6px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

/* ── Tech stack layers ── */
.stack-layers {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 24px 0;
}

.stack-layer {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.stack-layer:hover { border-color: var(--border); }

.stack-layer-num {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
  background: rgba(139,105,20,0.07);
  padding: 14px 0;
  border-right: 1px solid var(--border-soft);
  min-width: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.stack-layer-info { padding: 14px 20px; }

.stack-layer-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.stack-layer-tech {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-dim);
}

/* ════════════════════════════════════════════
   6a. DIJKSTRA Q&A + APPROACH COMPARISON (Section 4)
════════════════════════════════════════════ */

/* ── Q&A accordion-style blocks ── */
.qa-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 28px 0 32px;
}

.qa-block {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}

.qa-question {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 22px 16px;
  background: rgba(139, 105, 20, 0.04);
  border-bottom: 1px solid var(--border-soft);
}

.qa-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: rgba(139, 105, 20, 0.1);
  border: 1px solid rgba(139, 105, 20, 0.2);
  border-radius: 4px;
  padding: 2px 8px;
  flex-shrink: 0;
  margin-top: 3px;
}

.qa-q-text {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}

.qa-answer {
  padding: 18px 22px;
  font-size: 14px;
  color: var(--text-muted);
  line-height: 1.72;
  background: var(--surface);
}

.qa-answer p {
  font-size: inherit;
  color: inherit;
  margin-bottom: 0;
}

/* Approach reference tag inside a qa-answer */
.qa-approach-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  color: var(--accent);
  background: rgba(139,105,20,0.08);
  border: 1px solid rgba(139,105,20,0.22);
}

/* ── Card variant: question + answer in a single unified box ── */
.qa-list--cards .qa-block {
  background: var(--surface2);
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
}

.qa-list--cards .qa-question {
  background: rgba(139,105,20,0.05);
  border-bottom: 1px solid var(--border-soft);
  padding: 16px 22px 14px;
}

.qa-list--cards .qa-answer {
  background: transparent;
  padding: 14px 22px 18px;
}

/* ── Graph structure diagram (inside Q3 answer) ── */
.graph-diagram {
  margin-top: 16px;
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  overflow: hidden;
}

.graph-row {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid rgba(44, 36, 22, 0.05);
}

.graph-row:last-child { border-bottom: none; }

.graph-row-key {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(139, 105, 20, 0.05);
  padding: 11px 16px;
  border-right: 1px solid var(--border-soft);
  min-width: 88px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.graph-row-arrow {
  padding: 11px 10px;
  color: var(--text-dim);
  font-size: 13px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.graph-row-val {
  padding: 11px 12px 11px 0;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.graph-tag {
  font-size: 11.5px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: 5px;
  border: 1px solid;
}

.graph-tag-panel   { color: var(--accent);  background: rgba(139,105,20,0.07); border-color: rgba(139,105,20,0.2);  }
.graph-tag-circuit { color: var(--accent2); background: rgba(74,112,128,0.07); border-color: rgba(74,112,128,0.2); }
.graph-tag-element { color: var(--accent3); background: rgba(94,122,90,0.07);  border-color: rgba(94,122,90,0.2);  }
.graph-tag-neutral { color: var(--text-dim); background: var(--bg); border-color: var(--border-soft); }

/* ── Approach comparison cards ── */
.approach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
}

.approach-card {
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface2);
  transition: box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.approach-card--active {
  border-color: rgba(139, 105, 20, 0.45);
  box-shadow: 0 0 0 3px rgba(139, 105, 20, 0.09);
}

.approach-card--future {
  border-color: rgba(74, 112, 128, 0.35);
}

.approach-card-head {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.approach-num {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-dim);
}

.approach-status {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 9px;
  border-radius: 20px;
  white-space: nowrap;
}

.approach-status--active  { color: var(--accent);  background: rgba(139,105,20,0.1);  border: 1px solid rgba(139,105,20,0.25); }
.approach-status--future  { color: var(--accent2); background: rgba(74,112,128,0.1);  border: 1px solid rgba(74,112,128,0.25); }
.approach-status--ref     { color: var(--text-dim); background: var(--bg);            border: 1px solid var(--border-soft);    }

.approach-body {
  padding: 18px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.approach-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.approach-desc {
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.65;
  flex: 1;
}

.approach-meta {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 14px;
  border-top: 1px solid var(--border-soft);
}

.approach-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.approach-meta-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  flex-shrink: 0;
}

.approach-precision {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
}

.approach-precision--high     { color: var(--accent3); }
.approach-precision--veryhigh { color: #3A7A3A; }

.approach-stars {
  font-size: 12px;
  letter-spacing: 1px;
}

/* ════════════════════════════════════════════
   6b. CABLE CALCULATION LAYOUT (Section 3)
════════════════════════════════════════════ */

/* ── Row 1: two-column grid ── */
.calc-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 28px 0 20px;
}

/* Column card */
.calc-col {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  overflow: hidden;
}

.calc-col-head {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(139, 105, 20, 0.04);
}

.calc-col-num {
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
  background: rgba(139, 105, 20, 0.1);
  border: 1px solid rgba(139, 105, 20, 0.2);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}

.calc-col-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.calc-col-body {
  padding: 20px;
}

.calc-col-body > p {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 16px;
  line-height: 1.65;
}

/* Mini formula blocks inside columns */
.calc-formula {
  background: var(--bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 10px 14px;
  margin: 10px 0;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12.5px;
  color: var(--text);
  line-height: 1.7;
}

/* Factor note */
.calc-factor-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.calc-factor-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--accent4);
  background: rgba(139, 74, 20, 0.08);
  border: 1px solid rgba(139, 74, 20, 0.22);
  border-radius: 6px;
  padding: 3px 10px;
  white-space: nowrap;
}

/* ── Info block with embedded mini-table ── */
.info-block {
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  margin-bottom: 16px;
}

.info-block-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 20px;
  background: rgba(74,112,128,0.05);
  border-bottom: 1px solid var(--border-soft);
}

.info-block-icon { font-size: 22px; flex-shrink: 0; }

.info-block-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.info-block-desc {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 2px;
}

/* Table inside info-block: no outer border/radius */
.info-block .table-wrapper {
  border-radius: 0;
  border: none;
  margin: 0;
}

/* ── Bidirectional data flow grid ── */
.flow-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.flow-col {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}

.flow-col-head {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 600;
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 8px;
}

.flow-col-head::before {
  content: '';
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.flow-col-head--eplan { background: rgba(74,112,128,0.07); color: #3A5E70; border-bottom-color: rgba(74,112,128,0.18); }
.flow-col-head--eplan::before { background: #4A7080; }

.flow-col-head--revit { background: rgba(139,105,20,0.06); color: #7A5710; border-bottom-color: rgba(139,105,20,0.18); }
.flow-col-head--revit::before { background: #8B6914; }

.flow-list {
  list-style: none;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.flow-list li {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(44,36,22,0.04);
}

.flow-list li:last-child { border-bottom: none; }

.flow-list li::before {
  content: '→';
  font-size: 11px;
  flex-shrink: 0;
  color: var(--text-dim);
}

/* ── Factor tooltip (inline expand on hover) ── */
.factor-tooltip-wrap { cursor: help; }

.factor-tooltip {
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  padding: 0 12px;
  margin-top: 0;
  background: var(--bg);
  border: 1px solid transparent;
  border-radius: 8px;
  transition:
    max-height   0.35s ease,
    opacity      0.25s ease 0.06s,
    padding      0.3s  ease,
    margin-top   0.3s  ease,
    border-color 0.3s  ease;
}

.factor-tooltip-wrap:hover .factor-tooltip {
  max-height: 110px;
  opacity: 1;
  padding: 10px 12px;
  margin-top: 8px;
  border-color: var(--border);
}

.factor-tooltip-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
}

.ftr-value {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent4);
  flex-shrink: 0;
  min-width: 26px;
}

.ftr-sep  { font-size: 11px; color: var(--text-dim); flex-shrink: 0; }
.ftr-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; }

.ftr-highlight .ftr-value { color: var(--accent); }
.ftr-highlight .ftr-desc  { color: var(--text); font-weight: 500; }

.ftr-note {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 600;
  color: var(--accent);
  margin-left: 4px;
}

/* Conductor type list */
.conductor-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 4px;
}

.conductor-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  transition: border-color 0.15s ease;
}

.conductor-item:hover { border-color: var(--border); }

.conductor-type {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.conductor-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.cb-mono { color: var(--accent);  background: rgba(139, 105,  20, 0.1); border: 1px solid rgba(139, 105,  20, 0.2); }
.cb-bi   { color: var(--accent2); background: rgba( 74, 112, 128, 0.1); border: 1px solid rgba( 74, 112, 128, 0.2); }
.cb-tri  { color: var(--accent3); background: rgba( 94, 122,  90, 0.1); border: 1px solid rgba( 94, 122,  90, 0.2); }

.conductor-right {
  text-align: right;
  flex-shrink: 0;
}

.conductor-detail {
  font-size: 11.5px;
  color: var(--text-dim);
  display: block;
  margin-bottom: 2px;
}

.conductor-multiplier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 15px;
  font-weight: 600;
  color: var(--accent);
  display: block;
}

/* ── Row 2: full-width final formula ── */
.calc-final {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-top: 4px;
}

.calc-final-head {
  padding: 11px 24px;
  background: rgba(139, 105, 20, 0.07);
  border-bottom: 1px solid var(--border);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.calc-final-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.calc-final-formula {
  padding: 28px 28px 28px 24px;
  border-right: 1px solid var(--border-soft);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 16px;
}

.calc-final-formula-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

/* Each line of the stacked formula */
.calc-final-expr {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calc-expr-line {
  font-family: 'JetBrains Mono', monospace;
  color: var(--text);
  line-height: 1.6;
}

.calc-expr-line--main {
  font-size: 15px;
  font-weight: 600;
}

.calc-expr-line--factor {
  font-size: 13px;
  color: var(--text-muted);
  padding-left: 8px;
}

.calc-expr-line--factor::before {
  content: '×  ';
  color: var(--accent4);
  font-weight: 600;
}

/* Example panel */
.calc-final-example {
  padding: 28px 24px 28px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}

.calc-final-example-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-dim);
}

.calc-example-steps {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
}

.calc-step-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 14px;
  border-bottom: 1px solid rgba(44, 36, 22, 0.05);
  font-size: 13px;
}

.calc-step-row:last-child { border-bottom: none; }

.calc-step-label { color: var(--text-muted); }

.calc-step-value {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  color: var(--text);
}

/* Highlighted total result row */
.calc-step-row--total {
  background: rgba(139, 105, 20, 0.07);
  border-top: 1px solid rgba(139, 105, 20, 0.18) !important;
}

.calc-step-row--total .calc-step-label {
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: 0.06em;
}

.calc-step-row--total .calc-step-value {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent);
}

/* ════════════════════════════════════════════
   7. DATA TABLES
════════════════════════════════════════════ */

.table-wrapper {
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 12px;
  border: 1px solid var(--border-soft);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}

thead tr {
  background: var(--surface2);
  border-bottom: 1px solid var(--border-soft);
}

th {
  padding: 12px 16px;
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid rgba(44, 36, 22, 0.05);
  transition: background 0.15s ease;
}

tbody tr:last-child { border-bottom: none; }
tbody tr:hover      { background: var(--surface2); }

td {
  padding: 12px 16px;
  color: var(--text-muted);
  vertical-align: top;
}

td:first-child {
  color: var(--text);
  font-weight: 500;
}

/* ── Status badges (OK / Warning / Error) ── */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.status-ok      { color: #3E6A3A; background: rgba(94,122,90,0.1);  border: 1px solid rgba(94,122,90,0.25);  }
.status-warning { color: #8B4A14; background: rgba(139,74,20,0.1);  border: 1px solid rgba(139,74,20,0.25);  }
.status-error   { color: #8B2010; background: rgba(180,48,20,0.1);  border: 1px solid rgba(180,48,20,0.25);  }

/* Highlighted total row in tables */
.tr-total { background: rgba(139,105,20,0.07) !important; }
.tr-total td { color: var(--accent); font-weight: 700; border-top: 1px solid rgba(139,105,20,0.2) !important; }

/* Inline code tag inside table cells */
.td-tag {
  display: inline-block;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11.5px;
  background: var(--code-bg);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  padding: 1px 7px;
  color: #7AAABB;
}

/* ════════════════════════════════════════════
   8. CODE BLOCKS + SYNTAX HIGHLIGHTING
════════════════════════════════════════════ */

.code-block {
  background: var(--code-bg);
  border: 1px solid rgba(44, 36, 22, 0.25);
  border-radius: 10px;
  margin: 24px 0;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(44, 36, 22, 0.12);
}

.code-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  background: rgba(255, 255, 255, 0.04);
}

.code-block-lang {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--accent);
}

/* macOS-style window control dots (decorative) */
.code-block-dots         { display: flex; gap: 6px; }
.code-block-dots span    { width: 10px; height: 10px; border-radius: 50%; }
.dot-r                   { background: #ff5f56; }
.dot-y                   { background: #ffbd2e; }
.dot-g                   { background: #27c93f; }

pre {
  padding: 20px;
  overflow-x: auto;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.65;
  color: var(--text-muted);
}

pre code { color: inherit; }

/* ── Syntax token colors (dark theme, inside code-block) ── */
.kw  { color: #d4a0e8; }                      /* keyword              */
.fn  { color: #89b4e8; }                      /* function / identifier */
.str { color: #b8d68a; }                      /* string               */
.cm  { color: #7A6E5A; font-style: italic; }  /* comment              */
.nb  { color: #7AAABB; }                      /* built-in / module    */
.op  { color: #D4A055; }                      /* operator / decorator */
.num { color: #e8a07a; }                      /* number               */

/* ════════════════════════════════════════════
   9. FORMULA BLOCKS
════════════════════════════════════════════ */

.formula-block {
  background: var(--surface2);
  border-left: 3px solid var(--accent4);
  border-radius: 0 10px 10px 0;
  padding: 20px 24px;
  margin: 24px 0;
}

.formula-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent4);
  margin-bottom: 10px;
}

.formula-expr {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.6;
}

.formula-note {
  font-size: 12.5px;
  color: var(--text-dim);
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-soft);
  line-height: 1.6;
}

/* ════════════════════════════════════════════
   10. CALLOUT BOXES
════════════════════════════════════════════ */

.callout {
  border-radius: 10px;
  padding: 16px 20px;
  margin: 20px 0;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

/* Spacing modifiers — replace inline style="margin-top:..." */
.callout--mt    { margin-top: 24px; }
.callout--mt-lg { margin-top: 36px; }

.callout-icon {
  font-size: 18px;
  flex-shrink: 0;
  padding-top: 1px;
}

.callout-body {
  font-size: 13.5px;
  line-height: 1.65;
}

.callout-body strong {
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.callout-body p {
  margin: 0;
  font-size: inherit;
}

/* Variants */
.callout-info    { background: rgba( 74, 112, 128, 0.07); border: 1px solid rgba( 74, 112, 128, 0.22); }
.callout-warning { background: rgba(139,  74,  20, 0.07); border: 1px solid rgba(139,  74,  20, 0.22); }
.callout-success { background: rgba( 94, 122,  90, 0.07); border: 1px solid rgba( 94, 122,  90, 0.22); }

.callout-info    .callout-body         { color: #3A6070; }
.callout-info    .callout-body strong  { color: #2E4E5C; }

.callout-warning .callout-body         { color: #7A3E10; }
.callout-warning .callout-body strong  { color: #6A3008; }

.callout-success .callout-body         { color: #3E5E3A; }
.callout-success .callout-body strong  { color: #2E4E2A; }

/* ════════════════════════════════════════════
   11. COMPARE GRID (pro / con)
════════════════════════════════════════════ */

.compare-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 24px 0;
}

.compare-card {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
}

.compare-card-head {
  padding: 14px 20px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compare-card-head.bad  { background: rgba(139, 74, 20, 0.07); color: #8B3E10; border-bottom: 1px solid rgba(139, 74, 20, 0.18); }
.compare-card-head.good { background: rgba( 94, 122, 90, 0.07); color: #3E6A3A; border-bottom: 1px solid rgba( 94, 122, 90, 0.18); }

.compare-card ul  { list-style: none; padding: 16px 20px; }

.compare-card li {
  font-size: 13.5px;
  color: var(--text-muted);
  padding: 5px 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.compare-card li::before {
  flex-shrink: 0;
  font-size: 12px;
  padding-top: 2px;
}

.compare-card.bad  li::before { content: '✗'; color: #8B3E10; }
.compare-card.good li::before { content: '✓'; color: #3E6A3A; }

/* ════════════════════════════════════════════
   12. STEP LIST (numbered workflow)
════════════════════════════════════════════ */

.step-list {
  list-style: none;
  padding: 0;
  margin: 24px 0;
}

.step-item {
  display: flex;
  gap: 20px;
  padding-bottom: 28px;
  position: relative;
}

/* Vertical connector line between consecutive steps */
.step-item:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 17px;
  top: 36px;
  width: 1px;
  height: calc(100% - 12px);
  background: linear-gradient(var(--border), transparent);
}

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--surface2);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  flex-shrink: 0;
}

.step-content { padding-top: 6px; }

.step-title {
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.step-body {
  font-size: 13.5px;
  color: var(--text-dim);
  line-height: 1.6;
}

.step-body p {
  margin: 0;
  color: inherit;
  font-size: inherit;
}

/* ════════════════════════════════════════════
   13. MOBILE SIDEBAR TOGGLE BUTTON
════════════════════════════════════════════ */

.sidebar-toggle {
  display: none;           /* Shown only via responsive.css at ≤700px */
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  z-index: 300;
  box-shadow: 0 4px 20px rgba(139, 105, 20, 0.35);
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease, transform 0.15s ease;
}

.sidebar-toggle:hover  { background: #7A5A0F; transform: scale(1.05); }
.sidebar-toggle:active { transform: scale(0.96); }

/* ════════════════════════════════════════════
   6g. FORMULA RENDERED + GRAPH ILLUSTRATION
════════════════════════════════════════════ */

/* ── Rendered math formula ── */
.formula-rendered {
  font-family: 'JetBrains Mono', monospace;
  font-size: 16px;
  color: var(--text);
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px;
  line-height: 2.2;
}

.formula-main { font-weight: 600; }

/* The √ radical symbol */
.formula-sqrt {
  font-size: 1.4em;
  line-height: 1;
  vertical-align: -0.1em;
}

/* The expression under the radical — border-top creates the overline */
.formula-under {
  display: inline;
  border-top: 1.8px solid var(--text);
  padding-top: 2px;
  margin-left: 1px;
}

/* Variable names: italic serif (math convention) */
.formula-var {
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  color: var(--accent);
}

.formula-op   { color: var(--accent4); font-weight: 700; padding: 0 2px; }
.formula-eq   { font-weight: 400; padding: 0 4px; }

/* Small legend below the formula */
.formula-legend {
  margin-top: 12px;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  color: var(--text-dim);
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.formula-legend i {
  font-family: 'Playfair Display', Georgia, serif;
  color: var(--accent);
  font-style: italic;
}

/* ── SVG graph illustration ── */
.graph-illustration {
  margin: 20px 0;
  border: 1px solid var(--border-soft);
  border-radius: 12px;
  overflow: hidden;
  background: #FDFAF4;
}

.graph-illustration svg { display: block; width: 100%; }

.graph-caption {
  font-size: 11.5px;
  color: var(--text-dim);
  font-style: italic;
  text-align: center;
  padding: 8px 20px 12px;
  border-top: 1px solid var(--border-soft);
}

/* ════════════════════════════════════════════
   6d. CIRCUIT TYPE CARDS + WORKFLOW PIPELINE (Section 3)
════════════════════════════════════════════ */

/* ── Circuit type cards ── */
.circuit-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 8px;
}

.circuit-card {
  background: var(--bg);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 18px 12px;
  text-align: center;
  transition: border-color 0.15s, transform 0.15s;
}

.circuit-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.circuit-card-badge {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 6px;
  display: inline-block;
  margin-bottom: 10px;
}

.circuit-card--mono .circuit-card-badge { color: var(--accent);  background: rgba(139,105,20,0.1); border: 1px solid rgba(139,105,20,0.2); }
.circuit-card--bi   .circuit-card-badge { color: var(--accent2); background: rgba(74,112,128,0.1); border: 1px solid rgba(74,112,128,0.2); }
.circuit-card--tri  .circuit-card-badge { color: var(--accent3); background: rgba(94,122,90,0.1);  border: 1px solid rgba(94,122,90,0.2);  }

.circuit-card-name {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

.circuit-card-detail {
  font-size: 11px;
  color: var(--text-dim);
  margin-bottom: 10px;
  line-height: 1.4;
}

.circuit-card-multiplier {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--accent);
}

.circuit-card--bi  .circuit-card-multiplier { color: var(--accent2); }
.circuit-card--tri .circuit-card-multiplier { color: var(--accent3); }

/* ── Horizontal workflow pipeline ── */
.workflow-wrap {
  margin: 24px 0;
  overflow-x: auto;
  padding-bottom: 4px;
}

.workflow-pipeline {
  display: flex;
  align-items: flex-start;
  min-width: 700px;
  gap: 0;
}

.workflow-step         { flex: 1; min-width: 110px; }

.workflow-step-box {
  background: var(--surface2);
  border: 1px solid var(--border-soft);
  border-radius: 10px;
  padding: 16px 12px;
  text-align: center;
  transition: border-color 0.2s, box-shadow 0.2s;
  height: 100%;
  box-sizing: border-box;
}

.workflow-step-box:hover {
  border-color: var(--border);
  box-shadow: 0 4px 14px rgba(44, 36, 22, 0.1);
}

.workflow-step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(139, 105, 20, 0.09);
  border: 1px solid rgba(139, 105, 20, 0.2);
  color: var(--accent);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 10px;
}

.workflow-step-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.35;
  margin-bottom: 5px;
}

.workflow-step-desc {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10.5px;
  color: var(--text-dim);
  line-height: 1.5;
}

.workflow-arrow {
  flex: 0 0 22px;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 26px;
  color: var(--text-dim);
  font-size: 13px;
  flex-shrink: 0;
}

/* ════════════════════════════════════════════
   14. SCROLL REVEAL ANIMATIONS
════════════════════════════════════════════ */

/* ── Individual element: fade + slide up ── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.52s ease, transform 0.52s ease;
  will-change: opacity, transform;
}

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

/* ── Staggered group: children animate, container is transparent ── */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(13px);
  transition: opacity 0.45s ease, transform 0.45s ease;
  will-change: opacity, transform;
}

.reveal-stagger.reveal--visible > *:nth-child(1) { opacity: 1; transform: translateY(0); transition-delay: 0s;    }
.reveal-stagger.reveal--visible > *:nth-child(2) { opacity: 1; transform: translateY(0); transition-delay: 0.1s;  }
.reveal-stagger.reveal--visible > *:nth-child(3) { opacity: 1; transform: translateY(0); transition-delay: 0.2s;  }
.reveal-stagger.reveal--visible > *:nth-child(4) { opacity: 1; transform: translateY(0); transition-delay: 0.3s;  }

/* ── Respect reduced-motion preference ── */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal-stagger > * {
    opacity: 1;
    transform: none;
    transition: none;
    will-change: auto;
  }
}

/* ════════════════════════════════════════════
   15. LINE HERO (separador visual entre líneas)
════════════════════════════════════════════ */

.line-hero {
  margin: 64px 0 0;
  padding: 40px 0 36px;
  border-top: 2px solid transparent;
  position: relative;
}

/* Variante dorada — Línea 1 */
.line-hero--l1 {
  border-top-color: rgba(139, 105, 20, 0.45);
  background: linear-gradient(to bottom, rgba(139,105,20,0.05) 0%, transparent 80%);
}
.line-hero--l1 .line-hero-eyebrow { color: var(--accent); }
.line-hero--l1 .line-hero-dot     { background: var(--accent); }
.line-hero--l1 .line-hero-pill    { color: var(--accent); background: rgba(139,105,20,0.08); border: 1px solid rgba(139,105,20,0.25); }
.line-hero--l1 .line-hero-pill::before { background: var(--accent); }

/* Fondo degradado sutil de arriba hacia abajo */
.line-hero--l2 {
  border-top-color: rgba(107, 140, 174, 0.45);
  background: linear-gradient(
    to bottom,
    rgba(107, 140, 174, 0.05) 0%,
    transparent 80%
  );
}

.line-hero--l3 {
  border-top-color: rgba(122, 158, 126, 0.45);
  background: linear-gradient(
    to bottom,
    rgba(122, 158, 126, 0.05) 0%,
    transparent 80%
  );
}

/* Eyebrow: "Línea de Investigación N" */
.line-hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin-bottom: 14px;
}

.line-hero-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.line-hero--l2 .line-hero-eyebrow { color: #6B8CAE; }
.line-hero--l2 .line-hero-dot     { background: #6B8CAE; }

.line-hero--l3 .line-hero-eyebrow { color: #7A9E7E; }
.line-hero--l3 .line-hero-dot     { background: #7A9E7E; }

/* Título principal */
.line-hero-title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(24px, 3.5vw, 36px);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin-bottom: 12px;
}

/* Subtítulo descriptivo */
.line-hero-desc {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 520px;
  line-height: 1.7;
  margin-bottom: 20px;
}

/* Pill de estado */
.line-hero-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 12px;
  border-radius: 20px;
}

.line-hero-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.line-hero--l2 .line-hero-pill {
  color: #6B8CAE;
  background: rgba(107, 140, 174, 0.08);
  border: 1px solid rgba(107, 140, 174, 0.25);
}
.line-hero--l2 .line-hero-pill::before { background: #6B8CAE; }

.line-hero--l3 .line-hero-pill {
  color: #7A9E7E;
  background: rgba(122, 158, 126, 0.08);
  border: 1px solid rgba(122, 158, 126, 0.25);
}
.line-hero--l3 .line-hero-pill::before { background: #7A9E7E; }

/* ════════════════════════════════════════════
   15. SECTION-NUM Y PLACEHOLDER — variantes de línea
════════════════════════════════════════════ */

/* Section number badge — Línea 2 */
.section-num--l2 {
  color: #6B8CAE;
  background: rgba(107, 140, 174, 0.09);
  border-color: rgba(107, 140, 174, 0.25);
}

/* Section number badge — Línea 3 */
.section-num--l3 {
  color: #7A9E7E;
  background: rgba(122, 158, 126, 0.09);
  border-color: rgba(122, 158, 126, 0.25);
}

/* Placeholder con borde en Línea 2 */
.placeholder--l2 {
  border-color: rgba(107, 140, 174, 0.3);
  background: rgba(107, 140, 174, 0.03);
}

/* Placeholder con borde en Línea 3 */
.placeholder--l3 {
  border-color: rgba(122, 158, 126, 0.3);
  background: rgba(122, 158, 126, 0.03);
}
