/* ═══════════════════════════════════════════════════════════════════
   NEXO OS — nexo-os.css
   Hoja autocontenida (mismo criterio que style-nexo.css: /nexo puede
   moverse a un subdominio sin arrastrar rutas). Sirve solo a
   index-nexo.php — el resto de /nexo (login, catálogo, cuenta) sigue
   con su propio lenguaje visual de tarjetas en style-nexo.css. Este
   archivo es el lenguaje de un sistema operativo: núcleo, ventanas,
   barra de estado.
═══════════════════════════════════════════════════════════════════ */

/* 01. TOKENS ────────────────────────────────────────────────────── */
:root {
  --bg:            #09090B;
  --surface:       #111113;
  --glass:         rgba(17, 17, 19, 0.72);
  --border:        #1F1F23;
  --border-light:  #2A2A30;

  --accent:        #C9F31D;
  --accent-soft:   rgba(201, 243, 29, 0.10);
  --accent-border: rgba(201, 243, 29, 0.28);
  --accent-glow:   rgba(201, 243, 29, 0.35);

  --text: #FAFAFA;
  --t2:   #A1A1AA;
  --t3:   #6B6B72;

  --font-display: 'Poppins', -apple-system, sans-serif;
  --font:         'Poppins', -apple-system, sans-serif;
  --mono:         'Geist Mono', 'Fira Code', monospace;

  --r-sm: 6px; --r: 10px; --r-lg: 16px; --r-pill: 999px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* 02. RESET / BASE ──────────────────────────────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; background: var(--bg); }
body {
  color: var(--text);
  font-family: var(--font);
  font-weight: 300;
  -webkit-font-smoothing: antialiased;
}
button { font: inherit; cursor: pointer; background: none; border: none; color: inherit; }
a { color: inherit; text-decoration: none; }

#nxOsRoot {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  background:
    radial-gradient(ellipse at 50% 38%, rgba(201,243,29,0.05), transparent 60%),
    var(--bg);
  overflow: hidden;
}

.nx-os-state {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .6s var(--ease);
}
.nx-os-state.active { opacity: 1; pointer-events: all; }

/* 03. BOOT — no es una pantalla, es una capa de texto mínima sobre el
   escritorio (que ya está activo desde el primer fotograma): la esfera
   se construye detrás mientras el mensaje cambia, y todo se desvanece
   en cuanto termina. Nada de landing, nada de leer y pulsar un botón. */
.nx-boot-overlay {
  position: absolute; inset: 0;
  z-index: 50;
  display: flex; align-items: center; justify-content: center;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, rgba(9,9,11,.35), transparent 60%);
}
.nx-boot-msg {
  font-family: var(--mono); font-size: 13px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase; color: var(--t2);
  opacity: 0;
  transition: opacity .08s linear;
}
.nx-boot-msg.is-in { opacity: 1; }
.nx-boot-msg.is-brand {
  font-family: var(--font-display); font-weight: 700; font-size: 22px;
  letter-spacing: .04em; text-transform: none; color: var(--text);
}
.nx-boot-overlay.is-done { opacity: 0; transition: opacity .3s var(--ease); }

/* 04. DESKTOP — núcleo + órbita ─────────────────────────────────── */
.nx-desktop { position: absolute; inset: 0; display: block; }

.nx-core-stage {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(58vh, 48vw, 550px);
  height: min(58vh, 48vw, 550px);
  transition: width .5s var(--ease), height .5s var(--ease);
}
#nxSphereCanvas { position: absolute; inset: 0; width: 100%; height: 100%; }

.nx-module {
  position: absolute;
  top: 50%; left: 50%;
  display: inline-flex; align-items: center; gap: 9px;
  padding: 10px 16px 10px 12px;
  background: var(--glass);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-light);
  border-radius: var(--r-pill);
  font-size: 13px; font-weight: 500; color: var(--t2);
  white-space: nowrap;
  transform: translate(-50%, -50%) translate(var(--mx, 0px), var(--my, 0px)) scale(var(--mscale, 1));
  opacity: var(--mopacity, 1);
  transition: border-color .6s var(--ease), color .6s var(--ease),
              background .6s var(--ease), box-shadow .6s var(--ease);
}
/* Antes de entrar al escritorio, y mientras se revelan una a una, las
   categorías están encogidas/invisibles y no reciben clics — layoutModules()
   sigue calculando su posición real (--mx/--my) igual que siempre. */
#nxModuleOrbit.nx-modules-pending .nx-module,
#nxModuleOrbit.nx-modules-revealing .nx-module {
  --mopacity: 0;
  --mscale: .72;
  pointer-events: none;
}
#nxModuleOrbit.nx-modules-revealing .nx-module {
  transition: opacity .25s var(--ease), transform .25s var(--ease),
              border-color .6s var(--ease), color .6s var(--ease),
              background .6s var(--ease), box-shadow .6s var(--ease);
}
#nxModuleOrbit.nx-modules-revealing .nx-module.is-in {
  --mopacity: 1;
  --mscale: 1;
}
.nx-module svg { width: 16px; height: 16px; flex-shrink: 0; stroke: currentColor; }
.nx-module:hover,
.nx-module.is-tour-highlight {
  color: var(--text);
  border-color: var(--accent-border);
  background: rgba(201, 243, 29, 0.06);
  box-shadow: 0 0 0 1px var(--accent-border), 0 0 18px rgba(201,243,29,.16), 0 0 40px rgba(201,243,29,.08);
}
.nx-module-badge {
  display: none;
  font-family: var(--mono); font-size: 9px; color: var(--accent);
  border: 1px solid var(--accent-border); border-radius: 4px; padding: 1px 5px;
}
.nx-module.has-badge .nx-module-badge { display: inline-block; }

/* Módulo bloqueado (ej. Invitaciones antes de aprobar el Nodo) */
.nx-module.is-locked { color: var(--t3); }
.nx-module-lock-icon { width: 12px !important; height: 12px !important; opacity: .7; }

/* Franja de ventanas minimizadas, pegada a la barra de estado */
.nx-mindock {
  position: absolute; left: 22px; bottom: 56px;
  display: flex; gap: 8px;
  z-index: 490;
}
.nx-min-pill {
  display: flex; align-items: center; gap: 7px;
  padding: 7px 13px; border-radius: var(--r-pill);
  background: var(--glass); border: 1px solid var(--border-light);
  font-size: 11px; color: var(--t2);
  backdrop-filter: blur(12px);
  transition: border-color .25s var(--ease), color .25s var(--ease);
}
.nx-min-pill:hover { color: var(--text); border-color: var(--accent-border); }

/* Ayuda — siempre en la misma esquina, con o sin cuenta */
.nx-help-btn {
  position: absolute; right: 22px; bottom: 22px; z-index: 480;
  width: 38px; height: 38px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--glass); backdrop-filter: blur(14px);
  border: 1px solid var(--border-light); color: var(--t2);
  transition: color .2s var(--ease), border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.nx-help-btn:hover {
  color: var(--accent); border-color: var(--accent-border);
  box-shadow: 0 0 0 1px var(--accent-border), 0 0 18px rgba(201,243,29,.16);
}
.nx-help-btn svg { width: 17px; height: 17px; }

/* Notificaciones — misma pastilla que Ayuda, esquina opuesta. */
.nx-bell-btn { right: auto; left: 22px; }

/* Soporte — junto a la campana, misma esquina, pastilla ancha con texto
   (a diferencia de Ayuda/Notificaciones, que son solo icono). */
.nx-support-btn {
  right: auto; left: 68px; width: auto; border-radius: var(--r-pill);
  padding: 0 16px 0 12px; gap: 7px; font-size: 12px; font-weight: 500; white-space: nowrap;
}
.nx-bell-badge {
  position: absolute; top: -4px; right: -4px;
  min-width: 16px; height: 16px; padding: 0 4px;
  display: flex; align-items: center; justify-content: center;
  background: var(--accent); color: #09090B;
  font-family: var(--mono); font-size: 9px; font-weight: 700;
  border-radius: var(--r-pill); border: 2px solid var(--bg);
}

/* 06. VENTANAS ──────────────────────────────────────────────────── */
.nx-window {
  position: absolute;
  width: 560px;
  max-width: calc(100vw - 40px);
  height: 460px;
  max-height: calc(100vh - 110px);
  display: flex; flex-direction: column;
  background: var(--glass);
  backdrop-filter: blur(22px);
  border: 1px solid var(--border-light);
  border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 24px 70px rgba(0,0,0,.55), 0 0 40px rgba(201,243,29,.05);
  overflow: hidden;
  transform-origin: var(--origin-x, 50%) var(--origin-y, 50%);
  opacity: 0;
  pointer-events: none;
  transform: scale(.3);
  transition: opacity .45s var(--ease), transform .45s var(--ease);
}
.nx-window.is-open   { opacity: 1; transform: scale(1); pointer-events: all; }
.nx-window.is-closing{ opacity: 0; transform: scale(.85); }
.nx-window.is-min    { opacity: 0; transform: scale(.3); pointer-events: none; transition: opacity .3s var(--ease), transform .3s var(--ease); }

.nx-win-head {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  cursor: grab;
  flex-shrink: 0;
}
.nx-win-head:active { cursor: grabbing; }
.nx-win-icon { width: 15px; height: 15px; stroke: var(--accent); flex-shrink: 0; }
.nx-win-title { font-size: 13px; font-weight: 500; flex: 1; }
.nx-win-controls { display: flex; gap: 6px; }
.nx-win-ctrl {
  width: 22px; height: 22px; display: flex; align-items: center; justify-content: center;
  border-radius: 6px; color: var(--t3);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.nx-win-ctrl:hover { background: var(--border-light); color: var(--text); }
.nx-win-ctrl.close:hover { color: #FF6B6B; }
.nx-win-ctrl svg { width: 12px; height: 12px; }

.nx-win-body { flex: 1; overflow-y: auto; padding: 18px 20px 22px; }

/* Buscador + chips (ventana Recursos) */
.nx-win-search {
  width: 100%; padding: 9px 12px; margin-bottom: 12px;
  background: var(--surface); border: 1px solid var(--border-light); border-radius: var(--r-sm);
  color: var(--text); font-size: 13px;
}
.nx-win-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }
.nx-win-chip {
  padding: 5px 11px; border-radius: var(--r-pill); font-size: 11px;
  border: 1px solid var(--border-light); color: var(--t2);
  transition: all .2s var(--ease);
  cursor: pointer; user-select: none;
}
.nx-win-chip:hover { color: var(--text); border-color: var(--t3); }
.nx-win-chip.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }

.nx-res-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.nx-res-card {
  border: 1px solid var(--border-light); border-radius: var(--r); overflow: hidden;
  background: var(--surface); transition: border-color .25s var(--ease), transform .25s var(--ease);
}
.nx-res-card:hover { border-color: var(--accent-border); transform: translateY(-2px); }
.nx-res-thumb {
  width: 100%; aspect-ratio: 4/3; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #16161A, #0D0D0F); object-fit: cover;
  font-family: var(--mono); font-size: 10px; color: var(--t3); letter-spacing: .06em; text-transform: uppercase;
}
.nx-res-card-clickable { cursor: pointer; }
.nx-res-info { padding: 9px 11px; }
.nx-res-info h4 { font-size: 12.5px; font-weight: 500; margin-bottom: 4px; }

/* Estado "en construcción" y vacío, compartido */
.nx-win-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; gap: 10px; height: 100%; padding: 20px;
  color: var(--t3); font-size: 13px; line-height: 1.6;
}

/* El panel de Recursos tiene buscador + chips antes del estado vacío, así
   que height:100% (pensado para cuando .nx-win-empty es el único hijo de
   nx-win-body) no tiene de qué "100%" partir aquí — se necesita que su
   contenedor sea columna flex para que el hueco vacío se reparta bien. */
#packs-list-panel { display: flex; flex-direction: column; height: 100%; }
#packs-list-panel .nx-win-empty { height: auto; flex: 1; }
.nx-win-empty svg { width: 30px; height: 30px; stroke: var(--t3); opacity: .6; }
.nx-win-empty strong { color: var(--t2); font-weight: 500; }

.nx-win-btn {
  display: inline-flex; align-items: center; gap: 8px; margin-top: 4px;
  padding: 9px 16px; border-radius: var(--r-pill);
  background: var(--accent); color: #09090B; font-size: 12px; font-weight: 600;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.nx-win-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.nx-win-btn-ghost {
  background: none; color: var(--t2); border: 1px solid var(--border-light);
}
.nx-win-btn-ghost:hover { color: var(--text); border-color: var(--t3); box-shadow: none; }
.nx-win-btn-danger { background: none; color: #FF6B6B; border: 1px solid rgba(255,107,107,.35); }
.nx-win-btn-danger:hover { background: rgba(255,107,107,.08); box-shadow: none; }

/* Confirmación — modal propio para acciones destructivas (ej. eliminar
   cuenta), en vez de confirm()/prompt() nativos del navegador. */
.nx-confirm-overlay {
  position: fixed; inset: 0; z-index: 2000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(9,9,11,.7); backdrop-filter: blur(6px);
  opacity: 0; pointer-events: none;
  transition: opacity .25s var(--ease);
}
.nx-confirm-overlay.is-open { opacity: 1; pointer-events: all; }
.nx-confirm-card {
  width: 380px; max-width: calc(100vw - 40px);
  background: var(--glass); backdrop-filter: blur(22px);
  border: 1px solid var(--border-light); border-radius: var(--r-lg);
  box-shadow: 0 0 0 1px rgba(0,0,0,.3), 0 24px 70px rgba(0,0,0,.55);
  padding: 22px 24px;
  transform: scale(.94); transition: transform .25s var(--ease);
}
.nx-confirm-overlay.is-open .nx-confirm-card { transform: scale(1); }
.nx-confirm-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.nx-confirm-card p { font-size: 13px; color: var(--t2); line-height: 1.6; margin-bottom: 16px; }
.nx-confirm-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }

/* Gateway "Nodo" — dos únicas opciones (Iniciar sesión / Activar mi
   Nodo), sin formulario visible hasta que se elige una. */
.nx-gateway-options { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.nx-gateway-option {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--border-light); border-radius: var(--r);
  background: rgba(255,255,255,.02);
}
.nx-gateway-option .nx-f-hint { margin: 0; }

/* Asistente "Activar mi Nodo" — un paso visible a la vez. */
.nx-wizard-progress {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .04em; text-transform: uppercase;
  color: var(--t3); margin-bottom: 16px;
}
.nx-wizard-actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }

/* 07. CONTENIDO — formularios, dashboard, comunidad, invitaciones.
   Mismo lenguaje que el resto de la ventana (nx-win-*), nunca toca
   nada del núcleo/canvas. */
.nx-f-h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.nx-f-h4 { font-family: var(--font-display); font-size: 14px; font-weight: 600; margin-bottom: 10px; }
.nx-f-hint { color: var(--t3); font-size: 12px; line-height: 1.6; margin-bottom: 12px; }

.nx-activity-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 12.5px;
}

/* Acceso rápido a Disponibilidad desde Inicio — guarda al cambiar,
   sin tener que abrir el formulario completo de Mi Nodo. */
.nx-quick-avail { padding-bottom: 9px; border-bottom: 1px solid var(--border); }
.nx-quick-select {
  padding: 5px 9px; border-radius: var(--r-sm); border: 1px solid var(--border-light);
  background: var(--surface); color: var(--text); font-size: 12px; font-family: var(--font);
}
.nx-quick-select:focus { outline: none; border-color: var(--accent-border); }

/* Centro de Notificaciones — lista clicable, no leídas resaltadas. */
.nx-notif-row {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; opacity: .6; transition: opacity .15s var(--ease);
}
.nx-notif-row:hover { opacity: .85; }
.nx-notif-row.is-unread { opacity: 1; }
.nx-notif-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: 5px; background: var(--t3); }
.nx-notif-dot.is-success  { background: #3ECF6E; box-shadow: 0 0 6px rgba(62,207,110,.5); }
.nx-notif-dot.is-warning  { background: #EAB308; box-shadow: 0 0 6px rgba(234,179,8,.5); }
.nx-notif-dot.is-critical { background: #FF6B6B; box-shadow: 0 0 6px rgba(255,107,107,.5); }
.nx-notif-body strong { display: block; font-size: 13px; font-weight: 600; margin-bottom: 2px; }
.nx-notif-body p { font-size: 12px; color: var(--t2); line-height: 1.5; margin-bottom: 4px; }

.nx-f-field { margin-bottom: 13px; }
.nx-f-field label { display: block; font-size: 11.5px; color: var(--t2); margin-bottom: 5px; }
.nx-f-field input,
.nx-f-field select,
.nx-f-field textarea {
  width: 100%; padding: 9px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--border-light); background: var(--surface); color: var(--text);
  font-size: 13px; font-family: var(--font); resize: vertical;
}
.nx-f-field input:focus, .nx-f-field select:focus, .nx-f-field textarea:focus { outline: none; border-color: var(--accent-border); }
.nx-f-field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.nx-pass-wrap { position: relative; }
.nx-pass-wrap input { padding-right: 40px; }
.nx-pass-toggle {
  position: absolute; top: 50%; right: 3px; transform: translateY(-50%);
  width: 32px; height: 32px; display: flex; align-items: center; justify-content: center;
  background: none; border: none; padding: 0; color: var(--t3); cursor: pointer;
  border-radius: var(--r-sm); transition: color .2s var(--ease);
}
.nx-pass-toggle:hover { color: var(--text); }
.nx-pass-toggle svg { width: 17px; height: 17px; }
.nx-pass-toggle .nx-eye-off { display: none; }
.nx-pass-toggle.is-visible .nx-eye-on { display: none; }
.nx-pass-toggle.is-visible .nx-eye-off { display: block; }

.nx-f-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.nx-f-other-input { margin-top: 8px; }
.nx-f-chip {
  padding: 6px 12px; border-radius: var(--r-pill); font-size: 11.5px;
  border: 1px solid var(--border-light); color: var(--t2); background: none;
  transition: all .2s var(--ease);
}
.nx-f-chip:hover { color: var(--text); border-color: var(--t3); }
.nx-f-chip.active { background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); }

/* Mismo lenguaje que .nx-f-chip (chips de selección múltiple) — el
   radio nativo del navegador se oculta (sigue siendo focuseable y
   accesible por teclado) y la píldora entera cambia de color cuando su
   input queda marcado, en vez de mostrar el círculo grande por defecto. */
.nx-f-radio-row { display: flex; gap: 8px; flex-wrap: wrap; }
.nx-f-radio-pill {
  position: relative;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: var(--r-pill); font-size: 11.5px;
  border: 1px solid var(--border-light); color: var(--t2); background: none;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.nx-f-radio-pill:hover { color: var(--text); border-color: var(--t3); }
.nx-f-radio-pill input {
  /* Relativo a la propia píldora (position:relative arriba) — si no, al
     no tener un antepasado posicionado cercano, el navegador la coloca
     respecto a la ventana entera y, al enfocarla, hace scroll hasta una
     posición absurda intentando "mostrarla". */
  position: absolute;
  width: 1px; height: 1px; margin: 0; opacity: 0;
}
.nx-f-radio-pill:has(input:checked) {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent);
}
.nx-f-radio-pill:has(input:focus-visible) { outline: 2px solid var(--accent-border); outline-offset: 2px; }

/* Prioridad de Soporte — mismo lenguaje de tono (verde/ámbar/rojo) que
   ya usa la disponibilidad del Nodo (.nx-f-status-pill), aplicado aquí
   al radio-pill genérico para que la gravedad se vea, no solo se lea. */
.nx-f-radio-pill.is-ok:has(input:checked) {
  background: rgba(62,207,110,.08); border-color: rgba(62,207,110,.35); color: #3ECF6E;
}
.nx-f-radio-pill.is-warn:has(input:checked) {
  background: rgba(234,179,8,.08); border-color: rgba(234,179,8,.35); color: #EAB308;
}
.nx-f-radio-pill.is-busy:has(input:checked) {
  background: rgba(255,107,107,.08); border-color: rgba(255,107,107,.35); color: #FF6B6B;
}

/* Disponibilidad — una fila de estado por opción, con un punto de color
   propio (verde/ámbar/rojo) en vez del emoji, que se enciende del color
   que le corresponde a esa opción al quedar seleccionada. */
.nx-f-status-row { display: flex; flex-direction: column; gap: 8px; }
.nx-f-status-pill {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px; border-radius: var(--r); font-size: 13px;
  border: 1px solid var(--border-light); color: var(--t2); background: none;
  cursor: pointer;
  transition: all .2s var(--ease);
}
.nx-f-status-pill:hover { color: var(--text); border-color: var(--t3); }
.nx-f-status-pill input {
  position: absolute;
  width: 1px; height: 1px; margin: 0; opacity: 0;
}
.nx-f-status-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: var(--t3);
  transition: background .2s var(--ease), box-shadow .2s var(--ease);
}
.nx-f-status-pill.is-ok   .nx-f-status-dot { background: #3ECF6E; }
.nx-f-status-pill.is-warn .nx-f-status-dot { background: #EAB308; }
.nx-f-status-pill.is-busy .nx-f-status-dot { background: #FF6B6B; }
.nx-f-status-pill.is-ok:has(input:checked) {
  background: rgba(62,207,110,.08); border-color: rgba(62,207,110,.35); color: #3ECF6E;
}
.nx-f-status-pill.is-ok:has(input:checked) .nx-f-status-dot { box-shadow: 0 0 8px rgba(62,207,110,.6); }
.nx-f-status-pill.is-warn:has(input:checked) {
  background: rgba(234,179,8,.08); border-color: rgba(234,179,8,.35); color: #EAB308;
}
.nx-f-status-pill.is-warn:has(input:checked) .nx-f-status-dot { box-shadow: 0 0 8px rgba(234,179,8,.6); }
.nx-f-status-pill.is-busy:has(input:checked) {
  background: rgba(255,107,107,.08); border-color: rgba(255,107,107,.35); color: #FF6B6B;
}
.nx-f-status-pill.is-busy:has(input:checked) .nx-f-status-dot { box-shadow: 0 0 8px rgba(255,107,107,.6); }
.nx-f-status-pill:has(input:focus-visible) { outline: 2px solid var(--border-light); outline-offset: 2px; }

.nx-f-toggle-row { display: flex; align-items: center; gap: 9px; font-size: 13px; color: var(--t2); cursor: pointer; }
.nx-f-toggle-row input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex-shrink: 0;
  width: 17px; height: 17px; margin: 0;
  border: 1.5px solid var(--border-light); border-radius: 5px;
  background: rgba(255,255,255,.02);
  position: relative; cursor: pointer;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.nx-f-toggle-row input[type="checkbox"]:hover { border-color: var(--t3); }
.nx-f-toggle-row input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.nx-f-toggle-row input[type="checkbox"]:checked::after {
  content: ''; position: absolute; left: 5px; top: 2px;
  width: 4px; height: 8px;
  border: solid #09090B; border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.nx-f-toggle-row input[type="checkbox"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.nx-f-msg { font-size: 12px; margin-top: 8px; min-height: 1.4em; }
.nx-f-msg.nx-ok  { color: var(--accent); }
.nx-f-msg.nx-err { color: #FF6B6B; }

/* Comunidad */
.nx-post { padding: 13px 0; border-bottom: 1px solid var(--border); }
.nx-post-head { display: flex; justify-content: space-between; font-size: 11.5px; margin-bottom: 4px; }
.nx-post h4 { font-size: 13.5px; font-weight: 600; margin-bottom: 4px; }
.nx-post p { font-size: 12.5px; color: var(--t2); line-height: 1.6; }

/* Invitaciones */
.nx-invite-card { padding: 14px 0; border-bottom: 1px solid var(--border); }
.nx-invite-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.nx-invite-head h4 { font-size: 14px; font-weight: 600; }
.nx-invite-status {
  font-family: var(--mono); font-size: 9px; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 8px; border-radius: 4px; flex-shrink: 0;
  color: var(--t3); border: 1px solid var(--border-light);
}
.nx-invite-status.nx-invite-pendiente  { color: var(--accent); border-color: var(--accent-border); background: var(--accent-soft); }
.nx-invite-status.nx-invite-aceptada   { color: #3ECF6E; border-color: rgba(62,207,110,.3); background: rgba(62,207,110,.1); }
.nx-invite-status.nx-invite-rechazada  { color: var(--t3); border-color: var(--border-light); }
.nx-invite-status.nx-invite-finalizada { color: #8FA8FF; border-color: rgba(143,168,255,.3); background: rgba(143,168,255,.1); }
.nx-invite-status.nx-invite-cancelada,
.nx-invite-status.nx-invite-expirada   { color: var(--t3); border-color: var(--border-light); }
.nx-invite-card p { font-size: 12.5px; color: var(--t2); line-height: 1.6; margin-top: 4px; }
.nx-invite-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.nx-avail-form { margin-top: 10px; }
.nx-avail-form textarea {
  width: 100%; padding: 9px 11px; border-radius: var(--r-sm);
  border: 1px solid var(--border-light); background: var(--surface); color: var(--text);
  font-size: 13px; font-family: var(--font); resize: vertical;
}
.nx-avail-form textarea:focus { outline: none; border-color: var(--accent-border); }

/* Recursos: precio + acción por tarjeta (fusión con lo que era Marketplace) */
.nx-res-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.nx-res-price { font-size: 12px; font-weight: 600; color: var(--t2); }
.nx-res-price.is-free { color: var(--accent); }

/* Academia: rutas, progreso, lecciones */
.nx-route-card {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--border);
}
.nx-route-info { flex: 1; min-width: 0; }
.nx-route-info h4 { font-size: 14px; font-weight: 600; margin-bottom: 4px; }
.nx-progress-bar {
  width: 100%; max-width: 260px; height: 5px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--border-light);
  overflow: hidden; margin: 8px 0 4px;
}
.nx-progress-fill { height: 100%; background: var(--accent); border-radius: var(--r-pill); transition: width .3s var(--ease); }

.nx-route-detail { padding-top: 4px; }
.nx-lesson-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.nx-lesson-title { flex: 1; font-size: 13px; }
.nx-lesson-check {
  flex-shrink: 0; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--border-light); color: transparent;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s var(--ease);
}
.nx-lesson-check.done { color: #09090B; background: var(--accent); border-color: var(--accent); }

/* Packs: archivos dentro del detalle */
.nx-pack-file-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--border);
}
.nx-pack-file-name { font-size: 13px; }

/* Ficha de Pack: imagen + descripción antes de resolver acceso/compra */
.nx-pack-hero {
  width: 100%; aspect-ratio: 16/9; border-radius: var(--r); overflow: hidden;
  object-fit: cover; margin-bottom: 16px; background: linear-gradient(135deg, #16161A, #0D0D0F);
}
.nx-pack-hero-placeholder {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 10px; color: var(--t3); letter-spacing: .06em; text-transform: uppercase;
}
.nx-pack-buy { margin-top: 8px; }
.nx-pack-buy input[type="email"] {
  width: 100%; padding: 9px 11px; border-radius: var(--r-sm); margin-bottom: 8px;
  border: 1px solid var(--border-light); background: var(--surface); color: var(--text);
  font-size: 13px; font-family: var(--font);
}
.nx-pack-buy input[type="email"]:focus { outline: none; border-color: var(--accent-border); }

/* Aviso de estado de la solicitud de Nodo */
.nx-status-banner {
  padding: 10px 14px; border-radius: var(--r-sm); margin-bottom: 16px;
  font-size: 12.5px; line-height: 1.6;
}
.nx-status-banner-pendiente {
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent-border);
}

/* Avatar: círculo reutilizable (Nodo) */
.nx-avatar-row { display: flex; align-items: center; gap: 14px; margin-bottom: 6px; }
.nx-avatar-circle {
  border-radius: 50%; overflow: hidden; flex-shrink: 0;
  background: var(--accent-soft); border: 1px solid var(--accent-border); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display); font-weight: 700;
}
.nx-avatar-circle img { width: 100%; height: 100%; object-fit: cover; }
.nx-avatar-circle-lg { width: 56px; height: 56px; font-size: 20px; }
.nx-avatar-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* Onboarding — bienvenida guiada por la esfera, solo primera vez.
   No toca el núcleo/canvas: solo atenúa módulos y superpone un panel. */
.nx-module-orbit.nx-tour-dim .nx-module { opacity: .22; transition: opacity .5s var(--ease); }
.nx-module-orbit.nx-tour-dim .nx-module.is-tour-highlight { opacity: 1; }

@keyframes nxPulseOnce {
  0%   { filter: brightness(1); }
  40%  { filter: brightness(1.35); }
  100% { filter: brightness(1); }
}
.nx-pulse-once { animation: nxPulseOnce 1.1s var(--ease); }

.nx-onboarding {
  position: fixed; inset: 0; z-index: 550;
  opacity: 0; visibility: hidden;
  transition: opacity .5s var(--ease), visibility .5s;
}
.nx-onboarding.is-open { opacity: 1; visibility: visible; }
.nx-onboarding-blocker {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 42%, rgba(9,9,11,0) 0%, rgba(9,9,11,0) 22%, rgba(9,9,11,.55) 68%);
}
.nx-onboarding-panel {
  position: absolute; left: 50%; bottom: 64px; transform: translate(-50%, 0);
  width: min(460px, calc(100vw - 40px));
  background: var(--glass); backdrop-filter: blur(20px);
  border: 1px solid var(--border-light); border-radius: var(--r);
  padding: 22px 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.nx-onboarding-panel.is-transitioning { opacity: 0; transform: translate(-50%, 6px); }
.nx-onboarding-panel h3 {
  font-family: var(--font-display); font-size: 17px; font-weight: 600;
  letter-spacing: .02em; margin-bottom: 10px;
}
.nx-onboarding-panel p { font-size: 13px; color: var(--t2); line-height: 1.65; margin-bottom: 8px; }
.nx-onboarding-panel p:last-child { margin-bottom: 0; }
.nx-onboarding-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 18px; }

/* 08. RESPONSIVE ────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .nx-boot-msg { font-size: 11px; }
  .nx-boot-msg.is-brand { font-size: 19px; }

  /* La esfera y los módulos mantienen exactamente la misma composición
     radial que en escritorio (misma layoutModules() en JS) — solo se
     encoge la esfera y las píldoras para que quepan en el ancho real
     del teléfono. Nada de lista apilada ni de ventanas a pantalla
     completa: es la misma experiencia, a escala. */
  /* top:50% aquí a propósito — .nx-module también usa top:50% (regla base,
     sin override en móvil), así que la esfera y los módulos SIEMPRE tienen
     que compartir el mismo centro. Si alguna vez la esfera se mueve de
     50%, hay que mover el mismo valor en la regla de .nx-module de abajo,
     o vuelve el desajuste (Inicio metido en la esfera, otras muy lejos). */
  .nx-core-stage {
    top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: min(30vh, 44vw, 175px); height: min(30vh, 44vw, 175px);
  }
  .nx-module { padding: 8px 12px 8px 10px; font-size: 11px; gap: 6px; }
  .nx-module svg:first-child { width: 13px; height: 13px; }
  .nx-module-badge { font-size: 8px; padding: 1px 4px; }
  .nx-module-lock-icon { width: 10px !important; height: 10px !important; }

  .nx-mindock { left: 12px; right: 12px; bottom: 54px; overflow-x: auto; }
  .nx-help-btn { right: 12px; bottom: 12px; }
  .nx-bell-btn { left: 12px; right: auto; }
  .nx-support-btn { left: 58px; }
  .nx-support-btn span { display: none; }

  .nx-f-field-grid, .nx-res-grid { grid-template-columns: 1fr; }
  .nx-invite-actions { flex-direction: column; }
  .nx-route-card { flex-direction: column; align-items: flex-start; gap: 10px; }

  .nx-onboarding-panel { bottom: 20px; width: calc(100vw - 24px); padding: 18px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .nx-os-state, .nx-window, .nx-module,
  .nx-onboarding, .nx-onboarding-panel, .nx-pulse-once,
  .nx-boot-overlay, .nx-boot-msg {
    transition: none !important;
    animation: none !important;
  }
}
