/* Academy hub — arco tipo incertidumbre + fondo solar (environmental) */

@property --ah-border-angle {
  syntax: "<angle>";
  initial-value: 0deg;
  inherits: false;
}

html:has(body.academy-hub) {
  height: 100%;
  overflow: hidden;
}

.academy-hub {
  --ah-ink: #eef2f7;
  --ah-muted: #8b96a8;
  --ah-electric: #0088ff;
  --ah-electric-2: #33a3ff;
  --ah-steel: #3d9fff;
  --ah-indigo: #6ea8ff;
  --ah-sage: #2dd4bf;
  --ah-gold: #5ec8ff;
  --ah-cyan: var(--ah-electric);
  --ah-teal: var(--ah-sage);
  --ah-violet: #8b8fc7;
  --ah-amber: var(--ah-gold);
  height: 100dvh;
  max-height: 100dvh;
  min-height: 0;
  margin: 0;
  color: var(--ah-ink);
  font-family: "DM Sans", system-ui, sans-serif;
  background: #000000;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* ——— Fondo sistema solar (environmental) ——— */
.ah-space-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
  background: #000000;
}

.ah-space-bg canvas,
#ahSolarCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ah-space-bg__aurora {
  position: absolute;
  inset: 0;
  background: transparent;
  will-change: transform;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.academy-hub--space .ah-topbar,
.academy-hub--space .ah-main {
  position: relative;
  z-index: 1;
}

.academy-hub--space .ah-topbar {
  background: rgba(0, 0, 0, 0.55);
  border-bottom-color: rgba(196, 165, 116, 0.16);
}

/* ——— Topbar ——— */
.ah-topbar {
  position: relative;
  top: 0;
  z-index: 40;
  flex-shrink: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 14px clamp(16px, 3vw, 28px);
  border-bottom: 1px solid rgba(170, 190, 220, 0.12);
  background: rgba(6, 8, 12, 0.72);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.ah-topbar__brand { justify-self: start; min-width: 0; }
.ah-topbar__nav {
  display: flex;
  justify-content: center;
  align-items: center;
  justify-self: center;
  z-index: 2;
}
.ah-topbar__nav .site-nav { margin: 0; flex-wrap: wrap; justify-content: center; }
.ah-topbar__user {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  justify-self: end;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
  z-index: 1;
}
.ah-topbar__tools {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border-radius: 14px;
  border: 1px solid rgba(170, 190, 220, 0.14);
  background: rgba(8, 10, 14, 0.55);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.ah-logout__ico {
  font-size: 0.9rem;
  opacity: 0.85;
  line-height: 1;
}
.ah-topbar__user .hilab-cursor-pick { position: relative; z-index: 3; flex-shrink: 0; margin: 0; }
.ah-topbar__user .hilab-cursor-pick__btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 118px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid rgba(196, 165, 116, 0.45);
  background: linear-gradient(145deg, rgba(122, 155, 184, 0.28), rgba(196, 165, 116, 0.14));
  color: #f4f1ea;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  box-shadow: 0 0 0 1px rgba(196, 165, 116, 0.18), 0 0 16px rgba(122, 155, 184, 0.2);
}
.ah-topbar__user .hilab-cursor-pick__btn-label { overflow: hidden; text-overflow: ellipsis; }
.ah-topbar__brand-link {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}
.ah-topbar__logo {
  filter: drop-shadow(0 0 10px rgba(0, 136, 255, 0.22));
}
.ah-topbar__brand-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.ah-topbar__title {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.ah-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  border: 1px solid rgba(170, 190, 220, 0.14);
  background: rgba(14, 16, 22, 0.7);
}
.ah-user-chip__initials {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.72rem;
  font-weight: 700;
  background: linear-gradient(135deg, rgba(122, 155, 184, 0.5), rgba(196, 165, 116, 0.35));
  border: 1px solid rgba(255, 255, 255, 0.12);
}
.ah-user-chip__meta { display: flex; flex-direction: column; min-width: 0; }
.ah-user-chip__name {
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 160px;
}
.ah-user-chip__role {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ah-muted);
}
.ah-logout {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(255, 255, 255, 0.04);
  color: inherit;
  border-radius: 999px;
  padding: 8px 12px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.ah-logout:hover {
  border-color: rgba(196, 165, 116, 0.35);
  background: rgba(196, 165, 116, 0.08);
}

/* ——— Hero ——— */
.ah-main {
  flex: 1 1 auto;
  min-height: 0;
  width: min(1180px, calc(100% - 28px));
  max-width: 100%;
  margin: 0 auto;
  padding: clamp(10px, 1.6vh, 18px) 0 clamp(10px, 1.8vh, 20px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-sizing: border-box;
}

.ah-hero {
  margin-bottom: clamp(8px, 1.4vh, 14px);
  max-width: 40rem;
  flex-shrink: 0;
}

.ah-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c4a574;
  text-shadow: 0 0 18px rgba(196, 165, 116, 0.28);
}

.ah-heading {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.55rem, 2.8vw, 2.2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.12;
  color: #fff;
  text-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
}

.ah-lead {
  margin: 8px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: rgba(226, 232, 240, 0.86);
}

/* ——— Escenario: núcleo independiente | arco + panel ——— */
.ah-stage-wrap {
  display: grid;
  grid-template-columns: minmax(140px, 180px) minmax(0, 1fr);
  gap: clamp(8px, 1.5vw, 16px);
  align-items: stretch;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.ah-lab-stage {
  --ah-accent: var(--ah-cyan);
  display: grid;
  grid-template-columns: minmax(180px, 240px) minmax(0, 1fr);
  gap: clamp(12px, 2vw, 28px);
  align-items: stretch;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
}

.ah-lab-stage[data-active="cursos"] { --ah-accent: var(--ah-violet); }
.ah-lab-stage[data-active="herramientas"] { --ah-accent: var(--ah-teal); }
.ah-lab-stage[data-active="analisis"] { --ah-accent: var(--ah-electric); }

/* Núcleo planetario — columna propia a la izquierda (botón independiente) */
.ah-nucleus {
  position: relative;
  z-index: 4;
  display: grid;
  place-items: center;
  align-self: center;
  justify-self: center;
  width: 100%;
  padding: 8px 4px 28px;
  pointer-events: auto;
  overflow: visible;
  min-height: 0;
}

/* Spine / menú semicircular — desplazado a la izquierda para no encimar el panel */
.ah-spine {
  position: relative;
  padding: 12px 12px 12px 0;
  display: flex;
  align-items: stretch;
  overflow: visible;
  margin-right: 4px;
}

.ah-spine__path {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 100px;
  height: 100%;
  pointer-events: none;
  opacity: 0.95;
  filter: drop-shadow(0 0 12px rgba(0, 136, 255, 0.28));
}

.ah-spine__dash { animation: ah-spine-dash 18s linear infinite; }
@keyframes ah-spine-dash { to { stroke-dashoffset: -240; } }

.ah-spine__nodes {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: clamp(12px, 2.5vh, 28px);
  width: 100%;
  height: 100%;
  padding: clamp(12px, 2vh, 24px) 0;
  min-height: 0;
  overflow: visible;
  box-sizing: border-box;
}

.ah-pill {
  --pill: var(--ah-steel);
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 210px;
  padding: 12px 14px 12px 12px;
  border: 1px solid color-mix(in srgb, var(--pill) 48%, transparent);
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.62);
  color: #f4f6f8;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transform-origin: left center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 12px 30px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  transition:
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    z-index 0s;
  animation: ah-pill-in 0.65s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i, 0) * 0.1s);
}

@keyframes ah-pill-in {
  from { opacity: 0; transform: translateX(-28px) scale(0.92); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

.ah-pill--proy { --pill: #7a9bb8; }
.ah-pill--cursos { --pill: #8b8fc7; }
.ah-pill--tools { --pill: #6a9e94; }

/* Arco suave hacia la derecha, sin invadir el recuadro */
.ah-pill:nth-child(1) { margin-left: 4px; }
.ah-pill:nth-child(2) { margin-left: 42px; }
.ah-pill:nth-child(3) { margin-left: 4px; }

.ah-pill:hover {
  z-index: 5;
  transform: scale(1.06);
  background: rgba(14, 16, 22, 0.82);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--pill) 45%, transparent),
    0 0 28px color-mix(in srgb, var(--pill) 40%, transparent),
    0 18px 40px rgba(0, 0, 0, 0.5);
}

.ah-pill.is-active {
  z-index: 3;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.97), rgba(243, 244, 246, 0.94));
  color: #12161c;
  border-color: rgba(255, 255, 255, 0.92);
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--pill) 35%, transparent),
    0 0 28px color-mix(in srgb, var(--pill) 32%, transparent),
    0 16px 36px rgba(0, 0, 0, 0.4);
}

.ah-pill.is-active:hover {
  z-index: 6;
  transform: scale(1.05);
}

.ah-pill__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--pill);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pill) 22%, transparent), 0 0 16px var(--pill);
}

.ah-pill.is-active .ah-pill__dot {
  background: var(--pill);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--pill) 28%, transparent);
}

.ah-pill__text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ah-pill__text strong {
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1.15;
}
.ah-pill__text small {
  font-size: 0.7rem;
  font-weight: 600;
  color: rgba(226, 232, 240, 0.72);
  letter-spacing: 0.01em;
}
.ah-pill.is-active .ah-pill__text small { color: rgba(51, 65, 85, 0.88); }

/* Workspace — tarjeta laboratorio (misma lógica para todos los módulos) */
.ah-workspace {
  --ah-accent: var(--ah-electric);
  position: relative;
  border-radius: 28px;
  border: 1px solid rgba(0, 136, 255, 0.28);
  background: #040910;
  box-shadow:
    0 0 0 1px rgba(0, 136, 255, 0.08) inset,
    0 28px 70px rgba(0, 0, 0, 0.45),
    0 0 40px rgba(0, 136, 255, 0.12);
  padding: 0;
  overflow: hidden;
  min-height: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.ah-workspace[data-active="cursos"] { --ah-accent: #8b8fc7; }
.ah-workspace[data-active="herramientas"] { --ah-accent: #2dd4bf; }
.ah-workspace[data-active="analisis"] { --ah-accent: var(--ah-electric); }

/* Contorno eléctrico rápido */
.ah-workspace::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--ah-border-angle),
    transparent 0%,
    #0088ff 10%,
    transparent 22%,
    #5ec8ff 38%,
    transparent 50%,
    #0088ff 66%,
    transparent 78%,
    #33a3ff 92%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ah-border-spin 5.5s linear infinite;
  pointer-events: none;
  z-index: 3;
}

.ah-panel__body {
  display: none;
  position: relative;
  z-index: 1;
  flex: 1;
  min-height: 100%;
  animation: ah-panel-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ah-panel__body.is-active {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

@keyframes ah-panel-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.ah-lab-card {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  flex: 1;
  min-height: 0;
  height: 100%;
}

.ah-lab-card__copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 0;
  overflow: hidden;
  padding: clamp(14px, 2.2vh, 28px) clamp(16px, 2.5vw, 30px);
  background:
    linear-gradient(105deg, rgba(2, 10, 24, 0.92) 0%, rgba(4, 18, 40, 0.78) 55%, rgba(4, 18, 40, 0.35) 100%);
}

.ah-lab-card__visual {
  position: relative;
  min-height: 100%;
  background:
    linear-gradient(105deg, rgba(2, 10, 24, 0.55) 0%, rgba(2, 10, 24, 0.15) 35%, transparent 60%),
    url("./assets/academy-lab-bg.jpg") center / cover no-repeat;
  filter: saturate(1.15) contrast(1.08) brightness(0.78);
}

.ah-lab-card__visual::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 60% at 70% 40%, rgba(0, 136, 255, 0.28), transparent 65%),
    linear-gradient(180deg, transparent 40%, rgba(0, 8, 20, 0.55) 100%);
  pointer-events: none;
}

.ah-panel__eyebrow {
  margin: 0;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ah-electric-2);
  text-shadow: 0 0 16px rgba(0, 136, 255, 0.45);
}

.ah-panel__title {
  margin: 0;
  font-family: "Source Serif 4", Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.08;
  color: #fff;
  text-shadow: 0 10px 36px rgba(0, 0, 0, 0.55);
}

.ah-panel__lead {
  margin: 2px 0 0;
  max-width: 28rem;
  font-size: clamp(0.88rem, 1.5vh, 1rem);
  line-height: 1.4;
  color: rgba(226, 238, 255, 0.95);
}

.ah-panel__lead strong { color: #fff; font-weight: 800; }

.ah-panel__desc {
  margin: 0;
  max-width: 28rem;
  font-size: clamp(0.8rem, 1.35vh, 0.9rem);
  line-height: 1.4;
  color: rgba(186, 210, 235, 0.78);
}

.ah-shortcuts {
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1.2vh, 10px);
  margin-top: auto;
  padding-top: clamp(8px, 1.5vh, 14px);
  max-width: 26rem;
  min-height: 0;
}

.ah-planet {
  --planet-size: clamp(110px, 14vw, 158px);
  position: relative;
  display: block;
  width: var(--planet-size);
  height: var(--planet-size);
  margin: 0;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  color: inherit;
  font: inherit;
  text-decoration: none;
  flex-shrink: 0;
  isolation: isolate;
}

.ah-planet__core {
  position: absolute;
  inset: 18%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  /* Fondo uniforme: sin borde oscuro que “coma” las patitas */
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 255, 255, 0.28), transparent 52%),
    radial-gradient(circle at 50% 50%, rgba(70, 150, 230, 0.55), rgba(18, 40, 72, 0.88) 78%);
  border: 1px solid rgba(186, 220, 255, 0.5);
  box-shadow:
    0 0 0 6px rgba(61, 143, 212, 0.12),
    0 0 40px rgba(120, 180, 255, 0.45),
    0 0 80px rgba(168, 85, 247, 0.22),
    inset 0 0 18px rgba(180, 220, 255, 0.18);
  animation: ah-planet-pulse 3.6s ease-in-out infinite;
  transition: transform 0.28s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.28s ease;
  z-index: 2;
  overflow: visible;
}

.ah-planet__core img {
  width: 72%;
  height: 72%;
  object-fit: contain;
  /* Brillo pareja en todas las extremidades */
  filter:
    brightness(1.18)
    contrast(1.08)
    saturate(1.12)
    drop-shadow(0 0 1px rgba(200, 235, 255, 0.95))
    drop-shadow(0 0 10px rgba(140, 210, 255, 0.75));
  animation: ah-planet-spin 18s linear infinite;
}

.ah-planet__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid rgba(200, 220, 255, 0.28);
  z-index: 1;
  pointer-events: none;
}

.ah-planet__ring--a {
  inset: 4%;
  border-color: rgba(198, 232, 74, 0.22);
  animation: ah-ring-spin 10s linear infinite;
  box-shadow: 0 0 18px rgba(61, 143, 212, 0.15);
}

.ah-planet__ring--b {
  inset: -8%;
  border-style: dashed;
  border-color: rgba(170, 190, 220, 0.22);
  animation: ah-ring-spin 16s linear infinite reverse;
  opacity: 0.85;
}

.ah-planet__spark {
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 10px 2px rgba(198, 232, 74, 0.85);
  z-index: 3;
  pointer-events: none;
  animation: ah-spark 2.4s ease-in-out infinite;
}

.ah-planet__spark--1 { top: 10%; left: 52%; animation-delay: 0s; }
.ah-planet__spark--2 { top: 42%; right: 2%; animation-delay: 0.5s; background: #c6e84a; }
.ah-planet__spark--3 { bottom: 14%; left: 22%; animation-delay: 1s; }
.ah-planet__spark--4 { top: 28%; left: 6%; animation-delay: 1.4s; background: #7dd3fc; }

.ah-planet__hint {
  position: absolute;
  left: 50%;
  bottom: -28px;
  transform: translateX(-50%);
  white-space: nowrap;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: rgba(226, 232, 240, 0.75);
  transition: color 0.25s ease, opacity 0.25s ease;
}

.ah-planet:hover .ah-planet__core {
  transform: scale(1.06);
  box-shadow:
    0 0 0 8px rgba(61, 143, 212, 0.16),
    0 0 55px rgba(140, 200, 255, 0.55),
    0 0 100px rgba(198, 232, 74, 0.22),
    inset 0 0 28px rgba(255, 255, 255, 0.16);
}

.ah-planet:hover .ah-planet__hint { color: #c6e84a; }

.ah-planet.is-active .ah-planet__hint {
  color: #33a3ff;
  opacity: 1;
}
.ah-planet.is-active .ah-planet__core {
  box-shadow:
    0 0 0 8px rgba(0, 136, 255, 0.22),
    0 0 55px rgba(0, 136, 255, 0.55),
    0 0 100px rgba(51, 163, 255, 0.3),
    inset 0 0 24px rgba(255, 255, 255, 0.16);
}

@keyframes ah-planet-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.12); }
}

@keyframes ah-planet-spin {
  to { transform: rotate(360deg); }
}

@keyframes ah-ring-spin {
  to { transform: rotate(360deg); }
}

@keyframes ah-spark {
  0%, 100% { opacity: 0.35; transform: scale(0.7); }
  50% { opacity: 1; transform: scale(1.25); }
}


@keyframes ah-actions-in {
  from { opacity: 0; transform: translateY(14px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.ah-action-pill {
  --ring-a: rgba(0, 136, 255, 0.95);
  --ring-b: rgba(94, 200, 255, 0.85);
  position: relative;
  z-index: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: clamp(8px, 1.4vh, 12px) 14px clamp(8px, 1.4vh, 12px) 12px;
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid rgba(0, 136, 255, 0.28);
  overflow: visible;
  isolation: isolate;
  box-shadow:
    0 14px 32px rgba(0, 40, 90, 0.35),
    0 0 22px rgba(0, 136, 255, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  transition:
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.22s ease,
    filter 0.22s ease;
  animation: ah-pill-rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ah-shortcuts .ah-action-pill:nth-child(1) { animation-delay: 0.08s; }
.ah-shortcuts .ah-action-pill:nth-child(2) { animation-delay: 0.18s; }
.ah-shortcuts .ah-action-pill:nth-child(3) { animation-delay: 0.28s; }

@keyframes ah-pill-rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Contorno eléctrico rápido */
.ah-action-pill::before {
  content: "";
  position: absolute;
  inset: -1.5px;
  border-radius: inherit;
  padding: 1.5px;
  background: conic-gradient(
    from var(--ah-border-angle),
    transparent 0%,
    var(--ring-a) 12%,
    transparent 28%,
    var(--ring-b) 48%,
    transparent 64%,
    var(--ring-a) 82%,
    transparent 100%
  );
  -webkit-mask:
    linear-gradient(#000 0 0) content-box,
    linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  animation: ah-border-spin 4.2s linear infinite;
  pointer-events: none;
  z-index: 1;
}

.ah-action-pill > * {
  position: relative;
  z-index: 2;
}

@keyframes ah-border-spin {
  to { --ah-border-angle: 360deg; }
}

.ah-action-pill:hover {
  transform: translateY(-2px) scale(1.015);
  filter: brightness(1.05);
}

.ah-action-pill:hover::before {
  animation-duration: 2.8s;
  filter: brightness(1.15);
}

.ah-action-pill--start {
  color: #fff;
  background: linear-gradient(120deg, #0066cc 0%, #0088ff 48%, #33a3ff 100%);
}

.ah-action-pill--cyan {
  color: #eaf6ff;
  background: linear-gradient(120deg, #0a2a4a 0%, #0d3d6e 50%, #145a9a 100%);
  border-color: rgba(94, 200, 255, 0.35);
}

.ah-action-pill--ghost {
  color: #e8f4ff;
  background: rgba(6, 20, 40, 0.72);
  border-color: rgba(0, 136, 255, 0.35);
}

.ah-action-pill__ico {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16);
  color: #fff;
}

.ah-action-pill--cyan .ah-action-pill__ico,
.ah-action-pill--ghost .ah-action-pill__ico {
  background: rgba(0, 136, 255, 0.18);
  border-color: rgba(94, 200, 255, 0.28);
  color: #9fd4ff;
}

.ah-action-pill__txt {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.ah-action-pill__txt strong {
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.2;
}

.ah-action-pill__txt small {
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.78;
  letter-spacing: 0.01em;
}

.ah-action-pill__go {
  font-size: 1.5rem;
  font-weight: 300;
  line-height: 1;
  opacity: 0.75;
  flex-shrink: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.ah-action-pill:hover .ah-action-pill__go {
  transform: translateX(3px);
  opacity: 1;
}

@media (max-width: 1100px) {
  .ah-stage-wrap {
    grid-template-columns: 150px 1fr;
  }

  .ah-lab-stage {
    grid-template-columns: minmax(200px, 260px) 1fr;
    gap: 18px;
  }

  .ah-pill:nth-child(2) { margin-left: 28px; }
}

@media (max-width: 920px) {
  /* En pantallas angostas se permite scroll interno del main para no romper el layout */
  html:has(body.academy-hub) { overflow: auto; }
  .academy-hub {
    height: auto;
    max-height: none;
    min-height: 100dvh;
    overflow-x: hidden;
    overflow-y: auto;
  }
  .ah-main {
    overflow: visible;
    flex: none;
  }

  .ah-stage-wrap {
    grid-template-columns: 1fr;
    justify-items: center;
    min-height: 0;
    overflow: visible;
  }

  .ah-nucleus {
    order: -1;
    padding-bottom: 20px;
  }

  .ah-lab-card {
    grid-template-columns: 1fr;
  }

  .ah-lab-card__visual {
    min-height: 160px;
    order: -1;
  }

  .ah-lab-stage {
    grid-template-columns: 1fr;
    width: 100%;
    min-height: 0;
    height: auto;
    overflow: visible;
  }

  .ah-spine {
    padding: 0;
    width: 100%;
  }

  .ah-spine__path { display: none; }

  .ah-spine__nodes {
    min-height: 0;
    padding: 0;
    gap: 10px;
  }

  .ah-pill:nth-child(1),
  .ah-pill:nth-child(2),
  .ah-pill:nth-child(3) {
    margin-left: 0;
    width: 100%;
    max-width: none;
  }

  .ah-pill:hover,
  .ah-pill.is-active:hover {
    transform: scale(1.04);
  }

  .ah-workspace { width: 100%; }
  .ah-actions { width: 100%; }
}

@media (max-width: 820px) {
  .ah-topbar {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }
  .ah-topbar__nav { justify-content: flex-start; }
  .ah-topbar__user { justify-content: space-between; }
  /* logo size via --hilab-header-logo-* */
}

@media (max-width: 520px) {
  .ah-user-chip__meta { display: none; }
  .ah-heading { font-size: 1.65rem; }
}

@media (prefers-reduced-motion: reduce) {
  .ah-spine__dash,
  .ah-pill,
  .ah-panel__body,
  .ah-space-bg__aurora,
  .ah-planet__core,
  .ah-planet__core img,
  .ah-planet__ring,
  .ah-planet__spark,
  .ah-actions,
  .ah-action-pill,
  .ah-action-pill::before,
  .ah-workspace::before {
    animation: none !important;
    transition: none !important;
  }
}
