/* ═══════════════════════════════════════════════════════════════════════
 * NUCLEAR LENS FIELD — CSS
 *
 * Three-level interactive visualization:
 *   Level 1: THE FIELD — nuclei positioned by force direction (x) and magnitude (y)
 *   Level 2: THE NUCLEUS — expanded lens with orbital shells, phase radar, deliverables
 *   Level 3: THE ATOM — detail card with all bindings, chain state, actions
 *
 * Uses existing --bg-*, --text-*, --border, --green/--amber/--red/--blue vars
 * Phase colors: II=#ff6b6b  CR=#feca57  RR=#54a0ff  HC=#8395a7
 * ═══════════════════════════════════════════════════════════════════════ */

/* ─── LEVEL 1: THE FIELD ─────────────────────────────────────────────── */

.nlf-field {
  position: relative;
  width: 100%;
  height: 100%;
  flex: 1;
  min-height: 0;
  background: var(--bg-0, #080c14);
  border: 1px solid var(--border, #1e2a42);
  border-radius: 6px;
  overflow: hidden;
  user-select: none;
  display: flex;
  flex-direction: column;
}

.nlf-field-canvas {
  position: relative;
  width: 100%;
  flex: 1;
  min-height: 200px;
  overflow: hidden;
}

/* θ direction columns (background zones) */
.nlf-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  border-right: 1px solid rgba(30, 42, 66, 0.5);
  transition: background 0.25s ease;
}
.nlf-zone:last-child { border-right: none; }

.nlf-zone-label {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  pointer-events: none;
  z-index: 2;
}
.nlf-zone-label-title {
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.nlf-zone-label-sub {
  font-family: var(--sans, sans-serif);
  font-size: 8px;
  color: var(--text-3, #555e70);
  margin-top: 2px;
}

/* Y-axis magnitude labels */
.nlf-y-axis {
  position: absolute;
  left: 4px;
  top: 45px;
  bottom: 25px;
  width: 16px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  pointer-events: none;
  z-index: 2;
}
.nlf-y-label {
  font-family: var(--mono, monospace);
  font-size: 7px;
  color: var(--text-3, #555e70);
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  letter-spacing: 0.06em;
}

/* ─── NUCLEI (Level 1 bubbles) ───────────────────────────────────────── */

.nlf-nucleus {
  position: absolute;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
              box-shadow 0.3s ease,
              opacity 0.3s ease;
  z-index: 3;
}
.nlf-nucleus:hover {
  transform: translate(-50%, -50%) scale(1.08);
  z-index: 5;
}
.nlf-nucleus.nlf-nucleus-selected {
  z-index: 6;
}

/* Nucleus inner glow */
.nlf-nucleus-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
}

/* Atom orbit ring around nucleus */
.nlf-orbit-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
  animation: nlf-orbit-rotate 60s linear infinite;
}
@keyframes nlf-orbit-rotate {
  from { transform: translate(-50%, -50%) rotate(0deg); }
  to   { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Orbit atoms — tiny dots on the ring */
.nlf-orbit-atom {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  pointer-events: none;
  box-shadow: 0 0 4px currentColor;
}

/* Nucleus label */
.nlf-nucleus-label {
  position: absolute;
  bottom: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono, monospace);
  font-size: 8px;
  white-space: nowrap;
  pointer-events: none;
  text-align: center;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 0.2s ease;
}
.nlf-nucleus:hover .nlf-nucleus-label,
.nlf-nucleus-selected .nlf-nucleus-label {
  opacity: 1;
}
/* Keep labels visible in expanded state */
.nlf-nucleus-label._always-visible {
  opacity: 1;
}

/* Dominant phase pip */
.nlf-phase-pip {
  position: absolute;
  top: -7px;
  right: -5px;
  font-family: var(--mono, monospace);
  font-size: 7px;
  font-weight: 700;
  padding: 1px 3px;
  border-radius: 3px;
  background: var(--bg-3, #131b30);
  border: 1px solid var(--border, #1e2a42);
  pointer-events: none;
  letter-spacing: 0.06em;
}

/* Atom count badge */
.nlf-atom-count {
  position: absolute;
  top: -6px;
  left: -4px;
  font-family: var(--mono, monospace);
  font-size: 7px;
  color: var(--text-2, #7080a0);
  background: var(--bg-3, #131b30);
  border: 1px solid var(--border, #1e2a42);
  border-radius: 8px;
  padding: 1px 3px;
  pointer-events: none;
}

/* Selection pulse ring */
.nlf-selection-ring {
  position: absolute;
  inset: -8px;
  border-radius: 50%;
  border: 2px solid currentColor;
  opacity: 0.7;
  pointer-events: none;
  animation: nlf-pulse 2s ease-in-out infinite;
}
@keyframes nlf-pulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50%      { opacity: 0.8; transform: scale(1.04); }
}

/* Temporal exhaustion warning (>80% atoms expired) */
.nlf-temporal-warning {
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 2px dashed var(--amber, #ffaa00);
  opacity: 0.5;
  pointer-events: none;
  animation: nlf-warn-blink 3s ease-in-out infinite;
}
@keyframes nlf-warn-blink {
  0%, 100% { opacity: 0.3; }
  50%      { opacity: 0.6; }
}

/* Ghosted (temporal toggle — expired atoms) */
.nlf-nucleus-ghost {
  opacity: 0.25 !important;
  filter: grayscale(0.6);
}
.nlf-nucleus-ghost .nlf-nucleus-label {
  text-decoration: line-through;
  opacity: 0.5;
}

/* ─── ENTANGLEMENT LINES (shared atoms between nuclei) ───────────────── */

.nlf-entanglement-svg {
  display: none !important;
}
/* Hide distorted text labels inside entanglement SVG — the viewBox
   preserveAspectRatio="none" stretches them into unreadable diagonal bars */
.nlf-entanglement-svg text {
  display: none !important;
}
/* Target ALL lines inside the entanglement SVG — the JS creates bare <line>
   elements without CSS classes, and the viewBox="0 0 100 100" with
   preserveAspectRatio="none" on a ~1100px container would scale stroke-width:1
   to ~11px without non-scaling-stroke. */
.nlf-entanglement-svg line {
  vector-effect: non-scaling-stroke !important;
  stroke-width: 1px !important;
  stroke-dasharray: 4 3 !important;
}
.nlf-entanglement-line {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
  stroke-dasharray: 4 3;
  fill: none;
  vector-effect: non-scaling-stroke;
}
.nlf-entanglement-line-strong {
  stroke: rgba(84, 160, 255, 0.2);
  stroke-width: 1.5;
  stroke-dasharray: 6 4;
  vector-effect: non-scaling-stroke;
}

/* Phantom echo — atom shared with another nucleus */
.nlf-phantom-echo {
  position: absolute;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  border: 1px dotted rgba(255, 255, 255, 0.25);
  pointer-events: none;
  opacity: 0.5;
}


/* ─── FIELD BOTTOM BAR ───────────────────────────────────────────────── */

.nlf-field-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px;
  background: var(--bg-2, #0f1628);
  border-top: 1px solid var(--border, #1e2a42);
  flex-shrink: 0;
  flex-wrap: wrap;
}

.nlf-field-stat {
  font-family: var(--mono, monospace);
  font-size: 9px;
  color: var(--text-3, #555e70);
}
.nlf-field-stat-val {
  color: var(--text-1, #b8c0d0);
  font-weight: 600;
}


/* ─── LEVEL 2: THE NUCLEUS (expanded lens) ───────────────────────────── */

.nlf-nucleus-expanded {
  position: absolute;
  background: var(--bg-1, #0b1120);
  border: 1px solid var(--border, #1e2a42);
  border-radius: 8px;
  overflow: hidden;
  z-index: 20;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6),
              0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  animation: nlf-expand-in 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes nlf-expand-in {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}

/* Expanded nucleus header */
.nlf-exp-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-2, #0f1628);
  border-bottom: 1px solid var(--border, #1e2a42);
  flex-shrink: 0;
}
.nlf-exp-name {
  font-family: var(--mono, monospace);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-0, #f5f6fa);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nlf-exp-close {
  font-family: var(--mono, monospace);
  font-size: 14px;
  color: var(--text-3, #555e70);
  cursor: pointer;
  padding: 0 4px;
  transition: color 0.2s;
}
.nlf-exp-close:hover { color: var(--text-1, #b8c0d0); }

/* Expanded body: scrollable content area */
.nlf-exp-body {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-1, #243050) transparent;
}

/* ─── Orbital shells inside expanded nucleus ──────────────────────────── */

.nlf-shells-container {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 12px;
}

.nlf-shell {
  position: absolute;
  top: 50%;
  left: 50%;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.06);
  pointer-events: none;
}
.nlf-shell-inner {
  border-color: rgba(255, 107, 107, 0.25);
}
.nlf-shell-middle {
  border-color: rgba(254, 202, 87, 0.2);
}
.nlf-shell-outer {
  border-color: rgba(84, 160, 255, 0.15);
}

/* Atoms positioned on shells */
.nlf-shell-atom {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  z-index: 3;
}
.nlf-shell-atom:hover {
  transform: translate(-50%, -50%) scale(1.5);
  z-index: 5;
}
.nlf-shell-atom-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  font-family: var(--mono, monospace);
  font-size: 8px;
  color: var(--text-1, #b8c0d0);
  background: var(--bg-3, #131b30);
  border: 1px solid var(--border, #1e2a42);
  border-radius: 3px;
  padding: 3px 6px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
}
.nlf-shell-atom:hover .nlf-shell-atom-tooltip {
  opacity: 1;
}

/* Nucleus core dot in orbital view */
.nlf-shells-core {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  z-index: 4;
}

/* Shell legend */
.nlf-shell-legend {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 10px;
}
.nlf-shell-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-family: var(--mono, monospace);
  font-size: 8px;
  color: var(--text-3, #555e70);
}
.nlf-shell-legend-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}


/* ─── 4-Phase Radar ───────────────────────────────────────────────────── */

.nlf-radar {
  position: relative;
  width: 140px;
  height: 140px;
  margin: 0 auto 14px;
}
.nlf-radar-svg {
  width: 100%;
  height: 100%;
}
.nlf-radar-axis {
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 0.5;
}
.nlf-radar-grid {
  stroke: rgba(255, 255, 255, 0.04);
  stroke-width: 0.5;
  fill: none;
}
.nlf-radar-shape {
  fill: rgba(0, 168, 255, 0.12);
  stroke: var(--blue, #00a8ff);
  stroke-width: 1.5;
  transition: d 0.35s ease;
}
.nlf-radar-dot {
  r: 3;
  stroke: var(--bg-0, #080c14);
  stroke-width: 1;
  transition: cx 0.35s ease, cy 0.35s ease;
}
.nlf-radar-label {
  font-family: var(--mono, monospace);
  font-size: 9px;
  font-weight: 600;
  fill: currentColor;
}


/* ─── Scoped Deliverable Panels ───────────────────────────────────────── */

.nlf-deliverables {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.nlf-deliv-panel {
  background: var(--bg-2, #0f1628);
  border: 1px solid var(--border, #1e2a42);
  border-radius: 4px;
  overflow: hidden;
  transition: border-color 0.2s;
}
.nlf-deliv-panel:hover {
  border-color: var(--blue-dim, rgba(0, 168, 255, 0.25));
}

.nlf-deliv-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 10px;
  background: var(--bg-3, #131b30);
  cursor: pointer;
  transition: background 0.2s;
}
.nlf-deliv-header:hover {
  background: rgba(255, 255, 255, 0.03);
}

.nlf-deliv-icon {
  font-size: 11px;
  flex-shrink: 0;
}
.nlf-deliv-title {
  font-family: var(--mono, monospace);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-2, #7080a0);
  flex: 1;
}
.nlf-deliv-badge {
  font-family: var(--mono, monospace);
  font-size: 8px;
  font-weight: 600;
  padding: 1px 5px;
  border-radius: 2px;
  letter-spacing: 0.04em;
}
.nlf-deliv-arrow {
  font-size: 10px;
  color: var(--text-3, #555e70);
  transition: transform 0.2s;
}
.nlf-deliv-arrow.open {
  transform: rotate(90deg);
}

.nlf-deliv-content {
  padding: 8px 10px;
  max-height: 180px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-1, #243050) transparent;
}

/* Deliverable mini-table rows */
.nlf-deliv-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 0;
  font-family: var(--mono, monospace);
  font-size: 9px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
}
.nlf-deliv-row:last-child { border-bottom: none; }

.nlf-deliv-rail-name {
  color: var(--blue, #00a8ff);
  font-weight: 600;
  min-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nlf-deliv-val {
  color: var(--text-1, #b8c0d0);
  font-weight: 400;
}


/* ─── LEVEL 3: THE ATOM (detail card) ────────────────────────────────── */

.nlf-atom-card {
  position: absolute;
  width: 340px;
  max-height: 400px;
  background: var(--bg-1, #0b1120);
  border: 1px solid var(--border, #1e2a42);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
  z-index: 30;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: nlf-card-in 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes nlf-card-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

.nlf-atom-card-header {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  background: var(--bg-2, #0f1628);
  border-bottom: 1px solid var(--border, #1e2a42);
  flex-shrink: 0;
}
.nlf-atom-card-name {
  font-family: var(--mono, monospace);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-0, #f5f6fa);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nlf-atom-card-close {
  font-size: 14px;
  color: var(--text-3, #555e70);
  cursor: pointer;
  padding: 0 4px;
}
.nlf-atom-card-close:hover { color: var(--text-1, #b8c0d0); }

.nlf-atom-card-body {
  flex: 1;
  overflow-y: auto;
  padding: 10px 12px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-1, #243050) transparent;
}

/* Bindings list in atom card */
.nlf-binding-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.02);
  font-family: var(--mono, monospace);
  font-size: 9px;
}
.nlf-binding-row:last-child { border-bottom: none; }

.nlf-binding-lens {
  color: var(--text-1, #b8c0d0);
  font-weight: 600;
  min-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nlf-binding-strength {
  width: 40px;
  height: 4px;
  background: var(--bg-3, #131b30);
  border-radius: 2px;
  overflow: hidden;
}
.nlf-binding-strength-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.3s ease;
}
.nlf-binding-phase {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.04);
}

/* Chain state section */
.nlf-chain-state {
  margin-top: 8px;
  padding: 6px 8px;
  background: var(--bg-2, #0f1628);
  border: 1px solid var(--border, #1e2a42);
  border-radius: 3px;
}
.nlf-chain-state-title {
  font-family: var(--mono, monospace);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-3, #555e70);
  margin-bottom: 4px;
}

/* Treatment actions */
.nlf-actions {
  display: flex;
  gap: 4px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.nlf-action-btn {
  font-family: var(--mono, monospace);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border: 1px solid var(--border, #1e2a42);
  border-radius: 3px;
  background: transparent;
  color: var(--text-2, #7080a0);
  cursor: pointer;
  transition: all 0.2s;
}
.nlf-action-btn:hover {
  border-color: var(--blue, #00a8ff);
  color: var(--blue, #00a8ff);
  background: rgba(0, 168, 255, 0.06);
}


/* ─── PHASE BAR EXTENSION (nuclear mode toggle) ──────────────────────── */

.nlf-mode-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex-shrink: 0;
  background: var(--bg-3, #131b30);
  border: 1px solid var(--border, #1e2a42);
  border-radius: 3px;
  overflow: visible;
  position: relative;
  z-index: 5;
}
.nlf-mode-btn {
  font-family: var(--mono, monospace);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  min-width: 52px;
  color: var(--text-3, #555e70);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
  z-index: 6;
}
.nlf-mode-btn.active {
  color: #00eaff;
  background: rgba(0, 234, 255, 0.08);
  text-shadow: 0 0 6px rgba(0, 234, 255, 0.3);
}
.nlf-mode-btn:hover:not(.active) {
  color: var(--text-1, #b8c0d0);
  background: rgba(255, 255, 255, 0.03);
}


/* ─── UTILITY ────────────────────────────────────────────────────────── */

.nlf-badge {
  font-family: var(--mono, monospace);
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 1px 5px;
  border-radius: 2px;
  white-space: nowrap;
}
.nlf-badge-red    { background: rgba(255,50,50,0.12);  color: var(--red, #ff3344); border: 1px solid rgba(255,50,50,0.2); }
.nlf-badge-amber  { background: rgba(255,170,0,0.12);  color: var(--amber, #ffaa00); border: 1px solid rgba(255,170,0,0.2); }
.nlf-badge-blue   { background: rgba(0,168,255,0.12);  color: var(--blue, #00a8ff); border: 1px solid rgba(0,168,255,0.2); }
.nlf-badge-green  { background: rgba(0,200,100,0.12);  color: var(--green, #00cc88); border: 1px solid rgba(0,200,100,0.2); }
.nlf-badge-grey   { background: rgba(131,149,167,0.12); color: var(--text-3, #555e70); border: 1px solid rgba(131,149,167,0.2); }

/* Phase-specific badge colors */
.nlf-phase-ii { color: #ff6b6b; }
.nlf-phase-cr { color: #feca57; }
.nlf-phase-rr { color: #54a0ff; }
.nlf-phase-hc { color: #8395a7; }

/* Severity badge */
.nlf-sev-existential { background: rgba(255,50,50,0.2);  color: #ff3344; border: 1px solid rgba(255,50,50,0.3); }
.nlf-sev-high        { background: rgba(255,50,50,0.12); color: #ff6b6b; border: 1px solid rgba(255,50,50,0.2); }
.nlf-sev-med         { background: rgba(255,170,0,0.12); color: #feca57; border: 1px solid rgba(255,170,0,0.2); }
.nlf-sev-low         { background: rgba(0,200,100,0.08); color: #00cc88; border: 1px solid rgba(0,200,100,0.15); }

/* Breach badge */
.nlf-breach-breached { color: #ff3344; font-weight: 700; }
.nlf-breach-near     { color: #ff6b6b; }
.nlf-breach-stressed { color: #feca57; }
.nlf-breach-ok       { color: var(--text-3, #555e70); }

/* Mini bar for phase expression */
.nlf-phase-bar {
  display: flex;
  height: 3px;
  border-radius: 1.5px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.04);
}
.nlf-phase-bar-seg {
  height: 100%;
  transition: width 0.3s ease;
}

/* No-data empty state */
.nlf-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-family: var(--mono, monospace);
  font-size: 11px;
  color: var(--text-3, #555e70);
  text-align: center;
  padding: 20px;
}

/* Backdrop overlay when nucleus is expanded */
.nlf-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.5);
  z-index: 15;
  cursor: pointer;
  animation: nlf-fade-in 0.2s ease;
}
@keyframes nlf-fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}


/* ─── LEVEL 2.5: PROXIMITY MAP (double-click nucleus) ─────────────── */

.nlf-proximity-map {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 480px;
  max-width: 92vw;
  background: var(--bg-1, #0b1120);
  border: 1px solid var(--border, #1e2a42);
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.7),
              0 0 1px rgba(255, 255, 255, 0.08),
              0 0 40px rgba(84, 160, 255, 0.04);
  z-index: 25;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  animation: nlf-prox-in 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes nlf-prox-in {
  from { transform: translate(-50%, -50%) scale(0.6); opacity: 0; }
  to   { transform: translate(-50%, -50%) scale(1); opacity: 1; }
}

.nlf-prox-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--bg-2, #0f1628);
  border-bottom: 1px solid var(--border, #1e2a42);
  flex-shrink: 0;
}

.nlf-prox-canvas {
  position: relative;
  margin: 12px auto;
  flex-shrink: 0;
}

.nlf-prox-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 8px 14px;
  background: var(--bg-2, #0f1628);
  border-top: 1px solid var(--border, #1e2a42);
  flex-shrink: 0;
  flex-wrap: wrap;
  font-family: var(--mono, monospace);
  font-size: 8px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-3, #555e70);
}


/* ── Exhaustion banner ───────────────────────────────────────────── */

.nlf-exhaustion-banner {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(255, 170, 0, 0.08);
  border-top: 1px solid rgba(255, 170, 0, 0.25);
  border-bottom: 1px solid rgba(255, 170, 0, 0.10);
  font-family: var(--mono, monospace);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--amber, #ffaa00);
  animation: nlf-exhaust-pulse 3s ease-in-out infinite;
}

.nlf-exhaustion-icon {
  font-size: 13px;
  line-height: 1;
}

.nlf-exhaustion-text {
  opacity: 0.9;
}

@keyframes nlf-exhaust-pulse {
  0%, 100% { opacity: 0.85; }
  50% { opacity: 1; }
}

/* ─── DIMMED NUCLEUS (when another lens is highlighted) ──────────────── */
.nlf-nucleus.nlf-nucleus-dimmed {
  opacity: 0.15 !important;
  filter: grayscale(0.7) brightness(0.5);
  transition: opacity 0.4s ease, filter 0.4s ease;
}

.nlf-nucleus.nlf-nucleus-dimmed .nlf-nucleus-label {
  opacity: 0 !important;
}

.nlf-nucleus.nlf-nucleus-dimmed .nlf-orbit-ring,
.nlf-nucleus.nlf-nucleus-dimmed .nlf-atom-count,
.nlf-nucleus.nlf-nucleus-dimmed .nlf-phase-pip {
  opacity: 0 !important;
}

/* ─── ENHANCED ORBIT ATOMS — tiny dots, hover pause, tooltips ──────── */
.nlf-orbit-atom {
  width: 3px !important;
  height: 3px !important;
  pointer-events: all !important;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  z-index: 2;
}
.nlf-orbit-atom:hover {
  transform: scale(2.5);
  box-shadow: 0 0 8px currentColor, 0 0 14px currentColor !important;
  z-index: 10;
}

/* Pause orbit spin on nucleus hover — both shared ring and individual wrappers */
.nlf-nucleus:hover .nlf-orbit-ring {
  animation-play-state: paused;
}
.nlf-nucleus:hover .v13-orbit-wrapper {
  animation-play-state: paused !important;
}

/* Hide stale-evidence dashed rings — too noisy */
.bf-body-stale-ring {
  display: none !important;
}

/* Hide orbit ring border in nuclear view — atoms are the visual, not the ring itself */
.nlf-orbit-ring {
  border-color: transparent !important;
}

/* Atom tooltip on hover */
.nlf-orbit-atom .nlf-atom-tip {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 16, 32, 0.95);
  border: 1px solid rgba(0, 168, 255, 0.25);
  border-radius: 4px;
  padding: 3px 7px;
  font-family: var(--mono, monospace);
  font-size: 8px;
  color: var(--text-1, #c0d0e0);
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
.nlf-orbit-atom:hover .nlf-atom-tip {
  display: block;
}
