/* MiCerebro NeuroMap V6 — capa visible, viva y escalable. */
body.nv5 .neuromap-stage-wrap {
  position: relative;
  isolation: isolate;
  min-height: clamp(520px, 68dvh, 820px) !important;
  overflow: hidden;
  background:
    radial-gradient(ellipse 72% 64% at 50% 48%, rgba(11, 144, 167, .13), transparent 72%),
    radial-gradient(ellipse 45% 48% at 72% 38%, rgba(90, 75, 220, .08), transparent 75%),
    linear-gradient(155deg, #01070c, #031017 48%, #01060c) !important;
}
body.nv5 .neuromap-stage-wrap::before,
body.nv5 .neuromap-stage-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}
body.nv5 .neuromap-stage-wrap::before {
  opacity: .5;
  background-image:
    radial-gradient(circle at 17% 22%, rgba(37, 221, 240, .36) 0 1px, transparent 1.8px),
    radial-gradient(circle at 79% 18%, rgba(135, 108, 255, .28) 0 1px, transparent 1.8px),
    radial-gradient(circle at 64% 78%, rgba(255, 126, 116, .22) 0 1px, transparent 1.8px);
  background-size: 89px 89px, 127px 127px, 151px 151px;
  mask-image: radial-gradient(ellipse 88% 80% at center, #000 0 48%, transparent 94%);
}
body.nv5 .neuromap-stage-wrap::after {
  opacity: .24;
  background:
    linear-gradient(112deg, transparent 49%, rgba(38, 208, 229, .045) 50%, transparent 51%),
    linear-gradient(28deg, transparent 49%, rgba(101, 82, 232, .035) 50%, transparent 51%);
  background-size: 64px 64px, 83px 83px;
}

/* Todas las versiones anteriores quedan como fallback técnico, no compiten visualmente. */
body.nv5 .neuromap-stage-wrap canvas:not(.neuromap-v6-canvas) {
  position: absolute !important;
  inset: 0 !important;
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}
body.nv5 .neuromap-stage-wrap .neuromap-overlay {
  z-index: 8;
}
body.nv5 .neuromap-crumbs,
body.nv5 .neuromap-legend,
body.nv5 .neuromap-stats { display: none !important; }

.neuromap-v6-root {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  border-radius: inherit;
  touch-action: none;
}
.neuromap-v6-canvas {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 1;
  visibility: visible;
  cursor: grab;
  touch-action: none;
  user-select: none;
  outline: none;
}
.neuromap-v6-canvas:active { cursor: grabbing; }
.neuromap-v6-canvas:focus-visible { box-shadow: inset 0 0 0 3px rgba(54, 218, 246, .55); }

.neuromap-v6-ui {
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  color: #eaf8ff;
}
.neuromap-v6-top {
  position: absolute;
  top: 12px;
  left: 14px;
  right: 14px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.neuromap-v6-crumbs {
  display: flex;
  align-items: center;
  gap: 6px;
  max-width: calc(100% - 170px);
  overflow: auto hidden;
  scrollbar-width: none;
  pointer-events: auto;
}
.neuromap-v6-crumbs::-webkit-scrollbar { display: none; }
.neuromap-v6-crumbs button,
.neuromap-v6-actions button,
.neuromap-v6-more {
  min-height: 38px;
  border: 1px solid rgba(75, 184, 222, .24);
  border-radius: 999px;
  padding: 0 12px;
  color: #bbd4e7;
  background: rgba(2, 15, 27, .78);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.025), 0 8px 25px rgba(0,0,0,.18);
  backdrop-filter: blur(16px) saturate(125%);
  font: 600 11px/1 Sora, Inter, sans-serif;
  white-space: nowrap;
  cursor: pointer;
}
.neuromap-v6-crumbs button:hover,
.neuromap-v6-actions button:hover,
.neuromap-v6-more:hover {
  color: #fff;
  border-color: rgba(45, 219, 240, .43);
  background: rgba(7, 48, 66, .82);
}
.neuromap-v6-crumbs button[aria-current="page"] {
  color: #fff;
  border-color: rgba(67, 201, 242, .42);
  background: linear-gradient(135deg, rgba(7, 127, 180, .76), rgba(70, 72, 190, .72));
}
.neuromap-v6-actions {
  display: flex;
  gap: 6px;
  pointer-events: auto;
}
.neuromap-v6-actions button {
  width: 40px;
  padding: 0;
  font-size: 16px;
}

.neuromap-v6-status {
  position: absolute;
  left: 16px;
  bottom: 16px;
  max-width: min(440px, calc(100% - 150px));
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(71, 168, 207, .19);
  border-radius: 15px;
  color: #91a7bf;
  background: rgba(2, 13, 24, .72);
  box-shadow: 0 14px 35px rgba(0,0,0,.22);
  backdrop-filter: blur(16px);
  pointer-events: none;
}
.neuromap-v6-status b { color: #edfaff; font: 600 12px/1.2 Sora, sans-serif; }
.neuromap-v6-status span { font-size: 10.5px; line-height: 1.35; }
.neuromap-v6-more {
  position: absolute;
  right: 16px;
  bottom: 16px;
  min-width: 112px;
  pointer-events: auto;
}
.neuromap-v6-more[hidden] { display: none !important; }

.neuromap-v6-loading,
.neuromap-v6-empty {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  padding: 70px 24px;
  color: #8da5be;
  text-align: center;
  pointer-events: none;
}
.neuromap-v6-empty div,
.neuromap-v6-loading div {
  max-width: 420px;
  padding: 17px 20px;
  border: 1px solid rgba(67, 179, 218, .18);
  border-radius: 18px;
  background: rgba(2, 14, 26, .72);
  backdrop-filter: blur(15px);
}
.neuromap-v6-empty b,
.neuromap-v6-loading b { display: block; margin-bottom: 5px; color: #eefaff; font-family: Sora, sans-serif; }

body.nv5 .neuromap-detail.neuromap-v6-detail {
  z-index: 14;
  top: 64px;
  right: 14px;
  width: min(350px, calc(100% - 28px));
  max-height: calc(100% - 142px);
  color: #dceaf7 !important;
  border-color: rgba(74, 193, 228, .25) !important;
  background:
    radial-gradient(330px 180px at 100% 0, rgba(82, 74, 220, .16), transparent 72%),
    linear-gradient(145deg, rgba(5, 22, 38, .97), rgba(2, 12, 24, .97)) !important;
}
body.nv5 .neuromap-v6-detail small { color: #64caee; }
body.nv5 .neuromap-v6-detail h3 { color: #f4fbff !important; }
body.nv5 .neuromap-v6-detail .neuromap-detail-grid div { background: rgba(10, 47, 65, .64) !important; }

/* El mismo cerebro visible en Inicio. */
.nv-dashboard-hero { position: relative; }
.nv-brain-v6-preview {
  position: absolute;
  inset: 58px 0 0;
  z-index: 2;
  width: 100%;
  height: calc(100% - 58px);
  display: block;
  opacity: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.nv-dashboard-hero.nv-v6-preview-ready .nv-brain-preview,
.nv-dashboard-hero.nv-v6-preview-ready .nv-wire-preview { opacity: 0 !important; visibility: hidden !important; }
.nv-dashboard-hero-head,
.nv-brain-preview-hint,
.nv-brain-preview-action { z-index: 5 !important; }

@media (max-width: 760px) {
  body.nv5 .neuromap-shell {
    min-height: var(--nv-safe-vh, 100dvh) !important;
  }
  body.nv5 .neuromap-stage-wrap {
    min-height: calc(var(--nv-safe-vh, 100dvh) - 104px) !important;
    height: calc(var(--nv-safe-vh, 100dvh) - 104px) !important;
  }
  .neuromap-v6-top { top: 8px; left: 8px; right: 8px; }
  .neuromap-v6-crumbs { max-width: calc(100% - 98px); }
  .neuromap-v6-crumbs button { min-height: 42px; padding-inline: 11px; }
  .neuromap-v6-actions button { width: 42px; min-height: 42px; }
  .neuromap-v6-status {
    left: 9px;
    bottom: 9px;
    max-width: calc(100% - 124px);
    padding: 8px 10px;
  }
  .neuromap-v6-status span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .neuromap-v6-more { right: 9px; bottom: 9px; min-width: 104px; min-height: 43px; }
  body.nv5 .neuromap-detail.neuromap-v6-detail {
    left: 8px;
    right: 8px;
    top: auto;
    bottom: 68px;
    width: auto;
    max-height: 44dvh;
  }
  .nv-brain-v6-preview { inset: 52px 0 0; height: calc(100% - 52px); }
}

@media (max-width: 390px) {
  .neuromap-v6-status { max-width: calc(100% - 112px); }
  .neuromap-v6-status span { display: none; }
  .neuromap-v6-more { min-width: 96px; padding-inline: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  .neuromap-v6-canvas,
  .nv-brain-v6-preview { scroll-behavior: auto; }
}
