/* =========================================================
   €ERO — J.A.R.V.I.S. HOLOGRAPHIC INTERFACE
   Diseño responsive para iPhone, PWA, tablet y escritorio
   ========================================================= */

:root {
  color-scheme: dark;

  --bg: #020712;
  --bg-2: #061528;
  --panel: rgba(5, 17, 33, .88);
  --panel-strong: rgba(5, 16, 31, .97);
  --line: rgba(73, 190, 255, .24);
  --line-strong: rgba(61, 211, 255, .60);
  --cyan: #50e4ff;
  --cyan-bright: #c5f7ff;
  --blue: #168dff;
  --text: #eaf8ff;
  --muted: #b3c7db;
  --faint: #8aa2bb;
  --shadow: 0 24px 70px rgba(0, 0, 0, .43);
  --radius: 18px;
}

* {
  box-sizing: border-box;
  scrollbar-width: thin;
  scrollbar-color: rgba(64, 160, 220, .35) transparent;
}

html {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
}

body {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100%;
  min-height: 100%;
  margin: 0;
  overflow: hidden;

  color: var(--text);
  background-color: var(--bg);
  /* Fondo optimizado: 186 KB en WebP (antes 553 KB) y JPEG de respaldo. */
  background-image:
    linear-gradient(
      180deg,
      rgba(2, 9, 24, .35) 0%,
      rgba(2, 12, 30, .38) 48%,
      rgba(1, 6, 18, .65) 100%
    ),
    url("/fondo.jpg");
  background-image:
    linear-gradient(
      180deg,
      rgba(2, 9, 24, .35) 0%,
      rgba(2, 12, 30, .38) 48%,
      rgba(1, 6, 18, .65) 100%
    ),
    image-set(url("/fondo.webp") type("image/webp"), url("/fondo.jpg") type("image/jpeg"));

  background-position: center center;
  background-size: cover;
  background-repeat: no-repeat;
  background-attachment: scroll;

  font-family: Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;

  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
textarea {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

body::before {
  background:
    radial-gradient(
      ellipse at 50% 38%,
      rgba(0, 157, 255, .13),
      transparent 57%
    ),
    linear-gradient(
      90deg,
      rgba(0, 8, 24, .18),
      transparent 25%,
      transparent 75%,
      rgba(0, 8, 24, .18)
    );
}

body::after {
  background: radial-gradient(
    circle at 50% 45%,
    transparent 20%,
    rgba(0, 139, 255, .035) 65%,
    rgba(0, 3, 12, .15) 100%
  );
  animation: ero-atmosphere 8s ease-in-out infinite alternate;
}

#appScreen,
.auth-screen {
  position: relative;
  z-index: 1;
  background: transparent;
}

/* =========================================================
   INICIO DE SESIÓN
   ========================================================= */

.auth-screen {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow-y: auto;

  display: flex;
  align-items: center;
  justify-content: center;

  padding:
    max(24px, env(safe-area-inset-top))
    20px
    max(24px, env(safe-area-inset-bottom));

  background:
    radial-gradient(
      circle at 50% 38%,
      rgba(0, 147, 255, .07),
      transparent 48%
    );
}

.auth-box {
  position: relative;
  width: 100%;
  max-width: 390px;
  flex: 0 0 auto;
  padding: clamp(24px, 6vw, 42px);
  overflow: hidden;
  text-align: center;

  border: 1px solid var(--line-strong);
  border-radius: 26px;

  background: linear-gradient(
    145deg,
    rgba(10, 30, 53, .91),
    rgba(2, 10, 22, .96)
  );

  box-shadow:
    0 30px 90px rgba(0, 0, 0, .50),
    0 0 55px rgba(0, 145, 255, .13),
    inset 0 1px 0 rgba(190, 235, 255, .10);
  /* Sin desenfoque de fondo: el panel es casi opaco y el blur sobre el fondo
     animado retrasaba la primera pintura (sobre todo en móviles modestos). */
}

.auth-box::before {
  content: "";
  position: absolute;
  top: 0;
  left: 12%;
  right: 12%;
  height: 1px;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(103, 235, 255, .9),
    transparent
  );
  box-shadow: 0 0 18px rgba(52, 205, 255, .45);
  pointer-events: none;
}

.auth-logo {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;

  display: grid;
  place-items: center;

  border-radius: 22px;
  color: var(--cyan-bright);
  font-size: 35px;
  font-weight: 800;

  background:
    radial-gradient(
      circle at 35% 24%,
      rgba(115, 230, 255, .28),
      transparent 35%
    ),
    linear-gradient(145deg, #123b5c, #061426 72%);

  border: 1px solid rgba(99, 216, 255, .72);

  box-shadow:
    0 0 28px rgba(0, 166, 255, .22),
    inset 0 1px 0 rgba(255, 255, 255, .14),
    inset 0 0 22px rgba(0, 180, 255, .08);

  text-shadow: 0 0 20px rgba(73, 208, 255, .65);
}

.auth-box h1 {
  margin: 0;
  color: #f1faff;
  font-size: clamp(25px, 8vw, 34px);
  letter-spacing: .15em;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.auth-box p {
  margin: 12px 0 25px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.auth-box input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin: 11px 0;
  padding: 13px 15px;

  color: var(--text);
  background: rgba(1, 8, 17, .78);
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: none;

  font-size: 16px;

  transition: border-color .2s, box-shadow .2s;
}

.auth-box input::placeholder {
  color: #68839d;
}

.auth-box input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(41, 173, 255, .12);
}

.auth-box button {
  width: 100%;
  min-height: 46px;
  margin-top: 13px;
  padding: 12px 16px;

  border-radius: 12px;
  border: 1px solid #42caff;
  color: #00101c;
  font-weight: 750;
  cursor: pointer;

  background: linear-gradient(
    180deg,
    #c2f5ff,
    #63d9ff 45%,
    #1688ee
  );

  box-shadow:
    0 4px 0 #07549a,
    0 12px 24px rgba(0, 130, 255, .22),
    inset 0 1px 0 rgba(255, 255, 255, .78);

  transition: transform .12s, filter .2s;
}

.auth-box button:active {
  transform: translateY(3px);
}

.auth-box button:disabled {
  opacity: .55;
  cursor: wait;
}

.auth-box .secondary-auth-button {
  margin-top: 17px;
  color: #a8dfff;
  background: linear-gradient(
    145deg,
    rgba(13, 39, 63, .94),
    rgba(5, 17, 31, .96)
  );
  border: 1px solid var(--line);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .3);
}

#authError {
  min-height: 18px;
  margin-top: 13px;
  color: #ff9d9d;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

/* =========================================================
   APLICACIÓN Y CABECERA
   ========================================================= */

#appScreen {
  width: 100%;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
}

#appScreen header {
  position: relative;
  z-index: 2;
  height: 76px;
  flex-shrink: 0;
  padding: 0 clamp(16px, 3vw, 34px);

  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 18px;

  background: rgba(2, 9, 19, .64);
  border-bottom: 1px solid var(--line);

  box-shadow: 0 8px 32px rgba(0, 0, 0, .23);

  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

.mark {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;

  display: grid;
  place-items: center;

  border-radius: 13px;
  color: var(--cyan-bright);
  font-size: 23px;
  font-weight: 800;

  background:
    radial-gradient(
      circle at 35% 25%,
      rgba(87, 221, 255, .2),
      transparent 38%
    ),
    linear-gradient(145deg, #123956, #061426);

  border: 1px solid var(--line-strong);

  box-shadow:
    0 0 22px rgba(0, 150, 255, .14),
    inset 0 1px 0 rgba(255, 255, 255, .12);
}

.brand b {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  letter-spacing: .15em;
}

.brand small {
  display: block;
  margin-top: 5px;
  color: var(--cyan);
  font-size: 9px;
  letter-spacing: .14em;
  white-space: nowrap;
}

.online {
  justify-self: center;
  color: #73e9c7;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  white-space: nowrap;
}

.online span {
  margin-right: 6px;
  color: #53edb8;
  text-shadow: 0 0 10px rgba(83, 237, 184, .7);
}

.account-area {
  justify-self: end;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

#currentUser {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #9cb5cd;
  font-size: 13px;
}

#logoutButton {
  flex: 0 0 auto;
  padding: 9px 13px;
  color: #b7d9f2;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 28, 47, .85);
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}

#logoutButton:active {
  transform: translateY(2px);
}

/* =========================================================
   DISTRIBUCIÓN PRINCIPAL
   ========================================================= */

#appScreen main {
  position: relative;
  z-index: 1;

  width: min(1480px, 100%);
  height: calc(100% - 76px);
  min-height: 0;
  margin: 0 auto;
  padding: 22px;

  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  gap: 20px;
}

/* =========================================================
   PROYECTOS
   ========================================================= */

#appScreen aside {
  min-width: 0;
  min-height: 0;
  overflow: hidden;

  display: flex;
  flex-direction: column;
  gap: 15px;
  padding: 15px;

  border: 1px solid var(--line);
  border-radius: var(--radius);

  background: linear-gradient(
    160deg,
    rgba(8, 24, 42, .88),
    rgba(3, 11, 22, .87)
  );

  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.new {
  flex: 0 0 auto;
  width: 100%;
  padding: 13px 12px;

  border-radius: 11px;
  color: #dff6ff;
  border: 1px solid rgba(69, 190, 255, .38);
  background: linear-gradient(145deg, #123653, #08192b);

  font-size: 13px;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
  box-shadow: 0 4px 0 #020812;
}

.new:active {
  transform: translateY(2px);
}

#projects {
  min-height: 0;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-right: 2px;
}

.item {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 10px;

  border-radius: 10px;
  border: 1px solid transparent;
  color: #9db8d0;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item.active {
  color: #eaf9ff;
  border-color: rgba(69, 190, 255, .30);
  background: linear-gradient(
    100deg,
    rgba(18, 78, 117, .48),
    rgba(10, 33, 54, .40)
  );
  box-shadow: inset 2px 0 0 rgba(65, 220, 255, .75);
}

/* =========================================================
   CHAT
   ========================================================= */

.chat {
  position: relative;
  min-width: 0;
  min-height: 0;
  overflow: hidden;

  display: flex;
  flex-direction: column;

  border: 1px solid rgba(53, 204, 255, .38);
  border-radius: var(--radius);

  background: rgba(2, 10, 24, .23);
  box-shadow: var(--shadow);

  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.welcome {
  position: relative;
  isolation: isolate;

  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  width: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;

  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;

  padding: clamp(20px, 4vh, 42px) 22px 24px;
  text-align: center;
  background: transparent;
}

.welcome::before {
  content: "";
  position: absolute;
  z-index: -1;

  width: min(75vw, 540px);
  aspect-ratio: 1;
  left: 50%;
  top: 48%;
  transform: translate(-50%, -50%);

  border-radius: 50%;
  pointer-events: none;
  opacity: .38;

  background:
    radial-gradient(
      circle,
      rgba(12, 184, 255, .10),
      transparent 45%
    ),
    repeating-radial-gradient(
      circle,
      transparent 0 24px,
      rgba(50, 199, 255, .10) 25px 26px,
      transparent 27px 42px
    ),
    repeating-conic-gradient(
      from 15deg,
      transparent 0deg 17deg,
      rgba(50, 199, 255, .15) 17.2deg 17.5deg,
      transparent 17.7deg 30deg
    );

  mask-image: radial-gradient(
    circle,
    #000 0%,
    #000 54%,
    transparent 73%
  );
  -webkit-mask-image: radial-gradient(
    circle,
    #000 0%,
    #000 54%,
    transparent 73%
  );

  animation: ero-reactor-rotation 85s linear infinite reverse;
}

.big {
  position: relative;
  isolation: isolate;
  flex: 0 0 auto;

  width: 132px;
  height: 132px;
  margin: 0 auto 25px;

  display: grid;
  place-items: center;

  border-radius: 50%;
  color: #e8fcff;
  font-size: 55px;
  font-weight: 700;

  border: 1px solid rgba(121, 234, 255, .85);

  background:
    radial-gradient(
      circle at 30% 23%,
      rgba(220, 251, 255, .58),
      transparent 19%
    ),
    radial-gradient(
      circle at 40% 35%,
      rgba(58, 222, 255, .38),
      transparent 38%
    ),
    radial-gradient(
      circle at 50% 60%,
      rgba(0, 98, 190, .30),
      rgba(1, 10, 25, .88) 73%
    );

  box-shadow:
    0 0 18px rgba(0, 211, 255, .42),
    0 0 45px rgba(0, 135, 255, .22),
    inset 0 0 24px rgba(44, 202, 255, .25);

  text-shadow: 0 0 18px rgba(99, 225, 255, .78);
  animation: ero-core-pulse 4s ease-in-out infinite;
}

.big::before,
.big::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(81, 205, 255, .63);
  border-radius: 50%;
  pointer-events: none;
  transform: rotate(-22deg);
  clip-path: polygon(0 0, 100% 0, 100% 72%, 0 72%);
  animation: ero-core-orbit 13s linear infinite;
}

.big::after {
  inset: -22px;
  border-color: rgba(70, 166, 255, .40);
  border-style: dashed;
  clip-path: none;
  animation-duration: 25s;
  animation-direction: reverse;
}

.big span {
  position: relative;
  z-index: 1;
}

.system-label {
  margin: 0 0 13px;
  color: #5fcdf5;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .25em;
  text-shadow: 0 0 16px rgba(45, 175, 255, .40);
}

.welcome h1 {
  max-width: 100%;
  margin: 0;
  color: #f0f8ff;
  font-size: clamp(23px, 3vw, 34px);
  font-weight: 560;
  letter-spacing: -.035em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.welcome p {
  max-width: 480px;
  margin: 13px auto 23px;
  color: #b1c6d9;
  font-size: 13px;
  line-height: 1.7;
}

.examples {
  width: min(100%, 590px);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.examples button {
  position: relative;
  min-width: 0;
  min-height: 62px;
  padding: 11px 10px;
  overflow: hidden;

  border-radius: 11px;
  color: #c8e1f3;
  background: linear-gradient(
    145deg,
    rgba(13, 37, 60, .88),
    rgba(5, 18, 32, .91)
  );

  border: 1px solid rgba(71, 161, 220, .28);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35);

  font-size: 12.5px;
  line-height: 1.5;
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.examples button:active {
  transform: translateY(2px);
}

/* Primeros pasos (onboarding.js) */
.onboarding {
  width: min(100%, 590px);
  margin: 16px auto 0;
  padding: 12px;
  border-radius: 14px;
  background: rgba(5, 18, 32, .86);
  border: 1px solid var(--line);
  text-align: left;
}

.onboarding-head {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
}

.onboarding-head span { color: var(--muted); font-size: 13px; }

.onboarding-hide {
  margin-left: auto;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
}

.onboarding-bar {
  height: 4px;
  margin: 9px 0 6px;
  border-radius: 4px;
  background: rgba(73, 190, 255, .14);
  overflow: hidden;
}

.onboarding-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.onboarding-step {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 6px;
  color: var(--text);
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(73, 190, 255, .10);
  text-align: left;
  cursor: pointer;
}

.onboarding-step small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
  margin-top: 2px;
}

.onboarding-step b { font-size: 13px; font-weight: 600; }

.onboarding-check {
  flex: 0 0 22px;
  height: 22px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-strong);
  color: #021019;
  font-size: 13px;
}

.onboarding-step.done { cursor: default; opacity: .62; }
.onboarding-step.done b { text-decoration: line-through; }
.onboarding-step.done .onboarding-check { background: var(--cyan); border-color: var(--cyan); }

.invite-box {
  display: flex;
  max-width: 100%;
  gap: 8px;
  margin: 6px 0 10px;
}

.invite-box input {
  flex: 1 1 0;
  width: 0;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text);
  background: rgba(2, 10, 20, .8);
  border: 1px solid var(--line);
  font-size: 16px;
}

/* =========================================================
   MENSAJES
   ========================================================= */

.messages {
  display: none;
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;

  padding: 26px clamp(16px, 5vw, 62px) 22px;
  scroll-behavior: smooth;
  background: rgba(1, 8, 17, .12);
}

.msg {
  width: 100%;
  min-width: 0;

  display: flex;
  align-items: flex-start;
  gap: 11px;

  margin: 0 auto 20px;
  animation: ero-message-in .28s ease-out both;
}

.msg.user {
  flex-direction: row-reverse;
}

.avatar {
  flex: 0 0 31px;
  width: 31px;
  height: 31px;

  display: grid;
  place-items: center;

  border-radius: 10px;
  color: #9beaff;
  font-size: 14px;
  font-weight: 750;

  border: 1px solid rgba(77, 190, 255, .38);
  background: linear-gradient(145deg, #123652, #071525);
}

.bubble {
  min-width: 0;
  max-width: min(78%, 690px);
  padding: 12px 15px;

  border-radius: 4px 14px 14px 14px;
  color: #dcebf8;

  background: rgba(3, 17, 32, .90);
  border: 1px solid rgba(67, 195, 255, .30);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .10);

  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: pre-wrap;

  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.msg.user .bubble,
.user .bubble {
  border-radius: 14px 4px 14px 14px;
  color: #eaf8ff;
  background: rgba(7, 37, 62, .93);
  border-color: rgba(62, 174, 237, .34);
}

.thinking .bubble {
  color: #78cdeb;
}

.dots {
  display: inline-block;
  overflow: hidden;
  width: 16px;
  vertical-align: bottom;
  animation: ero-dots 1.2s steps(4, end) infinite;
}

/* =========================================================
   ESCRITOR DE MENSAJES
   ========================================================= */

.composer {
  position: relative;
  flex: 0 0 auto;

  width: calc(100% - 42px);
  max-width: 900px;
  margin: 0 auto 10px;
  padding: 9px 10px 9px 16px;

  display: flex;
  align-items: flex-end;
  gap: 12px;

  border: 1px solid rgba(78, 183, 245, .38);
  border-radius: 15px;

  background: linear-gradient(
    145deg,
    rgba(9, 27, 46, .96),
    rgba(3, 12, 24, .97)
  );

  box-shadow:
    0 10px 34px rgba(0, 0, 0, .32),
    0 0 22px rgba(0, 133, 255, .07),
    inset 0 1px 0 rgba(255, 255, 255, .05);
}

.composer:focus-within {
  border-color: rgba(84, 204, 255, .70);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, .32),
    0 0 0 3px rgba(38, 160, 255, .08);
}

.composer textarea {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 42px;
  max-height: 120px;
  resize: none;
  overflow-y: auto;

  padding: 10px 0;
  color: #eaf7ff;
  background: transparent;
  border: 0;
  outline: none;

  font-size: 16px;
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}

.composer textarea::placeholder {
  color: #68839c;
}

.composer textarea:focus-visible {
  outline: none;
}

#sendButton {
  flex: 0 0 43px;
  width: 43px;
  height: 43px;

  display: grid;
  place-items: center;

  border-radius: 12px;
  color: #00101b;
  font-size: 24px;
  font-weight: 800;
  cursor: pointer;

  border: 1px solid #48bfff;

  background: linear-gradient(
    180deg,
    #b6f2ff,
    #48c9ff 45%,
    #1486ed
  );

  box-shadow:
    0 4px 0 #07539a,
    0 9px 17px rgba(0, 121, 255, .23),
    inset 0 1px 0 rgba(255, 255, 255, .78);
}

#sendButton:active {
  transform: translateY(2px);
}

#sendButton:disabled {
  opacity: .55;
  cursor: wait;
}

.interface-footer {
  flex: 0 0 auto;
  padding: 0 12px 11px;
  color: #75a1bf;
  font-size: 8px;
  text-align: center;
  letter-spacing: .15em;
}

/* =========================================================
   SCROLLBARS
   ========================================================= */

::-webkit-scrollbar {
  width: 5px;
  height: 5px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(64, 160, 220, .32);
  border-radius: 10px;
}

/* =========================================================
   ANIMACIONES
   ========================================================= */

@keyframes ero-reactor-rotation {
  from { rotate: 0deg; }
  to { rotate: 360deg; }
}

@keyframes ero-core-orbit {
  to { transform: rotate(338deg); }
}

@keyframes ero-core-pulse {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(0, 174, 255, .28),
      0 0 58px rgba(0, 108, 255, .12),
      inset 0 0 26px rgba(50, 191, 255, .16);
  }

  50% {
    box-shadow:
      0 0 30px rgba(0, 205, 255, .48),
      0 0 78px rgba(0, 108, 255, .24),
      inset 0 0 34px rgba(50, 191, 255, .29);
  }
}

@keyframes ero-dots {
  from { width: 0; }
  to { width: 16px; }
}

@keyframes ero-message-in {
  from {
    opacity: 0;
    transform: translateY(7px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes ero-atmosphere {
  from { opacity: .72; }
  to { opacity: 1; }
}

@keyframes ero-background-drift {
  0%, 100% { background-position: 48% 48%; }
  50% { background-position: 52% 52%; }
}

/* =========================================================
   TABLETS
   ========================================================= */

@media (max-width: 850px) and (min-width: 601px) {
  #appScreen header {
    height: 66px;
    padding: 0 15px;
    gap: 10px;
  }

  .mark {
    width: 37px;
    height: 37px;
  }

  .brand {
    gap: 9px;
  }

  .brand b {
    font-size: 15px;
  }

  .brand small {
    font-size: 8px;
    letter-spacing: .10em;
  }

  #appScreen main {
    height: calc(100% - 66px);
    padding: 13px;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 12px;
  }

  #appScreen aside {
    padding: 11px;
  }

  .online {
    font-size: 9px;
    letter-spacing: .08em;
  }

  #currentUser {
    max-width: 100px;
  }

  .welcome {
    padding: 22px 16px;
  }

  .big {
    width: 108px;
    height: 108px;
    font-size: 45px;
    margin-bottom: 22px;
  }

  .examples {
    grid-template-columns: 1fr;
    max-width: 420px;
  }

  .examples button {
    min-height: 43px;
    padding: 10px 12px;
  }

  .composer {
    width: calc(100% - 24px);
  }
}

/* =========================================================
   IPHONE Y MÓVILES
   ========================================================= */

@media (max-width: 600px) {
  body {
    background-position: center center;
    background-size: cover;
    background-attachment: scroll;
  }

  #appScreen {
    height: 100vh;
    height: 100dvh;
    height: 100svh;
    min-height: 0;
    overflow: hidden;
  }

  #appScreen header {
    height: calc(60px + env(safe-area-inset-top));
    flex-shrink: 0;

    padding:
      env(safe-area-inset-top)
      12px
      0;

    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
  }

  .brand {
    gap: 8px;
  }

  .mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    font-size: 19px;
  }

  .brand b {
    font-size: 14px;
    letter-spacing: .12em;
  }

  .brand small {
    margin-top: 3px;
    font-size: 7px;
    letter-spacing: .08em;
  }

  .online {
    display: none;
  }

  .account-area {
    gap: 7px;
  }

  #currentUser {
    max-width: 75px;
    font-size: 11.5px;
  }

  #logoutButton {
    padding: 8px 9px;
    font-size: 12.5px;
  }

  #appScreen main {
    width: 100%;
    height: auto;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    padding: 0;

    display: flex;
    flex-direction: column;
    gap: 0;
  }

  #appScreen aside {
    display: none;
  }

  .chat {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    width: 100%;
    border: 0;
    border-radius: 0;
    background: rgba(2, 9, 19, .18);
    box-shadow: none;
  }

  .welcome {
    padding:
      max(18px, env(safe-area-inset-top))
      18px
      20px;
  }

  .welcome::before {
    width: min(115vw, 440px);
    opacity: .35;
  }

  .big {
    width: clamp(78px, 23vw, 96px);
    height: clamp(78px, 23vw, 96px);
    font-size: clamp(34px, 10vw, 41px);
    margin-bottom: 20px;
  }

  .big::before {
    inset: -9px;
  }

  .big::after {
    inset: -16px;
  }

  .system-label {
    font-size: 8px;
    letter-spacing: .15em;
  }

  .welcome h1 {
    max-width: 100%;
    font-size: clamp(22px, 6.5vw, 29px);
    line-height: 1.22;
  }

  .welcome p {
    max-width: 340px;
    margin: 11px auto 18px;
    font-size: 13px;
    line-height: 1.6;
  }

  .examples {
    width: 100%;
    max-width: 380px;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .examples button {
    min-height: 42px;
    padding: 10px 12px;
    font-size: 12.5px;
  }

  .messages {
    padding: 18px 12px 14px;
  }

  .msg {
    gap: 8px;
    margin-bottom: 15px;
  }

  .avatar {
    flex-basis: 28px;
    width: 28px;
    height: 28px;
    border-radius: 9px;
  }

  .bubble {
    max-width: calc(100% - 36px);
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.6;
  }

  .composer {
    width: calc(100% - 20px);
    max-width: 900px;
    margin: 0 auto 7px;
    padding: 7px 8px 7px 12px;
    gap: 8px;
    border-radius: 14px;
  }

  .composer textarea {
    min-height: 40px;
    max-height: 112px;
    font-size: 16px;
  }

  #sendButton {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
  }

  .interface-footer {
    padding:
      0 8px
      max(9px, env(safe-area-inset-bottom));
    font-size: 7px;
    letter-spacing: .10em;
  }
}

/* Móviles estrechos */

@media (max-width: 360px) {
  #currentUser {
    display: none;
  }

  .brand b {
    font-size: 13px;
  }

  .welcome {
    padding-left: 14px;
    padding-right: 14px;
  }

  .welcome h1 {
    font-size: 22px;
  }

  .system-label {
    letter-spacing: .10em;
  }

  .composer {
    width: calc(100% - 14px);
  }
}

/* Pantallas de poca altura */

@media (max-height: 700px) {
  .welcome {
    padding-top: 14px;
    padding-bottom: 14px;
  }

  .big {
    width: 76px;
    height: 76px;
    font-size: 33px;
    margin-bottom: 15px;
  }

  .welcome p {
    margin-top: 8px;
    margin-bottom: 12px;
  }

  .examples {
    gap: 6px;
  }

  .examples button {
    min-height: 38px;
    padding: 8px 10px;
  }
}

/* Reducir movimiento si el usuario lo prefiere.
   El fondo animado (anillos, partículas, núcleo €, brillo) NO se para aquí:
   muchas tablets activan "reducir movimiento" con el ahorro de batería y el
   fondo se quedaba quieto. Solo se para con el Modo ligero de Mi cuenta. */

@media (prefers-reduced-motion: reduce) {
  *:not(.hud, .hud *, .big, .big *, .online span, #hudStatus, .auth-logo),
  *:not(body, .welcome, .big, header, .hud *)::before,
  *:not(body, .welcome, .big, header, .hud *)::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
/* €ERO — AJUSTE DE LA CAJA DE TEXTO EN IPHONE */

@media (max-width: 600px) {
  #appScreen main {
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  #appScreen .chat {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
  }

  #appScreen .messages,
  #appScreen .welcome {
    flex: 1 1 auto;
    min-height: 0;
  }

  #appScreen .composer {
    flex: 0 0 auto;
    margin-top: auto;
    margin-bottom: 7px;
  }
}
/* =========================================================
   FASE 1: RESPUESTAS EN TIEMPO REAL, HERRAMIENTAS Y FUENTES
   ========================================================= */

.msg-body {
  flex: 1 1 auto;
  min-width: 0;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.msg.user .msg-body {
  align-items: flex-end;
}

.msg-body .bubble {
  max-width: min(86%, 690px);
}

.bubble strong {
  color: #f2fbff;
  font-weight: 700;
}

.bubble code {
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(80, 228, 255, .10);
  font-size: 13px;
}

.bubble a {
  color: var(--cyan);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Mientras se escribe la respuesta, el texto ya no es "pensando". */
.thinking.streaming .bubble {
  color: #dcebf8;
}

.tool-status {
  max-width: min(86%, 690px);
  padding: 4px 10px;

  border-radius: 999px;
  border: 1px solid rgba(80, 228, 255, .28);
  background: rgba(80, 228, 255, .07);

  color: #8fdcf5;
  font-size: 13px;
  animation: ero-tool-pulse 1.6s ease-in-out infinite;
}

@keyframes ero-tool-pulse {
  50% { opacity: .55; }
}

.sources {
  max-width: min(86%, 690px);

  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.sources-title {
  color: var(--faint);
  font-size: 12.5px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.source {
  max-width: 240px;
  padding: 4px 9px 4px 5px;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(3, 17, 32, .80);

  color: #b9e6f7;
  font-size: 13px;
  text-decoration: none;
}

.source:hover {
  border-color: var(--line-strong);
  color: var(--cyan-bright);
}

.source-n {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;

  display: grid;
  place-items: center;

  border-radius: 50%;
  background: rgba(80, 228, 255, .16);
  color: var(--cyan);
  font-size: 11.5px;
  font-weight: 700;
}

@media (max-width: 600px) {
  .msg-body .bubble,
  .tool-status,
  .sources {
    max-width: 100%;
  }

  .source {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tool-status {
    animation: none;
  }
}

/* =========================================================
   AVISOS Y ERRORES
   ========================================================= */

.ai-notice {
  max-width: 560px;
  margin: 0 auto 18px;
  padding: 10px 14px;

  border-radius: 12px;
  border: 1px solid rgba(255, 196, 87, .45);
  background: rgba(60, 40, 5, .55);

  color: #ffe2a8;
  font-size: 13.5px;
  line-height: 1.5;
  text-align: left;
}

.error-bubble {
  border-color: rgba(255, 140, 120, .45);
  color: #ffd9d2;
}

/* =========================================================
   TIENDA: BARRA, VENTANA, FORMULARIOS, TABLAS Y BOTONES
   ========================================================= */

.store-bar {
  flex: 0 0 auto;
  width: calc(100% - 42px);
  max-width: 900px;
  margin: 0 auto 8px;

  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.store-bar button,
.msg-actions button,
.link-button,
.secondary {
  padding: 6px 11px;

  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 37, .88);

  color: #bfe9f8;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.store-bar button:hover,
.msg-actions button:hover,
.link-button:hover,
.secondary:hover {
  border-color: var(--line-strong);
  color: var(--cyan-bright);
}

.store-bar button:disabled,
.msg-actions button:disabled {
  opacity: .5;
  cursor: default;
}

.msg-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.msg-actions button {
  padding: 4px 10px;
  font-size: 12.5px;
}

/* Tablas y bloques de código dentro de las respuestas */

.bubble .table-wrap {
  max-width: 100%;
  overflow-x: auto;
  margin: 6px 0;
  white-space: normal;
}

.bubble table {
  border-collapse: collapse;
  font-size: 13px;
  line-height: 1.45;
}

.bubble th,
.bubble td {
  padding: 5px 9px;
  border: 1px solid rgba(80, 200, 255, .22);
  text-align: left;
  vertical-align: top;
}

.bubble th {
  background: rgba(80, 228, 255, .08);
  color: #e6f8ff;
}

.bubble .code-block {
  max-width: 100%;
  overflow-x: auto;
  margin: 6px 0;
  padding: 9px 11px;

  border-radius: 9px;
  background: rgba(0, 0, 0, .35);
  border: 1px solid rgba(80, 200, 255, .18);

  font-size: 13px;
  line-height: 1.5;
  white-space: pre;
}

.bubble .code-block code {
  padding: 0;
  background: none;
}

/* Ventana */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 50;

  display: grid;
  /* Una columna del ancho disponible: así "width: min(760px, 100%)" del
     modal se calcula sobre la pantalla y nunca se sale por la derecha. */
  grid-template-columns: minmax(0, 1fr);
  place-items: center;
  padding: 16px;

  background: rgba(1, 5, 12, .72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: min(760px, 100%);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);

  display: flex;
  flex-direction: column;

  border-radius: 16px;
  border: 1px solid var(--line);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
  color: var(--text);
}

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

.modal-head h2 {
  margin: 0;
  font-size: 15px;
}

.modal-close {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.modal-body {
  overflow-y: auto;
  padding: 16px 18px 20px;
}

.modal-intro {
  margin: 0 0 12px;
  color: #b6cfe2;
  font-size: 13.5px;
  line-height: 1.55;
}

.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.tool-card {
  padding: 12px;

  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;

  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 22, 40, .9);

  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--line-strong);
  background: rgba(10, 34, 58, .95);
}

.tool-icon {
  font-size: 20px;
}

.tool-card b {
  font-size: 13px;
}

.tool-card small {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.tool-tag {
  margin-top: 2px;
  color: #ffd08a;
  font-size: 12px;
  font-style: normal;
}

/* Formularios */

.store-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.store-form label {
  margin-top: 6px;
  color: #cfe9f6;
  font-size: 13px;
}

.store-form input,
.store-form textarea,
.store-form select {
  width: 100%;
  padding: 9px 11px;

  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(1, 8, 17, .75);

  color: var(--text);
  font: inherit;
  font-size: 13px;
}

.store-form textarea {
  resize: vertical;
}

.store-form input:focus,
.store-form textarea:focus,
.store-form select:focus {
  outline: none;
  border-color: var(--line-strong);
}

.primary,
.button-link {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 16px;

  border: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, #3fd4ff, #168dff);

  color: #021222;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.primary:disabled {
  opacity: .55;
  cursor: wait;
}

.link-button {
  margin-bottom: 12px;
}

.form-message {
  min-height: 0;
  font-size: 13px;
  line-height: 1.5;
}

.form-message.error { color: #ffb4a6; }
.form-message.ok { color: #9ff0c3; }
.form-message.info { color: #9fdcf2; }

.image-results {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
}

.image-results img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  transform: translateX(-50%);

  max-width: calc(100% - 32px);
  padding: 10px 16px;

  border-radius: 10px;
  border: 1px solid var(--line-strong);
  background: var(--panel-strong);
  box-shadow: var(--shadow);

  color: var(--text);
  font-size: 13.5px;
}

@media (max-width: 600px) {
  .store-bar {
    width: calc(100% - 20px);
  }

  .modal-body {
    padding: 14px;
  }

  .tool-grid {
    grid-template-columns: 1fr;
  }
}

/* Las cifras de las tablas no se parten en dos líneas. */
.bubble th,
.bubble td {
  overflow-wrap: normal;
  word-break: normal;
}

.bubble td:last-child {
  white-space: nowrap;
}

/* En el móvil, la barra de tienda en una sola línea que se desliza. */
@media (max-width: 600px) {
  .store-bar {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .store-bar::-webkit-scrollbar {
    display: none;
  }

  .store-bar button {
    flex: 0 0 auto;
    white-space: nowrap;
  }
}

/* =========================================================
   FASE 2: MEMORIA Y MI CUENTA
   ========================================================= */

#openAccount {
  flex: 0 0 auto;
  padding: 9px 13px;
  color: #b7d9f2;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(10, 28, 47, .85);
  cursor: pointer;
  font-size: 13px;
  box-shadow: 0 3px 0 rgba(0, 0, 0, .35);
}

#openAccount:active {
  transform: translateY(2px);
}

.modal-section {
  margin: 20px 0 8px;
  color: #e6f8ff;
  font-size: 13px;
}

.modal-section:first-child {
  margin-top: 0;
}

.danger-title {
  color: #ffb4a6;
}

.danger {
  display: inline-block;
  margin-top: 10px;
  padding: 10px 16px;

  border: 1px solid rgba(255, 120, 100, .6);
  border-radius: 10px;
  background: rgba(120, 20, 10, .55);

  color: #ffe1db;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.memory-count {
  margin-top: 16px;
}

.memory-list {
  margin: 0;
  padding: 0;
  list-style: none;

  display: flex;
  flex-direction: column;
  gap: 8px;
}

.memory-item {
  padding: 10px 12px;

  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;

  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(6, 22, 40, .9);
}

.memory-text {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.memory-meta {
  grid-column: 1;
  color: var(--faint);
  font-size: 12.5px;
}

.memory-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: center;

  display: flex;
  gap: 6px;
}

.memory-actions .link-button {
  margin: 0;
}

@media (max-width: 600px) {
  #openAccount {
    padding: 8px 9px;
    font-size: 12.5px;
  }

  .memory-item {
    grid-template-columns: 1fr;
  }

  .memory-actions {
    grid-column: 1;
    grid-row: auto;
  }
}

/* =========================================================
   FASE 3: TARJETAS DE ACCIÓN, DOCUMENTOS Y ACTIVIDAD
   ========================================================= */

.attachments,
.live-attachments {
  width: 100%;
  max-width: min(86%, 690px);

  display: flex;
  flex-direction: column;
  gap: 8px;
}

.action-card {
  padding: 11px 13px;

  border-radius: 12px;
  border: 1px solid rgba(255, 196, 87, .45);
  background: rgba(40, 30, 6, .55);
}

.action-card.status-done {
  border-color: rgba(110, 230, 160, .45);
  background: rgba(6, 40, 24, .55);
}

.action-card.status-failed {
  border-color: rgba(255, 140, 120, .5);
  background: rgba(50, 12, 8, .55);
}

.action-card.status-rejected,
.action-card.status-cancelled,
.action-card.status-expired {
  opacity: .65;
  border-color: var(--line);
  background: rgba(6, 22, 40, .7);
}

.action-card.status-running {
  border-color: var(--line-strong);
  animation: ero-tool-pulse 1.6s ease-in-out infinite;
}

.action-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 6px;
}

.action-type {
  color: #f2fbff;
  font-size: 13.5px;
  font-weight: 700;
}

.action-status {
  color: #cfe0ee;
  font-size: 13px;
}

.action-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  padding: 2px 0;
  font-size: 13px;
}

.action-row span {
  color: var(--muted);
}

.action-row b {
  color: #e6f3fb;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.action-result {
  margin-top: 6px;
  color: #b8f0cf;
  font-size: 13px;
}

.action-result.error {
  color: #ffc2b6;
}

.action-result a {
  color: var(--cyan);
}

.action-buttons {
  margin-top: 9px;
  display: flex;
  gap: 8px;
}

.action-buttons button,
.approve-all,
.doc-download {
  padding: 7px 14px;
  border-radius: 9px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.action-buttons .approve,
.approve-all {
  border: 0;
  background: linear-gradient(145deg, #5df0a3, #16b86a);
  color: #02170c;
}

.action-buttons .reject {
  border: 1px solid var(--line);
  background: rgba(10, 28, 47, .85);
  color: #cfe0ee;
}

.approve-all {
  align-self: flex-start;
}

.doc-download {
  align-self: flex-start;
  border: 1px solid var(--line-strong);
  background: rgba(10, 34, 58, .95);
  color: var(--cyan-bright);
}

.action-buttons button:disabled,
.approve-all:disabled,
.doc-download:disabled {
  opacity: .5;
  cursor: wait;
}

.activity-item {
  margin-bottom: 10px;
}

.activity-meta {
  margin-bottom: 4px;
  color: var(--faint);
  font-size: 12.5px;
}

@media (max-width: 600px) {
  .attachments,
  .live-attachments {
    max-width: 100%;
  }

  .action-row {
    grid-template-columns: 1fr;
    gap: 0;
  }
}

/* =========================================================
   K3: BIBLIOTECA DE CONOCIMIENTO
========================================================= */

.k-optional {
  color: var(--faint);
  font-weight: normal;
}

.memory-meta a {
  color: inherit;
  text-decoration: underline;
}

.k-result .memory-meta {
  white-space: pre-line;
  font-size: 13px;
}

#kResults {
  margin-top: 10px;
}

/* =========================================================
   BLOQUE 1: PLANES DE TRABAJO Y FICHA DEL PROYECTO
   ========================================================= */

.plan-card,
.plan-card.status-active {
  border-color: var(--line-strong);
  background: rgba(6, 26, 46, .7);
}

.plan-steps {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.plan-step {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 6px;
  font-size: 13.5px;
  color: #e6f3fb;
}

.plan-step small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.plan-step .plan-step-result {
  color: #b8f0cf;
  overflow-wrap: anywhere;
}

.plan-step.step-failed .plan-step-result {
  color: #ffc2b6;
}

.plan-step.step-done b,
.plan-step.step-skipped b {
  opacity: .75;
}

.plan-step.step-running .plan-step-icon {
  animation: ero-tool-pulse 1.6s ease-in-out infinite;
}

.brief-form fieldset {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  margin: 0;
}

.brief-form legend {
  padding: 0 4px;
  color: var(--muted);
  font-size: 13px;
}

.brief-decisions {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 6px;
}

.brief-decision {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 6px;
  align-items: center;
}

.brief-decision input[type="text"] {
  min-width: 0;
}

.brief-add,
.brief-remove {
  padding: 5px 10px;
  border-radius: 8px;
  font-size: 13px;
}

/* =========================================================
   BLOQUE E: VÍDEOS
   ========================================================= */

.videos-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.video-item small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.video-player video {
  width: 100%;
  max-height: 60vh;
  margin-top: 8px;
  border-radius: 10px;
  background: #000;
}

/* =========================================================
   AUTOMATIZACIONES
   ========================================================= */

.automations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.automation-buttons {
  flex-wrap: wrap;
}

.automation-runs ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 13px;
  color: var(--muted);
}

.automation-runs small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
}

/* =========================================================
   GALERÍA DE IMÁGENES
   ========================================================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.gallery-item {
  margin: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(6, 22, 40, .7);
}

.gallery-thumb {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: rgba(0, 0, 0, .3);
  color: var(--muted);
  font-size: 13px;
}

.gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gallery-item figcaption {
  margin-top: 6px;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.gallery-item small {
  display: block;
  color: var(--muted);
}

/* =========================================================
   PANEL DE INTEGRACIONES
   ========================================================= */

.integrations-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 10px;
}

.integration-help {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.integration-token {
  width: 100%;
}

/* Botón de enviar convertido en "Detener" mientras €ERO responde. */
#sendButton.stop {
  background: rgba(255, 120, 100, .18);
  border-color: rgba(255, 140, 120, .6);
  color: #ffd2c8;
  font-size: 14px;
}

/* =========================================================
   AYUDA
   ========================================================= */

.manual {
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 22, 40, .6);
  font-size: 13px;
  line-height: 1.5;
}

.manual summary {
  cursor: pointer;
  font-weight: 700;
  color: #f2fbff;
}

.manual summary:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.manual p,
.manual ol,
.manual ul {
  margin: 6px 0;
}

.manual ol,
.manual ul {
  padding-left: 20px;
}

.manual-flag {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 6px;
  background: rgba(255, 196, 87, .18);
  color: #ffd98a;
  font-size: 12.5px;
  font-weight: 600;
}

.manual-note {
  color: #ffd98a;
}

/* Manual completo (❓ Ayuda → 📖 Manual de €ERO) */
.manual.guide {
  border-color: var(--line-strong);
  background: rgba(8, 34, 60, .72);
}

.guide-flag {
  background: rgba(80, 228, 255, .16);
  color: var(--cyan-bright);
}

.guide-section {
  margin-top: 6px;
  padding: 6px 10px;
  border-left: 2px solid var(--line);
}

.guide-section summary {
  font-weight: 600;
  color: var(--cyan-bright);
}

.guide-section[open] {
  border-left-color: var(--cyan);
}

/* =========================================================
   BUZÓN DE CLIENTES (📥)
   ========================================================= */

.mailbox-history {
  margin: 6px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 6px;
}

.mailbox-history li {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(6, 22, 40, .6);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.mailbox-history small {
  color: var(--muted);
}

.mailbox-action {
  font-size: 13px;
  color: var(--cyan-bright);
}

#mailboxCheckResult {
  margin-top: 10px;
}

#mb_custom[hidden] {
  display: none;
}

/* =========================================================
   AUDITORÍA · MÓVIL: PANEL DE PROYECTOS (☰), OPCIONES DE
   PROYECTO Y CAMPOS SIN ZOOM EN IPHONE
   ========================================================= */

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  padding: 0;
  place-items: center;

  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(6, 22, 40, .7);
  color: var(--cyan-bright);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
}

.menu-button:focus-visible,
.item:focus-visible,
.item-more:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

.item-icon {
  flex: 0 0 auto;
}

.item-name {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.item-more {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;

  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;

  opacity: .55;
}

.item:hover .item-more,
.item.active .item-more,
.item-more:focus-visible {
  opacity: 1;
}

.item-more:hover {
  background: rgba(69, 190, 255, .14);
  color: var(--text);
}

.projects-empty {
  margin: 4px 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.drawer-backdrop {
  display: none;
}

@media (max-width: 600px) {
  #appScreen header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .menu-button {
    display: grid;
  }

  /* El panel de proyectos se abre por encima del chat. */
  body.drawer-open #appScreen aside {
    display: flex;
    position: fixed;
    z-index: 60;
    top: calc(60px + env(safe-area-inset-top));
    bottom: 0;
    left: 0;
    width: min(86vw, 320px);
    padding-bottom: max(15px, env(safe-area-inset-bottom));

    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: 0;
    background: var(--panel-strong);

    animation: ero-drawer-in .18s ease-out;
  }

  body.drawer-open .drawer-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    z-index: 59;
    inset: calc(60px + env(safe-area-inset-top)) 0 0 0;
    background: rgba(0, 4, 10, .55);
  }

  #projects .item {
    min-height: 46px;
    font-size: 14px;
  }

  .item-more {
    width: 36px;
    height: 36px;
    opacity: 1;
  }

  /* El iPhone amplía la página al tocar un campo con letra < 16 px. */
  .store-form input,
  .store-form textarea,
  .store-form select,
  .brief-decision input[type="text"] {
    font-size: 16px;
  }
}

/*
 * Tablet en vertical (601–850 px): la columna de proyectos dejaba el chat
 * estrecho y cortaba los textos ("Buscar en mis conve…", "Dame 3 ide…").
 * Como en el móvil, los proyectos se abren con ☰ por encima del chat.
 */
@media (max-width: 850px) and (min-width: 601px) {
  #appScreen header {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .menu-button {
    display: grid;
  }

  #appScreen header .online {
    display: none;
  }

  #appScreen main {
    grid-template-columns: minmax(0, 1fr);
  }

  #appScreen aside {
    display: none;
  }

  body.drawer-open #appScreen aside {
    display: flex;
    position: fixed;
    z-index: 60;
    top: 66px;
    bottom: 0;
    left: 0;
    width: 340px;
    padding-bottom: max(15px, env(safe-area-inset-bottom));

    border-radius: 0 var(--radius) var(--radius) 0;
    border-left: 0;
    background: var(--panel-strong);

    animation: ero-drawer-in .18s ease-out;
  }

  body.drawer-open .drawer-backdrop:not([hidden]) {
    display: block;
    position: fixed;
    z-index: 59;
    inset: 66px 0 0 0;
    background: rgba(0, 4, 10, .55);
  }

  #projects .item {
    min-height: 46px;
    font-size: 14px;
  }

  .item-more {
    width: 36px;
    height: 36px;
    opacity: 1;
  }

  #currentUser {
    max-width: 140px;
  }
}

@keyframes ero-drawer-in {
  from { transform: translateX(-100%); }
  to { transform: translateX(0); }
}

@media (prefers-reduced-motion: reduce) {
  body.drawer-open #appScreen aside {
    animation: none;
  }
}

/* Listas y títulos en las respuestas de €ERO. */
.bubble .md-list {
  margin: 4px 0 6px;
  padding-left: 22px;
  white-space: normal;
}

.bubble .md-list li {
  margin: 2px 0;
}

.bubble .md-list li::marker {
  color: var(--cyan);
}

.bubble .md-heading {
  display: inline-block;
  margin-top: 4px;
  color: var(--cyan-bright);
  font-size: 1.04em;
}

/* =========================================================
   HUD HOLOGRÁFICO
   Capa animada sobre el fondo (index.html → .hud, hud.js).
   Solo se anima transform y opacity (fluido también en móvil).
   Se anima siempre; solo se para con el Modo ligero de Mi cuenta.
   ========================================================= */

:root {
  --hud: 80, 228, 255;          /* cian en RGB para las transparencias */
  --hud-blue: 22, 141, 255;
  --glow: 0 0 12px rgba(var(--hud), .55), 0 0 32px rgba(var(--hud-blue), .25);
}

/* El fondo fotográfico pasa a segundo plano: la capa viva manda. */
body {
  background-image:
    radial-gradient(ellipse at 50% 50%, rgba(1, 8, 20, .50) 0%, rgba(1, 6, 16, .80) 70%, rgba(0, 3, 10, .94) 100%),
    url("/fondo.jpg");
  background-image:
    radial-gradient(ellipse at 50% 50%, rgba(1, 8, 20, .50) 0%, rgba(1, 6, 16, .80) 70%, rgba(0, 3, 10, .94) 100%),
    image-set(url("/fondo.webp") type("image/webp"), url("/fondo.jpg") type("image/jpeg"));
}

.hud {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* ---- Anillos ---- */

.hud-rings {
  position: absolute;
  left: 50%;
  top: 52%;
  width: min(118vmin, 1100px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  opacity: .85;
  transition: opacity .6s ease;
}

.ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: rgb(var(--hud));
  stroke-width: 1.4;
  filter: drop-shadow(0 0 6px rgba(var(--hud), .55));
  will-change: transform;
}

.ring-ticks { opacity: .55; animation: hud-spin 140s linear infinite; }
.ring-arcs  { opacity: .75; animation: hud-spin 70s linear infinite reverse; }
.ring-thick { opacity: .35; stroke: rgb(var(--hud-blue)); animation: hud-spin 45s linear infinite; }
.ring-dash  { opacity: .7;  animation: hud-spin 30s linear infinite reverse; }
.ring-core  { opacity: .55; animation: hud-spin 90s linear infinite; }

/* Barrido de radar */
.hud-sweep {
  position: absolute;
  inset: 4%;
  border-radius: 50%;
  background: conic-gradient(from 0deg, rgba(var(--hud), .22), rgba(var(--hud), .05) 10%, transparent 18%, transparent);
  mask-image: radial-gradient(circle, transparent 18%, #000 19%, #000 70%, transparent 71%);
  -webkit-mask-image: radial-gradient(circle, transparent 18%, #000 19%, #000 70%, transparent 71%);
  opacity: .5;
  animation: hud-spin 9s linear infinite;
  will-change: transform;
}

/* ---- Rejilla en perspectiva (suelo holográfico) ---- */

.hud-grid {
  position: absolute;
  left: -50%;
  right: -50%;
  bottom: -8%;
  height: 52%;
  background-image:
    linear-gradient(rgba(var(--hud), .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--hud), .22) 1px, transparent 1px);
  background-size: 64px 64px;
  transform: perspective(520px) rotateX(64deg);
  transform-origin: 50% 100%;
  mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 85%);
  -webkit-mask-image: linear-gradient(to top, #000 0%, rgba(0, 0, 0, .55) 45%, transparent 85%);
  opacity: .5;
  animation: hud-grid-move 6s linear infinite;
}

/* ---- Partículas ---- */

/* La capa mide el doble de la pantalla y sube exactamente media capa (una
   pantalla), que es un número entero de baldosas del dibujo: el bucle no da
   saltos y la parte de abajo nunca se queda sin partículas. */
.hud-particles {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 200%;
  background-image:
    radial-gradient(2px 2px at 12% 22%, rgba(var(--hud), .9), transparent 60%),
    radial-gradient(1.5px 1.5px at 28% 68%, rgba(var(--hud), .7), transparent 60%),
    radial-gradient(2px 2px at 44% 12%, rgba(var(--hud), .8), transparent 60%),
    radial-gradient(1.5px 1.5px at 63% 48%, rgba(var(--hud), .7), transparent 60%),
    radial-gradient(2px 2px at 78% 82%, rgba(var(--hud), .9), transparent 60%),
    radial-gradient(1.5px 1.5px at 90% 30%, rgba(var(--hud), .7), transparent 60%),
    radial-gradient(1.5px 1.5px at 6% 90%, rgba(var(--hud), .6), transparent 60%),
    radial-gradient(2px 2px at 55% 95%, rgba(var(--hud), .8), transparent 60%);
  background-size: 100% 50%;   /* baldosa = 1 pantalla */
  opacity: .7;
  animation: hud-rise 46s linear infinite;
  will-change: transform;
}

.hud-particles-2 {
  background-size: 70% 25%;    /* baldosa = media pantalla */
  opacity: .45;
  animation-duration: 72s;
}

/* ---- Línea de escaneo ---- */

.hud-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 140px;
  background: linear-gradient(to bottom, transparent, rgba(var(--hud), .03) 75%, rgba(var(--hud), .22) 99.4%, transparent);
  opacity: .8;
  animation: hud-scan 7.5s cubic-bezier(.45, 0, .55, 1) infinite;
  will-change: transform;
}

/* ---- Lecturas reales en la cabecera (hora del dispositivo y estado) ---- */

.online {
  display: flex;
  align-items: center;
  gap: 0;
}

.hud-readout {
  display: inline-flex;
  gap: 14px;
  margin-left: 14px;
  padding-left: 14px;
  border-left: 1px solid rgba(var(--hud), .3);
  font: 600 10px/1 ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-style: normal;
  letter-spacing: .2em;
  color: rgba(var(--hud), .85);
  text-shadow: 0 0 8px rgba(var(--hud), .6);
}

.hud-readout b { font-weight: 600; }

/* ---- €ERO trabajando: todo se ilumina ---- */

body.ero-busy .hud-rings { opacity: 1; }
body.ero-busy .hud-sweep { opacity: .9; }
body.ero-busy #hudStatus { color: #d6fbff; animation: hud-blink 1.1s ease-in-out infinite; }
body.ero-busy .mark { box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .12); }

/* =========================================================
   HUD · PANELES, CABECERA, NÚCLEO Y MENSAJES
   ========================================================= */

/* Cabecera: cristal con línea de energía que la recorre */
#appScreen header {
  background: linear-gradient(180deg, rgba(3, 12, 26, .78), rgba(2, 9, 19, .58));
  border-bottom-color: rgba(var(--hud), .28);
}

#appScreen header::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--hud), .95), transparent);
  background-size: 35% 100%;
  background-repeat: no-repeat;
  animation: hud-glint 6s ease-in-out infinite;
  pointer-events: none;
}

.mark {
  text-shadow: 0 0 12px rgba(var(--hud), .9);
  transition: box-shadow .4s ease;
}

.brand b {
  text-shadow: 0 0 14px rgba(var(--hud), .45);
}

.online span {
  animation: hud-blink 2.4s ease-in-out infinite;
}

/* Paneles con esquinas de visor */
.chat,
#appScreen aside {
  --c: rgba(var(--hud), .9);
  background-image:
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c)),
    linear-gradient(var(--c), var(--c)), linear-gradient(var(--c), var(--c));
  background-repeat: no-repeat;
  background-size:
    22px 2px, 2px 22px,
    22px 2px, 2px 22px,
    22px 2px, 2px 22px,
    22px 2px, 2px 22px;
  background-position:
    10px 10px, 10px 10px,
    calc(100% - 10px) 10px, calc(100% - 10px) 10px,
    10px calc(100% - 10px), 10px calc(100% - 10px),
    calc(100% - 10px) calc(100% - 10px), calc(100% - 10px) calc(100% - 10px);
}

.chat {
  background-color: rgba(2, 10, 24, .22);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: rgba(var(--hud), .34);
  box-shadow: var(--shadow), inset 0 0 60px rgba(var(--hud-blue), .06), 0 0 30px rgba(var(--hud-blue), .06);
}

.chat::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(var(--hud), .9), transparent);
  opacity: .7;
  pointer-events: none;
  z-index: 1;
}

#appScreen aside {
  background-color: rgba(3, 12, 26, .62);
}

/* Núcleo de la bienvenida: anillos propios alrededor del € */
.big .core-hud {
  position: absolute;
  inset: -46px;
  width: calc(100% + 92px);
  height: calc(100% + 92px);
  fill: none;
  stroke: rgb(var(--hud));
  pointer-events: none;
  filter: drop-shadow(0 0 5px rgba(var(--hud), .7));
}

.core-hud circle { transform-origin: 100px 100px; transform-box: view-box; }
.core-hud .c1 { stroke-width: 3;   opacity: .55; animation: hud-spin 40s linear infinite; }
.core-hud .c2 { stroke-width: 1.4; opacity: .9;  animation: hud-spin 14s linear infinite reverse; }
.core-hud .c3 { stroke-width: .8;  opacity: .6;  animation: hud-spin 22s linear infinite; }

.welcome .big {
  margin-top: 40px;
  margin-bottom: 52px;
}

body.ero-busy .big { animation-duration: 1.1s; }

.system-label {
  text-shadow: 0 0 14px rgba(var(--hud), .7);
}

.welcome h1 {
  text-shadow: 0 0 26px rgba(var(--hud-blue), .35);
}

.examples button {
  transition: border-color .25s ease, box-shadow .25s ease, transform .1s ease;
}

.examples button:hover,
.examples button:focus-visible {
  border-color: rgba(var(--hud), .75);
  box-shadow: 0 4px 0 rgba(0, 0, 0, .35), 0 0 18px rgba(var(--hud), .22);
}

/* Mensajes: €ERO con línea de energía y avatar encendido */
.msg.assistant .bubble {
  border-color: rgba(var(--hud), .32);
  box-shadow: 0 8px 22px rgba(0, 0, 0, .14), inset 2px 0 0 rgba(var(--hud), .75), -4px 0 18px -10px rgba(var(--hud), .9);
}

.msg.assistant .avatar {
  color: #d8fbff;
  border-color: rgba(var(--hud), .7);
  box-shadow: 0 0 14px rgba(var(--hud), .35);
  text-shadow: 0 0 10px rgba(var(--hud), .9);
}

/* Caja de texto: anillo de energía al escribir */
.composer {
  border-color: rgba(var(--hud), .36);
}

.composer:focus-within {
  border-color: rgba(var(--hud), .8);
  box-shadow:
    0 10px 34px rgba(0, 0, 0, .32),
    0 0 0 3px rgba(var(--hud), .08),
    0 0 26px rgba(var(--hud), .18);
}

#sendButton {
  transition: box-shadow .25s ease, filter .25s ease;
}

#sendButton:hover {
  filter: brightness(1.08);
  box-shadow:
    0 4px 0 #07539a,
    0 0 22px rgba(var(--hud), .55),
    inset 0 1px 0 rgba(255, 255, 255, .78);
}

body.ero-busy #sendButton {
  box-shadow:
    0 4px 0 #07539a,
    0 0 26px rgba(var(--hud), .7),
    inset 0 1px 0 rgba(255, 255, 255, .78);
}

.store-bar button:hover {
  border-color: rgba(var(--hud), .7);
  box-shadow: 0 0 14px rgba(var(--hud), .2);
}

/* Inicio de sesión: logo con anillo vivo */
.auth-box {
  border-color: rgba(var(--hud), .5);
  box-shadow:
    0 30px 90px rgba(0, 0, 0, .55),
    0 0 60px rgba(var(--hud-blue), .16),
    inset 0 1px 0 rgba(190, 235, 255, .10);
}

.auth-logo {
  box-shadow: var(--glow);
  animation: ero-core-pulse 4s ease-in-out infinite;
}

/* ---- Animaciones ---- */

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

@keyframes hud-grid-move {
  to { background-position: 0 64px, 0 0; }
}

@keyframes hud-rise {
  from { transform: translateY(0); }
  to   { transform: translateY(-50%); }
}

@keyframes hud-scan {
  0%   { transform: translateY(-160px); opacity: 0; }
  10%  { opacity: .8; }
  90%  { opacity: .8; }
  100% { transform: translateY(100vh); opacity: 0; }
}

@keyframes hud-glint {
  0%   { background-position: -40% 0; }
  60%, 100% { background-position: 140% 0; }
}

@keyframes hud-blink {
  0%, 100% { opacity: 1; }
  50%      { opacity: .35; }
}

/* ---- Móvil: menos capas y anillos alrededor del núcleo ---- */

@media (max-width: 600px) {
  .hud-rings { width: 150vmin; top: 46%; opacity: .5; }
  .hud-particles-2, .hud-scan { display: none; }
  .online { display: none; }
  /* La zona de chat ocupa toda la pantalla bajo la cabecera: la caja de
     texto queda siempre abajo, aunque haya pocos mensajes. */
  #appScreen main { height: calc(100% - 60px - env(safe-area-inset-top)); }
  .hud-grid { height: 38%; opacity: .35; background-size: 44px 44px; }
  .ring { filter: none; }
  .welcome .big { margin-top: 34px; margin-bottom: 46px; }
}

/* Pantallas medianas: sin hueco para la hora y el estado */
@media (max-width: 1100px) {
  .hud-readout { display: none; }
}

/* Escritorio: anillos centrados en el chat (a la derecha de los proyectos) */
@media (min-width: 901px) {
  .hud-rings { left: calc(50% + 134px); top: 54%; }
}

/* Texto legible sobre los anillos */
.welcome p,
.welcome h1,
.system-label {
  text-shadow: 0 1px 10px rgba(0, 4, 12, .95), 0 0 2px rgba(0, 4, 12, .9);
}

/* "€ERO está pensando…": los puntos ya no se parten en varias líneas
   y lleva un pequeño anillo girando */
.dots {
  white-space: nowrap;
  overflow-wrap: normal;
}

.thinking .bubble::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 9px;
  vertical-align: -1px;
  border-radius: 50%;
  border: 2px solid rgba(var(--hud), .25);
  border-top-color: rgb(var(--hud));
  box-shadow: 0 0 8px rgba(var(--hud), .5);
  animation: hud-spin .9s linear infinite;
}

/* El campo de invitación solo aparece cuando la app lo pide (atributo hidden) */
.auth-box input[hidden] {
  display: none;
}

/* =========================================================
   CAJA DE TEXTO: una línea centrada que crece al escribir
   (antes el texto salía pegado arriba de una caja alta)
   ========================================================= */

.composer {
  align-items: flex-end;
}

.composer textarea {
  box-sizing: border-box;
  min-height: 44px;
  max-height: 140px;
  padding: 11px 0;
  line-height: 22px;
  overflow-y: hidden;
}

#sendButton {
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .composer {
    padding: 6px 6px 6px 14px;
    border-radius: 16px;
  }

  .composer textarea {
    min-height: 44px;
    max-height: 132px;
    padding: 11px 0;
  }

  #sendButton {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
  }

}

/* El texto de ayuda nunca ocupa dos líneas */
.composer textarea::placeholder {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 600px) {
  /* Altura real visible (con el teclado abierto, la parte de encima) */
  #appScreen {
    height: var(--app-h, 100svh);
  }
}

/* ==================================================   FASE A: MENÚ ＋, ACCIONES DE LOS MENSAJES, PERFIL,
   BUSCADOR Y MODO LIGERO (experience.js)
   ========================================================= */

/* Botón ＋ dentro de la caja de texto */
.tools-button {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  margin-left: -6px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .9);
  color: var(--cyan-bright);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: transform .15s ease, border-color .15s ease;
}

.tools-button:hover,
.tools-button[aria-expanded="true"] {
  border-color: var(--line-strong);
}

.tools-button[aria-expanded="true"] {
  transform: rotate(45deg);
}

/* Menú de herramientas: tarjeta encima de la caja de texto */
.chat { position: relative; }

.tools-sheet {
  position: absolute;
  z-index: 30;
  /* Centrado con márgenes (no con transform): la animación de entrada usa
     transform y lo pisaba, y el menú se abría desplazado a la derecha. */
  left: 0;
  right: 0;
  margin: 0 auto;
  bottom: 86px;
  width: calc(100% - 42px);
  max-width: 900px;
  max-height: min(62vh, 520px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  padding: 14px;

  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;

  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: var(--shadow), 0 0 30px rgba(0, 133, 255, .10);
  animation: ero-message-in .18s ease-out both;
}

.tools-sheet[hidden] { display: none; }

.tools-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.tools-group span {
  padding: 0 4px 2px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.tools-group button {
  width: 100%;
  padding: 10px 12px;
  text-align: left;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 37, .88);
  color: #d6f2ff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  /* El nombre entero, en dos líneas si hace falta: con "…" parecía que había
     más a la derecha y no se podía desplazar para leerlo. */
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.25;
}

.tools-group button:hover,
.tools-group button:focus-visible {
  border-color: var(--line-strong);
  color: var(--cyan-bright);
  outline: none;
}

@media (max-width: 900px) {
  .tools-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .tools-sheet {
    width: calc(100% - 20px);
    bottom: 76px;
    max-height: 64vh;
    gap: 12px;
  }
  .tools-group button { padding: 11px 10px; font-size: 13.5px; }
}

/* Aviso de "editando tu último mensaje" */
.edit-banner {
  width: calc(100% - 42px);
  max-width: 900px;
  margin: 0 auto 6px;
  padding: 7px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 37, 62, .9);
  color: var(--cyan-bright);
  font-size: 13.5px;
}

.edit-banner[hidden] { display: none; }

.edit-banner button {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: #bfe9f8;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

@media (max-width: 600px) {
  .edit-banner { width: calc(100% - 20px); }
}

/* Acciones de los mensajes */
.msg-actions button.chosen {
  border-color: var(--line-strong);
  background: rgba(22, 141, 255, .22);
  opacity: 1;
}

.msg-actions.user-actions {
  justify-content: flex-end;
}

/* En el móvil, botones de acción con zona táctil cómoda */
@media (max-width: 600px) {
  .msg-actions button { padding: 6px 11px; font-size: 13px; }
}

/* ¿A qué te dedicas? */
.segment-picker {
  max-width: 620px;
  margin: 0 auto 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 20, 37, .82);
  text-align: center;
}

.segment-picker[hidden] { display: none; }

.segment-picker b {
  display: block;
  margin-bottom: 10px;
  color: var(--cyan-bright);
  font-size: 13.5px;
}

.segment-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.segment-options button {
  padding: 11px 10px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .9);
  color: #d6f2ff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.segment-options button:hover {
  border-color: var(--line-strong);
  color: var(--cyan-bright);
}

.examples .segment-change {
  opacity: .75;
  font-size: 13px;
}

/* Buscador de conversaciones */
.project-search {
  width: 100%;
  margin: 0 0 10px;
  padding: 9px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(3, 14, 28, .85);
  color: var(--text);
  font: inherit;
  font-size: 13px;
  outline: none;
}

.project-search:focus {
  border-color: var(--line-strong);
}

@media (max-width: 600px) {
  .project-search { font-size: 16px; }
}

/* Modo ligero: sin animaciones de fondo (batería y móviles modestos).
   La identidad holográfica se mantiene: anillos y rejilla quietos. */
body.lite .hud-particles,
body.lite .hud-scan,
body.lite .hud-sweep {
  display: none;
}

body.lite .ring,
body.lite .hud-grid,
body.lite .big .core-hud circle,
body.lite .online span,
body.lite::after,
body.lite .welcome::before,
body.lite .big,
body.lite .big::after,
body.lite .auth-logo {
  animation: none !important;
}

body.lite .bubble,
body.lite .modal,
body.lite .tools-sheet {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* =========================================================
   FASE B: ADJUNTOS, VOZ, MI DÍA Y AVISOS (jarvis.js)
   ========================================================= */

.tools-sheet {
  grid-template-columns: repeat(auto-fit, minmax(165px, 1fr));
}

@media (max-width: 600px) {
  .tools-sheet { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Bandeja de adjuntos encima de la caja de texto */
.attach-tray {
  width: calc(100% - 42px);
  max-width: 900px;
  margin: 0 auto 6px;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.attach-tray[hidden] { display: none; }

.attach-chip {
  flex: 0 0 auto;
  max-width: 220px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 5px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 37, .92);
  color: #d6f2ff;
  font-size: 13px;
}

.attach-chip img,
.attach-chip .attach-icon {
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  object-fit: cover;
  display: grid;
  place-items: center;
  font-size: 18px;
  background: rgba(8, 30, 52, .9);
}

.attach-chip.uploading { opacity: .7; }
.attach-chip.error { border-color: rgba(255, 110, 110, .6); color: #ffb4b4; }

.attach-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attach-remove {
  flex: 0 0 26px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: #bfe9f8;
  cursor: pointer;
}

@media (max-width: 600px) {
  .attach-tray { width: calc(100% - 20px); }
}

/* Fotos y PDF en los mensajes del usuario */
.msg-files {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  max-width: min(86%, 690px);
}

.msg-photo {
  width: 132px;
  height: 132px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .9);
}

.msg-file {
  padding: 7px 11px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(7, 37, 62, .93);
  color: #d6f2ff;
  font-size: 13px;
}

/* Micrófono */
.mic-button {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .9);
  font-size: 18px;
  cursor: pointer;
}

.mic-button[hidden] { display: none; }

.mic-button.listening {
  border-color: #ff6b6b;
  background: rgba(120, 20, 30, .55);
  animation: ero-mic 1.2s ease-in-out infinite;
}

@keyframes ero-mic {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, .45); }
  50% { box-shadow: 0 0 0 7px rgba(255, 107, 107, 0); }
}

/* Mi día */
.today {
  max-width: 680px;
  margin: 0 auto 18px;
  text-align: left;
}

.today[hidden] { display: none; }

.today-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin: 0 4px 8px;
}

.today-head b { color: var(--cyan-bright); font-size: 14px; }
.today-head span { color: var(--faint); font-size: 13px; text-transform: capitalize; }

.today-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.today-cards.in-modal { grid-template-columns: 1fr; margin-bottom: 12px; }

.today-card {
  min-width: 0;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 12px;
  text-align: left;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 37, .88);
  color: #d6f2ff;
  font: inherit;
  cursor: pointer;
}

.today-card:hover { border-color: var(--line-strong); }
.today-card.attention { border-color: rgba(255, 196, 92, .55); }
.today-card.muted { cursor: default; opacity: .8; }

.today-icon { font-size: 19px; line-height: 1.2; }

.today-card b {
  display: block;
  font-size: 13px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.today-card small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .today-cards { grid-template-columns: 1fr; }
}

.modal-steps {
  margin: 0 0 12px;
  padding-left: 20px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

/* =========================================================
   FASE C: ENTRAR CON GOOGLE, RECUPERAR, LEGAL E IDIOMA
   ========================================================= */

.google-button {
  width: 100%;
  margin: 4px 0 2px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .22);
  background: #ffffff;
  color: #1f2937;
  font-weight: 650;
  font-size: 14.5px;
  text-decoration: none;
}

.google-button[hidden] { display: none; }

.google-g {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(#ea4335 0 25%, #fbbc05 0 50%, #34a853 0 75%, #4285f4 0);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
}

.auth-or {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 4px;
  color: var(--faint);
  font-size: 13px;
}

.auth-or[hidden] { display: none; }
.auth-or::before,
.auth-or::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.auth-forgot {
  margin-top: 10px;
  border: 0 !important;
  background: transparent !important;
  text-decoration: underline;
}

.auth-forgot[hidden] { display: none; }

.auth-legal {
  margin: 12px 0 0;
  color: var(--faint);
  font-size: 13px;
  line-height: 1.5;
}

.auth-legal a,
.legal-links a { color: var(--cyan); }

.auth-lang {
  margin-top: 10px;
  padding: 6px 10px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(3, 14, 28, .85);
  color: var(--muted);
  font: inherit;
  font-size: 13.5px;
}

.store-form select {
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(3, 14, 28, .9);
  color: var(--text);
  font: inherit;
  font-size: 13px;
}

@media (max-width: 600px) {
  .store-form select { font-size: 16px; }
}

/* =========================================================
   ZOOM SIN SALTOS NI PARPADEOS (app.js añade body.zoomed)
   ========================================================= */

/* Capas propias para el fondo animado y la cabecera: el navegador no tiene
   que repintarlas a la vez (evita parpadeos en iPhone al hacer zoom). */
.hud,
#appScreen header {
  transform: translateZ(0);
  backface-visibility: hidden;
}

/* Mientras hay zoom: animaciones en pausa y sin cristal desenfocado. */
body.zoomed .hud *,
body.zoomed .hud,
body.zoomed #appScreen header::after,
body.zoomed .online span,
body.zoomed #hudStatus {
  animation-play-state: paused !important;
}

body.zoomed #appScreen header,
body.zoomed .bubble,
body.zoomed .chat,
body.zoomed .tools-sheet,
body.zoomed .modal {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.zoomed #appScreen header {
  background: rgba(3, 12, 26, .94);
}

/* El modo ligero (solo si se activa en Mi cuenta) también quita el cristal de la
   cabecera y su línea animada. */
body.lite #appScreen header {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  background: rgba(3, 12, 26, .92);
}

body.lite #appScreen header::after,
body.lite #hudStatus {
  animation: none !important;
}
.store-form .checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px;
  line-height: 1.4;
}

.store-form .checkbox-row input {
  width: auto;
  margin-top: 3px;
}

/* =========================================================
   🛠️ ADMINISTRACIÓN (admin.js) Y 🗓️ CALENDARIO (calendar.js)
   ========================================================= */

.tools-group button[hidden] { display: none; }

/* Las pestañas bajan a otra línea si no caben: nada queda escondido a la derecha. */
.admin-tabs,
.calendar-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.admin-tabs button,
.calendar-filters button {
  flex: 0 0 auto;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 37, .88);
  color: #d6f2ff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.admin-tabs button.active,
.calendar-filters button.active {
  border-color: var(--line-strong);
  color: var(--cyan-bright);
  background: rgba(0, 133, 255, .18);
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.admin-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 37, .7);
}

.admin-stat span,
.admin-stat small { color: var(--faint); font-size: 13px; }
.admin-stat b { font-size: 20px; color: var(--cyan-bright); }

.admin-h { margin: 14px 0 6px; font-size: 14px; color: var(--cyan-bright); }

.admin-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.admin-list li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: baseline;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(5, 20, 37, .55);
  font-size: 13px;
}
.admin-list small { color: var(--faint); }

.admin-search { display: flex; gap: 8px; margin-bottom: 8px; }
.admin-search input { flex: 1; min-width: 0; font-size: 16px; }

.admin-user,
.calendar-post {
  border-color: var(--line);
  background: rgba(5, 20, 37, .7);
}

.admin-errors,
#adminUserList,
.calendar-list { display: grid; gap: 8px; margin-top: 8px; }

.admin-pre {
  margin: 6px 0 0;
  padding: 8px;
  max-height: 160px;
  overflow: auto;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 13px;
  border-radius: 8px;
  background: rgba(0, 0, 0, .35);
}

.calendar-day { margin: 12px 0 2px; font-size: 13px; color: var(--cyan-bright); }
.calendar-day::first-letter { text-transform: uppercase; }
.calendar-post .action-result { white-space: pre-wrap; }
.calendar-post.status-done { border-color: rgba(110, 230, 160, .45); }
.calendar-form { display: grid; gap: 8px; }
.calendar-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.calendar-form label { display: grid; gap: 4px; min-width: 0; color: var(--faint); font-size: 13.5px; }
.calendar-form input,
.calendar-form select,
.calendar-form textarea { width: 100%; box-sizing: border-box; }
.calendar-form input,
.calendar-form select,
.calendar-form textarea { font-size: 16px; min-width: 0; }

/* =========================================================
   BIENVENIDA SIN CORTES (tablets y pantallas bajas)
   Con "justify-content: center", si el contenido era más alto que el
   panel, el navegador lo recortaba por arriba y por abajo: el núcleo €
   salía cortado y no se podía subir hasta él. Ahora se centra con
   márgenes automáticos: si cabe queda centrado; si no, empieza arriba
   y se desplaza entero.
   ========================================================= */

#appScreen .welcome {
  justify-content: flex-start;
}

#appScreen .welcome > :first-child { margin-top: auto; }
#appScreen .welcome > :last-child  { margin-bottom: auto; }

/* Tablets en horizontal y portátiles bajos: núcleo y espacios más
   compactos para que la bienvenida quepa sin desplazarse. */
@media (min-width: 601px) and (max-height: 860px) {
  #appScreen .welcome {
    padding-top: 28px;
    padding-bottom: 12px;
  }

  #appScreen .welcome .big {
    width: 92px;
    height: 92px;
    font-size: 40px;
    margin-bottom: 26px;
  }

  #appScreen .welcome .big:not(:first-child) { margin-top: 10px; }
  #appScreen .welcome h1 { margin-top: 6px; margin-bottom: 6px; }
  #appScreen .welcome p { margin-top: 6px; margin-bottom: 12px; }
  #appScreen .welcome .examples { gap: 6px; }
  #appScreen .welcome .examples button { min-height: 36px; padding: 7px 10px; }
}

/* =========================================================
   FONDO ANIMADO SIN PARPADEOS
   Las animaciones que repintaban la pantalla en cada fotograma (mover el
   fondo de la rejilla o de la línea de la cabecera) ahora solo desplazan
   capas (transform): la tarjeta gráfica las mueve sin volver a dibujarlas.
   ========================================================= */

/* Rejilla: se mueve una capa interior en vez de su dibujo. */
.hud-grid {
  --grid: 64px;
  overflow: hidden;
  background-image: none;
  animation: none;
}

.hud-grid::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: calc(-1 * var(--grid));
  bottom: 0;
  background-image:
    linear-gradient(rgba(var(--hud), .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(var(--hud), .22) 1px, transparent 1px);
  background-size: var(--grid) var(--grid);
  animation: hud-grid-slide 6s linear infinite;
  will-change: transform;
}

@keyframes hud-grid-slide {
  to { transform: translateY(var(--grid)); }
}

@media (max-width: 600px) {
  .hud-grid { --grid: 44px; }
}

/* Línea de energía de la cabecera: se desliza una capa. */
#appScreen header { overflow: hidden; }

#appScreen header::after {
  /* Con overflow: hidden, a -1px caía sobre el borde y se recortaba entera. */
  bottom: 0;
  right: auto;
  width: 35%;
  background-size: 100% 100%;
  animation: hud-glint-slide 6s ease-in-out infinite;
  will-change: transform;
}

@keyframes hud-glint-slide {
  0%        { transform: translateX(-120%); }
  60%, 100% { transform: translateX(300%); }
}

body.zoomed .hud-grid::before { animation-play-state: paused !important; }
body.lite .hud-grid::before { animation: none !important; }

/* ---- Android ----
   Chrome en Android parpadeaba al volver a desenfocar el cristal (paneles
   y cabecera) en cada fotograma del fondo, y con los brillos difuminados
   que giran. Ahí los paneles son algo más opacos y sin desenfoque, y los
   anillos sin difuminado: el fondo sigue igual de animado. */
body.android #appScreen header,
body.android .brand,
body.android #appScreen aside,
body.android .chat,
body.android .bubble,
body.android .tools-sheet,
body.android .modal,
body.android .modal-backdrop,
body.android .auth-box {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}

body.android #appScreen header { background: rgba(3, 12, 26, .9); }
body.android .brand { background: linear-gradient(160deg, rgba(8, 24, 42, .94), rgba(3, 11, 22, .94)); }
body.android .bubble { background-color: rgba(4, 16, 32, .9); }

body.android .ring,
body.android .big .core-hud {
  filter: none;
}

/* El latido del núcleo cambiaba su sombra (repintado); queda fijo y sus
   anillos siguen girando. */
body.android .big,
body.android .auth-logo {
  animation: none;
}

/* Capas propias para lo que gira o se mueve. */
body.android .welcome::before,
body.android::after,
body.android .core-hud circle {
  will-change: transform;
}

/* =========================
   BIENVENIDA (welcome.js): el asistente se presenta y pregunta de una en una
========================= */

.welcome-flow {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.welcome-progress {
  display: flex;
  gap: 6px;
}

.welcome-progress span {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: rgba(80, 228, 255, .15);
  transition: background .3s ease;
}

.welcome-progress span.done {
  background: linear-gradient(90deg, #3fd4ff, #168dff);
}

.welcome-bubble {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.welcome-avatar {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle, rgba(80, 228, 255, .28), rgba(6, 22, 40, .95));
  color: var(--cyan-bright);
  font-weight: 700;
  box-shadow: 0 0 14px rgba(80, 228, 255, .25);
}

.welcome-bubble p {
  margin: 0;
  padding: 11px 13px;
  border-radius: 4px 14px 14px 14px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .85);
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
}

/* 16 px: el iPhone no hace zoom al tocar el campo. */
.welcome-form input,
.welcome-form textarea {
  font-size: 16px;
}

.welcome-segments {
  margin-bottom: 4px;
}

.welcome-segments button.chosen {
  border-color: var(--line-strong);
  background: rgba(22, 141, 255, .28);
  color: var(--cyan-bright);
}

.welcome-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.welcome-buttons .primary,
.welcome-buttons .secondary {
  margin-top: 6px;
}

.welcome-buttons .link-button {
  margin-left: auto;
}

/* Equipo del asistente (fase 2): quién ha trabajado la respuesta */
.msg-member {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin: 0 0 5px;
  padding: 2px 9px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .7);
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .02em;
}

/* =========================
   ✅ MI TRABAJO (work.js)
========================= */

.work-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 12px;
}

.work-tabs button {
  padding: 9px 4px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .85);
  color: #d6f2ff;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.work-tabs button.chosen {
  border-color: var(--line-strong);
  background: rgba(22, 141, 255, .28);
  color: var(--cyan-bright);
}

.work-count {
  display: inline-block;
  min-width: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-size: 12px;
}

.work-row {
  display: flex;
  gap: 6px;
  align-items: center;
}

.work-row input {
  flex: 1;
  min-width: 0;
  font-size: 16px;
}

.work-row input[type="date"],
.work-row .work-amount {
  flex: 0 0 auto;
  width: 120px;
}

.work-row .primary {
  margin-top: 0;
  flex: none;
}

.work-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.work-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(6, 22, 40, .85);
  font-size: 13.5px;
}

.work-item .work-main {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.work-check {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  cursor: pointer;
}

.work-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--cyan);
  flex: none;
}

.work-item.done .work-main {
  color: var(--muted);
  text-decoration: line-through;
}

.work-item.late .work-meta {
  color: #ffb4a6;
}

.work-meta {
  flex: none;
  color: var(--muted);
  font-size: 13px;
}

.work-delete {
  flex: none;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 13px;
  cursor: pointer;
}

.work-delete:hover {
  color: #ffb4a6;
}

.work-done {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13.5px;
}

@media (max-width: 420px) {
  .work-row {
    flex-wrap: wrap;
  }
  .work-row input:first-child {
    flex-basis: 100%;
  }
  .work-row input[type="date"],
  .work-row .work-amount {
    flex: 1;
    width: auto;
  }
  .work-row input[name="note"] {
    flex-basis: 100%;
    order: 2;
  }
  .work-row .primary {
    order: 3;
  }
  .work-tabs button {
    font-size: 13px;
  }
}

/* =========================
   ◎ PROGRESO (progress.js): anillos, racha y resumen
========================= */

.progress-button {
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .9);
  cursor: pointer;
  transition: border-color .15s ease;
}

.progress-button:hover {
  border-color: var(--line-strong);
}

.progress-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke-width: 2.6;
}

.progress-button circle:first-child { stroke: #50e4ff; }
.progress-button circle:last-child { stroke: #5ff0a8; }

.progress-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.rings {
  width: min(220px, 62vw);
  height: auto;
}

.ring-fill {
  transition: stroke-dashoffset 1.2s cubic-bezier(.22, 1, .36, 1);
}

body.lite .ring-fill {
  transition: none;
}

.progress-closed {
  color: var(--cyan-bright);
  font-size: 13px;
  font-weight: 700;
}

.ring-legend {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.ring-legend li {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 13.5px;
}

.ring-dot {
  flex: none;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.ring-name {
  flex: 1;
}

.ring-num {
  color: var(--muted);
}

.ring-num b {
  color: var(--text);
}

.streak {
  margin-top: 16px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(6, 22, 40, .85);
}

.streak-text {
  font-size: 13.5px;
}

.streak-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.streak-week span {
  width: 34px;
  height: 34px;
  justify-self: center;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.streak-week span.on {
  border-color: transparent;
  background: linear-gradient(145deg, #ffb35c, #ff6b4a);
  color: #1c0700;
  font-weight: 700;
}

.streak-week span.today:not(.on) {
  border-color: var(--line-strong);
  color: var(--cyan-bright);
}

.streak-week span.future {
  opacity: .4;
}

.streak-best {
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.progress-summary {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.progress-summary .secondary {
  font-size: 13.5px;
  padding: 8px 13px;
}

.progress-goals {
  margin-top: 16px;
  color: var(--muted);
  font-size: 13px;
}

.progress-goals summary {
  cursor: pointer;
}

.goals-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.goals-grid label {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.goals-grid input {
  font-size: 16px;
}

@media (max-width: 420px) {
  .streak-week span {
    width: 30px;
    height: 30px;
  }
  .composer .progress-button {
    flex-basis: 36px;
    width: 36px;
    height: 36px;
  }
}

/* Fase 5: ofrecer los avisos al terminar la bienvenida */
.welcome-push {
  margin-top: 4px;
  padding: 12px;
  border-radius: 12px;
  border: 1px dashed var(--line-strong);
  background: rgba(6, 22, 40, .7);
}

.welcome-push p {
  margin: 0 0 10px;
  font-size: 13.5px;
  line-height: 1.5;
}

.welcome-push .secondary {
  font-size: 13.5px;
  padding: 8px 13px;
}

/* =========================
   APEX (apex.js): apartado propio para hablar con el asistente
========================= */

/* Botón de la cabecera */
.apex-entry {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 13px 7px 9px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: radial-gradient(circle at 20% 50%, rgba(80, 228, 255, .28), rgba(8, 30, 52, .92) 70%);
  color: var(--cyan-bright);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
  box-shadow: 0 0 18px rgba(80, 228, 255, .22);
}

.apex-entry:hover {
  box-shadow: 0 0 26px rgba(80, 228, 255, .4);
}

.apex-entry svg {
  width: 20px;
  height: 20px;
  fill: none;
}

.apex-entry .o { stroke: rgba(80, 228, 255, .7); stroke-width: 1.5; stroke-dasharray: 3 2; transform-origin: 12px 12px; animation: apexSpin 9s linear infinite; }
.apex-entry .m { stroke: #50e4ff; stroke-width: 1.8; }
.apex-entry .i { fill: #e1faff; filter: drop-shadow(0 0 3px #50e4ff); }

#welcome .big[role="button"] {
  cursor: pointer;
}

@media (max-width: 600px) {
  /* En el móvil, el nombre de usuario deja sitio al asistente. */
  body:has(#openApex) #currentUser { display: none; }
  .apex-entry { padding: 6px 11px 6px 7px; font-size: 13.5px; }
}

/* Pantalla completa */
.apex {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: flex;
  flex-direction: column;
  color: var(--text);
  background:
    radial-gradient(ellipse at 50% 30%, rgba(14, 64, 120, .55), rgba(3, 13, 30, 0) 60%),
    radial-gradient(circle at 50% 120%, rgba(22, 141, 255, .18), transparent 55%),
    #020a17;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  animation: apexIn .28s ease-out;
}

.apex[hidden] { display: none; }

/* Líneas de escaneo de holograma sobre toda la consola. */
.apex::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(120, 220, 255, .035) 0 1px, transparent 1px 4px);
  z-index: 0;
}

.apex > * { position: relative; z-index: 1; }

body.apex-open { overflow: hidden; }

.apex-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px 10px;
  border-bottom: 1px solid rgba(73, 190, 255, .14);
}

.apex-id {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.apex-id b {
  color: var(--cyan-bright);
  font-size: 17px;
  letter-spacing: .32em;
  text-shadow: 0 0 12px rgba(80, 228, 255, .6);
}

.apex-id span {
  color: var(--cyan);
  font-family: "DejaVu Sans Mono", ui-monospace, monospace;
  font-size: 12px;
  letter-spacing: .18em;
}

.apex-tools {
  display: flex;
  gap: 8px;
}

.apex-tools button {
  min-width: 40px;
  height: 38px;
  padding: 0 11px;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .8);
  color: #d6f2ff;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.apex-tools button[aria-pressed="true"] {
  border-color: var(--line-strong);
  background: rgba(22, 141, 255, .3);
  color: var(--cyan-bright);
}

.apex-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 16px 12px;
}

.apex-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-top: clamp(12px, 4vh, 40px);
  transition: padding .3s ease;
}

/* Núcleo holográfico */
.apex-core {
  width: min(62vw, 300px);
  aspect-ratio: 1;
  position: relative;
  transition: width .35s ease;
  filter: drop-shadow(0 0 18px rgba(80, 228, 255, .45));
}

.apex-core::after {
  /* Líneas de escaneo propias del núcleo. */
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  pointer-events: none;
  background: repeating-linear-gradient(0deg, rgba(2, 10, 23, .35) 0 1px, transparent 1px 3px);
  mix-blend-mode: multiply;
}

.apex-core svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.apex-core g,
.apex-core circle {
  transform-origin: 100px 100px;
  transform-box: view-box;
}

.apex-core g circle { fill: none; }
.ac-outer circle { stroke: rgba(95, 230, 255, .55); stroke-width: 3; }
.ac-brackets circle { stroke: #5fe6ff; stroke-width: 2.2; }
.ac-dots circle { stroke: #e1faff; stroke-width: 2.4; stroke-linecap: round; }
.ac-data circle { stroke: #50e4ff; stroke-width: 4.5; opacity: .85; }
.ac-ticks circle { stroke: rgba(150, 235, 255, .7); stroke-width: 4; }
.ac-cells circle { stroke: #7febff; stroke-width: 18; opacity: .55; }
.ac-inner { fill: none; stroke: #c9f6ff; stroke-width: 4; }
.ac-wave { fill: none; stroke: #e1faff; stroke-width: 1.5; opacity: 0; }

.ac-outer { animation: apexSpin 60s linear infinite; }
.ac-brackets { animation: apexSpin 40s linear infinite reverse; }
.ac-dots { animation: apexSpin 90s linear infinite; }
.ac-data { animation: apexSpin 24s linear infinite reverse; }
.ac-cells { animation: apexSpin 120s linear infinite; }
.ac-lens { animation: apexBreath 4s ease-in-out infinite; }
.ac-glow { animation: apexBreath 4s ease-in-out infinite; }

/* Escuchando: el núcleo late y se ilumina. */
.apex[data-state="listening"] .ac-lens,
.apex[data-state="listening"] .ac-glow { animation: apexPulse .9s ease-in-out infinite; }
.apex[data-state="listening"] .ac-cells circle { opacity: .85; }
.apex[data-state="listening"] .ac-wave { animation: apexRipple 1.2s ease-out infinite; }

/* Pensando: los anillos giran deprisa. */
.apex[data-state="thinking"] .ac-data { animation-duration: 2.2s; }
.apex[data-state="thinking"] .ac-brackets { animation-duration: 4s; }
.apex[data-state="thinking"] .ac-outer { animation-duration: 8s; }
.apex[data-state="thinking"] .ac-cells { animation-duration: 10s; }

/* Hablando: ondas desde la lente. */
.apex[data-state="speaking"] .ac-wave { animation: apexRipple .8s ease-out infinite; }
.apex[data-state="speaking"] .ac-lens { animation: apexPulse .45s ease-in-out infinite alternate; }

@keyframes apexSpin { to { transform: rotate(360deg); } }
@keyframes apexBreath { 0%, 100% { opacity: .85; transform: scale(1); } 50% { opacity: 1; transform: scale(1.04); } }
@keyframes apexPulse { 0%, 100% { transform: scale(1); opacity: .9; } 50% { transform: scale(1.12); opacity: 1; } }
@keyframes apexRipple { from { transform: scale(1); opacity: .8; } to { transform: scale(3.6); opacity: 0; } }
@keyframes apexIn { from { opacity: 0; transform: scale(1.02); } to { opacity: 1; transform: none; } }

.apex-hello h2 {
  margin: 14px 0 4px;
  font-size: clamp(22px, 5.5vw, 30px);
  letter-spacing: -.01em;
}

.apex-hello p {
  margin: 0;
  color: var(--muted);
  font-size: 15px;
}

.apex-stats,
.apex-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.apex-stats button {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid rgba(73, 190, 255, .3);
  background: rgba(6, 22, 40, .7);
  color: #cfeefc;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.apex-chips {
  max-width: 560px;
  margin-inline: auto;
}

.apex-chips button {
  padding: 10px 14px;
  border-radius: 13px;
  border: 1px solid var(--line);
  background: rgba(8, 30, 52, .85);
  color: #e3f6ff;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}

.apex-chips button:hover,
.apex-stats button:hover {
  border-color: var(--line-strong);
}

/* Con conversación: el núcleo se hace pequeño arriba y el saludo se oculta. */
.apex.has-messages .apex-stage { padding-top: 8px; }
.apex.has-messages .apex-core { width: 84px; }
.apex.has-messages .apex-hello { display: none; }

.apex-messages {
  max-width: 760px;
  margin: 10px auto 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.apex-msg {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}

.apex-msg.user { align-items: flex-end; }

.apex-msg .bubble {
  max-width: min(100%, 640px);
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.apex-msg.user .bubble {
  border-bottom-right-radius: 5px;
  background: linear-gradient(145deg, rgba(63, 212, 255, .28), rgba(22, 141, 255, .25));
  border: 1px solid rgba(80, 228, 255, .35);
}

.apex-msg.assistant .bubble {
  border-bottom-left-radius: 5px;
  background: rgba(6, 22, 40, .82);
  border: 1px solid rgba(73, 190, 255, .2);
  box-shadow: inset 2px 0 0 rgba(80, 228, 255, .6);
}

.apex-msg-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.apex-msg-actions button {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 37, .7);
  color: #bfe9f8;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.apex-msg-actions button.chosen {
  border-color: var(--line-strong);
  color: var(--cyan-bright);
}

.apex-typing { color: var(--muted); }

/* Caja de texto */
.apex-composer {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  width: min(760px, 100% - 24px);
  margin: 0 auto 12px;
  padding: 8px;
  border-radius: 20px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 17, 33, .92);
  box-shadow: 0 0 30px rgba(22, 141, 255, .18);
}

.apex-composer textarea {
  flex: 1;
  min-width: 0;
  max-height: 140px;
  padding: 10px 6px;
  border: 0;
  outline: none;
  resize: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
  line-height: 1.4;
}

.apex-mic,
.apex-send {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid var(--line);
  font-size: 20px;
  cursor: pointer;
}

.apex-mic {
  background: radial-gradient(circle, rgba(80, 228, 255, .25), rgba(8, 30, 52, .9) 70%);
  color: var(--cyan-bright);
}

.apex-mic.listening {
  border-color: #5fe6ff;
  box-shadow: 0 0 0 0 rgba(95, 230, 255, .6);
  animation: apexMicPulse 1s ease-out infinite;
}

@keyframes apexMicPulse { to { box-shadow: 0 0 0 14px rgba(95, 230, 255, 0); } }

.apex-send {
  border: 0;
  background: linear-gradient(145deg, #3fd4ff, #168dff);
  color: #021222;
  font-weight: 800;
}

/* Holograma 3D (apex-orb.js): el lienzo sustituye al núcleo SVG. */
.apex-core.has-orb { filter: none; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.apex-core.has-orb svg,
.apex-core.has-orb::after { display: none; }
.apex-core:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: 6px; border-radius: 50%; }
.apex-orb-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: none;
}

/* Indicador de micrófono abierto: siempre visible mientras escucha. */
.apex-rec {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 8px;
  padding: 2px 8px 2px 6px;
  border-radius: 999px;
  border: 1px solid rgba(255, 90, 90, .45);
  color: #ffb3b3;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
}
.apex-rec[hidden] { display: none; }
.apex-rec i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff4d4d;
  box-shadow: 0 0 8px #ff4d4d;
  animation: apexRec 1.4s ease-in-out infinite;
}
@keyframes apexRec { 50% { opacity: .35; } }

/* Subtítulos y barra de la conversación de voz (solo en directo). */
.apex-captions,
.apex-live-bar { display: none; }

.apex.voice-live {
  background:
    radial-gradient(circle at 50% 42%, rgba(18, 78, 160, .28), rgba(0, 0, 0, 0) 55%),
    #010409;
}
.apex.voice-live::before { opacity: .35; }
.apex.voice-live .apex-body { display: flex; flex-direction: column; justify-content: center; }
.apex.voice-live .apex-messages,
.apex.voice-live .apex-hello,
.apex.voice-live .apex-composer { display: none; }
.apex.voice-live .apex-stage { padding-top: 0; }
.apex.voice-live .apex-core { width: min(86vw, 52vh, 460px); }

.apex.voice-live .apex-captions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: min(560px, 100%);
  min-height: 7.5em;
  margin-top: clamp(8px, 3vh, 28px);
  text-align: center;
}
.apex-captions p { margin: 0; line-height: 1.45; transition: opacity .25s ease; }
.apex-captions p:empty { opacity: 0; }
.apex-captions .cap-you { color: var(--muted); font-size: 15px; }
.apex-captions .cap-me { color: #e8f7ff; font-size: 18px; font-weight: 500; text-shadow: 0 0 18px rgba(80, 200, 255, .35); }

.apex.voice-live .apex-live-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: min(560px, 100% - 32px);
  margin: 0 auto 16px;
  color: var(--muted);
  font-size: 13px;
}
.apex-live-bar button {
  flex: none;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(255, 110, 110, .45);
  background: rgba(60, 10, 14, .55);
  color: #ffd0d0;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .apex-rec i { animation: none; }
}

/* Modo ligero: sin animaciones. */
body.lite .apex,
body.lite .apex-core *,
body.lite .apex-entry .o,
body.lite .apex-mic.listening,
body.lite .apex-rec i { animation: none !important; }

@media (min-width: 900px) {
  .apex-core { width: 320px; }
}

@media (max-width: 430px) {
  /* Que "AI ORCHESTRATOR" no choque con el botón del asistente. */
  body:has(#openApex) .brand small { display: none; }
}

/* =========================================================
   LA BOLA DE APEX (apex-orb.js con /apex-bola.webp)
   El negro de la imagen se funde con el fondo (modo "pantalla").
   ========================================================= */

.apex-orb-canvas { mix-blend-mode: screen; }
.apex-core.has-orb { width: min(84vw, 46vh, 400px); }

/* Subtítulos de lo que dice Apex en voz alta (pantalla de Apex). */
.apex-subs {
  display: flex;
  justify-content: center;
  max-height: 0;
  padding: 0 16px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  transition: opacity .3s ease, max-height .3s ease, margin .3s ease;
}
.apex-subs.show { max-height: 7em; margin-bottom: 8px; opacity: 1; }
.apex-subs p {
  max-width: 640px;
  margin: 0;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(0, 6, 16, .62);
  color: #eaf8ff;
  font-size: 16.5px;
  line-height: 1.45;
  text-align: center;
  text-shadow: 0 0 18px rgba(80, 200, 255, .45);
}
.apex.voice-live .apex-subs { display: none; }

/* =========================================================
   INICIO → BOLA DE APEX (home-apex.js)
   Al final del inicio, deslizar hacia abajo: la app se aleja, sube el logo
   de €ERO, se atraviesa y queda la bola, en la misma pantalla de inicio.
   ========================================================= */

.home-pull {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 22px auto 6px;
  padding: 8px 14px;
  border: 0;
  background: none;
  color: rgba(var(--hud), .85);
  font: inherit;
  font-size: 13px;
  letter-spacing: .02em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.home-pull b { color: #e1faff; }
.home-pull i {
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  text-shadow: 0 0 12px rgba(var(--hud), .8);
  animation: home-pull-bob 1.8s ease-in-out infinite;
}
@keyframes home-pull-bob {
  0%, 100% { transform: translateY(0); opacity: .65; }
  50% { transform: translateY(6px); opacity: 1; }
}

body.home-pulling { overscroll-behavior: none; }
body.home-pulling #appScreen main { will-change: transform; transform-origin: 50% 0; }

/* Capa de la transición (no recibe toques: el gesto sigue en el inicio). */
.home-portal {
  position: fixed;
  top: var(--ha-top, 0px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 41;
  overflow: hidden;
  pointer-events: none;
}
.home-portal[hidden] { display: none; }
.home-portal.fading { opacity: 0; transition: opacity .45s ease; }

.hp-bg {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #04122a 0%, #01040b 55%, #000 100%);
}

.hp-rays {
  position: absolute;
  inset: -30%;
  background: repeating-conic-gradient(from 0deg, rgba(80, 200, 255, .09) 0deg 1.2deg, transparent 1.2deg 14deg);
  animation: hud-spin 40s linear infinite;
  will-change: transform;
}

.hp-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(80vw, 46vh, 440px);
  height: auto;
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

/* home-apex.js la coloca justo donde queda la bola del inicio. */
.hp-ball {
  position: fixed;
  left: 50%;
  top: 50%;
  width: min(88vw, 50vh, 480px);
  height: auto;
  mix-blend-mode: screen;
  will-change: transform, opacity;
}

.hp-flash {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 140vmax;
  height: 140vmax;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(200, 240, 255, .9) 0%, rgba(60, 170, 255, .35) 12%, rgba(30, 111, 255, 0) 34%);
  mix-blend-mode: screen;
}

/* La bola en la pantalla de inicio */
.home-apex {
  position: fixed;
  top: var(--ha-top, 0px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 44px 16px calc(84px + env(safe-area-inset-bottom));
  background: radial-gradient(circle at 50% 42%, #04122a 0%, #01040b 55%, #000 100%);
  color: var(--text);
  overflow: hidden;
  touch-action: none;
}
.home-apex[hidden] { display: none; }

.ha-up {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--hud), .3);
  background: rgba(4, 16, 32, .7);
  color: rgba(var(--hud), .9);
  font: inherit;
  font-size: 13.5px;
  letter-spacing: .04em;
  cursor: pointer;
}

.ha-orb {
  position: relative;
  flex: none;
  width: min(88vw, 50vh, 480px);
  aspect-ratio: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border-radius: 50%;
}
.ha-orb:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: 4px; }

.ha-subs {
  width: min(620px, 100%);
  min-height: 5.6em;
  margin-top: clamp(4px, 2vh, 18px);
  text-align: center;
}
.ha-subs p { margin: 0; line-height: 1.45; transition: opacity .25s ease; }
.ha-subs p:empty { opacity: 0; }
.ha-you { color: var(--muted); font-size: 14.5px; margin-bottom: 6px !important; }
.ha-me {
  color: #eef9ff;
  font-size: clamp(17px, 2.3vh, 21px);
  font-weight: 500;
  text-shadow: 0 0 18px rgba(80, 200, 255, .4), 0 1px 3px #000;
}

.ha-hint {
  margin: 4px 0 0;
  color: rgba(var(--hud), .75);
  font-size: 13.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  min-height: 1.2em;
}

.ha-approve {
  margin-top: 10px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 196, 90, .55);
  background: rgba(50, 34, 6, .6);
  color: #ffe2a8;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.ha-approve[hidden] { display: none; }

.ha-bar {
  position: absolute;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(560px, calc(100% - 28px));
  padding: 6px;
  border-radius: 18px;
  border: 1px solid var(--line-strong);
  background: rgba(5, 17, 33, .9);
  touch-action: manipulation;
}
.ha-bar input {
  flex: 1;
  min-width: 0;
  padding: 10px 6px;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.ha-mic,
.ha-send {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 13px;
  border: 1px solid var(--line);
  font-size: 19px;
  cursor: pointer;
}
.ha-mic { background: radial-gradient(circle, rgba(80, 228, 255, .25), rgba(8, 30, 52, .9) 70%); color: var(--cyan-bright); }
.ha-mic.on { border-color: #ff6b6b; box-shadow: 0 0 0 3px rgba(255, 90, 90, .25), 0 0 18px rgba(255, 90, 90, .45); }
.ha-send { border: 0; background: linear-gradient(145deg, #3fd4ff, #168dff); color: #021222; font-weight: 800; }

body.lite .home-pull i,
body.lite .hp-rays { animation: none !important; }

@media (max-height: 640px) {
  .home-apex { padding-top: 40px; }
  .ha-subs { min-height: 4.4em; }
}

/* La ventana recibe el foco en pantallas táctiles (sin abrir el teclado): sin marco. */
.modal:focus { outline: none; }

/* Botones de las ventanas que no tienen estilo propio: que no salgan con el
   gris del navegador. */
#storeModalBody button:not([class]),
.brief-remove {
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 37, .88);
  color: #bfe9f8;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

#storeModalBody button:not([class]):hover,
.brief-remove:hover {
  border-color: var(--line-strong);
  color: var(--cyan-bright);
}

/* La ficha: el botón de guardar ocupa todo el ancho, como en los demás formularios. */
.brief-form > .primary {
  width: 100%;
}

/* "Mi trabajo": la fecha se veía cortada ("mm/dd/y"). */
.work-row input[type="date"] {
  min-width: 150px;
}

/* =========================================================
   FONDO FUNDIDO
   La foto se oscurecía mucho y los anillos animados (más grandes y algo
   más abajo) no coincidían con los círculos de la foto: parecían dos
   fondos encima. Ahora la foto se ve más y los anillos tienen el tamaño
   y el centro de sus círculos, así que se ven como una sola pieza viva.
   La foto (1080×1920) se escala con "cover": su ancho en pantalla es
   max(100vw, 56.25vh) y su círculo grande ocupa ~90 % de ese ancho, con
   el centro al 51,3 % de la altura.
   ========================================================= */

body {
  background-image:
    radial-gradient(ellipse at 50% 51%, rgba(1, 8, 20, .22) 0%, rgba(1, 6, 16, .58) 62%, rgba(0, 3, 10, .88) 100%),
    url("/fondo.jpg");
  background-image:
    radial-gradient(ellipse at 50% 51%, rgba(1, 8, 20, .22) 0%, rgba(1, 6, 16, .58) 62%, rgba(0, 3, 10, .88) 100%),
    image-set(url("/fondo.webp") type("image/webp"), url("/fondo.jpg") type("image/jpeg"));
}

.hud-rings {
  top: 51.3%;
  width: calc(max(100vw, 56.25vh) * .9);
  opacity: .62;
}

/* Las tarjetas del chat dejan ver un poco más el fondo, sin perder lectura. */
.chat {
  background-color: rgba(2, 10, 24, .16);
}

/* ---------- Tu equipo (progreso) ---------- */
.team-panel { margin: 6px 0 14px; }
.team-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 420px) {
  .team-grid { grid-template-columns: minmax(0, 1fr); }
}
.team-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(5, 20, 37, .7);
}
.team-card.active {
  border-color: rgba(var(--hud), .45);
  box-shadow: inset 0 0 22px rgba(var(--hud-blue), .10), 0 0 16px rgba(var(--hud), .08);
}
.team-head { display: flex; align-items: center; gap: 8px; }
.team-icon { font-size: 20px; }
.team-card small { color: var(--muted); line-height: 1.4; }
.team-count { font-size: 13px; color: #9fdcf2; }
.team-card.active .team-count { color: var(--cyan-bright); font-weight: 600; }
.team-ask { align-self: flex-start; margin-top: auto; }

/* Mientras piensa: el miembro del equipo que trabaja late suavemente. */
.msg.thinking.team-working .msg-member {
  border-color: rgba(var(--hud), .55);
  animation: team-pulse 1.6s ease-in-out infinite;
}
@keyframes team-pulse {
  0%, 100% { box-shadow: 0 0 0 rgba(var(--hud), 0); }
  50% { box-shadow: 0 0 12px rgba(var(--hud), .45); }
}
@media (prefers-reduced-motion: reduce) {
  .msg.thinking.team-working .msg-member { animation: none; }
}

/* =========================================================
   BOTONES HOLOGRÁFICOS
   Los botones son mandos de una consola tipo JARVIS:
   - Cristal: vidrio oscuro con líneas de escaneo y cuatro esquinas de
     mira (las mismas del marco del chat). Al pasar por encima, las
     esquinas se abren y el borde se enciende.
   - Energía (acciones principales y enviar): núcleo cian con luz
     interior; al pasar por encima o enfocarlo, lo cruza un destello.
   Sin filtros ni desenfoques (fluido también en Android) y sin
   animaciones si el sistema pide menos movimiento.
   ========================================================= */

:root {
  --btn-glass:
    repeating-linear-gradient(180deg, rgba(var(--hud), .035) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(12, 44, 72, .62) 0%, rgba(4, 17, 32, .9) 100%);
}

.secondary,
.msg-actions button,
#openAccount,
#logoutButton,
.examples button,
.tools-group button,
.segment-options button,
.work-tabs button,
.action-buttons .approve,
#storeModalBody button:not([class]),
.brief-remove,
.modal-close {
  --bk-c: rgba(var(--hud), .7);
  --bk-s: 7px;
  --bk-w: 1.5px;

  border-radius: 7px;
  border: 1px solid rgba(var(--hud), .26);
  background:
    linear-gradient(var(--bk-c), var(--bk-c)) left top / var(--bk-s) var(--bk-w) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) left top / var(--bk-w) var(--bk-s) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) right top / var(--bk-s) var(--bk-w) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) right top / var(--bk-w) var(--bk-s) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) left bottom / var(--bk-s) var(--bk-w) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) left bottom / var(--bk-w) var(--bk-s) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) right bottom / var(--bk-s) var(--bk-w) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) right bottom / var(--bk-w) var(--bk-s) no-repeat,
    var(--btn-glass);
  box-shadow:
    inset 0 1px 0 rgba(190, 245, 255, .08),
    inset 0 0 16px rgba(var(--hud-blue), .08);
  color: #cdf3ff;
  transition:
    background-size .22s ease,
    border-color .22s ease,
    box-shadow .22s ease,
    color .22s ease,
    transform .08s ease;
}

/* Los botones pequeños llevan esquinas pequeñas. */
.msg-actions button,
.modal-close,
.brief-remove {
  --bk-s: 5px;
  --bk-w: 1px;
}

.secondary:hover,
.msg-actions button:hover,
#openAccount:hover,
#logoutButton:hover,
.examples button:hover,
.tools-group button:hover,
.segment-options button:hover,
.work-tabs button:hover,
.action-buttons .approve:hover,
#storeModalBody button:not([class]):hover,
.brief-remove:hover,
.modal-close:hover,
.tools-group button:focus-visible {
  --bk-c: rgb(var(--hud));
  --bk-s: 11px;
  border-color: rgba(var(--hud), .55);
  box-shadow:
    inset 0 1px 0 rgba(190, 245, 255, .14),
    inset 0 0 20px rgba(var(--hud-blue), .16),
    0 0 14px rgba(var(--hud), .22);
  color: #e9fbff;
}

.msg-actions button:hover,
.modal-close:hover,
.brief-remove:hover {
  --bk-s: 8px;
}

/* Pulsar: se hunde un poco y se enciende por dentro, como una tecla de luz. */
.secondary:active,
.msg-actions button:active,
#openAccount:active,
#logoutButton:active,
.examples button:active,
.tools-group button:active,
.segment-options button:active,
.work-tabs button:active,
.action-buttons .approve:active,
#storeModalBody button:not([class]):active,
.brief-remove:active,
.modal-close:active {
  transform: translateY(1px);
  box-shadow:
    inset 0 0 22px rgba(var(--hud), .28),
    0 0 10px rgba(var(--hud), .2);
}

/* Elegido (pestañas, me gusta…): esquinas cerradas en un marco encendido. */
.work-tabs button.chosen,
.msg-actions button.chosen,
.segment-options button.chosen,
.segment-options button[aria-pressed="true"] {
  --bk-c: rgb(var(--hud));
  --bk-s: 50%;
  border-color: rgba(var(--hud), .6);
  background-color: transparent;
  box-shadow:
    inset 0 0 18px rgba(var(--hud), .2),
    0 0 12px rgba(var(--hud), .18);
  color: #f0fcff;
}

/* Las ideas del inicio conservan su tamaño de tarjeta; sin la sombra dura de antes. */
.examples button {
  border-radius: 9px;
}

/* ---------- Botones de energía ---------- */

.primary,
#sendButton {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  border: 1px solid rgba(190, 248, 255, .55);
  background:
    radial-gradient(120% 140% at 50% -20%, rgba(255, 255, 255, .55) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(135deg, #8af3ff 0%, #32c8ff 40%, #1677ef 100%);
  color: #01111f;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .75),
    inset 0 -2px 0 rgba(0, 45, 100, .35),
    0 0 0 1px rgba(var(--hud-blue), .25),
    0 0 18px rgba(var(--hud), .32),
    0 6px 18px rgba(0, 100, 255, .22);
  text-shadow: 0 1px 0 rgba(255, 255, 255, .35);
  transition: box-shadow .22s ease, transform .08s ease;
}

.primary {
  border-radius: 8px;
  letter-spacing: .01em;
}

#sendButton {
  border-radius: 12px;
}

/* Destello que cruza el botón al pasar por encima o enfocarlo. */
.primary::after,
#sendButton::after {
  content: "";
  position: absolute;
  z-index: -1;
  top: -20%;
  bottom: -20%;
  left: -60%;
  width: 45%;
  background: linear-gradient(100deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .7) 50%, rgba(255, 255, 255, 0) 100%);
  transform: skewX(-18deg) translateX(0);
  opacity: 0;
  pointer-events: none;
}

.primary:hover::after,
.primary:focus-visible::after,
#sendButton:hover::after,
#sendButton:focus-visible::after {
  animation: btn-sweep .75s ease-out;
}

@keyframes btn-sweep {
  0% { opacity: 0; transform: skewX(-18deg) translateX(0); }
  15% { opacity: 1; }
  100% { opacity: 0; transform: skewX(-18deg) translateX(420%); }
}

.primary:hover,
#sendButton:hover {
  filter: none;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .85),
    inset 0 -2px 0 rgba(0, 45, 100, .35),
    0 0 0 1px rgba(var(--hud), .55),
    0 0 26px rgba(var(--hud), .55),
    0 8px 22px rgba(0, 100, 255, .3);
}

.primary:active,
#sendButton:active {
  transform: translateY(1px) scale(.985);
  box-shadow:
    inset 0 2px 6px rgba(0, 40, 90, .45),
    0 0 0 1px rgba(var(--hud), .6),
    0 0 30px rgba(var(--hud), .65);
}

.primary:disabled,
#sendButton:disabled {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .4);
}

/* Parar la respuesta: el mismo botón en rojo de alerta. */
#sendButton.stop {
  border-color: rgba(255, 190, 180, .6);
  background:
    radial-gradient(120% 140% at 50% -20%, rgba(255, 255, 255, .45) 0%, rgba(255, 255, 255, 0) 45%),
    linear-gradient(135deg, #ffb3a3 0%, #ff6b5a 45%, #d6283c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .6),
    0 0 18px rgba(255, 90, 80, .4);
}

/* Foco con teclado: anillo de luz, visible sobre cualquier fondo. */
.secondary:focus-visible,
.msg-actions button:focus-visible,
#openAccount:focus-visible,
#logoutButton:focus-visible,
.examples button:focus-visible,
.segment-options button:focus-visible,
.work-tabs button:focus-visible,
.action-buttons .approve:focus-visible,
.modal-close:focus-visible,
.primary:focus-visible,
#sendButton:focus-visible {
  outline: 2px solid rgba(var(--hud), .9);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .primary:hover::after,
  .primary:focus-visible::after,
  #sendButton:hover::after,
  #sendButton:focus-visible::after {
    animation: none;
  }
}

/* Mandos de la caja de texto (＋, progreso, micrófono): el mismo cristal. */
.tools-button,
.progress-button,
.mic-button:not(.listening) {
  --bk-c: rgba(var(--hud), .7);
  --bk-s: 6px;
  --bk-w: 1.5px;
  border-radius: 9px;
  border: 1px solid rgba(var(--hud), .26);
  background:
    linear-gradient(var(--bk-c), var(--bk-c)) left top / var(--bk-s) var(--bk-w) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) left top / var(--bk-w) var(--bk-s) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) right top / var(--bk-s) var(--bk-w) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) right top / var(--bk-w) var(--bk-s) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) left bottom / var(--bk-s) var(--bk-w) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) left bottom / var(--bk-w) var(--bk-s) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) right bottom / var(--bk-s) var(--bk-w) no-repeat,
    linear-gradient(var(--bk-c), var(--bk-c)) right bottom / var(--bk-w) var(--bk-s) no-repeat,
    var(--btn-glass);
  box-shadow: inset 0 0 14px rgba(var(--hud-blue), .1);
  transition: background-size .22s ease, border-color .22s ease, box-shadow .22s ease, transform .15s ease;
}

.tools-button:hover,
.tools-button[aria-expanded="true"],
.progress-button:hover,
.mic-button:not(.listening):hover {
  --bk-c: rgb(var(--hud));
  --bk-s: 10px;
  border-color: rgba(var(--hud), .55);
  box-shadow: inset 0 0 18px rgba(var(--hud-blue), .18), 0 0 12px rgba(var(--hud), .25);
}

.tools-button:focus-visible,
.progress-button:focus-visible,
.mic-button:focus-visible {
  outline: 2px solid rgba(var(--hud), .9);
  outline-offset: 2px;
}

/* =========================================================
   LOGO DE €ERO (el de Bruce: palabra plateada con anillo azul)
   Sustituye a la "€" dentro de un cuadrado en la cabecera, la pantalla
   de entrar y el núcleo del inicio. Imágenes con fondo transparente.
   ========================================================= */

.brand-logo {
  display: block;
  height: 40px;
  width: auto;
}

/* En Android la cabecera ponía un recuadro detrás de la marca: el logo va libre. */
body.android .brand { background: none; }

.auth-brand {
  margin: 0 auto 4px;
  line-height: 0;
}

.auth-brand img {
  display: block;
  width: min(230px, 72%);
  height: auto;
  margin: 0 auto;
}

/* Núcleo del inicio: el logo con su anillo dentro de las órbitas animadas. */
.big {
  background: radial-gradient(circle at 50% 50%, rgba(0, 70, 150, .28) 0%, rgba(1, 10, 25, .0) 70%);
  border-color: transparent;
  box-shadow: none;
}

.big-logo {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: 50%;
  width: 150%;
  height: auto;
  transform: translate(-50%, -50%);
  pointer-events: none;
}

@media (max-width: 850px) and (min-width: 601px) {
  .brand-logo { height: 34px; }
}

@media (max-width: 600px) {
  .brand-logo { height: 28px; }
}


/* =============================================
   Menú ＋ simplificado: "Lo más usado" + "Más herramientas"
   ============================================= */
.tools-sheet { grid-template-columns: 1fr; }
.tools-main { grid-column: 1 / -1; }
.tools-main {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
}
.tools-main > span { grid-column: 1 / -1; }
.tools-more-toggle {
  grid-column: 1 / -1;
  justify-self: center;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--cyan-bright);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}
.tools-more-toggle:hover,
.tools-more-toggle:focus-visible { border-color: var(--line-strong); outline: none; }
.tools-more {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tools-more[hidden] { display: none; }
@media (max-width: 900px) {
  .tools-more { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* "Salir" está dentro de 👤 Mi cuenta. */
#logoutButton[hidden] { display: none !important; }

/* Inicio más tranquilo: mientras se elige a qué te dedicas, sin ejemplos. */
.welcome.picking-segment .examples { display: none; }

/* Primeros pasos plegados: una sola línea que se abre al tocarla. */
.onboarding.collapsed .onboarding-bar,
.onboarding.collapsed .onboarding-step { display: none; }
.onboarding-toggle {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

/* Campos de las ventanas a 16 px: el iPhone no hace zoom al tocarlos. */
.store-form input,
.store-form select,
.store-form textarea { font-size: 16px; }

/* Los avisos cortos salen por encima de la caja de texto, sin taparla. */
.toast { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }

/* Botones de cada respuesta: solo iconos, en una fila (antes ocupaban dos). */
.msg-actions .icon-action {
  min-width: 36px;
  min-height: 34px;
  padding: 4px 8px;
  font-size: 15px;
  line-height: 1;
}

/* El asistente se presenta con su bola (la misma que el botón de Apex). */
.avatar .avatar-orb { width: 20px; height: 20px; fill: none; }
.avatar-orb .o { stroke: rgba(80, 228, 255, .7); stroke-width: 1.5; stroke-dasharray: 3 2; transform-origin: 12px 12px; animation: apexSpin 9s linear infinite; }
.avatar-orb .m { stroke: rgba(80, 228, 255, .45); stroke-width: 1.2; }
.avatar-orb .i { fill: #7af0ff; filter: drop-shadow(0 0 3px rgba(80, 228, 255, .9)); }
@media (prefers-reduced-motion: reduce) { .avatar-orb .o { animation: none; } }

/* Aviso de "sin conexión" */
.offline-bar {
  position: fixed;
  z-index: 200;
  top: calc(72px + env(safe-area-inset-top, 0px));
  white-space: nowrap;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100% - 24px);
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 196, 92, .55);
  background: rgba(40, 26, 4, .94);
  color: #ffe2b0;
  font-size: 14px;
  text-align: center;
}

/* ===== €ERO y Apex: dos cosas distintas ===== */

/* Botón de arriba: "Hablar con Apex" donde cabe; en móvil, solo "Apex". */
.apex-entry-verb { margin-right: 4px; }
@media (max-width: 600px) { .apex-entry-verb { display: none; } }

/* Presentación en la bienvenida: primero €ERO (el sitio), luego Apex (el asistente). */
.welcome-intro {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 6px 4px 14px;
  text-align: center;
  animation: ero-message-in .25s ease-out both;
}
.welcome-intro-img {
  width: min(190px, 55%);
  height: auto;
  filter: drop-shadow(0 0 18px rgba(0, 140, 255, .35));
}
.welcome-intro.is-apex .welcome-intro-img {
  width: min(150px, 45%);
  border-radius: 50%;
  animation: ero-core-pulse 4s ease-in-out infinite;
}
.welcome-intro h3 { margin: 4px 0 0; font-size: 22px; color: var(--text); }
.welcome-intro p { margin: 0; max-width: 34ch; font-size: 16px; line-height: 1.5; color: var(--text); }
.welcome-intro small { color: var(--muted); font-size: 14px; }
.welcome-intro-dots { display: flex; gap: 6px; margin-top: 6px; }
.welcome-intro-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.welcome-intro-dots span.on { background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }
@media (prefers-reduced-motion: reduce) {
  .welcome-intro, .welcome-intro.is-apex .welcome-intro-img { animation: none; }
}

/* En la bienvenida habla Apex: su bola, no "€". */
.welcome-avatar .avatar-orb { width: 22px; height: 22px; fill: none; }

/* =========================================================
   FONDO MÁS OSCURO, HOLOGRAMAS QUE RESALTAN
   El fondo animado sigue igual (anillos, barrido, rejilla, partículas),
   solo más oscuro y algo más apagado. Lo de delante (logo €ERO, botones
   holograma) gana brillo y contraste para que no se pierda en el fondo.
   ========================================================= */

/* Foto del fondo más oscura, sobre todo en los bordes. */
body {
  background-image:
    radial-gradient(ellipse at 50% 51%, rgba(1, 6, 16, .48) 0%, rgba(1, 4, 12, .78) 60%, rgba(0, 2, 8, .95) 100%),
    url("/fondo.jpg");
  background-image:
    radial-gradient(ellipse at 50% 51%, rgba(1, 6, 16, .48) 0%, rgba(1, 4, 12, .78) 60%, rgba(0, 2, 8, .95) 100%),
    image-set(url("/fondo.webp") type("image/webp"), url("/fondo.jpg") type("image/jpeg"));
}

/* La capa animada se sigue moviendo, pero más tenue: acompaña, no compite. */
.hud-rings { opacity: .42; }
.hud-sweep { opacity: .3; }

/* Un velo oscuro detrás del contenido para separarlo del fondo. */
.chat {
  background-color: rgba(1, 6, 16, .34);
}

/* Logo €ERO del inicio: halo de luz detrás y brillo propio. */
.big {
  background: radial-gradient(circle at 50% 50%,
    rgba(40, 170, 255, .30) 0%,
    rgba(0, 90, 190, .18) 38%,
    rgba(1, 10, 25, 0) 70%);
}

.big-logo {
  filter:
    brightness(1.15)
    drop-shadow(0 0 10px rgba(var(--hud), .55))
    drop-shadow(0 0 26px rgba(var(--hud-blue), .35));
}

.core-hud { opacity: 1; }

/* Logo de la cabecera y de la pantalla de entrar, con un poco de luz. */
.brand-logo,
.auth-brand img {
  filter: drop-shadow(0 0 8px rgba(var(--hud), .45));
}

/* En Android sin filtros (van más fluidos): solo el halo de detrás. */
body.android .big-logo,
body.android .brand-logo,
body.android .auth-brand img {
  filter: brightness(1.1);
}

/* Botones holograma: cristal más oscuro, borde más vivo y algo de luz. */
:root {
  --btn-glass:
    repeating-linear-gradient(180deg, rgba(var(--hud), .05) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(10, 40, 70, .82) 0%, rgba(2, 10, 22, .95) 100%);
}

.secondary,
.msg-actions button,
#openAccount,
#logoutButton,
.examples button,
.tools-group button,
.segment-options button,
.work-tabs button,
.action-buttons .approve,
#storeModalBody button:not([class]),
.brief-remove,
.modal-close {
  --bk-c: rgb(var(--hud));
  border-color: rgba(var(--hud), .45);
  box-shadow:
    inset 0 1px 0 rgba(190, 245, 255, .14),
    inset 0 0 18px rgba(var(--hud-blue), .14),
    0 0 10px rgba(var(--hud), .16);
  color: #e4faff;
  text-shadow: 0 0 6px rgba(var(--hud), .35);
}

.secondary:hover,
.msg-actions button:hover,
#openAccount:hover,
#logoutButton:hover,
.examples button:hover,
.tools-group button:hover,
.segment-options button:hover,
.work-tabs button:hover,
.action-buttons .approve:hover,
#storeModalBody button:not([class]):hover,
.brief-remove:hover,
.modal-close:hover,
.tools-group button:focus-visible {
  border-color: rgba(var(--hud), .8);
  box-shadow:
    inset 0 1px 0 rgba(190, 245, 255, .2),
    inset 0 0 22px rgba(var(--hud-blue), .22),
    0 0 18px rgba(var(--hud), .35);
  color: #ffffff;
}

/* Textos del inicio un poco más brillantes sobre el fondo oscuro. */
.system-label { text-shadow: 0 0 10px rgba(var(--hud), .5); }
.welcome h1 { text-shadow: 0 0 18px rgba(var(--hud), .35); }

/* =========================================================
   PORTADA (pantalla de entrar)
   Primero se ve qué hace €ERO, un ejemplo, el precio y la prueba.
   "Probar gratis" o "Ya tengo cuenta" enseñan el formulario.
   Quien ya ha entrado alguna vez (.returning) va directo al formulario.
   ========================================================= */

.auth-screen:not(.returning) { align-items: flex-start; }
.auth-screen:not(.returning) .auth-box { display: none; }
.auth-screen.returning .landing { display: none; }

.auth-box .auth-back {
  display: block;
  width: auto;
  margin: 0 auto 6px;
  padding: 4px 8px;
  border: 0;
  background: none;
  box-shadow: none;
  color: rgb(var(--hud));
  font-size: 13px;
  font-weight: 600;
  opacity: .85;
}

.landing {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 8px 4px 28px;
  text-align: center;
  color: #e4faff;
}

.landing-logo {
  display: block;
  width: min(190px, 52%);
  height: auto;
  margin: 0 auto 6px;
  filter: drop-shadow(0 0 10px rgba(var(--hud), .5)) drop-shadow(0 0 24px rgba(var(--hud-blue), .3));
}

body.android .landing-logo { filter: none; }

.landing-title {
  margin: 4px 0 10px;
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1.15;
  font-weight: 800;
  text-shadow: 0 0 18px rgba(var(--hud), .35);
}

.landing-title span { color: rgb(var(--hud)); }

.landing-sub {
  margin: 0 auto 18px;
  max-width: 400px;
  font-size: 16px;
  line-height: 1.45;
  color: #b9dcea;
}

.landing-demo {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0 0 18px;
  padding: 26px 14px 14px;
  border-radius: 14px;
  border: 1px solid rgba(var(--hud), .35);
  background: rgba(2, 10, 24, .78);
  box-shadow: 0 0 18px rgba(var(--hud), .12), inset 0 0 22px rgba(var(--hud-blue), .1);
  text-align: left;
}

.landing-demo-tag {
  position: absolute;
  top: 8px;
  left: 14px;
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: rgba(var(--hud), .8);
}

.landing-bubble {
  margin: 0;
  max-width: 86%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  opacity: 0;
  animation: landing-in .45s ease forwards;
}

.landing-bubble.lb-me {
  align-self: flex-end;
  background: rgba(22, 141, 255, .28);
  border: 1px solid rgba(22, 141, 255, .45);
}

.landing-bubble.lb-apex {
  align-self: flex-start;
  background: rgba(10, 40, 70, .7);
  border: 1px solid rgba(var(--hud), .3);
}

.landing-bubble.lb-card { border-color: rgba(var(--hud), .7); }

.landing-bubble:nth-of-type(1) { animation-delay: .3s; }
.landing-bubble:nth-of-type(2) { animation-delay: 1.1s; }
.landing-bubble:nth-of-type(3) { animation-delay: 2.1s; }
.landing-bubble:nth-of-type(4) { animation-delay: 2.8s; }

@keyframes landing-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-bubble { animation: none; opacity: 1; }
}

.landing-points {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
  text-align: left;
}

.landing-points li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 11px 14px;
  border-radius: 12px;
  border: 1px solid rgba(var(--hud), .22);
  background: rgba(2, 10, 24, .6);
}

.landing-points b { font-size: 15px; }
.landing-points span { font-size: 14px; color: #b9dcea; line-height: 1.4; }

.landing-price {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 14px;
}

.landing-price b { font-size: 22px; color: #fff; }
.landing-price span { font-size: 14px; color: #b9dcea; }
.landing-price[hidden] { display: none; }

/* Enlace de la portada a la página pública de €ERO (SEO). */
.landing-more { display: block; margin-top: 10px; text-align: center; font-size: 14px; color: #b9dcea; }
.landing-more:hover { color: #c5f7ff; }

.landing-cta {
  width: 100%;
  padding: 15px 18px;
  border: 0;
  border-radius: 12px;
  background: linear-gradient(180deg, #3fc8ff, #1689ff);
  color: #00121f;
  font: inherit;
  font-size: 17px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 22px rgba(var(--hud), .4);
}

.landing-cta:active { transform: scale(.98); }

.landing-login {
  display: block;
  margin: 12px auto 0;
  font-size: 15px;
}

/* Uso en Mi cuenta: barras como en Claude (se renuevan solas). */
.usage-bar {
  display: block;
  height: 6px;
  margin: 4px 0 8px;
  border-radius: 99px;
  background: rgba(var(--hud), .15);
  overflow: hidden;
}
.usage-bar > span {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: linear-gradient(90deg, #3fc8ff, #1689ff);
}

/* Logo de Apex (A + P + X con la bola) en el botón de la cabecera. */
.apex-entry { padding: 4px 13px 4px 6px; }
.apex-entry-logo {
  display: block;
  width: 26px;
  height: 26px;
  filter: drop-shadow(0 0 4px rgba(80, 228, 255, .55));
  animation: apexLogoGlow 4s ease-in-out infinite;
}
@keyframes apexLogoGlow {
  0%, 100% { filter: drop-shadow(0 0 3px rgba(80, 228, 255, .4)); }
  50%      { filter: drop-shadow(0 0 7px rgba(80, 228, 255, .85)); }
}
body.android .apex-entry-logo, body.lite .apex-entry-logo { animation: none; filter: none; }

/* Transición hacia Apex con el logo nuevo: el logo se coloca con su bola
   pequeña encima de la bola grande y hace zoom desde ahí (home-apex.js). */
.home-portal .hp-logo {
  position: absolute;
  left: 50%;
  top: 50%;
  /* Se dibuja 1,9 veces más grande y se reduce con scale: nunca se pixela. */
  width: calc(min(78vw, 44vh, 420px) * 1.9);
  height: auto;
  aspect-ratio: 1;
  overflow: visible;
  transform-origin: 50% 44.53%;
  mix-blend-mode: normal;
  will-change: transform, opacity;
}
.hp-halo {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(110vw, 64vh, 620px);
  height: min(110vw, 64vh, 620px);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80, 200, 255, .38) 0%, rgba(30, 120, 255, .16) 38%, rgba(30, 111, 255, 0) 68%);
  pointer-events: none;
  will-change: transform, opacity;
}

/* =========================================================
   FONDO DE APEX (pantalla de la bola, home-apex.js)
   La bola no cambia. Detrás: haces de luz, panal hexagonal, suelo con
   rejilla en perspectiva, polvo de luz que sube, una línea de escaneo,
   esquinas de visor, anillos grandes detrás de la bola y dos paneles
   (reloj y fecha; modo de Apex en tiempo real). Solo se anima transform
   y opacity; en Android y Modo ligero, quieto.
   ========================================================= */

.home-apex {
  background:
    radial-gradient(ellipse 70% 45% at 50% 44%, rgba(20, 110, 220, .22) 0%, rgba(4, 18, 42, 0) 70%),
    radial-gradient(circle at 50% 42%, #04122a 0%, #01040b 58%, #000 100%);
}
.home-apex > .ha-orb,
.home-apex > .ha-subs,
.home-apex > .ha-hint,
.home-apex > .ha-approve { position: relative; z-index: 1; }
.home-apex > .ha-up,
.home-apex > .ha-bar { z-index: 2; }
.ha-orb { isolation: isolate; }

.ha-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

/* Haces de luz desde arriba */
.hab-beams {
  position: absolute;
  left: 50%;
  top: -10%;
  width: 160%;
  height: 55%;
  transform: translateX(-50%);
  background:
    linear-gradient(100deg, transparent 38%, rgba(80, 200, 255, .07) 44%, transparent 50%),
    linear-gradient(80deg, transparent 50%, rgba(80, 200, 255, .06) 56%, transparent 62%),
    linear-gradient(90deg, transparent 46%, rgba(120, 220, 255, .05) 50%, transparent 54%);
  animation: hab-beams 9s ease-in-out infinite;
}
@keyframes hab-beams { 0%, 100% { opacity: .7; } 50% { opacity: 1; } }

/* Panal hexagonal, suave, alrededor del centro */
.hab-hex {
  position: absolute;
  inset: 0;
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='56' height='97' viewBox='0 0 56 97'%3E%3Cpath d='M28 0 L56 16 L56 48 L28 64 L0 48 L0 16 Z M28 64 L28 97' fill='none' stroke='%2350e4ff' stroke-opacity='.16' stroke-width='1'/%3E%3C/svg%3E");
  background-size: 56px 97px;
  background-position: center;
}

/* Suelo holográfico con rejilla en perspectiva: dibujo SVG plano, sin
   transformaciones 3D ni máscaras (en algunas tablets Android eso abría un
   "agujero" y se veía la pantalla de inicio por detrás). */
.hab-floor {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 40%;
  display: block;
}

/* Polvo de luz que sube */
.hab-dust i {
  position: absolute;
  bottom: -10px;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: #9ff0ff;
  box-shadow: 0 0 6px #50e4ff;
  opacity: 0;
  animation: hab-dust 11s linear infinite;
}
.hab-dust i:nth-child(1)  { left: 6%;  animation-delay: 0s; }
.hab-dust i:nth-child(2)  { left: 14%; animation-delay: 3.5s; animation-duration: 13s; }
.hab-dust i:nth-child(3)  { left: 22%; animation-delay: 7s; }
.hab-dust i:nth-child(4)  { left: 31%; animation-delay: 1.5s; animation-duration: 15s; }
.hab-dust i:nth-child(5)  { left: 39%; animation-delay: 9s; }
.hab-dust i:nth-child(6)  { left: 47%; animation-delay: 4.5s; animation-duration: 12s; }
.hab-dust i:nth-child(7)  { left: 55%; animation-delay: 2s; }
.hab-dust i:nth-child(8)  { left: 62%; animation-delay: 6s; animation-duration: 14s; }
.hab-dust i:nth-child(9)  { left: 70%; animation-delay: 10s; }
.hab-dust i:nth-child(10) { left: 77%; animation-delay: 0.8s; animation-duration: 12s; }
.hab-dust i:nth-child(11) { left: 84%; animation-delay: 5.2s; }
.hab-dust i:nth-child(12) { left: 91%; animation-delay: 8.4s; animation-duration: 16s; }
.hab-dust i:nth-child(13) { left: 35%; animation-delay: 11s; width: 2px; height: 2px; }
.hab-dust i:nth-child(14) { left: 66%; animation-delay: 12.5s; width: 2px; height: 2px; }
@keyframes hab-dust {
  0%   { transform: translateY(0); opacity: 0; }
  10%  { opacity: .9; }
  80%  { opacity: .5; }
  100% { transform: translateY(-105vh); opacity: 0; }
}

/* Línea de escaneo que baja despacio */
.hab-scan {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  background: linear-gradient(90deg, transparent, rgba(120, 230, 255, .55), transparent);
  box-shadow: 0 0 14px rgba(80, 228, 255, .5);
  opacity: .45;
  animation: hab-scan 7s ease-in-out infinite;
}
@keyframes hab-scan { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: .45; } 85% { opacity: .45; } 100% { transform: translateY(100vh); opacity: 0; } }

/* Esquinas de visor */
.hab-corner {
  position: absolute;
  width: 26px;
  height: 26px;
  border: 0 solid rgba(80, 228, 255, .55);
}
.hab-corner.tl { top: 52px; left: 12px; border-top-width: 2px; border-left-width: 2px; }
.hab-corner.tr { top: 52px; right: 12px; border-top-width: 2px; border-right-width: 2px; }
.hab-corner.bl { bottom: calc(76px + env(safe-area-inset-bottom)); left: 12px; border-bottom-width: 2px; border-left-width: 2px; }
.hab-corner.br { bottom: calc(76px + env(safe-area-inset-bottom)); right: 12px; border-bottom-width: 2px; border-right-width: 2px; }

/* Paneles: reloj y fecha (izquierda), modo de Apex (derecha) */
.hab-panel {
  position: absolute;
  top: 62px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 42%;
  padding: 8px 10px;
  border: 1px solid rgba(80, 228, 255, .22);
  background: linear-gradient(180deg, rgba(6, 26, 48, .55), rgba(2, 10, 22, .35));
  font-size: 10.5px;
  letter-spacing: .12em;
  color: rgba(160, 230, 255, .85);
  text-transform: uppercase;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 10px 100%, 0 calc(100% - 10px));
}
.hab-panel.left { left: 22px; }
.hab-panel.right { right: 22px; align-items: flex-end; text-align: right; }
.hab-panel b { font-weight: 700; color: rgba(80, 228, 255, .95); }
.hab-live i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 2px;
  border-radius: 50%;
  background: #4dffb5;
  box-shadow: 0 0 8px #4dffb5;
  animation: hab-blink 2s ease-in-out infinite;
}
@keyframes hab-blink { 50% { opacity: .35; } }
.hab-clock { font-size: 22px; letter-spacing: .06em; color: #e4faff; font-weight: 700; text-shadow: 0 0 10px rgba(80, 228, 255, .5); }
.hab-date { font-size: 9.5px; opacity: .8; }
.hab-mode { font-size: 13px; color: #e4faff; font-weight: 700; text-shadow: 0 0 8px rgba(80, 228, 255, .5); }
.hab-eq { display: flex; gap: 3px; align-items: flex-end; height: 16px; margin-top: 3px; }
.hab-eq i {
  width: 3px;
  height: 100%;
  background: linear-gradient(180deg, #8ff3ff, #1689ff);
  transform-origin: 50% 100%;
  transform: scaleY(.2);
  animation: hab-eq 1.1s ease-in-out infinite;
  opacity: .5;
}
.hab-eq i:nth-child(2) { animation-delay: .15s; } .hab-eq i:nth-child(3) { animation-delay: .3s; }
.hab-eq i:nth-child(4) { animation-delay: .45s; } .hab-eq i:nth-child(5) { animation-delay: .6s; }
.hab-eq i:nth-child(6) { animation-delay: .75s; } .hab-eq i:nth-child(7) { animation-delay: .9s; }
@keyframes hab-eq { 0%, 100% { transform: scaleY(.2); } 50% { transform: scaleY(.5); } }
/* El ecualizador se mueve más cuando Apex escucha o habla. */
.home-apex[data-state="speaking"] .hab-eq i,
.home-apex[data-state="listening"] .hab-eq i { animation-duration: .55s; opacity: 1; }
.home-apex[data-state="speaking"] .hab-eq i { animation-name: hab-eq-on; }
.home-apex[data-state="listening"] .hab-eq i { animation-name: hab-eq-on; }
@keyframes hab-eq-on { 0%, 100% { transform: scaleY(.25); } 50% { transform: scaleY(1); } }
.home-apex[data-state="thinking"] .hab-mode { animation: hab-blink .9s ease-in-out infinite; }

/* Texto que corre abajo, muy suave */
.hab-ticker {
  position: absolute;
  left: 0;
  bottom: calc(66px + env(safe-area-inset-bottom));
  display: flex;
  white-space: nowrap;
  font-size: 9.5px;
  letter-spacing: .3em;
  color: rgba(80, 228, 255, .28);
  animation: hab-ticker 40s linear infinite;
}
.hab-ticker span { padding-right: 2em; }
@keyframes hab-ticker { to { transform: translateX(-50%); } }

/* Anillos grandes detrás de la bola (dentro de .ha-orb, detrás del lienzo) */
.hab-rings {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 150%;
  height: 150%;
  margin: -75% 0 0 -75%;
  z-index: -1;
  fill: none;
  stroke: rgb(80, 228, 255);
  pointer-events: none;
  will-change: transform;
}
.hab-rings.r1 { stroke-width: 3; opacity: .28; animation: hud-spin 120s linear infinite; }
.hab-rings.r2 { stroke-width: 2; opacity: .22; animation: hud-spin 70s linear infinite reverse; }
.hab-rings.r3 { stroke-width: 10; opacity: .12; animation: hud-spin 160s linear infinite; }
.hab-rings.r4 { stroke-width: 3; opacity: .4; will-change: auto; }

/* Pantallas bajas: menos elementos para no tapar nada */
@media (max-height: 620px) {
  .hab-panel, .hab-ticker { display: none; }
}

/* Android y Modo ligero: todo quieto (la bola sigue animada) */
body.android .ha-bg *, body.lite .ha-bg *,
body.android .hab-rings, body.lite .hab-rings { animation: none !important; }
body.android .hab-dust, body.lite .hab-dust, body.lite .hab-scan, body.android .hab-scan { display: none; }

/* Pantalla de Apex preparada debajo de la transición (invisible hasta el final). */
.home-apex.ha-under { opacity: 0; pointer-events: none; }
/* Con el portal ya opaco encima: se pinta (invisible para el usuario) y así
   todo está listo antes de enseñarse. */
.home-apex.ha-under.ha-ready { opacity: 1; }
.home-apex.ha-leaving { opacity: 0; transition: opacity .4s ease; pointer-events: none; }
/* La bola de la transición: misma imagen que la de Apex, sin mezclas raras. */
.home-portal .hp-ball { image-rendering: auto; backface-visibility: hidden; }


/* Mientras se va a Apex o Apex está abierto, el fondo animado del inicio
   (que queda tapado) se para: la tarjeta gráfica solo trabaja en lo que se ve. */
body.home-pulling .hud,
body.home-pulling .hud *,
body.home-apex-open .hud,
body.home-apex-open .hud *,
body.home-apex-open #appScreen main *,
body.home-apex-open #appScreen main *::before,
body.home-apex-open #appScreen main *::after { animation-play-state: paused !important; }
body.home-apex-open .hud { visibility: hidden; }

/* =========================================================
   TABLETS: transición hacia Apex sin trozos mezclados y fondo
   "currado" también en la pantalla de Apex del botón de arriba.
   ========================================================= */

/* Lo que queda tapado no se dibuja: así la tarjeta gráfica de la tablet
   llega a todo (antes se veían cuadros del inicio, de Apex y del portal). */
body.home-covered #appScreen main,
body.home-apex-open #appScreen main,
body.apex-open #appScreen main,
body.home-covered .hud,
body.apex-open .hud { visibility: hidden; }
body.apex-open .hud *,
body.apex-open #appScreen main * { animation-play-state: paused !important; }

/* La bola de la transición: además de la mezcla de colores, recortada en
   redondo con borde suave (si la mezcla falla en una tablet, ya no sale el
   cuadro negro alrededor de la bola). */
.home-portal .hp-ball {
  mix-blend-mode: screen;
  border-radius: 50%;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 66%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 66%, transparent 100%);
}

/* Rayos del portal: más pequeños (menos memoria) y quietos en Android. */
.hp-rays { inset: auto; left: 50%; top: 50%; width: 120vmax; height: 120vmax; margin: -60vmax 0 0 -60vmax; will-change: auto; }
body.android .hp-rays { animation: none; }

/* Pantalla de Apex del botón de arriba: el mismo fondo que la bola del inicio. */
.apex {
  background:
    radial-gradient(ellipse 70% 45% at 50% 44%, rgba(20, 110, 220, .22) 0%, rgba(4, 18, 42, 0) 70%),
    radial-gradient(circle at 50% 42%, #04122a 0%, #01040b 58%, #000 100%);
}
.apex > .ha-bg { position: absolute; inset: 0; z-index: 0; }
.ha-bg-simple .hab-corner.tl, .ha-bg-simple .hab-corner.tr { top: calc(78px + env(safe-area-inset-top)); }
.ha-bg-simple .hab-corner.bl, .ha-bg-simple .hab-corner.br { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* =========================================================
   OFICINA DE APEX: ondas de tu voz, paneles holográficos y
   órdenes rápidas (home-apex.js). Apex sigue sola en el centro:
   los paneles solo salen cuando se piden.
   ========================================================= */

/* Más sitio abajo para la fila de órdenes rápidas. */
.home-apex { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }

/* --- Ondas que crecen con tu voz (solo escuchando) --- */
.ha-waves {
  --lvl: 0;
  position: absolute;
  inset: 17%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: scale(calc(1 + var(--lvl) * .14));
  transition: opacity .35s ease, transform .09s linear;
}
.ha-waves i {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2.5px solid rgba(140, 242, 255, .95);
  box-shadow: 0 0 22px rgba(80, 228, 255, .7), inset 0 0 22px rgba(80, 228, 255, .35);
  opacity: 0;
}
.home-apex[data-state="listening"] .ha-waves { opacity: calc(.35 + var(--lvl) * .65); }
.home-apex[data-state="listening"] .ha-waves i { animation: ha-wave 1.8s cubic-bezier(.2, .6, .35, 1) infinite; }
.home-apex[data-state="listening"] .ha-waves i:nth-child(2) { animation-delay: .6s; }
.home-apex[data-state="listening"] .ha-waves i:nth-child(3) { animation-delay: 1.2s; }
@keyframes ha-wave {
  0% { transform: scale(.92); opacity: 0; }
  15% { opacity: 1; }
  100% { transform: scale(1.5); opacity: 0; }
}

/* --- Fila de abajo: paneles (izquierda en grande) + órdenes rápidas --- */
.ha-quick {
  position: absolute;
  left: 50%;
  bottom: calc(74px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 20px);
  overflow-x: auto;
  scrollbar-width: none;
  touch-action: pan-x;
  transition: opacity .3s ease;
}
.ha-quick::-webkit-scrollbar { display: none; }
@media (max-width: 759px), (max-height: 619px) {
  .ha-quick {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 26px), transparent);
    padding-right: 22px;
  }
}
.ha-dock, .ha-chips { display: flex; gap: 6px; flex: none; }
.ha-dock button,
.ha-chips button {
  flex: none;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(80, 228, 255, .32);
  background: linear-gradient(180deg, rgba(8, 34, 60, .78), rgba(3, 14, 28, .78));
  color: rgba(200, 244, 255, .95);
  font: inherit;
  font-size: 13px;
  letter-spacing: .02em;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: inset 0 0 12px rgba(80, 228, 255, .08);
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.ha-chips button { padding: 0 13px; }
.ha-dock button { width: 34px; padding: 0; font-size: 15px; font-weight: 700; color: var(--cyan-bright); }
.ha-dock button.on,
.ha-dock button:hover,
.ha-chips button:hover { border-color: rgba(120, 240, 255, .8); box-shadow: 0 0 14px rgba(80, 228, 255, .35), inset 0 0 12px rgba(80, 228, 255, .18); }
.ha-dock button:active, .ha-chips button:active { transform: scale(.95); }
.ha-dock { padding-right: 8px; border-right: 1px solid rgba(80, 228, 255, .2); }

/* Mientras Apex escucha, piensa o habla, las órdenes rápidas se apartan. */
.home-apex:not([data-state="idle"]) .ha-chips { opacity: .25; pointer-events: none; }

/* Pantalla grande: los paneles pasan a una columna a la izquierda. */
@media (min-width: 760px) and (min-height: 620px) {
  .ha-quick { display: contents; }
  .ha-dock {
    position: absolute;
    left: 22px;
    top: 150px;
    z-index: 2;
    flex-direction: column;
    gap: 8px;
    padding: 0;
    border: 0;
  }
  .ha-dock button { width: 40px; height: 40px; font-size: 17px; border-radius: 12px; }
  .ha-chips {
    position: absolute;
    left: 50%;
    bottom: calc(76px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 2;
    transition: opacity .3s ease;
  }
}

/* --- Panel holográfico --- */
.ha-holo {
  position: absolute;
  z-index: 3;
  left: 50%;
  top: 52px;
  width: min(340px, calc(100% - 24px));
  max-height: calc(100% - 200px);
  display: flex;
  flex-direction: column;
  transform: translateX(-50%);
  padding: 12px 14px 14px;
  border: 1px solid rgba(110, 236, 255, .5);
  background:
    repeating-linear-gradient(180deg, rgba(80, 228, 255, .05) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(10, 44, 78, .72), rgba(2, 12, 26, .8));
  box-shadow: 0 0 28px rgba(60, 200, 255, .28), inset 0 0 30px rgba(80, 228, 255, .1);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #e4faff;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 16px, 100% 100%, 16px 100%, 0 calc(100% - 16px));
  touch-action: pan-y;
}
.ha-holo[hidden] { display: none; }
.ha-holo.in { animation: ha-holo-in .42s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes ha-holo-in {
  0% { opacity: 0; transform: translateX(-50%) scaleY(.04) scaleX(.6); filter: brightness(2.4); }
  45% { opacity: 1; transform: translateX(-50%) scaleY(.08) scaleX(1); }
  70% { opacity: .75; }
  100% { opacity: 1; transform: translateX(-50%) scale(1); filter: none; }
}
@media (min-width: 760px) and (min-height: 620px) {
  .ha-holo { left: 76px; top: 150px; transform: none; max-height: calc(100% - 260px); }
  @keyframes ha-holo-in-side {
    0% { opacity: 0; transform: scaleX(.04) scaleY(.6); transform-origin: 0 50%; filter: brightness(2.4); }
    45% { opacity: 1; transform: scaleX(.08) scaleY(1); transform-origin: 0 50%; }
    70% { opacity: .75; }
    100% { opacity: 1; transform: none; filter: none; }
  }
  .ha-holo.in { animation-name: ha-holo-in-side; }
}
.ha-holo-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.ha-holo-head b { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--cyan-bright); text-shadow: 0 0 10px rgba(80, 228, 255, .6); }
.ha-holo-x { width: 28px; height: 28px; border-radius: 8px; border: 1px solid rgba(80, 228, 255, .3); background: transparent; color: rgba(200, 244, 255, .9); cursor: pointer; font: inherit; }
.ha-holo-body { overflow-y: auto; min-height: 0; }
.ha-holo-stats { display: flex; gap: 8px; margin-bottom: 10px; }
.ha-holo-stats span {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(80, 228, 255, .2);
  background: rgba(4, 22, 42, .5);
  font-size: 10.5px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: rgba(160, 230, 255, .8);
}
.ha-holo-stats b { font-size: 18px; letter-spacing: .02em; text-transform: none; color: #fff; text-shadow: 0 0 10px rgba(80, 228, 255, .55); }
.ha-holo-stats .warn b, .ha-holo-list small.warn { color: #ffb36b; }
.ha-holo-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ha-holo-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 7px 9px;
  border-left: 2px solid rgba(80, 228, 255, .55);
  background: linear-gradient(90deg, rgba(80, 228, 255, .1), rgba(80, 228, 255, 0));
  font-size: 14px;
  line-height: 1.35;
  transition: opacity .4s ease;
}
.ha-holo-list li span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ha-holo-list li small { flex: none; color: rgba(160, 230, 255, .75); font-size: 12px; }
.ha-holo-list li.done { opacity: .35; text-decoration: line-through; }
.ha-check {
  flex: none;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 1.5px solid rgba(110, 236, 255, .7);
  background: transparent;
  cursor: pointer;
}
.ha-check.on { background: radial-gradient(circle, #8ff3ff 0 35%, transparent 40%); box-shadow: 0 0 10px rgba(80, 228, 255, .6); }
.ha-holo-empty { margin: 4px 0; color: rgba(200, 244, 255, .8); font-size: 14px; line-height: 1.45; }
.ha-holo-more {
  margin-top: 10px;
  width: 100%;
  padding: 8px;
  border: 1px solid rgba(80, 228, 255, .3);
  background: rgba(4, 22, 42, .6);
  color: var(--cyan-bright);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

/* Pantallas bajas: las órdenes rápidas, más pequeñas. */
@media (max-height: 640px) {
  .home-apex { padding-bottom: calc(118px + env(safe-area-inset-bottom)); }
  .ha-chips button, .ha-dock button { height: 30px; font-size: 12.5px; }
  .ha-dock button { width: 30px; }
}

body.lite .ha-waves i, body.android .ha-waves i { animation-duration: 2.4s; }
body.lite .ha-holo { -webkit-backdrop-filter: none; backdrop-filter: none; }
@media (prefers-reduced-motion: reduce) {
  .ha-waves i, .ha-holo.in { animation: none !important; }
}

/* =========================================================
   TU EQUIPO: cada empleado IA es una mini bola de su color
   (progress.js). En el chat, su punto se enciende mientras trabaja.
   ========================================================= */
.team-orbs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 12px 0 6px;
}
@media (max-width: 520px) { .team-orbs { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.agent-card {
  --agent: #50e4ff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 14px 8px 12px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--agent) 28%, transparent);
  background: radial-gradient(circle at 50% 30%, color-mix(in srgb, var(--agent) 12%, transparent), rgba(3, 12, 24, .6) 70%);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  text-align: center;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.agent-card b { font-size: 13.5px; line-height: 1.2; }
.agent-card small { color: var(--muted); font-size: 12px; }
.agent-card:hover { border-color: color-mix(in srgb, var(--agent) 60%, transparent); }
.agent-card:active { transform: scale(.97); }
.agent-card[aria-pressed="true"] {
  border-color: var(--agent);
  box-shadow: 0 0 0 1px var(--agent), 0 0 22px color-mix(in srgb, var(--agent) 40%, transparent);
}

/* La mini bola: núcleo brillante, red de "neuronas" girando y un anillo. */
.agent-orb {
  --agent: inherit;
  --glow: .35;
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background:
    radial-gradient(circle at 50% 50%, #fff 0 6%, color-mix(in srgb, var(--agent) 85%, #fff) 14%, transparent 40%),
    radial-gradient(circle at 36% 30%, color-mix(in srgb, var(--agent) 55%, #fff) 0 8%, transparent 30%),
    radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--agent) 70%, #000) 0 45%, color-mix(in srgb, var(--agent) 25%, #000) 68%, transparent 72%);
  box-shadow: 0 0 calc(10px + 22px * var(--glow)) color-mix(in srgb, var(--agent) calc(40% * var(--glow) + 20%), transparent);
  filter: saturate(calc(.55 + var(--glow)));
  animation: agent-breathe 3.6s ease-in-out infinite;
}
.agent-orb[data-level="0"] { --glow: .15; opacity: .72; }
.agent-orb[data-level="1"] { --glow: .45; }
.agent-orb[data-level="2"] { --glow: .75; }
.agent-orb[data-level="3"] { --glow: 1; animation-duration: 2.4s; }
.agent-orb::before {
  content: "";
  position: absolute;
  inset: 8%;
  border-radius: 50%;
  background:
    radial-gradient(circle at 30% 40%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 70% 30%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 62% 72%, #fff 0 1.5px, transparent 2.5px),
    radial-gradient(circle at 26% 70%, #fff 0 1.2px, transparent 2px),
    conic-gradient(from 0deg, transparent 0 12%, color-mix(in srgb, var(--agent) 60%, #fff) 13% 14%, transparent 15% 40%, color-mix(in srgb, var(--agent) 60%, #fff) 41% 42%, transparent 43% 70%, color-mix(in srgb, var(--agent) 60%, #fff) 71% 72%, transparent 73%);
  opacity: .55;
  -webkit-mask-image: radial-gradient(circle, #000 55%, transparent 72%);
  mask-image: radial-gradient(circle, #000 55%, transparent 72%);
  animation: hud-spin 14s linear infinite;
}
.agent-orb i {
  position: absolute;
  inset: -7px;
  border-radius: 50%;
  border: 1.5px dashed color-mix(in srgb, var(--agent) 55%, transparent);
  animation: hud-spin 22s linear infinite reverse;
}
.agent-orb.small { width: 40px; height: 40px; flex: none; }
.agent-orb.small i { inset: -5px; }
@keyframes agent-breathe { 50% { transform: scale(1.06); } }

.agent-detail {
  --agent: #50e4ff;
  margin: 8px 0 4px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--agent) 40%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--agent) 10%, transparent), rgba(3, 12, 24, .5));
  animation: agent-detail-in .3s ease both;
}
.agent-detail[hidden] { display: none; }
@keyframes agent-detail-in { from { opacity: 0; transform: translateY(-6px); } }
.agent-detail-head { display: flex; align-items: center; gap: 12px; }
.agent-detail-head > div { display: flex; flex-direction: column; gap: 2px; }
.agent-detail-head small { color: var(--muted); }
.agent-week { margin: 10px 0; color: var(--muted); font-size: 14px; }
.agent-detail .team-ask { width: 100%; text-align: left; white-space: normal; }
.agent-form { display: flex; gap: 8px; margin-top: 8px; }
.agent-form input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: rgba(3, 12, 24, .7);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.team-progress { width: 100%; margin-top: 10px; }

/* En el chat: el punto del empleado que trabaja la respuesta. */
.agent-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 3px;
  vertical-align: -1px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff 0 15%, var(--agent, #50e4ff) 45%, color-mix(in srgb, var(--agent, #50e4ff) 40%, #000) 100%);
  box-shadow: 0 0 6px var(--agent, #50e4ff);
}
.team-working .agent-dot,
.streaming .agent-dot { animation: agent-working .9s ease-in-out infinite; }
@keyframes agent-working {
  50% { transform: scale(1.35); box-shadow: 0 0 14px var(--agent, #50e4ff), 0 0 3px #fff; }
}

body.lite .agent-orb, body.lite .agent-orb::before, body.lite .agent-orb i { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .agent-orb, .agent-orb::before, .agent-orb i, .agent-dot { animation: none !important; }
}

/* =========================================================
   LA OFICINA TIPO TONY STARK (home-apex.js → roomSVG)
   Sala holográfica en perspectiva: techo con luces, paredes con
   rejilla y pantallas, pared del fondo y mesa de luz bajo Apex.
   Todo plano (SVG y degradados): nada de 3D en el fondo.
   La sala toma el color del panel abierto y se ilumina cuando
   Apex escucha o habla.
   ========================================================= */
.home-apex, .apex { --tint: 80, 228, 255; }
.home-apex[data-holo="sales"] { --tint: 95, 240, 168; }
.home-apex[data-holo="ideas"] { --tint: 255, 204, 102; }

.hab-room {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  color: rgb(var(--tint, 80, 228, 255));
  transition: color .8s ease;
}
.hab-room * { vector-effect: non-scaling-stroke; }
.room-wall, .room-back { stroke: none; }
.room-grid { fill: none; stroke: currentColor; stroke-width: 1; stroke-opacity: .13; }
.room-grid.back { stroke-opacity: .1; }
.room-edge { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-opacity: .45; }
.room-light {
  fill: currentColor;
  fill-opacity: .12;
  animation: room-light 6s ease-in-out infinite;
}
.room-light:nth-of-type(2) { animation-delay: 2s; }
.room-light:nth-of-type(3) { animation-delay: 4s; }
@keyframes room-light { 0%, 100% { fill-opacity: .09; } 50% { fill-opacity: .18; } }

/* Pantallas de las paredes */
.rs-frame { fill: currentColor; fill-opacity: .06; stroke: currentColor; stroke-width: 1.2; stroke-opacity: .55; }
.rs-bar { fill: currentColor; fill-opacity: .4; animation: rs-bar 2.8s ease-in-out infinite; }
@keyframes rs-bar { 0%, 100% { fill-opacity: .22; } 50% { fill-opacity: .6; } }
.rs-wave { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-opacity: .75; stroke-dasharray: 6 4; animation: rs-wave 3s linear infinite; }
@keyframes rs-wave { to { stroke-dashoffset: -60; } }
.rs-text { stroke: currentColor; stroke-width: 2; stroke-opacity: .45; }
.room-screen { animation: rs-flicker 9s steps(1) infinite; }
.room-screen:nth-of-type(2n) { animation-delay: 4.3s; }
@keyframes rs-flicker { 0%, 100% { opacity: 1; } 61% { opacity: .55; } 62% { opacity: 1; } 63% { opacity: .7; } 64% { opacity: 1; } }

/* Resplandor de la sala: sube cuando Apex escucha o habla. */
.hab-room-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 55% 45% at 50% 42%, rgba(var(--tint, 80, 228, 255), .16), transparent 70%);
  opacity: .5;
  transition: opacity .6s ease, background .8s ease;
}
.home-apex[data-state="listening"] .hab-room-glow { opacity: .85; }
.home-apex[data-state="speaking"] .hab-room-glow { opacity: 1; animation: room-breathe 1.6s ease-in-out infinite; }
.home-apex[data-state="thinking"] .hab-room-glow { opacity: .75; animation: room-breathe 2.4s ease-in-out infinite; }
@keyframes room-breathe { 50% { opacity: .65; } }
.home-apex[data-state="speaking"] .room-edge { stroke-opacity: .7; }
.room-edge { transition: stroke-opacity .5s ease; }

/* Menos panal: ahora las paredes ya tienen su rejilla. */
.hab-hex { opacity: .14; }

/* --- Mesa de luz bajo Apex (proyector del holograma) --- */
.ha-table {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 86%;
  height: 20%;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
  background:
    radial-gradient(ellipse at 50% 50%, rgba(var(--tint), .6) 0 10%, rgba(var(--tint), .14) 46%, transparent 70%);
  box-shadow: 0 0 0 1.5px rgba(var(--tint), .35), 0 0 30px rgba(var(--tint), .3);
  transition: background .8s ease, box-shadow .8s ease;
}
.ha-table::before {
  /* Haz de luz que sube de la mesa a la bola */
  content: "";
  position: absolute;
  left: 18%;
  right: 18%;
  bottom: 50%;
  height: 300%;
  background: linear-gradient(0deg, rgba(var(--tint), .22), rgba(var(--tint), 0) 80%);
  clip-path: polygon(38% 100%, 62% 100%, 100% 0, 0 0);
}
.ha-table i {
  position: absolute;
  inset: 22% 24%;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--tint), .5);
  animation: ha-table-pulse 3s ease-in-out infinite;
}
@keyframes ha-table-pulse { 50% { opacity: .35; } }
.home-apex[data-state="speaking"] .ha-table { box-shadow: 0 0 0 1.5px rgba(var(--tint), .6), 0 0 46px rgba(var(--tint), .55); }

/* --- Paneles holográficos flotando (inclinados como pantallas en el aire) --- */
.ha-holo { animation: none; }
.ha-holo:not([hidden]) { animation: ha-holo-float 6s ease-in-out infinite; }
.ha-holo.in { animation: ha-holo-in .42s cubic-bezier(.2, .8, .3, 1) both, ha-holo-float 6s ease-in-out .42s infinite; }
@keyframes ha-holo-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
.home-apex[data-holo="sales"] .ha-holo { border-color: rgba(95, 240, 168, .55); box-shadow: 0 0 28px rgba(95, 240, 168, .25), inset 0 0 30px rgba(95, 240, 168, .1); }
.home-apex[data-holo="ideas"] .ha-holo { border-color: rgba(255, 204, 102, .55); box-shadow: 0 0 28px rgba(255, 204, 102, .22), inset 0 0 30px rgba(255, 204, 102, .08); }
@media (min-width: 760px) and (min-height: 620px) {
  /* En grande, el panel se inclina hacia Apex, como una pantalla flotando. */
  body:not(.android):not(.lite) .ha-holo { transform: perspective(1100px) rotateY(16deg); transform-origin: 0 50%; }
  body:not(.android):not(.lite) .ha-holo.in { animation: ha-holo-in-tilt .5s cubic-bezier(.2, .8, .3, 1) both, ha-holo-float 6s ease-in-out .5s infinite; }
  @keyframes ha-holo-in-tilt {
    0% { opacity: 0; transform: perspective(1100px) rotateY(80deg); filter: brightness(2.4); }
    60% { opacity: 1; }
    100% { opacity: 1; transform: perspective(1100px) rotateY(16deg); filter: none; }
  }
}

/* Android y Modo ligero: la sala se queda quieta (sigue viéndose). */
body.android .hab-room *, body.lite .hab-room *,
body.android .ha-table i, body.lite .ha-table i,
body.android .ha-holo, body.lite .ha-holo { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .hab-room *, .ha-table i, .hab-room-glow, .ha-holo { animation: none !important; }
}

/* =========================================================
   OFICINA: MÁS DETALLE
   Techo con lámpara de anillo, panal en la pared del fondo,
   columnas de luz, pantallas de muchos tipos (código, globo,
   radar, medidor), mesas de trabajo con pantalla flotante,
   etiquetas del sistema, suelo que reacciona a Apex y arranque
   por partes al entrar.
   ========================================================= */
.hab-floor { color: rgb(var(--tint, 80, 228, 255)); transition: color .8s ease; }

/* Techo y lámpara */
.room-lamp {
  fill: none;
  stroke: currentColor;
  stroke-width: 3;
  stroke-opacity: .85;
}
.room-lamp-beam { fill: currentColor; fill-opacity: .035; }
.home-apex[data-state="speaking"] .room-lamp-beam { fill-opacity: .06; }

/* Pared del fondo: panal que respira por partes y columnas de luz */
.room-hex { fill: currentColor; fill-opacity: .015; stroke: currentColor; stroke-width: 1; stroke-opacity: .16; animation: room-hex 9s ease-in-out infinite; }
@keyframes room-hex { 0%, 85%, 100% { fill-opacity: .015; } 92% { fill-opacity: .14; stroke-opacity: .5; } }
.room-pillar { opacity: .5; animation: room-pillar 4s ease-in-out infinite; }
.room-pillar.b { animation-delay: 2s; }
@keyframes room-pillar { 0%, 100% { opacity: .25; } 50% { opacity: .8; } }
.room-skirt { fill: none; stroke: currentColor; stroke-width: 2.5; stroke-opacity: .55; }

/* Pantallas: más tipos */
.rs-corner { fill: none; stroke: currentColor; stroke-width: 2; stroke-opacity: .9; }
.rs-wave.b { stroke-opacity: .4; stroke-dasharray: none; animation: none; }
.rs-globe { fill: none; stroke: currentColor; stroke-width: 1.3; stroke-opacity: .7; }
.rs-globe.m { stroke-opacity: .35; }
.rs-node { fill: currentColor; fill-opacity: .9; }
.rs-node.blip { animation: rs-blip 3s ease-in-out infinite; }
@keyframes rs-blip { 0%, 70%, 100% { fill-opacity: 0; } 78% { fill-opacity: 1; } }
.room-screen.globe { animation: rs-flicker 9s steps(1) infinite, rs-globe 5s ease-in-out infinite; }
@keyframes rs-globe { 50% { opacity: .75; } }
.rs-sweep { fill: currentColor; fill-opacity: 0; animation: rs-sweep 3s linear infinite; }
@keyframes rs-sweep { 0% { fill-opacity: .45; } 30% { fill-opacity: .08; } 60%, 100% { fill-opacity: 0; } }
.rs-code { stroke: currentColor; stroke-width: 2.2; stroke-opacity: .65; stroke-dasharray: 200; stroke-dashoffset: 200; animation: rs-code 3.2s ease-in-out infinite; }
@keyframes rs-code { 0% { stroke-dashoffset: 200; } 35%, 75% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -200; } }
.rs-arc { fill: none; stroke: currentColor; stroke-width: 3.5; stroke-opacity: .9; stroke-dasharray: 400; animation: rs-arc 6s ease-in-out infinite; }
@keyframes rs-arc { 0%, 100% { stroke-dashoffset: 120; } 50% { stroke-dashoffset: 30; } }
.rs-scanline { fill: currentColor; fill-opacity: .18; animation: rs-scanline 4s linear infinite; }
@keyframes rs-scanline { 0%, 100% { fill-opacity: 0; } 10% { fill-opacity: .25; } 40% { fill-opacity: 0; } }

/* Mesas de trabajo */
.hab-props {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  color: rgb(var(--tint, 80, 228, 255));
  transition: color .8s ease;
}
.hab-props * { vector-effect: non-scaling-stroke; }
.desk-top { fill: rgba(6, 26, 48, .85); stroke: currentColor; stroke-width: 1.2; stroke-opacity: .5; }
.desk-front { fill: rgba(2, 10, 22, .92); stroke: currentColor; stroke-width: 1; stroke-opacity: .3; }
.desk-edge { stroke: currentColor; stroke-width: 2.5; stroke-opacity: .95; }
.desk-keys { stroke: currentColor; stroke-width: 1.2; stroke-opacity: .55; stroke-dasharray: 3 3; }
.desk-holo { fill: currentColor; fill-opacity: .07; stroke: currentColor; stroke-width: 1; stroke-opacity: .45; animation: desk-holo 5s ease-in-out infinite; }
@keyframes desk-holo { 0%, 100% { fill-opacity: .05; } 50% { fill-opacity: .12; } }
.desk-holo-lines { stroke: currentColor; stroke-width: 1.6; stroke-opacity: .6; }

/* Etiquetas del sistema (solo en pantallas grandes) */
.hab-labels { position: absolute; inset: 0; }
.hl {
  position: absolute;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 9.5px;
  letter-spacing: .18em;
  color: rgba(var(--tint, 80, 228, 255), .7);
  text-shadow: 0 0 8px rgba(var(--tint, 80, 228, 255), .5);
  white-space: nowrap;
  transition: color .8s ease;
}
.hl b { font-size: 12px; letter-spacing: .12em; color: #e4faff; font-weight: 700; }
.hl::before { content: ""; width: 26px; height: 1px; margin-bottom: 3px; background: currentColor; }
.hl.l1 { left: 18.6%; top: 7%; }
.hl.l2 { left: 18.6%; top: 42%; }
.hl.l3 { right: 18.6%; top: 7%; align-items: flex-end; text-align: right; }
.hl.l4 { right: 18.6%; top: 42%; align-items: flex-end; text-align: right; }
@media (max-width: 899px), (max-height: 619px) { .hab-labels { display: none; } }

/* Suelo que reacciona: ondas que salen de la mesa y reflejo de Apex */
.ha-table s {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--tint), .45);
  opacity: 0;
  animation: ha-ripple 6s ease-out infinite;
}
.ha-table s:nth-of-type(2) { animation-delay: 2s; }
.ha-table s:nth-of-type(3) { animation-delay: 4s; }
@keyframes ha-ripple { 0% { transform: scale(.4); opacity: .7; } 100% { transform: scale(2.1); opacity: 0; } }
.home-apex[data-state="speaking"] .ha-table s { animation-duration: 2.4s; border-color: rgba(var(--tint), .75); }
.home-apex[data-state="listening"] .ha-table s { animation-duration: 3.4s; }
.ha-table u {
  /* Reflejo de la bola en el suelo brillante */
  position: absolute;
  left: 30%;
  right: 30%;
  top: 55%;
  height: 120%;
  border-radius: 50%;
  background: radial-gradient(ellipse at 50% 0%, rgba(var(--tint), .28), transparent 70%);
  filter: blur(6px);
}

/* Arranque al llegar: la sala se enciende por partes */
.home-apex.ha-boot .room-shell { animation: room-boot-shell 1.6s ease-out both; }
.home-apex.ha-boot .room-screen { animation: room-boot-screen 2.2s steps(1) both; }
.home-apex.ha-boot .room-screen:nth-of-type(2n) { animation-delay: .25s; }
.home-apex.ha-boot .room-screen:nth-of-type(3n) { animation-delay: .5s; }
.home-apex.ha-boot .room-desk { animation: room-boot-shell 1.8s .4s ease-out both; }
.home-apex.ha-boot .hl { animation: room-boot-screen 2s .9s steps(1) both; }
@keyframes room-boot-shell { 0% { opacity: 0; } 20% { opacity: .9; } 30% { opacity: .2; } 45% { opacity: 1; } 55% { opacity: .5; } 100% { opacity: 1; } }
@keyframes room-boot-screen { 0% { opacity: 0; } 40% { opacity: 0; } 45% { opacity: 1; } 50% { opacity: 0; } 60% { opacity: 1; } 65% { opacity: .3; } 70%, 100% { opacity: 1; } }

/* Android y Modo ligero: todo quieto (se sigue viendo la sala entera). */
body.android .hab-props *, body.lite .hab-props *,
body.android .ha-table s, body.lite .ha-table s,
body.android .home-apex.ha-boot *, body.lite .home-apex.ha-boot * { animation: none !important; }
body.android .ha-table s, body.lite .ha-table s { display: none; }
/* Brillo de las líneas: un trazo ancho y suave debajo (sin filtros, más ligero). */
.room-lamp.glow, .room-skirt.glow, .desk-edge.glow { stroke-width: 10; stroke-opacity: .14; }
/* Móvil: las mesas taparían las órdenes rápidas; se quedan solo en pantallas anchas. */
@media (max-width: 759px), (max-height: 619px) { .room-desk { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .hab-props *, .ha-table s, .home-apex.ha-boot * { animation: none !important; }
}

/* =========================================================
   OFICINA EN EL TELÉFONO: enfoque vertical
   Sin paredes en perspectiva (en vertical se veía todo pegado):
   lámpara → haz → Apex → mesa de luz → suelo, cúpula detrás y
   lecturas pequeñas en los bordes. Paneles de arriba en una sola
   línea para dejar aire a la bola.
   ========================================================= */
.hab-room-phone { display: none; }
.q-short { display: none; }

@media (max-width: 600px) {
  .hab-room .room-shell,
  .hab-room .room-screens,
  .hab-props { display: none; }
  .hab-room-phone {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    color: rgb(var(--tint, 80, 228, 255));
    transition: color .8s ease;
  }
  .hab-room-phone * { vector-effect: non-scaling-stroke; }
  .ph-rays { fill: none; stroke: currentColor; stroke-width: 1; stroke-opacity: .12; }
  .ph-dome { fill: none; stroke: currentColor; stroke-width: 1.2; stroke-opacity: .28; stroke-dasharray: 2 7; animation: ph-dome 40s linear infinite; }
  .ph-dome.b { stroke-opacity: .16; stroke-dasharray: 40 10 6 10; animation-duration: 70s; animation-direction: reverse; }
  @keyframes ph-dome { to { stroke-dashoffset: -400; } }
  .ph-beam { opacity: .55; transition: opacity .6s ease; }
  .home-apex[data-state="speaking"] .ph-beam { opacity: 1; }
  .ph-tick { stroke: currentColor; stroke-width: 1; stroke-opacity: .4; }
  .hab-room-phone .rs-code { stroke-width: 1.6; stroke-opacity: .5; }
  .hab-room-phone .rs-bar { fill: currentColor; }

  /* Paneles de arriba: una sola línea, pequeños, a los lados de "Inicio". */
  .hab-panel {
    top: 12px;
    flex-direction: row;
    align-items: center;
    gap: 6px;
    max-width: none;
    padding: 5px 9px;
  }
  .hab-panel.left { left: 10px; }
  .hab-panel.right { right: 10px; }
  .hab-live { font-size: 0; }
  .hab-live i { margin: 0; }
  .hab-clock { font-size: 13px; }
  .hab-date, .hab-panel.right > b, .hab-eq { display: none; }
  .hab-mode { font-size: 10.5px; }
  .hab-corner.tl, .hab-corner.tr { top: 50px; }

  /* Las ondas del suelo, más discretas para que no se mezclen con los botones. */
  .ha-table s { border-color: rgba(var(--tint), .3); }

  /* Órdenes rápidas en corto: caben todas sin deslizar. */
  .q-full { display: none; }
  .q-short { display: inline; }
  .ha-chips button { padding: 0 11px; font-size: 12.5px; }
  .ha-quick { gap: 6px; }
  .ha-dock { padding-right: 6px; }
}
@media (max-width: 600px) and (min-width: 380px) {
  .ha-quick { -webkit-mask-image: none; mask-image: none; padding-right: 0; }
}
body.android .hab-room-phone *, body.lite .hab-room-phone * { animation: none !important; }
@media (prefers-reduced-motion: reduce) { .hab-room-phone * { animation: none !important; } }

/* Teléfono: el panel holográfico, pequeño y abajo (encima de los botones),
   para que no tape a Apex. Se ve lo importante y el resto se desliza. */
@media (max-width: 600px) {
  .ha-holo {
    top: auto;
    bottom: calc(118px + env(safe-area-inset-bottom));
    width: calc(100% - 28px);
    max-height: min(34%, 230px);
    padding: 8px 11px 10px;
    clip-path: polygon(0 0, calc(100% - 12px) 0, 100% 12px, 100% 100%, 12px 100%, 0 calc(100% - 12px));
  }
  .ha-holo.in { animation: ha-holo-in-up .38s cubic-bezier(.2, .8, .3, 1) both, ha-holo-float 6s ease-in-out .38s infinite; }
  @keyframes ha-holo-in-up {
    0% { opacity: 0; transform: translateX(-50%) translateY(24px) scaleY(.2); filter: brightness(2.2); }
    60% { opacity: 1; }
    100% { opacity: 1; transform: translateX(-50%); filter: none; }
  }
  .ha-holo-head { margin-bottom: 6px; }
  .ha-holo-head b { font-size: 11px; }
  .ha-holo-x { width: 24px; height: 24px; font-size: 12px; }
  .ha-holo-stats { gap: 6px; margin-bottom: 6px; }
  .ha-holo-stats span { padding: 4px 7px; font-size: 9px; }
  .ha-holo-stats b { font-size: 14.5px; }
  .ha-holo-list { gap: 4px; }
  .ha-holo-list li { padding: 5px 8px; font-size: 13px; gap: 7px; }
  .ha-holo-list li small { font-size: 11px; }
  .ha-check { width: 19px; height: 19px; }
  .ha-holo-empty { font-size: 13px; }
  .ha-holo-more { margin-top: 6px; padding: 5px; font-size: 12px; }
}
@media (max-width: 600px) {
  .ha-holo { max-height: min(29%, 200px); }
  /* Cifras en una línea: número y nombre juntos. */
  .ha-holo-stats span { flex-direction: row; align-items: baseline; gap: 5px; padding: 4px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .ha-holo-stats b { font-size: 13.5px; }
  /* Con un panel abierto, Apex se aparta un poco hacia arriba. */
  .ha-orb { transition: transform .45s cubic-bezier(.2, .8, .3, 1); }
  .home-apex[data-holo] .ha-orb { transform: translateY(-9%) scale(.8); }
  .home-apex[data-holo] .ha-subs, .home-apex[data-holo] .ha-hint { opacity: 0; }
}

/* =========================================================
   DENTRO DE APEX (doble toque en la bola): su red de neuronas
   con el núcleo en el centro y los empleados del equipo como
   neuronas grandes de su color (home-apex.js → openNeural).
   ========================================================= */
.ha-neural {
  position: absolute;
  inset: 0;
  z-index: 4;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 44%, rgba(var(--tint), .16) 0%, rgba(var(--tint), .05) 38%, transparent 62%),
    radial-gradient(circle at 50% 44%, #05183a 0%, #020b1d 55%, #00040c 100%);
  touch-action: none;
}
.ha-neural[hidden] { display: none; }
.ha-neural-canvas { position: absolute; inset: 0; display: block; }

/* La cámara entra en la bola: la bola crece y se desvanece, y la red aparece. */
.home-apex.ha-diving .ha-orb { animation: ha-dive-orb .75s cubic-bezier(.5, 0, .2, 1) both; }
.home-apex.ha-diving .ha-neural { animation: ha-dive-net .75s cubic-bezier(.3, 0, .2, 1) both; }
@keyframes ha-dive-orb { 0% { transform: scale(1); opacity: 1; filter: none; } 70% { opacity: .7; filter: brightness(1.8); } 100% { transform: scale(3.4); opacity: 0; filter: brightness(2.4); } }
@keyframes ha-dive-net { 0%, 25% { opacity: 0; transform: scale(.35); } 100% { opacity: 1; transform: scale(1); } }
/* Y sale: la red se aleja y la bola vuelve. */
.home-apex.ha-surfacing .ha-neural { animation: ha-surf-net .6s cubic-bezier(.5, 0, .3, 1) both; pointer-events: none; }
.home-apex.ha-surfacing .ha-orb { animation: ha-surf-orb .6s cubic-bezier(.2, .6, .3, 1) both; }
@keyframes ha-surf-net { to { opacity: 0; transform: scale(.35); } }
@keyframes ha-surf-orb { 0% { transform: scale(3.4); opacity: 0; filter: brightness(2.4); } 100% { transform: scale(1); opacity: 1; filter: none; } }

/* Con la red abierta, lo demás de la oficina se aparta. */
.home-apex[data-neural] .ha-orb { opacity: 0; pointer-events: none; }
.home-apex[data-neural] .ha-quick,
.home-apex[data-neural] .ha-chips,
.home-apex[data-neural] .ha-dock,
.home-apex[data-neural] .ha-subs,
.home-apex[data-neural] .ha-hint,
.home-apex[data-neural] .ha-bar,
.home-apex[data-neural] .ha-approve,
.home-apex[data-neural] .ha-up { opacity: 0; pointer-events: none; transition: opacity .3s ease; }

.ha-neural-back {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid rgba(var(--tint), .4);
  background: rgba(4, 16, 32, .75);
  color: rgba(var(--tint), 1);
  font: inherit;
  font-size: 13.5px;
  letter-spacing: .04em;
  cursor: pointer;
}
.ha-neural-title {
  position: absolute;
  top: 50px;
  left: 0;
  right: 0;
  margin: 0;
  text-align: center;
  color: rgba(var(--tint), .8);
  font-size: 11px;
  letter-spacing: .22em;
  text-transform: uppercase;
  text-shadow: 0 0 10px rgba(var(--tint), .6);
  pointer-events: none;
}

/* Los empleados: zona tocable sobre su neurona y su nombre. */
.ha-agent {
  --agent: #50e4ff;
  position: absolute;
  z-index: 2;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ha-agent-hit {
  position: absolute;
  left: -30px;
  top: -30px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
}
.ha-agent:focus-visible .ha-agent-hit { outline: 2px solid var(--agent); outline-offset: 2px; }
.ha-agent-label {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  white-space: nowrap;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .02em;
  color: #eefaff;
  text-shadow: 0 0 10px var(--agent), 0 1px 3px #000;
  pointer-events: none;
  transition: transform .25s ease;
}
.ha-agent.below .ha-agent-label { bottom: auto; top: 30px; }
.ha-agent-label small { font-size: 10.5px; font-weight: 500; color: color-mix(in srgb, var(--agent) 70%, #fff); }
.ha-agent.on .ha-agent-label { transform: translateX(-50%) scale(1.08); }

/* Ficha del empleado elegido */
.ha-neural-card {
  --agent: #50e4ff;
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: calc(18px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(440px, calc(100% - 24px));
  padding: 11px 13px 12px;
  border: 1px solid color-mix(in srgb, var(--agent) 60%, transparent);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, color-mix(in srgb, var(--agent) 16%, rgba(4, 18, 36, .9)), rgba(2, 10, 22, .92));
  box-shadow: 0 0 26px color-mix(in srgb, var(--agent) 30%, transparent);
  clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 14px 100%, 0 calc(100% - 14px));
  color: var(--text);
  touch-action: manipulation;
}
.ha-neural-card[hidden] { display: none; }
.ha-neural-card.in { animation: ha-card-in .35s cubic-bezier(.2, .8, .3, 1) both; }
@keyframes ha-card-in { from { opacity: 0; transform: translateX(-50%) translateY(18px); } }
.ha-neural-card-head { display: flex; align-items: center; gap: 10px; }
.ha-neural-card-head > div { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.ha-neural-card-head b { font-size: 15px; }
.ha-neural-card-head small { color: var(--muted); font-size: 12.5px; }
.ha-neural-dot {
  flex: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 40% 35%, #fff 0 15%, var(--agent) 45%, color-mix(in srgb, var(--agent) 35%, #000));
  box-shadow: 0 0 12px var(--agent);
}
.ha-neural-week { margin: 8px 0; color: var(--muted); font-size: 13.5px; }
.ha-neural-ask {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--agent) 45%, transparent);
  background: color-mix(in srgb, var(--agent) 10%, rgba(3, 12, 24, .7));
  color: #eefaff;
  font: inherit;
  font-size: 13.5px;
  text-align: left;
  cursor: pointer;
}
.ha-neural-form { display: flex; gap: 8px; margin-top: 8px; }
.ha-neural-form input {
  flex: 1;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid var(--line);
  background: rgba(3, 12, 24, .8);
  color: var(--text);
  font: inherit;
  font-size: 16px;
}
.ha-neural-form button {
  flex: none;
  width: 42px;
  border: 0;
  background: var(--agent);
  color: #021222;
  font-weight: 800;
  font-size: 18px;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  .home-apex.ha-diving .ha-orb, .home-apex.ha-diving .ha-neural,
  .home-apex.ha-surfacing .ha-orb, .home-apex.ha-surfacing .ha-neural,
  .ha-neural-card.in { animation-duration: .01s !important; }
}
.ha-neural-tip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: calc(30px + env(safe-area-inset-bottom));
  margin: 0;
  text-align: center;
  color: rgba(var(--tint), .75);
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  pointer-events: none;
  animation: hab-blink 3s ease-in-out infinite;
}
.ha-neural-card:not([hidden]) ~ .ha-neural-tip, .ha-neural-tip:has(~ .ha-neural-card:not([hidden])) { opacity: 0; }

/* =========================================================
   DENTRO DE APEX, COMO EN UN MICROSCOPIO
   La propia bola ampliada (dos capas con profundidad), sus
   neuronas nítidas encima, los empleados como mini bolas azules
   y un visor con aumento, enfoque y escala.
   ========================================================= */
.ha-neural { background: #01050f; }
.hn-zoom { position: absolute; inset: 0; will-change: transform; }
.hn-deep, .hn-mid {
  position: absolute;
  background-size: cover;
  background-position: center;
  border-radius: 50%;
  pointer-events: none;
}
.hn-deep { filter: blur(5px) brightness(.62); opacity: .9; }
.hn-mid {
  opacity: .5;
  filter: blur(2.5px) brightness(.9);
  mix-blend-mode: screen;
  animation: hn-drift 26s ease-in-out infinite alternate;
}
@keyframes hn-drift { to { translate: 3% -2%; } }
.ha-neural-canvas { transition: opacity .5s ease; }
.home-apex.ha-diving .ha-neural-canvas,
.home-apex.ha-diving .hn-hud,
.home-apex.ha-diving .ha-neural-nodes,
.home-apex.ha-diving .ha-neural-tip { opacity: 0; }
.home-apex.ha-diving .ha-neural-canvas { transition-delay: .55s; }
.home-apex.ha-surfacing .ha-neural-canvas,
.home-apex.ha-surfacing .hn-hud,
.home-apex.ha-surfacing .ha-neural-nodes,
.home-apex.ha-surfacing .ha-neural-tip,
.home-apex.ha-surfacing .ha-neural-back { opacity: 0; transition: opacity .25s ease; }
.hn-hud, .ha-neural-nodes, .ha-neural-tip, .ha-neural-back { transition: opacity .45s ease .7s; }

/* La entrada ya no escala la bola: la sustituye su imagen ampliada en el mismo sitio. */
.home-apex.ha-diving .ha-orb { animation: none; opacity: 0; transition: opacity .12s ease; }
.home-apex.ha-diving .ha-neural { animation: none; }
.home-apex.ha-surfacing .ha-neural { animation: none; pointer-events: none; }
.home-apex.ha-surfacing .ha-orb { animation: none; opacity: 0; }

/* Visor del microscopio */
.hn-hud { position: absolute; inset: 0; pointer-events: none; color: rgba(170, 236, 255, .85); }
.hn-hud::before {
  /* Bordes oscuros de la lente */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 78% 70% at 50% 46%, transparent 62%, rgba(0, 4, 12, .55) 84%, rgba(0, 3, 10, .92) 100%);
}
.hn-hud::after {
  /* Cruz de enfoque muy fina en el centro */
  content: "";
  position: absolute;
  left: 50%;
  top: 46%;
  width: 46px;
  height: 46px;
  margin: -23px 0 0 -23px;
  background:
    linear-gradient(rgba(170, 236, 255, .35), rgba(170, 236, 255, .35)) center / 1px 100% no-repeat,
    linear-gradient(rgba(170, 236, 255, .35), rgba(170, 236, 255, .35)) center / 100% 1px no-repeat;
  -webkit-mask-image: radial-gradient(circle, transparent 0 9px, #000 10px);
  mask-image: radial-gradient(circle, transparent 0 9px, #000 10px);
  opacity: .55;
}
.hn-corner { position: absolute; width: 22px; height: 22px; border: 0 solid rgba(170, 236, 255, .55); }
.hn-corner.tl { top: 12px; left: 12px; border-top-width: 1.5px; border-left-width: 1.5px; }
.hn-corner.tr { top: 12px; right: 12px; border-top-width: 1.5px; border-right-width: 1.5px; }
.hn-corner.bl { bottom: 12px; left: 12px; border-bottom-width: 1.5px; border-left-width: 1.5px; }
.hn-corner.br { bottom: 12px; right: 12px; border-bottom-width: 1.5px; border-right-width: 1.5px; }
.hn-read {
  position: absolute;
  top: 18px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  font-size: 9px;
  letter-spacing: .2em;
  color: rgba(120, 220, 255, .7);
}
.hn-read b { font-size: 12px; letter-spacing: .12em; color: #e8fbff; font-weight: 700; font-variant-numeric: tabular-nums; }
.hn-read.l { left: 26px; }
.hn-read.r { right: 26px; align-items: flex-end; }
.hn-focus { position: absolute; right: 26px; top: 54px; display: flex; gap: 3px; }
.hn-focus i { width: 9px; height: 3px; background: rgba(170, 236, 255, .7); }
.hn-focus i:last-child { opacity: .25; }
.hn-scale {
  position: absolute;
  left: 26px;
  bottom: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 9.5px;
  letter-spacing: .14em;
  color: rgba(170, 236, 255, .75);
}
.hn-scale i {
  width: 64px;
  height: 6px;
  border: 1.5px solid rgba(170, 236, 255, .7);
  border-top: 0;
}

/* Botón de volver, sobrio */
.ha-neural-back { top: 14px; border-color: rgba(170, 236, 255, .35); color: #dff8ff; background: rgba(2, 12, 26, .7); font-size: 13px; }

/* Etiquetas de los empleados: anotaciones de microscopio */
.ha-agent { --r: 26px; }
.ha-agent-hit { left: calc(var(--r) * -1.7); top: calc(var(--r) * -1.7); width: calc(var(--r) * 3.4); height: calc(var(--r) * 3.4); }
.ha-agent:focus-visible .ha-agent-hit { outline: 1.5px solid rgba(170, 236, 255, .8); }
.ha-agent-label {
  bottom: calc(var(--r) * 1.9);
  gap: 1px;
  padding-bottom: 8px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .03em;
  color: #eafbff;
  text-shadow: 0 0 12px rgba(80, 228, 255, .7), 0 1px 3px #000;
}
.ha-agent-label::after {
  /* Línea que une la etiqueta con su mini bola */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 7px;
  background: rgba(170, 236, 255, .6);
}
.ha-agent.below .ha-agent-label { top: calc(var(--r) * 1.9); padding: 8px 0 0; }
.ha-agent.below .ha-agent-label::after { top: 0; bottom: auto; }
.ha-agent-label i { font-style: normal; font-size: 9px; letter-spacing: .22em; color: rgba(120, 220, 255, .8); }
.ha-agent-label b { font-weight: 700; font-size: 12.5px; }
.ha-agent-label small { font-size: 10px; font-weight: 500; letter-spacing: .06em; color: rgba(170, 236, 255, .78); }
.ha-agent.on .ha-agent-label b { color: #fff; text-shadow: 0 0 14px rgba(120, 236, 255, 1); }

/* Ficha del empleado: azul, como el resto */
.ha-neural-card {
  --agent: #50e4ff;
  border-color: rgba(120, 228, 255, .5);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .025) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(10, 44, 78, .9), rgba(2, 10, 22, .94));
  box-shadow: 0 0 26px rgba(60, 200, 255, .25);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.ha-neural-dot { background: radial-gradient(circle at 40% 35%, #fff 0 15%, #50e4ff 45%, #0a4a7a); box-shadow: 0 0 12px #50e4ff; }
.ha-neural-code { font-style: normal; font-size: 9.5px; letter-spacing: .2em; color: rgba(120, 220, 255, .8); text-transform: uppercase; }
.ha-neural-ask { border-color: rgba(120, 228, 255, .35); background: rgba(8, 34, 60, .6); }
.ha-neural-form button { background: linear-gradient(145deg, #3fd4ff, #168dff); }
.ha-neural-tip { bottom: calc(40px + env(safe-area-inset-bottom)); color: rgba(170, 236, 255, .75); font-size: 11px; letter-spacing: .18em; }

@media (max-width: 600px) {
  .hn-read { top: 60px; }
  .hn-focus { top: 96px; }
  .hn-scale { bottom: 70px; }
}
body.android .hn-mid, body.lite .hn-mid { animation: none; }
body.android .hn-deep, body.lite .hn-deep { filter: brightness(.6); }
@media (prefers-reduced-motion: reduce) { .hn-mid { animation: none; } }
/* Las neuronas, el visor y las etiquetas aparecen al terminar el zoom. */
.home-apex.ha-diving .ha-neural-canvas { opacity: 1; animation: hn-appear .55s ease .6s both; }
.home-apex.ha-diving .hn-hud,
.home-apex.ha-diving .ha-neural-nodes,
.home-apex.ha-diving .ha-neural-tip,
.home-apex.ha-diving .ha-neural-back { opacity: 1; animation: hn-appear .5s ease .8s both; }
@keyframes hn-appear { from { opacity: 0; } }
.hn-hud, .ha-neural-nodes, .ha-neural-tip, .ha-neural-back { transition: opacity .25s ease; }
.hn-deep { filter: blur(5px) brightness(.52); }

@media (max-width: 600px) {
  /* En el teléfono el visor va abajo y discreto, sin chocar con las etiquetas. */
  .hn-read.l, .hn-focus { display: none; }
  .hn-read.r { top: auto; bottom: 22px; right: 26px; }
  .hn-scale { bottom: 22px; }
  .ha-neural-tip { bottom: calc(64px + env(safe-area-inset-bottom)); }
  .ha-neural-card.top { bottom: auto; top: 54px; }
  .ha-neural-card.top.in { animation-name: ha-card-in-top; }
  @keyframes ha-card-in-top { from { opacity: 0; transform: translateX(-50%) translateY(-18px); } }
  .ha-neural-card-head small { display: none; }
}
/* Calidad: fondo de la bola menos ampliado y más limpio, capa lejana dibujada (no foto ampliada). */
.hn-deep { filter: blur(3.5px) brightness(.42) saturate(1.25); opacity: .85; }
.hn-mid {
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  opacity: 1;
  filter: none;
  mix-blend-mode: screen;
}
.ha-neural-canvas { image-rendering: auto; }

/* =========================================================
   INICIO DE €ERO: CENTRO DE MANDO (inicio.js)
   Estilo propio de €ERO: plateado y metálico, como su logo
   (Apex se queda con su azul de neuronas).
   ========================================================= */
:root {
  --ero-silver: linear-gradient(135deg, #f6faff 0%, #aebfd2 32%, #f1f6fc 52%, #8fa6be 78%, #e2ebf5 100%);
  --ero-silver-line: linear-gradient(135deg, rgba(235, 244, 255, .75), rgba(140, 170, 200, .25) 40%, rgba(80, 228, 255, .45) 70%, rgba(235, 244, 255, .6));
}

.welcome.ero-home > p[data-i18n="welcome.text"] { display: none; }
.welcome.ero-home h1 {
  margin: 4px 0 14px;
  font-size: clamp(24px, 3.6vh, 34px);
  background: var(--ero-silver);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 0 14px rgba(120, 200, 255, .25));
}

/* --- Saludo con nombre y hora --- */
.system-label.ero-greet {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  margin-top: 6px;
  letter-spacing: normal;
  text-transform: none;
}
#eroGreetHi {
  font-size: clamp(15px, 2.2vh, 18px);
  font-weight: 600;
  color: #eaf4ff;
  letter-spacing: .01em;
}
#eroGreetWhen {
  font-size: 10.5px;
  letter-spacing: .22em;
  color: rgba(var(--hud), .75);
}

/* --- Logo vivo --- */
.big { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.core-sweep {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: visible;
}
.core-sweep circle { fill: none; transform-origin: 100px 100px; transform-box: view-box; }
.core-sweep .sw1 { stroke: url(#eroSweep); stroke-width: 2.4; stroke-dasharray: 18 82; stroke-linecap: round; animation: ero-sweep 5s linear infinite; filter: drop-shadow(0 0 4px rgba(200, 235, 255, .9)); }
.core-sweep .sw2 { stroke: rgba(225, 238, 252, .5); stroke-width: 1; stroke-dasharray: 6 94; animation: ero-sweep 9s linear infinite reverse; }
@keyframes ero-sweep { to { transform: rotate(360deg); } }
.core-shine {
  /* Brillo metálico que cruza el logo de vez en cuando */
  position: absolute;
  z-index: 3;
  inset: 22%;
  border-radius: 50%;
  pointer-events: none;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, .55) 48%, transparent 60%);
  background-size: 250% 100%;
  background-position: 130% 0;
  mix-blend-mode: overlay;
  animation: ero-shine 6s ease-in-out infinite;
}
@keyframes ero-shine { 0%, 62% { background-position: 130% 0; } 85%, 100% { background-position: -40% 0; } }
.core-pulse {
  position: absolute;
  inset: 12%;
  z-index: 0;
  border-radius: 50%;
  border: 2px solid rgba(230, 244, 255, .8);
  opacity: 0;
  pointer-events: none;
}
.big.pulsing .core-pulse { animation: ero-pulse .9s ease-out; }
.big.pulsing .big-logo { animation: ero-logo-pop .5s ease-out; }
@keyframes ero-pulse { 0% { transform: scale(.8); opacity: .9; box-shadow: 0 0 30px rgba(160, 220, 255, .8); } 100% { transform: scale(1.7); opacity: 0; } }
@keyframes ero-logo-pop { 40% { transform: translate(-50%, -50%) scale(1.06); filter: brightness(1.5) drop-shadow(0 0 22px rgba(200, 235, 255, .9)); } }

/* --- Tu semana --- */
.ero-dash {
  width: min(680px, 100%);
  margin: 4px auto 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.ero-week {
  position: relative;
  padding: 14px 14px 12px;
  border: 1px solid transparent;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(10, 30, 54, .78), rgba(3, 12, 26, .82)) padding-box,
    var(--ero-silver-line) border-box;
  box-shadow: 0 10px 34px rgba(0, 0, 0, .35), inset 0 0 26px rgba(120, 190, 255, .06);
  text-align: left;
}
.ero-week::before {
  /* Reflejo metálico en el borde de arriba */
  content: "";
  position: absolute;
  left: 18px;
  right: 18px;
  top: -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .85), transparent);
}
.wk-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 2px 10px; }
.wk-head b {
  font-size: 12px;
  letter-spacing: .2em;
  text-transform: uppercase;
  background: var(--ero-silver);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.wk-head span { font-size: 11.5px; color: var(--muted); }
.wk-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.wk-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 10px 6px 9px;
  border-radius: 14px;
  border: 1px solid rgba(150, 190, 225, .18);
  background: linear-gradient(180deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .01));
  color: var(--text);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, transform .15s ease, box-shadow .2s ease;
}
.wk-card:hover { border-color: rgba(200, 230, 255, .45); box-shadow: 0 0 18px rgba(120, 200, 255, .15); }
.wk-card:active { transform: scale(.97); }
.wk-ring { width: 46px; height: 46px; transform: rotate(-90deg); }
.wk-track { fill: none; stroke: rgba(170, 200, 230, .14); stroke-width: 4.5; }
.wk-fill {
  fill: none;
  stroke: #cfe7ff;
  stroke-width: 4.5;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  filter: drop-shadow(0 0 4px rgba(120, 210, 255, .7));
  transition: stroke-dashoffset 1.2s cubic-bezier(.2, .8, .3, 1);
}
.ero-week.filled .wk-fill { stroke-dashoffset: calc(100 - var(--pct)); }
.wk-card.done .wk-fill { stroke: #8ff3c9; }
.wk-pct { position: absolute; top: 22px; left: 0; right: 0; text-align: center; font-size: 11px; font-weight: 700; color: #eaf6ff; font-variant-numeric: tabular-nums; }
.wk-pct small { font-size: 8px; opacity: .7; }
.wk-text { display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 0; text-align: center; }
.wk-text b { font-size: 14px; color: #f2f8ff; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wk-text small { font-size: 10.5px; color: var(--muted); line-height: 1.25; }
.wk-streak { justify-content: center; }
.wk-flame { font-size: 24px; line-height: 46px; filter: drop-shadow(0 0 10px rgba(255, 150, 60, .6)); animation: ero-flame 2.4s ease-in-out infinite; }
@keyframes ero-flame { 50% { transform: scale(1.1) translateY(-1px); } }
.wk-days { display: flex; gap: 2px; margin-top: 1px; }
.wk-days i { width: 13px; height: 13px; border-radius: 4px; font-style: normal; font-size: 8px; line-height: 13px; text-align: center; color: var(--muted); background: rgba(170, 200, 230, .1); }
.wk-days i.on { background: linear-gradient(145deg, #ffcf7a, #ff8a3d); color: #2a1200; font-weight: 700; }
.wk-days i.today { outline: 1px solid rgba(230, 244, 255, .7); }

@media (max-width: 600px) {
  .wk-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wk-card { flex-direction: row; justify-content: flex-start; gap: 10px; padding: 9px 10px; }
  .wk-pct { top: 50%; left: 10px; right: auto; width: 46px; transform: translateY(-50%); }
  .wk-text { align-items: flex-start; text-align: left; }
  .wk-streak { grid-column: 1 / -1; justify-content: flex-start; }
  .wk-streak .wk-days { margin-left: auto; }
  .wk-flame { width: 46px; text-align: center; }
}

/* --- Accesos directos con iconos animados --- */
.ero-shortcuts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.ero-sc {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  padding: 12px 6px 11px;
  border: 1px solid transparent;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(12, 34, 60, .82), rgba(3, 12, 26, .86)) padding-box,
    var(--ero-silver-line) border-box;
  color: #eaf4ff;
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform .15s ease, box-shadow .25s ease;
}
.ero-sc:hover { box-shadow: 0 0 22px rgba(140, 210, 255, .22); transform: translateY(-2px); }
.ero-sc:active { transform: scale(.96); }
.sc-icon { width: 38px; height: 38px; display: block; }
.sc-icon svg { width: 100%; height: 100%; overflow: visible; }
.sc-icon svg * { fill: none; stroke: #d9ecff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.sc-icon .i-frame { stroke: rgba(217, 236, 255, .85); }
.sc-icon .i-line { stroke: rgba(160, 220, 255, .75); }
.sc-icon .i-tick { stroke: #8ff3ff; stroke-width: 2; stroke-dasharray: 8; stroke-dashoffset: 8; animation: sc-tick 3.2s ease-in-out infinite; }
@keyframes sc-tick { 0%, 15% { stroke-dashoffset: 8; } 40%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 8; } }
.sc-icon .i-dot { fill: #8ff3ff; stroke: none; animation: sc-blink 2s ease-in-out infinite; }
@keyframes sc-blink { 50% { opacity: .25; } }
.sc-icon .i-core { fill: #eaf6ff; stroke: none; filter: drop-shadow(0 0 3px #8ff3ff); }
.sc-icon .i-orb { fill: rgba(143, 243, 255, .25); stroke: #8ff3ff; animation: sc-orb 2.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.sc-icon .o2 { animation-delay: .8s; }
.sc-icon .o3 { animation-delay: 1.6s; }
@keyframes sc-orb { 50% { transform: scale(1.3); fill: rgba(143, 243, 255, .7); } }
.sc-icon .i-track { stroke: rgba(170, 200, 230, .18); stroke-width: 3; }
.sc-icon .i-ring { stroke: #cfe7ff; stroke-width: 3; stroke-dasharray: 100; transform: rotate(-90deg); transform-origin: 20px 20px; animation: sc-ring 4s ease-in-out infinite; }
.sc-icon .i-ring.r2 { stroke: #8ff3ff; animation-delay: .6s; }
@keyframes sc-ring { 0% { stroke-dashoffset: 100; } 50%, 70% { stroke-dashoffset: 30; } 100% { stroke-dashoffset: 100; } }

@media (max-width: 380px) { .ero-sc { font-size: 11.5px; } .sc-icon { width: 32px; height: 32px; } }

/* --- Apex asomándose abajo --- */
.home-pull { gap: 6px; margin-top: 26px; }
.hp-peek { position: relative; width: 58px; height: 58px; display: block; }
.hp-peek img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 70%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 70%, transparent 100%);
  animation: hp-breathe 3s ease-in-out infinite;
}
.hp-peek s {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1.5px solid rgba(80, 228, 255, .6);
  opacity: 0;
  animation: hp-ring 3s ease-out infinite;
}
.hp-peek s:nth-of-type(2) { animation-delay: 1.5s; }
@keyframes hp-breathe { 50% { transform: scale(1.08); filter: brightness(1.35) drop-shadow(0 0 12px rgba(80, 228, 255, .8)); } }
@keyframes hp-ring { 0% { transform: scale(.9); opacity: .8; } 100% { transform: scale(1.8); opacity: 0; } }
.home-pull span:not(.hp-peek) { font-size: 12.5px; }

/* --- Arranque por partes al volver al inicio --- */
.welcome.ero-boot > .big { animation: ero-in-scale .7s cubic-bezier(.2, .8, .3, 1) both; }
.welcome.ero-boot > .system-label { animation: ero-in .5s .15s ease both; }
.welcome.ero-boot > h1 { animation: ero-in .5s .25s ease both; }
.welcome.ero-boot .ero-week { animation: ero-in .55s .35s ease both; }
.welcome.ero-boot .ero-sc { animation: ero-in .5s ease both; }
.welcome.ero-boot .ero-sc:nth-child(1) { animation-delay: .5s; }
.welcome.ero-boot .ero-sc:nth-child(2) { animation-delay: .58s; }
.welcome.ero-boot .ero-sc:nth-child(3) { animation-delay: .66s; }
.welcome.ero-boot .ero-sc:nth-child(4) { animation-delay: .74s; }
.welcome.ero-boot .home-pull { animation: ero-in .6s .9s ease both; }
@keyframes ero-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes ero-in-scale { from { opacity: 0; transform: scale(.86); filter: brightness(2); } }

/* El inicio se ordena de arriba abajo (ya no cabe "centrado" en pantallas bajas). */
.welcome.ero-home { justify-content: flex-start; }

body.lite .core-sweep circle, body.lite .core-shine, body.lite .sc-icon *, body.lite .hp-peek *, body.lite .wk-flame,
body.android .core-shine, body.android .sc-icon * { animation: none !important; }
body.lite .welcome.ero-boot *, body.lite .welcome.ero-boot > * { animation: none !important; }
/* En Android, la entrada animada del inicio (con sus paneles translúcidos)
   dejaba trozos sin pintar en tablets: el inicio aparece directamente. */
body.android .welcome.ero-boot *, body.android .welcome.ero-boot > * { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .core-sweep circle, .core-shine, .sc-icon *, .hp-peek *, .wk-flame, .welcome.ero-boot * , .welcome.ero-boot > * { animation: none !important; }
}
.wk-fill.zero { stroke-opacity: 0; }
.wk-pct.full { font-size: 16px; color: #8ff3c9; text-shadow: 0 0 10px rgba(143, 243, 201, .6); }
.wk-text small { white-space: nowrap; }
.wk-card { justify-content: center; }

/* =========================================================
   MI EQUIPO: mapa holográfico (progress.js → teamHTML)
   Núcleo de Apex en el centro, los cuatro empleados como mini
   bolas de Apex azules con su anillo, unidos por caminos de luz.
   ========================================================= */
.tm-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin: 2px 2px 8px; }
.tm-head span { font-size: 10px; letter-spacing: .22em; text-transform: uppercase; color: rgba(120, 220, 255, .8); }
.tm-head b { font-size: 12px; color: #dff3ff; font-weight: 600; }
.tm-map {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  max-height: 440px;
  margin: 0 auto;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(120, 210, 255, .22);
  background:
    radial-gradient(circle at 50% 50%, rgba(60, 170, 255, .22), transparent 55%),
    radial-gradient(circle at 50% 50%, #06203f 0%, #021025 60%, #010811 100%);
  box-shadow: inset 0 0 40px rgba(0, 0, 0, .55), 0 0 24px rgba(60, 180, 255, .1);
}
.tm-map::after {
  /* Bordes de lente y rejilla fina */
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 50% 50%, transparent 60%, rgba(0, 4, 12, .6) 100%),
    repeating-linear-gradient(0deg, rgba(120, 210, 255, .035) 0 1px, transparent 1px 22px),
    repeating-linear-gradient(90deg, rgba(120, 210, 255, .035) 0 1px, transparent 1px 22px);
}
.tm-svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.tm-svg * { vector-effect: non-scaling-stroke; }
.tm-web { fill: none; stroke: rgba(150, 220, 255, .14); stroke-width: 1; }
.tm-dot { fill: rgba(190, 235, 255, .7); animation: tm-twinkle 4s ease-in-out infinite; }
@keyframes tm-twinkle { 50% { opacity: .2; } }
.tm-link {
  fill: none;
  stroke: rgba(170, 236, 255, .55);
  stroke-width: 1.6;
  stroke-dasharray: 3 7;
  animation: tm-flow 1.8s linear infinite;
  filter: drop-shadow(0 0 3px rgba(80, 228, 255, .8));
  transition: stroke .3s ease, stroke-width .3s ease, opacity .3s ease;
}
@keyframes tm-flow { to { stroke-dashoffset: -20; } }
.tm.picked .tm-link { opacity: .3; }
.tm.picked .tm-link.on { opacity: 1; stroke: #e6fbff; stroke-width: 2.6; stroke-dasharray: 6 5; animation-duration: .7s; }

/* Núcleo de Apex */
.tm-core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 20%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  pointer-events: none;
}
.tm-core img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  mix-blend-mode: screen;
  -webkit-mask-image: radial-gradient(circle closest-side, #000 72%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 72%, transparent 100%);
  filter: drop-shadow(0 0 18px rgba(80, 228, 255, .8));
  animation: tm-breathe 3.2s ease-in-out infinite;
}
.tm-core s { position: absolute; inset: 0; border-radius: 50%; border: 1.5px solid rgba(120, 228, 255, .5); opacity: 0; animation: tm-wave 3.2s ease-out infinite; }
.tm-core s:nth-of-type(2) { animation-delay: 1.6s; }
@keyframes tm-breathe { 50% { transform: scale(1.06); filter: drop-shadow(0 0 26px rgba(120, 236, 255, 1)); } }
@keyframes tm-wave { 0% { transform: scale(.95); opacity: .7; } 100% { transform: scale(1.9); opacity: 0; } }

/* Empleados */
.tm-agent {
  position: absolute;
  z-index: 2;
  width: 0;
  height: 0;
  padding: 0;
  border: 0;
  background: none;
  color: var(--text);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.tm-orb {
  position: absolute;
  left: 0;
  top: 0;
  width: clamp(44px, 12vw, 62px);
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  display: block;
  transition: transform .25s cubic-bezier(.2, .8, .3, 1);
}
.tm-orb img {
  position: absolute;
  inset: 14%;
  width: 72%;
  height: 72%;
  border-radius: 50%;
  object-fit: cover;
  transform: scale(1.15);
  box-shadow: 0 0 0 1.2px rgba(190, 240, 255, .75), 0 0 18px rgba(80, 228, 255, .55);
  -webkit-mask-image: radial-gradient(circle closest-side, #000 88%, transparent 100%);
  mask-image: radial-gradient(circle closest-side, #000 88%, transparent 100%);
}
.tm-orb[data-level="0"] img { filter: brightness(.8) saturate(.85); }
.tm-orb[data-level="2"] img, .tm-orb[data-level="3"] img { filter: brightness(1.2); box-shadow: 0 0 0 1.2px rgba(220, 250, 255, .9), 0 0 26px rgba(80, 228, 255, .85); }
.tm-ring { position: absolute; inset: -8%; width: 116%; height: 116%; overflow: visible; }
.tm-ring * { fill: none; stroke: rgba(190, 240, 255, .75); stroke-width: 2.2; stroke-linecap: round; }
.tm-ring.spin { animation: tm-spin 14s linear infinite; }
.tm-ring.spin-rev { animation: tm-spin 10s linear infinite reverse; }
.tm-ring.spin-slow { animation: tm-spin 22s linear infinite; }
@keyframes tm-spin { to { transform: rotate(360deg); } }
.tm-ring.waves circle { transform-origin: 50px 50px; transform-box: view-box; animation: tm-emit 2.4s ease-out infinite; opacity: 0; }
.tm-ring.waves circle:nth-child(2) { animation-delay: .8s; }
.tm-ring.waves circle:nth-child(3) { animation-delay: 1.6s; }
@keyframes tm-emit { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.tm-agent:hover .tm-orb, .tm-agent:focus-visible .tm-orb { transform: translate(-50%, -50%) scale(1.08); }
.tm-agent[aria-pressed="true"] .tm-orb { transform: translate(-50%, -50%) scale(1.18); }
.tm-agent[aria-pressed="true"] .tm-ring * { stroke: #fff; stroke-width: 2.8; }
.tm.picked .tm-agent[aria-pressed="false"] { opacity: .55; }
.tm-agent:focus-visible { outline: none; }
.tm-agent:focus-visible .tm-orb img { box-shadow: 0 0 0 2px #fff, 0 0 22px rgba(80, 228, 255, .9); }

.tm-label {
  position: absolute;
  left: 0;
  top: calc(clamp(44px, 12vw, 62px) * .62);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  white-space: nowrap;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 0 10px rgba(80, 228, 255, .6), 0 1px 3px #000;
}
.tm-agent.up .tm-label { top: auto; bottom: calc(clamp(44px, 12vw, 62px) * .62); }
.tm-label i { font-style: normal; font-size: 8.5px; letter-spacing: .22em; color: rgba(120, 220, 255, .85); }
.tm-label b { font-size: 12.5px; color: #eefaff; }
.tm-label small { font-size: 10px; color: rgba(170, 236, 255, .78); }
@media (max-width: 420px) { .tm-label b { font-size: 11.5px; } .tm-label small { font-size: 9px; } }

.tm-tip { margin: 8px 0 0; text-align: center; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: rgba(170, 236, 255, .6); }
.tm.picked .tm-tip { display: none; }

/* Ficha del empleado, azul */
.tm-detail {
  --agent: #50e4ff;
  border-color: rgba(120, 228, 255, .45);
  background:
    repeating-linear-gradient(180deg, rgba(255, 255, 255, .02) 0 1px, transparent 1px 3px),
    linear-gradient(180deg, rgba(10, 44, 78, .75), rgba(2, 10, 22, .85));
}
.tm-detail .tm-orb.small { position: relative; left: auto; top: auto; transform: none; width: 46px; flex: none; }
.tm-code { font-style: normal; font-size: 9.5px; letter-spacing: .2em; text-transform: uppercase; color: rgba(120, 220, 255, .8); }

.tm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.tm-btn {
  padding: 10px 8px;
  border-radius: 12px;
  border: 1px solid transparent;
  background:
    linear-gradient(180deg, rgba(12, 34, 60, .85), rgba(3, 12, 26, .9)) padding-box,
    var(--ero-silver-line, linear-gradient(135deg, #8fd, #48f)) border-box;
  color: #eaf4ff;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.tm-btn:hover { box-shadow: 0 0 18px rgba(120, 210, 255, .2); }
@media (max-width: 420px) { .tm-actions { grid-template-columns: 1fr; } }

body.lite .tm *, body.android .tm-link, body.android .tm-dot { animation: none !important; }
body.android .tm-link { filter: none; }
@media (prefers-reduced-motion: reduce) { .tm * { animation: none !important; } }
@media (max-width: 600px) {
  .tm-map { aspect-ratio: 1 / 1.02; }
  /* Etiquetas hacia su lado, para que no se salgan del mapa. */
  .tm-agent.l .tm-label { left: -26px; transform: none; align-items: flex-start; text-align: left; }
  .tm-agent.r .tm-label { left: auto; right: -26px; transform: none; align-items: flex-end; text-align: right; }
  .tm-label { white-space: normal; width: 42vw; max-width: 170px; }
}

/* Inicio más fluido en el móvil: sin sombras ni fusiones que se recalculan
   en cada fotograma (solo se mueven transformaciones y opacidad). */
.core-sweep .sw1 { filter: none; stroke-width: 2.8; }
.core-shine {
  background: linear-gradient(115deg, transparent 38%, rgba(255, 255, 255, .35) 50%, transparent 62%);
  background-size: 100% 100%;
  mix-blend-mode: normal;
  -webkit-mask-image: radial-gradient(circle, #000 60%, transparent 72%);
  mask-image: radial-gradient(circle, #000 60%, transparent 72%);
  animation: ero-shine-move 6s ease-in-out infinite;
  transform: translateX(-120%);
  opacity: .8;
}
@keyframes ero-shine-move { 0%, 62% { transform: translateX(-120%); } 88%, 100% { transform: translateX(120%); } }
.core-shine { overflow: hidden; }
.hp-peek img { animation: hp-breathe-lite 3s ease-in-out infinite; filter: brightness(1.15); }
@keyframes hp-breathe-lite { 50% { transform: scale(1.08); opacity: .85; } }
.wk-fill { filter: none; }
.welcome.ero-home .core-sweep, .welcome.ero-home .core-shine, .ero-sc, .ero-week { will-change: auto; }

/* =========================================================
   FLUIDEZ EN EL TELÉFONO
   Las luces y pantallas de la sala están dentro de un dibujo que
   ocupa toda la pantalla: si algo de dentro se mueve, el móvil
   repinta la pantalla entera en cada fotograma. En el teléfono
   la sala se queda quieta por dentro y "respira" entera (solo
   cambia su opacidad, que lo hace la tarjeta gráfica sin coste).
   ========================================================= */
@media (max-width: 760px) {
  .hab-room *, .hab-room-phone *, .hab-props *, .hab-floor * { animation: none !important; }
  .hab-room-phone, .hab-room { animation: room-breathe-all 6s ease-in-out infinite; will-change: opacity; }
  @keyframes room-breathe-all { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
  .hab-room-glow { will-change: opacity; }
  /* Polvo de luz: menos partículas en el teléfono. */
  .hab-dust i:nth-child(n+8) { display: none; }
  /* El panal del fondo, sin repintar. */
  .hab-hex { opacity: .1; }
}
/* En cualquier pantalla, lo que se mueve va en su propia capa. */
.hab-dust i, .hab-scan, .ha-waves, .ha-table i, .ha-table s, .hab-rings { will-change: transform, opacity; }

/* =========================================================
   TUS PROYECTOS: pantalla que entra desde la derecha
   (proyectos.js). Mismo lenguaje que €ERO: cristal oscuro,
   bordes plateados y luz azul.
   ========================================================= */

/* --- Pestaña en el borde derecho del inicio --- */
.pj-tab {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 30;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 14px 6px 12px 8px;
  border: 1px solid transparent;
  border-right: 0;
  border-radius: 14px 0 0 14px;
  background:
    linear-gradient(180deg, rgba(12, 34, 60, .92), rgba(3, 12, 26, .94)) padding-box,
    var(--ero-silver-line, linear-gradient(135deg, #cfe, #48f)) border-box;
  box-shadow: -6px 0 22px rgba(0, 0, 0, .4), -2px 0 14px rgba(80, 200, 255, .18);
  color: #eaf4ff;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transform: translate(110%, -50%);
  opacity: 0;
  pointer-events: none;
  transition: transform .45s cubic-bezier(.2, .8, .3, 1), opacity .3s ease;
}
.pj-tab.shown { transform: translate(calc(0px - var(--pull, 0px)), -50%); opacity: 1; pointer-events: auto; }
.pj-tab.pulling { transition: none; }
.pj-tab-grip { width: 3px; height: 22px; border-radius: 2px; background: linear-gradient(180deg, #eaf6ff, #6fd8ff); box-shadow: 0 0 8px rgba(120, 220, 255, .8); }
.pj-tab-text {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .24em;
  text-transform: uppercase;
  background: var(--ero-silver, #dfeaf5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pj-tab-arrow { font-size: 16px; line-height: 1; color: #8fe3ff; animation: pj-nudge 2.2s ease-in-out infinite; }
@keyframes pj-nudge { 0%, 60%, 100% { transform: translateX(0); } 75% { transform: translateX(-4px); } }

/* --- La pantalla --- */
.pj-panel {
  position: fixed;
  top: var(--pj-top, 0px);
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 42;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 14px 16px calc(24px + env(safe-area-inset-bottom));
  background:
    radial-gradient(ellipse 80% 50% at 85% 10%, rgba(60, 160, 255, .16), transparent 70%),
    radial-gradient(circle at 50% 40%, #061a36 0%, #020b1a 60%, #01050d 100%);
  color: var(--text);
  transform: translateX(100%);
  touch-action: pan-y;
}
.pj-panel[hidden] { display: none; }
.pj-panel.in { transform: translateX(0); transition: transform .5s cubic-bezier(.2, .85, .25, 1); }
.pj-panel.out { transform: translateX(100%); transition: transform .38s cubic-bezier(.5, 0, .7, .4); }
.pj-panel.dragging { transition: none; }
.pj-bg { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.pj-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(120, 210, 255, .04) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(120, 210, 255, .04) 0 1px, transparent 1px 28px);
  -webkit-mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
  mask-image: radial-gradient(ellipse at 50% 30%, #000 30%, transparent 80%);
}
.pj-scan {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 2px;
  background: linear-gradient(180deg, transparent, rgba(160, 230, 255, .9), transparent);
  box-shadow: 0 0 18px rgba(80, 228, 255, .8);
  opacity: 0;
}
.pj-panel.in .pj-scan { animation: pj-scan .9s .12s ease-out both; }
@keyframes pj-scan { 0% { left: 100%; opacity: 1; } 100% { left: -2%; opacity: 0; } }

.pj-head { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.pj-back {
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid rgba(170, 220, 255, .35);
  background: rgba(4, 16, 32, .7);
  color: #dff3ff;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
}
.pj-title { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.pj-title b {
  font-size: 13px;
  letter-spacing: .24em;
  text-transform: uppercase;
  background: var(--ero-silver, #dfeaf5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.pj-title span { font-size: 11.5px; color: var(--muted); }

.pj-grid {
  position: relative;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr));
  gap: 10px;
  width: min(980px, 100%);
  margin: 0 auto;
}
@media (max-width: 600px) { .pj-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; } }
.pj-loading { grid-column: 1 / -1; text-align: center; color: var(--muted); font-size: 13px; }

.pj-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
  padding: 12px 12px 11px;
  border-radius: 16px;
  border: 1px solid transparent;
  background:
    linear-gradient(160deg, rgba(16, 42, 72, .92), rgba(4, 14, 30, .94)) padding-box,
    var(--ero-silver-line, linear-gradient(135deg, #cfe, #48f)) border-box;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  transition: transform .18s ease, box-shadow .25s ease;
}
.pj-card::before {
  content: "";
  position: absolute;
  right: -34px;
  top: -34px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(80, 228, 255, .2), transparent 70%);
  pointer-events: none;
}
.pj-card:hover { box-shadow: 0 8px 26px rgba(0, 0, 0, .4), 0 0 22px rgba(120, 210, 255, .18); }
.pj-card:active, .pj-card.tapped { transform: scale(.96); }
.pj-panel.in .pj-card { animation: pj-card-in .5s calc(.18s + var(--i, 0) * .05s) cubic-bezier(.2, .8, .3, 1) both; }
@keyframes pj-card-in { from { opacity: 0; transform: translateX(26px); } }

.pj-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.pj-ico {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 16px;
  color: #dff6ff;
  background: rgba(80, 228, 255, .12);
  border: 1px solid rgba(120, 220, 255, .38);
}
.pj-state { font-size: 9px; letter-spacing: .18em; text-transform: uppercase; color: #8ff3c9; }
.pj-state::before { content: "● "; }
.pj-card.stale .pj-state { color: #ffb36b; }
.pj-name { font-size: 14.5px; line-height: 1.22; color: #f2f8ff; overflow-wrap: anywhere; }
.pj-when { font-size: 11px; color: var(--muted); line-height: 1.3; }
.pj-bar { display: block; height: 5px; margin-top: 4px; border-radius: 3px; background: rgba(170, 200, 230, .14); overflow: hidden; }
.pj-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: linear-gradient(90deg, #8fdcff, #f0f9ff); box-shadow: 0 0 8px rgba(120, 210, 255, .7); }
.pj-panel.in .pj-bar i { width: var(--pct); transition: width 1s .4s cubic-bezier(.2, .8, .3, 1); }
.pj-next { font-size: 10.5px; color: rgba(170, 236, 255, .88); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pj-card.stale .pj-next { color: #ffb36b; }

.pj-new {
  align-items: center;
  justify-content: center;
  min-height: 140px;
  gap: 7px;
  border: 1.5px dashed rgba(200, 230, 255, .38);
  background: rgba(80, 228, 255, .04);
  box-shadow: none;
  text-align: center;
}
.pj-new::before { display: none; }
.pj-plus {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #eaf6ff;
  border: 1px solid rgba(200, 230, 255, .5);
  box-shadow: 0 0 18px rgba(80, 228, 255, .35);
  animation: pj-plus 2.6s ease-in-out infinite;
}
@keyframes pj-plus { 50% { box-shadow: 0 0 28px rgba(80, 228, 255, .6); transform: scale(1.05); } }
.pj-new b { font-size: 13px; color: #dff3ff; }
.pj-new small { font-size: 11px; color: var(--muted); max-width: 220px; }
.pj-new.first { grid-column: 1 / -1; min-height: 200px; }

.pj-hint { position: relative; margin: 18px 0 0; text-align: center; font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: rgba(170, 236, 255, .5); }
@media (min-width: 761px) { .pj-hint { display: none; } }

/* Con la pantalla de proyectos encima, el inicio se para (batería). */
body.pj-open .hud, body.pj-open .hud *,
body.pj-open #appScreen main * { animation-play-state: paused !important; }

body.lite .pj-tab-arrow, body.lite .pj-plus, body.lite .pj-panel.in .pj-card, body.lite .pj-panel.in .pj-scan { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .pj-panel.in, .pj-panel.out { transition-duration: .01s; }
  .pj-tab-arrow, .pj-plus, .pj-card, .pj-scan { animation: none !important; }
}
.pj-head { width: min(980px, 100%); margin-left: auto; margin-right: auto; }
@media (min-width: 761px) { .pj-panel { padding-top: 26px; } .pj-head { margin-bottom: 20px; } }
@media (max-width: 600px) { .pj-tab { top: 60%; } }

/* Tablets Android: sin mezclas ni recortes que fallan (la bola central no
   salía) y caminos con trazo normal. */
.tm-core img {
  mix-blend-mode: normal;
  -webkit-mask-image: none;
  mask-image: none;
  border-radius: 50%;
  box-shadow: 0 0 0 1px rgba(170, 236, 255, .55), 0 0 26px rgba(80, 228, 255, .6);
  filter: none;
  animation: tm-breathe-lite 3.2s ease-in-out infinite;
}
@keyframes tm-breathe-lite { 50% { transform: scale(1.06); } }
.tm-link, .tm-link-base { vector-effect: none !important; filter: none; }
.tm-link-base { fill: none; stroke: rgba(120, 220, 255, .22); stroke-width: 3; stroke-linecap: round; }
.tm-link { stroke: rgba(200, 244, 255, .9); stroke-width: 1.6; stroke-dasharray: 4 8; stroke-linecap: round; }
.tm.picked .tm-link-base { opacity: .35; }
.hp-peek img { mix-blend-mode: normal; -webkit-mask-image: none; mask-image: none; border-radius: 50%; box-shadow: 0 0 16px rgba(80, 228, 255, .5); }

/* "Tu progreso": el equipo en una fila compacta */
.tm-compact { margin-top: 14px; }
.tm-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.tm-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 10px 4px 9px;
  border-radius: 14px;
  border: 1px solid rgba(120, 210, 255, .22);
  background: radial-gradient(circle at 50% 30%, rgba(60, 170, 255, .14), rgba(2, 12, 26, .7) 75%);
  color: var(--text);
  font: inherit;
  cursor: pointer;
}
.tm-chip .tm-orb.small { position: relative; left: auto; top: auto; transform: none; width: 46px; }
.tm-chip b { font-size: 12px; text-align: center; line-height: 1.2; }
.tm-chip small { font-size: 10.5px; color: var(--muted); }
.tm-chip[aria-pressed="true"] { border-color: rgba(200, 244, 255, .8); box-shadow: 0 0 16px rgba(80, 228, 255, .3); }
@media (max-width: 420px) { .tm-row { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* Android: dentro de las ventanas, lo animado se queda quieto (el mapa del
   equipo y sus anillos parpadeaban al repintarse sobre el fondo). */
body.android .modal .tm *, body.android .modal .agent-orb, body.android .modal .agent-orb * { animation: none !important; }
body.android .modal .tm-link { stroke-dasharray: none; stroke: rgba(170, 236, 255, .6); }
body.android .modal-backdrop { background: rgba(1, 5, 12, .9); }

/* =========================================================
   APEX: que se sepa que hay equipo dentro de la bola
   ========================================================= */
/* Botón del equipo en la fila de paneles (también abre el microscopio). */
.ha-dock .ha-dock-team { display: grid; place-items: center; }
.ha-dock-team svg { width: 19px; height: 19px; overflow: visible; }
.ha-dock-team svg * { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ha-dock-team svg circle:first-of-type { fill: currentColor; }
.ha-dock-team { color: #dff8ff; border-color: rgba(170, 236, 255, .55) !important; box-shadow: 0 0 14px rgba(80, 228, 255, .25), inset 0 0 12px rgba(80, 228, 255, .14) !important; }

/* Pista "dos toques" sobre la bola: dos pulsos seguidos y "×2". */
.ha-tapcue { position: absolute; inset: 0; z-index: 3; pointer-events: none; opacity: 0; }
.ha-orb.teach-tap .ha-tapcue { opacity: 1; }
.ha-tapcue i {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 2px solid rgba(230, 250, 255, .85);
  transform: translate(-50%, -50%) scale(.6);
  opacity: 0;
  animation: ha-tap 2.6s ease-out infinite;
}
.ha-tapcue i:nth-of-type(2) { animation-delay: .28s; }
@keyframes ha-tap {
  0% { transform: translate(-50%, -50%) scale(.6); opacity: 0; }
  6% { opacity: .95; }
  30% { transform: translate(-50%, -50%) scale(1.5); opacity: 0; }
  100% { opacity: 0; }
}
.home-apex:not([data-state="idle"]) .ha-tapcue { opacity: 0 !important; }
@media (prefers-reduced-motion: reduce) { .ha-tapcue i { animation: none; } }
/* Etiqueta "Tu equipo ×2" dentro de la bola (abajo), siempre visible. */
.ha-team-pill {
  position: absolute;
  left: 50%;
  bottom: 9%;
  z-index: 4;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px 5px 8px;
  border-radius: 999px;
  border: 1px solid rgba(200, 244, 255, .55);
  background: rgba(2, 14, 30, .72);
  box-shadow: 0 0 14px rgba(80, 228, 255, .3);
  color: #eafbff;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: opacity .3s ease, transform .15s ease;
}
.ha-team-pill:active { transform: translateX(-50%) scale(.95); }
.ha-team-pill svg { width: 16px; height: 16px; overflow: visible; }
.ha-team-pill svg * { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; }
.ha-team-pill svg circle:first-of-type { fill: currentColor; }
.ha-team-pill b { padding: 1px 6px; border-radius: 999px; background: rgba(120, 220, 255, .2); font-size: 11px; }
.ha-orb.teach-tap .ha-team-pill { animation: ha-pill-glow 2.6s ease-in-out infinite; }
@keyframes ha-pill-glow { 0%, 100% { box-shadow: 0 0 14px rgba(80, 228, 255, .3); } 20%, 35% { box-shadow: 0 0 24px rgba(120, 236, 255, .8); border-color: #fff; } }
.home-apex:not([data-state="idle"]) .ha-team-pill { opacity: 0; pointer-events: none; }
.home-apex[data-neural] .ha-team-pill { opacity: 0; pointer-events: none; }

/* =========================
   PRUEBA GRATIS Y MEMBRESÍA: tabla de qué incluye cada opción (portada,
   Mi cuenta y antes de pagar) y el anuncio suave de la prueba.
========================= */
.plan-compare {
  width: 100%;
  border-collapse: collapse;
  margin: 10px 0 14px;
  font-size: 13px;
  color: var(--text);
}
.plan-compare th,
.plan-compare td {
  padding: 7px 6px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.plan-compare th { color: var(--cyan-bright); font-weight: 600; }
.plan-compare td:first-child { color: #b9dcea; }
.landing-compare { margin: -4px 0 14px; }
.landing-compare[hidden] { display: none; }

.ero-ad {
  margin-top: 16px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  max-height: 140px;
  overflow: hidden;
}
.ero-ad-note { margin: 6px 0 0; font-size: 12px; color: #b9dcea; text-align: center; }

/* Caminos de €ERO (src/modes): la elección en la bienvenida, en grande. */
.welcome-modes { grid-template-columns: 1fr; }
.welcome-modes button { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; padding: 14px 14px; font-size: 15px; text-align: left; }
.welcome-modes button small { font-size: 12px; opacity: .75; font-weight: 400; }
.welcome-modes button.chosen { border-color: var(--line-strong); background: rgba(22, 141, 255, .28); color: var(--cyan-bright); }
.no-sales .ha-dock [data-holo="sales"] { display: none; }

/* Camino estudiante: botones de Apex solo para quien estudia. */
.ha-dock .ha-only-study { display: none; }
.has-study .ha-dock .ha-only-study { display: inline-flex; align-items: center; justify-content: center; }

/* ⏱️ Sesión de estudio (study.js): barra flotante con la cuenta atrás. */
.study-bar {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(4, 18, 34, .94);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .45), 0 0 18px rgba(80, 228, 255, .18);
  color: var(--text);
  max-width: calc(100vw - 24px);
}
.study-dot { width: 9px; height: 9px; border-radius: 50%; background: #5ff0a8; box-shadow: 0 0 10px #5ff0a8; animation: studyPulse 2s ease-in-out infinite; }
.study-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.study-text b { font-variant-numeric: tabular-nums; font-size: 16px; color: var(--cyan-bright); }
.study-text small { font-size: 11.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46vw; }
.study-bar button { border-radius: 999px; padding: 7px 12px; font-size: 12.5px; }
.study-lengths { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
@keyframes studyPulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { .study-dot { animation: none; } }

/* =========================
   🎓 Mi media (grades.js)
========================= */
.gm-panel { display: flex; flex-direction: column; gap: 12px; }
.gm-back { align-self: flex-start; background: none; border: 0; color: var(--cyan-bright); font: inherit; font-size: 14px; padding: 2px 0; cursor: pointer; }
.gm-h { margin: 0; font-size: 18px; }
.gm-hero {
  border: 1px solid var(--line-strong);
  border-radius: 18px;
  padding: 14px 16px 16px;
  background: radial-gradient(120% 140% at 0% 0%, rgba(80, 228, 255, .16), rgba(6, 22, 40, .92) 60%);
  box-shadow: 0 0 24px rgba(80, 228, 255, .08) inset;
}
.gm-hero.small { padding: 12px 14px; }
.gm-hero-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.gm-label { font-size: 12.5px; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.gm-big { font-size: 52px; line-height: 1.05; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--cyan-bright); margin: 6px 0 2px; }
.gm-hero.small .gm-big { font-size: 40px; }
.gm-hero.excellent .gm-big { color: #7dffc4; }
.gm-hero.low .gm-big { color: #ff9f8f; }
.gm-sub { margin: 0; font-size: 13.5px; color: #cfeeff; }
.gm-bar { height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); overflow: hidden; margin-top: 12px; }
.gm-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #168dff, #50e4ff, #7dffc4); }
.gm-chip { border: 1px solid var(--line); background: rgba(8, 30, 52, .85); color: #d6f2ff; border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 12.5px; cursor: pointer; }
.gm-delta { display: inline-block; font-weight: 700; font-size: 13px; padding: 1px 7px; border-radius: 999px; margin-left: 4px; }
.gm-delta.up { color: #7dffc4; background: rgba(95, 240, 168, .12); }
.gm-delta.down { color: #ff9f8f; background: rgba(255, 120, 100, .12); }
.gm-delta.same { color: var(--muted); background: rgba(255, 255, 255, .06); }
.gm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gm-actions button { border-radius: 12px; padding: 11px 8px; font: inherit; font-size: 14px; border: 1px solid var(--line); background: rgba(8, 30, 52, .85); color: #d6f2ff; cursor: pointer; margin: 0; }
.gm-actions button.primary { background: var(--blue); color: #fff; border-color: transparent; }
.gm-need { margin: 0; padding: 11px 13px; border-radius: 12px; border: 1px solid var(--line); background: rgba(22, 141, 255, .1); font-size: 14px; line-height: 1.45; }
.gm-need.warn { background: rgba(255, 120, 100, .1); }
.gm-big-inline { font-size: 18px; color: var(--cyan-bright); }
.gm-card { border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; background: rgba(6, 22, 40, .85); }
.gm-card-title { display: block; font-size: 13.5px; margin-bottom: 8px; }
.gm-scenarios { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.gm-scenarios span { display: flex; flex-direction: column; align-items: center; padding: 6px 2px; border-radius: 10px; background: rgba(255, 255, 255, .04); }
.gm-scenarios small { font-size: 11px; color: var(--muted); }
.gm-scenarios b { font-size: 14px; font-variant-numeric: tabular-nums; }
.gm-scenarios .excellent b, .gm-scenarios .good b { color: #7dffc4; }
.gm-scenarios .low b { color: #ff9f8f; }
.gm-section-head { display: flex; justify-content: space-between; align-items: center; margin-top: 4px; }
.gm-course { margin: 4px 0 -4px; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.gm-subjects { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gm-subject { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; text-align: left; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: rgba(6, 22, 40, .85); color: var(--text); font: inherit; cursor: pointer; border-left-width: 4px; }
.gm-subject.excellent { border-left-color: #5ff0a8; }
.gm-subject.good { border-left-color: #50e4ff; }
.gm-subject.ok { border-left-color: #ffcf5c; }
.gm-subject.low { border-left-color: #ff8a73; }
.gm-subject.off { opacity: .6; }
.gm-subject-name { display: flex; flex-direction: column; min-width: 0; font-size: 14.5px; }
.gm-subject-name small { color: var(--muted); font-size: 12px; }
.gm-subject-avg { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gm-empty { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }
.gm-empty p { margin: 0; color: #cfeeff; }
.gm-link { background: none; border: 0; color: var(--cyan-bright); font: inherit; font-size: 13.5px; text-align: left; padding: 0; cursor: pointer; }
.gm-foot { margin: 2px 0 0; font-size: 12px; color: var(--muted); line-height: 1.45; }
.gm-muted { margin: 0; color: var(--muted); font-size: 13.5px; }
.gm-form label { margin-top: 8px; }
.gm-two { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.gm-two input { width: 100%; }
.gm-preview { min-height: 20px; margin-top: 10px; }
.gm-sim { display: flex; flex-direction: column; gap: 6px; }
.gm-sim > div { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; padding: 9px 11px; border-radius: 10px; border: 1px solid var(--line); background: rgba(6, 22, 40, .85); }
.gm-sim small { color: var(--muted); font-size: 12.5px; }
.gm-sim b { font-variant-numeric: tabular-nums; }
.gm-need-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.gm-need-list li { display: flex; justify-content: space-between; align-items: center; gap: 10px; font-size: 13.5px; padding: 7px 0; border-bottom: 1px solid rgba(255, 255, 255, .05); }
.gm-need-list li:last-child { border-bottom: 0; }
.gm-need-list span { display: flex; flex-direction: column; min-width: 0; }
.gm-need-list small { color: var(--muted); font-size: 11.5px; }
.gm-need-list b { display: flex; flex-direction: column; align-items: flex-end; font-size: 16px; color: var(--cyan-bright); font-variant-numeric: tabular-nums; white-space: nowrap; }
.gm-need-list b small { font-size: 12px; color: #7dffc4; }
.gm-need-list b.low { color: #ff9f8f; }
.gm-need-list .gm-chain b { font-size: 13.5px; white-space: normal; text-align: right; color: #e9f8ff; }
.gm-spec { display: grid; grid-template-columns: 1fr auto 64px; gap: 6px; margin-top: 6px; }
.gm-spec input, .gm-spec select { min-width: 0; font-size: 15px; }
.gm-check { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.gm-check input { width: 18px; height: 18px; accent-color: var(--cyan); }
.gm-settings summary { cursor: pointer; font-size: 14px; color: #cfeeff; padding: 6px 0; }
.gm-mini { flex: none; border: 1px solid var(--line); background: rgba(22, 141, 255, .18); color: #d6f2ff; border-radius: 8px; padding: 4px 8px; font: inherit; font-size: 12px; cursor: pointer; }
.gm-open { width: 100%; margin: 0 0 10px; }
input[type="range"]#gmSimRange { width: 100%; accent-color: var(--cyan); }
@media (max-width: 360px) { .gm-scenarios { grid-template-columns: repeat(3, 1fr); } .gm-big { font-size: 44px; } }

/* =========================
   📚 Mi estudio (study-hub.js)
========================= */
.sh-panel { display: flex; flex-direction: column; gap: 12px; }
.sh-tabs { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; margin: 0 -2px; padding: 2px; }
.sh-tabs::-webkit-scrollbar { display: none; }
.sh-tabs button { flex: none; padding: 8px 12px; border-radius: 999px; border: 1px solid var(--line); background: rgba(8, 30, 52, .85); color: #d6f2ff; font: inherit; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.sh-tabs button.chosen { border-color: var(--line-strong); background: rgba(22, 141, 255, .28); color: var(--cyan-bright); }
#shBody { display: flex; flex-direction: column; gap: 12px; }
.sh-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.sh-item { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 9px 10px; border-radius: 10px; border: 1px solid var(--line); background: rgba(6, 22, 40, .85); font-size: 13.5px; }
.sh-item span { display: flex; flex-direction: column; min-width: 0; }
.sh-item small { color: var(--muted); font-size: 12px; }
.sh-item.soon { border-color: rgba(255, 160, 120, .55); }
.sh-count { flex: none; color: var(--cyan-bright); font-weight: 700; font-size: 13px; }
.sh-classes { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.sh-classes span { padding: 4px 9px; border-radius: 999px; background: rgba(255, 255, 255, .06); font-size: 12.5px; }
.sh-big { width: 100%; padding: 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: linear-gradient(135deg, rgba(22, 141, 255, .45), rgba(80, 228, 255, .22)); color: #fff; font: inherit; font-size: 15.5px; font-weight: 700; cursor: pointer; }
.sh-day { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .06); }
.sh-day > b { font-size: 14px; text-transform: capitalize; }
.sh-day > b small { font-weight: 400; color: var(--muted); text-transform: none; }
.sh-day.today > b { color: var(--cyan-bright); }
.sh-exam { margin: 0; display: flex; align-items: center; justify-content: space-between; gap: 6px; padding: 7px 10px; border-radius: 10px; background: rgba(255, 150, 110, .12); font-size: 13.5px; }
.sh-class-row { display: grid; grid-template-columns: 1fr 92px 92px; gap: 6px; }
.sh-class-row select, .sh-class-row input { min-width: 0; font-size: 15px; }
.sh-due { display: block; font-size: 10.5px; font-weight: 400; color: var(--muted); text-align: right; }
.sh-review-top { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12.5px; }
.sh-flash { min-height: 190px; display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 20px 16px; border-radius: 18px; border: 1px solid var(--line-strong); background: radial-gradient(120% 120% at 50% 0%, rgba(80, 228, 255, .14), rgba(6, 22, 40, .95) 70%); text-align: center; }
.sh-flash hr { width: 60%; border: 0; border-top: 1px dashed rgba(255, 255, 255, .2); margin: 0 auto; }
.sh-front { margin: 0; font-size: 19px; font-weight: 700; line-height: 1.35; white-space: pre-wrap; }
.sh-back { margin: 0; font-size: 16.5px; color: #cfeeff; line-height: 1.45; white-space: pre-wrap; }
.sh-grades { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.sh-grades button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(8, 30, 52, .9); color: #fff; font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
.sh-grades small { font-weight: 400; font-size: 11px; color: var(--muted); }
.sh-grades .again { border-color: rgba(255, 120, 100, .6); }
.sh-grades .hard { border-color: rgba(255, 200, 90, .6); }
.sh-grades .good { border-color: rgba(80, 228, 255, .6); }
.sh-grades .easy { border-color: rgba(95, 240, 168, .6); }
.sh-rank { margin: 0 0 10px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px; }
.sh-rank li { display: flex; justify-content: space-between; padding: 6px 8px; border-radius: 8px; font-size: 13.5px; }
.sh-rank li.me { background: rgba(22, 141, 255, .18); }
.sh-rank b { font-variant-numeric: tabular-nums; }
.sh-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.sh-stats span { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; border: 1px solid var(--line); background: rgba(6, 22, 40, .85); font-size: 12px; color: var(--muted); text-align: center; }
.sh-stats b { font-size: 20px; color: var(--cyan-bright); }
.sh-cutoff { display: flex; flex-direction: column; gap: 6px; }
.sh-cutoff a { color: var(--cyan-bright); }

/* Tus proyectos en tablets Android: un fondo sólido debajo del degradado, por
   encima de todo el inicio, sin transformación cuando ya ha entrado, y el
   inicio oculto debajo (para que nunca se vea a través ni reciba los toques). */
.pj-panel { z-index: 48; background-color: #020b1a; isolation: isolate; }
.pj-panel.in.settled { transform: none; transition: none; }
body.pj-open { overflow: hidden; }
body.pj-settled #appScreen main { visibility: hidden; }
body.android .pj-panel.in .pj-card, body.android .pj-panel.in .pj-scan { animation: none !important; }

/* Ventanas (Mi cuenta, herramientas…) en tablets Android: la ventana salía
   vacía y cortada, con el inicio viéndose a través (Chrome no pintaba entera
   la capa fija encima del fondo animado). Igual que en Tus proyectos: fondo
   sólido, capa aislada y el inicio de debajo oculto mientras está abierta. */
body.modal-open { overflow: hidden; }
body.android .modal-backdrop { isolation: isolate; background: #01050c; }
body.android .modal { background: #05101f; isolation: isolate; transform: none; }
body.android .modal-body { contain: paint; }
body.android.modal-open #appScreen main { visibility: hidden; }

/* Con una ventana abierta en Android, lo de detrás deja de animarse: el fondo
   holográfico se quita y el inicio oculto se para. Así la ventana (Mi cuenta…)
   abre y se desplaza sin tirones en tablets modestas. Al cerrarla, todo vuelve. */
body.android.modal-open .hud { display: none; }
body.android.modal-open::after { animation: none; }
body.android.modal-open #appScreen main,
body.android.modal-open #appScreen main * { animation-play-state: paused !important; }

/* =========================
   Desplegables con el estilo de €ERO (selector.js)
   La lista blanca del sistema se sustituye por esta.
   ========================= */
select.ero-select-open { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(80, 228, 255, .14); }
.ero-select-menu {
  position: fixed;
  z-index: 2147483000;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(8, 26, 48, .98), rgba(4, 13, 27, .98));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .55), 0 0 22px rgba(80, 228, 255, .16), inset 0 0 0 1px rgba(255, 255, 255, .03);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: ero-select-in .14s ease-out;
}
@keyframes ero-select-in { from { opacity: 0; transform: translateY(-4px) scale(.98); } to { opacity: 1; transform: none; } }
.ero-select-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 15px;
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ero-select-option + .ero-select-option { margin-top: 2px; }
.ero-select-option:hover, .ero-select-option:focus-visible { background: rgba(80, 228, 255, .08); outline: none; }
.ero-select-option:active { background: rgba(80, 228, 255, .16); }
.ero-select-option.is-selected { background: rgba(22, 141, 255, .20); color: var(--cyan-bright); box-shadow: inset 0 0 0 1px rgba(80, 228, 255, .35); }
.ero-select-option.is-selected::after { content: "\2713"; color: var(--cyan); font-weight: 700; }
.ero-select-option:disabled { opacity: .4; cursor: default; }
.ero-select-group { padding: 8px 12px 4px; font-size: 11.5px; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
@media (prefers-reduced-motion: reduce) { .ero-select-menu { animation: none; } }
/* La lista del sistema, si llega a salir (teclado), también en oscuro. */
select option, select optgroup { background-color: #061528; color: var(--text); }

/* =========================
   ⌂ Volver al inicio (app.js: goHome)
   En la cabecera solo dentro de un chat; en Proyectos, siempre.
   ========================= */
.home-button {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: 11px;
  border: 1px solid var(--line);
  background: rgba(6, 22, 40, .7);
  color: var(--cyan-bright);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.home-button[hidden] { display: none; }
.home-button:hover, .home-button:focus-visible { border-color: var(--line-strong); box-shadow: 0 0 14px rgba(80, 228, 255, .22); outline: none; }
.home-button:active { background: rgba(22, 141, 255, .22); }
.new.home-link { margin-bottom: 8px; background: linear-gradient(145deg, #0d2a42, #061523); border-color: rgba(69, 190, 255, .26); }
@media (max-width: 600px) {
  .home-button { width: 36px; height: 36px; }
  .home-button:not([hidden]) + .brand-logo { max-width: 92px; }
}

/* =========================
   Tablets Android: cabecera y fondo sin capas de más
   Al girar la tablet o deslizar, Chrome en Android a veces dejaba la
   cabecera (y otros trozos) sin pintar: demasiadas capas animadas a la vez
   (cabecera con su línea de energía, rejilla del fondo moviéndose a
   pantalla completa…). En Android la cabecera va pintada con la página y
   esas dos animaciones quedan quietas. El resto del fondo sigue igual.
   ========================= */
body.android #appScreen header,
body.android .hud {
  transform: none;
  backface-visibility: visible;
}
body.android #appScreen header::after {
  animation: none !important;
  will-change: auto;
  transform: translateX(90%);
}
body.android .hud-grid::before {
  animation: none !important;
  will-change: auto;
}

/* =========================
   ✋ MODO HOLO — control por gestos (gestos.js)
   Capa a pantalla completa que NO recibe toques (pointer-events: none):
   el holograma de la mano, la retícula, las esquinas sobre el botón
   apuntado, el visor de la cámara y los avisos de cada gesto.
   ========================= */
.eg {
  position: fixed;
  inset: 0;
  z-index: 2147482000;
  pointer-events: none;
  opacity: 0;
  transition: opacity .45s ease;
  font-family: "DejaVu Sans Mono", ui-monospace, monospace;
}
.eg[hidden] { display: none; }
.eg.on { opacity: 1; }
.eg-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }

/* Marco de pantalla: cuatro esquinas que entran al encender */
.eg-frame i {
  position: absolute;
  width: clamp(28px, 5vw, 54px);
  height: clamp(28px, 5vw, 54px);
  border: 2px solid rgba(var(--hud), .75);
  filter: drop-shadow(0 0 6px rgba(var(--hud), .8));
  transition: transform .7s cubic-bezier(.2, .9, .25, 1.15), opacity .5s ease;
  opacity: 0;
}
.eg-frame .tl { top: 12px; left: 12px; border-right: 0; border-bottom: 0; transform: translate(40vw, 40vh); }
.eg-frame .tr { top: 12px; right: 12px; border-left: 0; border-bottom: 0; transform: translate(-40vw, 40vh); }
.eg-frame .bl { bottom: 12px; left: 12px; border-right: 0; border-top: 0; transform: translate(40vw, -40vh); }
.eg-frame .br { bottom: 12px; right: 12px; border-left: 0; border-top: 0; transform: translate(-40vw, -40vh); }
.eg.on .eg-frame i { transform: none; opacity: 1; }
.eg.tracking .eg-frame i { border-color: rgba(197, 247, 255, .95); }

/* Barrido de arranque (tres líneas de escaneo) */
.eg-boot span {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  top: -4px;
  background: linear-gradient(90deg, transparent, rgba(var(--hud), .9), transparent);
  box-shadow: 0 0 18px rgba(var(--hud), .9);
  opacity: 0;
}
.eg.on .eg-boot span { animation: eg-boot 1.3s cubic-bezier(.4, 0, .2, 1) both; }
.eg.on .eg-boot span:nth-child(2) { animation-delay: .12s; }
.eg.on .eg-boot span:nth-child(3) { animation-delay: .24s; }
@keyframes eg-boot {
  0% { top: -4px; opacity: 0; }
  10% { opacity: 1; }
  100% { top: 100%; opacity: 0; }
}

/* Estado arriba (como el HUD del casco) */
.eg-status {
  position: absolute;
  top: calc(var(--eg-top, 0px) + 12px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px;
  border: 1px solid rgba(var(--hud), .35);
  border-radius: 999px;
  background: rgba(2, 12, 26, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  font-size: 11px;
  letter-spacing: .16em;
  color: rgba(197, 247, 255, .92);
  white-space: nowrap;
  box-shadow: 0 0 22px rgba(var(--hud), .18);
}
.eg-status b { color: #fff; font-weight: 700; text-shadow: 0 0 10px rgba(var(--hud), .9); }
.eg-status b::before {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #ffb36b;
  box-shadow: 0 0 8px #ffb36b;
  vertical-align: 1px;
  animation: eg-dot 1s ease-in-out infinite;
}
.eg.tracking .eg-status b::before { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); animation-duration: 2.2s; }
@keyframes eg-dot { 50% { opacity: .35; } }
.eg-status span.blink { animation: eg-glitch .4s steps(2) both; }
@keyframes eg-glitch {
  0% { opacity: 0; transform: translateX(-4px); filter: blur(2px); }
  40% { opacity: 1; transform: translateX(3px); }
  100% { opacity: 1; transform: none; filter: none; }
}

/* El aviso de cada gesto: aparece con un destello y se va */
.eg-label {
  position: absolute;
  top: 24%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.9);
  font-size: clamp(14px, 2.2vw, 20px);
  font-weight: 700;
  letter-spacing: .32em;
  color: #fff;
  text-shadow: 0 0 12px rgba(var(--hud), 1), 0 0 34px rgba(var(--hud-blue), .8);
  opacity: 0;
  white-space: nowrap;
  padding: 8px 18px 8px 24px;
  border-top: 1px solid rgba(var(--hud), .55);
  border-bottom: 1px solid rgba(var(--hud), .55);
  background: linear-gradient(90deg, transparent, rgba(4, 22, 44, .55), transparent);
}
.eg-label[data-kind="big"] { font-size: clamp(18px, 3.4vw, 30px); }
.eg-label.in { animation: eg-label var(--eg-label-dur, 1.3s) cubic-bezier(.2, .9, .3, 1) both; }
/* Consejos largos: más pequeños, en dos líneas como mucho y debajo del dock */
.eg .eg-label.eg-label-long { font-size: clamp(12px, 1.5vw, 15px); letter-spacing: .12em; white-space: normal; text-align: center; width: max-content; max-width: min(620px, calc(100vw - 40px)); top: auto; bottom: calc(120px + env(safe-area-inset-bottom, 0px)); padding: 8px 16px; border-radius: 12px; background: rgba(2, 12, 26, .92); }
.eg .eg-label.eg-label-long.in { animation-name: eg-label-long; }
@keyframes eg-label-long {
  0% { opacity: 0; transform: translate(-50%, -50%) scale(.92); filter: blur(4px) brightness(2); }
  8% { opacity: 1; transform: translate(-50%, -50%) scale(1); filter: none; }
  88% { opacity: 1; }
  100% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
}
@keyframes eg-label {
  0% { opacity: 0; transform: translate(-50%, -50%) scaleX(1.8) scaleY(.2); filter: blur(6px) brightness(2.5); }
  14% { opacity: 1; transform: translate(-50%, -50%) scale(1.04); filter: none; }
  22% { transform: translate(-50%, -50%) scale(1); }
  75% { opacity: 1; letter-spacing: .32em; }
  100% { opacity: 0; letter-spacing: .5em; transform: translate(-50%, -50%) scale(1); }
}

/* Visor de la cámara (abajo a la izquierda, en espejo y teñido de holograma) */
.eg-cam {
  position: absolute;
  left: calc(14px + env(safe-area-inset-left, 0px));
  bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  width: clamp(150px, 16vw, 210px);
  aspect-ratio: 4 / 3;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid rgba(var(--hud), .45);
  background: #020a16;
  box-shadow: 0 0 26px rgba(var(--hud), .25), inset 0 0 30px rgba(0, 0, 0, .6);
  transform: translateY(30px) scale(.85);
  opacity: 0;
  transition: transform .6s cubic-bezier(.2, .9, .3, 1.2) .25s, opacity .5s ease .25s;
}
.eg.on .eg-cam { transform: none; opacity: 1; }
.eg-cam video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
  filter: grayscale(1) contrast(1.25) brightness(.85);
}
.eg-cam-tint { position: absolute; inset: 0; background: rgba(22, 141, 255, .38); mix-blend-mode: color; }
.eg-cam-tint::after {
  content: "";
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(0deg, rgba(0, 0, 0, .25) 0 1px, transparent 1px 3px);
}
.eg-cam-scan {
  position: absolute;
  left: 0;
  right: 0;
  height: 30%;
  background: linear-gradient(180deg, transparent, rgba(var(--hud), .22), transparent);
  animation: eg-scan 2.4s linear infinite;
}
@keyframes eg-scan { from { top: -30%; } to { top: 100%; } }
.eg-cam-c { position: absolute; width: 12px; height: 12px; border: 1.5px solid rgba(197, 247, 255, .9); }
.eg-cam-c.tl { top: 5px; left: 5px; border-right: 0; border-bottom: 0; }
.eg-cam-c.tr { top: 5px; right: 5px; border-left: 0; border-bottom: 0; }
.eg-cam-c.bl { bottom: 5px; left: 5px; border-right: 0; border-top: 0; }
.eg-cam-c.br { bottom: 5px; right: 5px; border-left: 0; border-top: 0; }
.eg-cam-read, .eg-cam-lock {
  position: absolute;
  left: 10px;
  font-size: 9px;
  letter-spacing: .14em;
  color: rgba(197, 247, 255, .9);
  text-shadow: 0 0 6px rgba(var(--hud), .9);
}
.eg-cam-read { bottom: 22px; left: 22px; }
.eg-cam-read b { color: #fff; margin-left: 4px; }
.eg-cam-lock { bottom: 8px; left: 22px; color: #ffb36b; text-shadow: 0 0 6px rgba(255, 150, 60, .8); }
.eg.tracking .eg-cam-lock { color: var(--cyan-bright); text-shadow: 0 0 6px rgba(var(--hud), .9); }
.eg.tracking .eg-cam { border-color: rgba(197, 247, 255, .8); }
.eg-cam-btn {
  position: absolute;
  top: 6px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--hud), .5);
  background: rgba(2, 12, 26, .75);
  color: #fff;
  font: 700 12px/1 Inter, system-ui, sans-serif;
  cursor: pointer;
  pointer-events: auto;
}
.eg-cam-btn:hover, .eg-cam-btn:focus-visible { border-color: var(--cyan-bright); box-shadow: 0 0 12px rgba(var(--hud), .6); outline: none; }
.eg-off { right: 6px; }
.eg-help { right: 38px; }

/* Chuleta de gestos (botón ?) */
.eg-legend {
  position: absolute;
  left: calc(14px + env(safe-area-inset-left, 0px));
  bottom: calc(clamp(150px, 16vw, 210px) * .75 + 26px + env(safe-area-inset-bottom, 0px));
  width: min(320px, calc(100vw - 28px));
  margin: 0;
  padding: 10px;
  list-style: none;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(var(--hud), .35);
  border-radius: 12px;
  background: rgba(2, 12, 26, .82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  animation: eg-pop .35s cubic-bezier(.2, .9, .3, 1.2) both;
}
.eg-legend[hidden] { display: none; }
@keyframes eg-pop { from { opacity: 0; transform: translateY(10px) scale(.96); } }

/* La guía (en la presentación y en la chuleta) */
.eg-guide, .eg-legend { text-align: left; }
.eg-guide { list-style: none; margin: 14px 0; padding: 0; display: grid; gap: 8px; }
.eg-guide li, .eg-legend li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(var(--hud), .16);
  border-radius: 12px;
  background: linear-gradient(90deg, rgba(22, 141, 255, .1), rgba(4, 16, 32, .2));
}
.eg-guide li { animation: eg-row .5s cubic-bezier(.2, .9, .3, 1) both; animation-delay: calc(.25s + var(--i) * .07s); }
@keyframes eg-row { from { opacity: 0; transform: translateX(-14px); } }
.eg-g-ico {
  flex: none;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 19px;
  border: 1px solid rgba(var(--hud), .4);
  background: radial-gradient(circle, rgba(var(--hud), .2), transparent 70%);
  box-shadow: 0 0 14px rgba(var(--hud), .25);
  letter-spacing: -.2em;
}
.eg-guide li span:last-child, .eg-legend li span:last-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.eg-guide b, .eg-legend b { color: #fff; font-size: 14px; }
.eg-guide small, .eg-legend small { color: var(--muted); font-size: 12.5px; line-height: 1.35; }
.eg-legend .eg-g-ico { width: 32px; height: 32px; font-size: 15px; }

/* Presentación (primera vez) */
.eg-intro {
  position: fixed;
  inset: 0;
  z-index: 2147482500;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(0, 4, 12, .72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s ease;
}
.eg-intro.in { opacity: 1; }
.eg-intro-card {
  position: relative;
  width: min(460px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 26px 22px 20px;
  border: 1px solid rgba(var(--hud), .45);
  border-radius: 20px;
  background:
    radial-gradient(ellipse 80% 40% at 50% 0%, rgba(22, 141, 255, .25), transparent 70%),
    linear-gradient(180deg, rgba(5, 20, 40, .97), rgba(2, 10, 22, .97));
  box-shadow: 0 0 60px rgba(var(--hud), .22), var(--shadow);
  text-align: center;
  color: var(--text);
  transform: perspective(900px) rotateX(18deg) scale(.9) translateY(24px);
  transition: transform .55s cubic-bezier(.2, .9, .3, 1.15);
}
.eg-intro.in .eg-intro-card { transform: none; }
.eg-intro-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: linear-gradient(180deg, transparent 0 46%, rgba(var(--hud), .1) 50%, transparent 54%);
  background-size: 100% 300%;
  animation: eg-sheen 3.2s linear infinite;
}
@keyframes eg-sheen { from { background-position: 0 100%; } to { background-position: 0 -200%; } }
.eg-intro-ico {
  width: 74px;
  height: 74px;
  margin: 0 auto 8px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--hud), .7);
  box-shadow: 0 0 24px rgba(var(--hud), .5), inset 0 0 18px rgba(var(--hud), .3);
  animation: eg-breathe 2.4s ease-in-out infinite;
}
.eg-intro-ico svg { width: 38px; height: 38px; fill: none; stroke: var(--cyan-bright); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px rgba(var(--hud), .9)); }
@keyframes eg-breathe { 50% { box-shadow: 0 0 40px rgba(var(--hud), .75), inset 0 0 24px rgba(var(--hud), .45); } }
.eg-intro-tag { display: block; font: 600 10.5px "DejaVu Sans Mono", ui-monospace, monospace; letter-spacing: .3em; color: rgba(var(--hud), .9); }
.eg-intro-card h2 { margin: 4px 0 6px; font-size: 26px; letter-spacing: .04em; text-shadow: 0 0 18px rgba(var(--hud), .6); }
.eg-intro-card > p { margin: 0 auto; max-width: 34ch; color: var(--muted); line-height: 1.45; font-size: 14.5px; }
.eg-intro-card .eg-privacy { margin-top: 4px; font-size: 12.5px; color: var(--faint); max-width: none; }
.eg-intro-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.eg-intro-go, .eg-intro-no {
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font: 600 15px Inter, system-ui, sans-serif;
  cursor: pointer;
}
.eg-intro-go {
  border: 1px solid rgba(197, 247, 255, .8);
  color: #00121f;
  background: linear-gradient(180deg, #9ff4ff, #34c6ff);
  box-shadow: 0 0 24px rgba(var(--hud), .55);
}
.eg-intro-no { border: 1px solid rgba(var(--hud), .35); color: var(--text); background: transparent; }
.eg-intro-go:focus-visible, .eg-intro-no:focus-visible { outline: 2px solid var(--cyan-bright); outline-offset: 3px; }

/* Ajustes, manos vistas, avisos y práctica */
.eg-gear { right: 102px; font-size: 14px; }
.eg-cam-hands {
  position: absolute;
  right: 10px;
  bottom: 8px;
  font: 600 9px "DejaVu Sans Mono", ui-monospace, monospace;
  letter-spacing: .1em;
  color: var(--cyan-bright);
  text-shadow: 0 0 6px rgba(var(--hud), .9);
}
.eg-settings {
  position: absolute;
  left: calc(14px + env(safe-area-inset-left, 0px));
  bottom: calc(clamp(150px, 16vw, 210px) * .75 + 26px + env(safe-area-inset-bottom, 0px));
  width: min(340px, calc(100vw - 28px));
  padding: 12px;
  display: grid;
  gap: 10px;
  border: 1px solid rgba(var(--hud), .35);
  border-radius: 14px;
  background: rgba(2, 12, 26, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  animation: eg-pop .35s cubic-bezier(.2, .9, .3, 1.2) both;
}
.eg-settings[hidden] { display: none; }
.eg-settings-title { font: 700 11px "DejaVu Sans Mono", ui-monospace, monospace; letter-spacing: .3em; color: rgba(var(--hud), .95); }
.eg-set-row { display: grid; gap: 6px; }
.eg-set-row > span { font-size: 13px; color: var(--muted); }
.eg-seg { display: flex; gap: 6px; }
.eg-seg button {
  flex: 1;
  min-height: 40px;
  border-radius: 10px;
  border: 1px solid rgba(var(--hud), .3);
  background: rgba(4, 16, 32, .7);
  color: var(--text);
  font: 600 13px Inter, system-ui, sans-serif;
  cursor: pointer;
}
.eg-seg button[aria-pressed="true"] {
  color: #00121f;
  background: linear-gradient(180deg, #9ff4ff, #34c6ff);
  border-color: rgba(197, 247, 255, .9);
  box-shadow: 0 0 12px rgba(var(--hud), .45);
}
.eg-settings-note { font-size: 11.5px; color: var(--faint); }
.eg-hint {
  position: absolute;
  left: 50%;
  bottom: calc(74px + env(safe-area-inset-bottom, 0px)); /* justo encima del estado: no tapa los widgets */
  transform: translate(-50%, 14px);
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 170, 70, .6);
  background: rgba(30, 14, 2, .78);
  color: #ffd9a8;
  font: 600 12px "DejaVu Sans Mono", ui-monospace, monospace;
  letter-spacing: .14em;
  white-space: normal;
  text-align: center;
  width: max-content;
  max-width: calc(100vw - 40px);
  box-shadow: 0 0 22px rgba(255, 150, 60, .3);
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
}
.eg-hint.on { opacity: 1; transform: translate(-50%, 0); }
.eg-practice {
  position: absolute;
  top: calc(var(--eg-top, 0px) + 58px);
  left: 50%;
  transform: translateX(-50%);
  width: min(360px, calc(100vw - 28px));
  padding: 12px 14px;
  border: 1px solid rgba(var(--hud), .45);
  border-radius: 14px;
  background: rgba(2, 12, 26, .88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  box-shadow: 0 0 30px rgba(var(--hud), .2);
  animation: eg-pop .4s cubic-bezier(.2, .9, .3, 1.2) both;
}
.eg-practice[hidden] { display: none; }
.eg-practice > b { font: 700 11px "DejaVu Sans Mono", ui-monospace, monospace; letter-spacing: .28em; color: rgba(var(--hud), .95); }
.eg-practice ol { list-style: none; margin: 8px 0; padding: 0; display: grid; gap: 6px; }
.eg-practice li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); transition: color .3s ease; }
.eg-practice li span {
  width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid rgba(var(--hud), .4); background: rgba(22, 141, 255, .12);
}
.eg-practice li.ok { color: var(--cyan-bright); }
.eg-practice li.ok span { background: linear-gradient(180deg, #9ff4ff, #34c6ff); color: #00121f; font-weight: 800; animation: eg-dock-hit .5s ease; }
.eg-practice-skip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid rgba(var(--hud), .35); background: transparent; color: var(--muted); font: 600 13px Inter, system-ui, sans-serif;
}
.eg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.eg-thrown { transition: translate .42s cubic-bezier(.5, 0, .9, .4), rotate .42s ease, scale .42s ease, opacity .42s ease !important; opacity: 0 !important; }

/* Menú circular alrededor de la mano abierta */
.eg-radial {
  position: fixed;
  z-index: 2147481960;
  width: 0;
  height: 0;
  pointer-events: none;
}
.eg-radial[hidden] { display: none; }
.eg-radial-ring {
  position: absolute;
  left: calc(var(--r) * -1 - 34px);
  top: calc(var(--r) * -1 - 34px);
  width: calc(var(--r) * 2 + 68px);
  height: calc(var(--r) * 2 + 68px);
  border-radius: 50%;
  border: 1px solid rgba(var(--hud), .45);
  background: radial-gradient(circle, rgba(22, 141, 255, .22), rgba(2, 12, 26, .55) 62%, transparent 72%);
  box-shadow: 0 0 40px rgba(var(--hud), .25), inset 0 0 40px rgba(var(--hud), .18);
  transform: scale(.2) rotate(-90deg);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2, .9, .3, 1.15), opacity .3s ease;
}
.eg-radial-ring.b {
  background: none;
  box-shadow: none;
  border: 1.5px dashed rgba(var(--hud), .4);
  inset: auto;
  left: calc(var(--r) * -1 + 34px);
  top: calc(var(--r) * -1 + 34px);
  width: calc(var(--r) * 2 - 68px);
  height: calc(var(--r) * 2 - 68px);
}
.eg-radial.on .eg-radial-ring { transform: none; opacity: 1; }
.eg-radial.on .eg-radial-ring.b { animation: eg-spin 12s linear infinite; }
.eg-radial-btn, .eg-radial-center {
  position: absolute;
  width: 58px;
  height: 58px;
  margin: -29px 0 0 -29px;
  display: grid;
  place-items: center;
  align-content: center;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--hud), .6);
  background: radial-gradient(circle at 50% 35%, rgba(22, 141, 255, .45), rgba(2, 12, 26, .92) 72%);
  color: #fff;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 16px rgba(var(--hud), .35);
  transform: translate(0, 0) scale(.3);
  opacity: 0;
  transition: transform .45s cubic-bezier(.2, .9, .3, 1.35), opacity .3s ease, border-color .15s ease;
  transition-delay: calc(var(--i, 0) * .035s);
}
.eg-radial.on .eg-radial-btn { transform: translate(var(--x), var(--y)) scale(1); opacity: 1; }
.eg-radial-btn span { font-size: 20px; line-height: 1; text-shadow: 0 0 10px rgba(var(--hud), .9); }
.eg-radial-btn small { font: 600 8.5px "DejaVu Sans Mono", ui-monospace, monospace; letter-spacing: .08em; text-transform: uppercase; color: rgba(197, 247, 255, .9); margin-top: 3px; }
.eg-radial-center { width: 44px; height: 44px; margin: -22px 0 0 -22px; font-size: 15px; }
.eg-radial.on .eg-radial-center { transform: scale(1); opacity: 1; }
.eg-radial-btn.eg-hover, .eg-radial-center.eg-hover { border-color: rgb(255, 196, 84); box-shadow: 0 0 24px rgba(255, 196, 84, .6) !important; }
.eg-radial.off .eg-radial-btn, .eg-radial.off .eg-radial-center { transform: scale(.2); opacity: 0; transition-delay: 0s; }
.eg-radial.off .eg-radial-ring { transform: scale(.3) rotate(90deg); opacity: 0; }

/* Widgets flotantes (reloj, Tu semana) */
.eg-widgets { position: fixed; inset: 0; z-index: 2147481920; pointer-events: none; }
.eg-widget {
  position: absolute;
  min-width: 220px;
  padding: 10px 14px 14px;
  border: 1.5px solid rgba(var(--hud), .55);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(8, 30, 58, .86), rgba(2, 12, 26, .86));
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 0 30px rgba(var(--hud), .25), inset 0 0 24px rgba(var(--hud), .08);
  color: var(--text);
  pointer-events: auto;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  animation: eg-widget-in .5s cubic-bezier(.2, .9, .3, 1.2) both;
  /* Nunca más alto que la pantalla (entre el dock y el estado): lo que sobra, se desliza dentro */
  max-height: calc(100dvh - 150px);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}
@keyframes eg-widget-in { from { opacity: 0; transform: perspective(700px) rotateX(35deg) scale(.7); filter: blur(4px) brightness(2); } }
.eg-widget.closing { animation: eg-widget-out .26s ease forwards; }
@keyframes eg-widget-out { to { opacity: 0; transform: scale(.7); filter: blur(4px); } }
.eg-widget header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.eg-widget header span { font: 700 10.5px "DejaVu Sans Mono", ui-monospace, monospace; letter-spacing: .26em; color: rgba(var(--hud), .95); }
.eg-widget-x {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(var(--hud), .4); background: rgba(2, 12, 26, .7); color: #fff; font-size: 12px;
}
.eg-clock-time { font: 700 46px/1.05 "DejaVu Sans Mono", ui-monospace, monospace; color: #fff; text-shadow: 0 0 18px rgba(var(--hud), .8); letter-spacing: .04em; }
.eg-clock-date { font-size: 12.5px; color: var(--muted); margin: 4px 0 10px; }
.eg-clock-date::first-letter { text-transform: uppercase; }
.eg-clock-bar { height: 3px; border-radius: 3px; background: rgba(var(--hud), .2); overflow: hidden; }
.eg-clock-bar i { display: block; height: 100%; background: linear-gradient(90deg, #34c6ff, #9ff4ff); box-shadow: 0 0 8px rgba(var(--hud), .9); }
.eg-gauges { display: flex; gap: 12px; }
.eg-gauge { position: relative; width: 62px; display: grid; justify-items: center; gap: 2px; }
.eg-gauge svg { width: 56px; height: 56px; transform: rotate(-90deg); }
.eg-gauge circle { fill: none; stroke: rgba(var(--hud), .18); stroke-width: 4; }
.eg-gauge circle.v { stroke: var(--cyan-bright); stroke-linecap: round; stroke-dasharray: var(--p) 100; filter: drop-shadow(0 0 4px rgba(var(--hud), .9)); animation: eg-gauge 1.1s cubic-bezier(.2, .9, .3, 1) both; }
.eg-gauge.full circle.v { stroke: rgb(255, 196, 84); filter: drop-shadow(0 0 5px rgba(255, 196, 84, .9)); }
@keyframes eg-gauge { from { stroke-dasharray: 0 100; } }
.eg-gauge b { position: absolute; top: 19px; font: 700 12px "DejaVu Sans Mono", ui-monospace, monospace; color: #fff; }
.eg-gauge small { font-size: 10.5px; color: var(--muted); text-align: center; }
.eg-widget-empty { margin: 4px 0 0; max-width: 230px; font-size: 13px; color: var(--muted); }
@media (max-width: 600px) {
  .eg-radial-btn { width: 50px; height: 50px; margin: -25px 0 0 -25px; }
  .eg-radial-btn small { display: none; }
  .eg-widget { min-width: 0; max-width: calc(100vw - 80px); }
  .eg-gauges { gap: 6px; }
  .eg-gauge { width: 52px; }
  .eg-gauge svg { width: 48px; height: 48px; }
  .eg-gauge b { top: 16px; font-size: 11px; }
  .eg-clock-time { font-size: 36px; }
}

/* Dock: botones grandes para acertar con la mano en el aire */
.eg-dock {
  position: fixed;
  right: calc(44px + env(safe-area-inset-right, 0px));
  top: 57%;
  z-index: 2147481950;
  display: flex;
  flex-direction: column;
  gap: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}
.eg-dock[hidden] { display: none; }
.eg-dock-btn {
  position: relative;
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.5px solid rgba(var(--hud), .55);
  background: radial-gradient(circle at 50% 35%, rgba(22, 141, 255, .35), rgba(2, 12, 26, .85) 70%);
  color: #fff;
  font: inherit;
  cursor: pointer;
  pointer-events: auto;
  box-shadow: 0 0 18px rgba(var(--hud), .3), inset 0 0 14px rgba(var(--hud), .25);
  opacity: 0;
  transform: translateX(90px) scale(.6);
  transition: transform .55s cubic-bezier(.2, .9, .3, 1.3), opacity .4s ease, border-color .2s ease, box-shadow .2s ease;
  transition-delay: calc(.35s + var(--i) * .06s), calc(.35s + var(--i) * .06s), 0s, 0s;
}
.eg-dock.on .eg-dock-btn { opacity: 1; transform: none; }
.eg-dock-btn::before {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px dashed rgba(var(--hud), .35);
  animation: eg-spin 9s linear infinite;
}
@keyframes eg-spin { to { transform: rotate(360deg); } }
.eg-dock-ico { font-size: 24px; line-height: 1; text-shadow: 0 0 10px rgba(var(--hud), .9); }
.eg-dock-txt {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(2, 12, 26, .8);
  border: 1px solid rgba(var(--hud), .3);
  font: 600 11px "DejaVu Sans Mono", ui-monospace, monospace;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(197, 247, 255, .95);
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s ease;
}
.eg-dock-btn:hover .eg-dock-txt, .eg-dock-btn.eg-hover .eg-dock-txt, .eg-dock-btn:focus-visible .eg-dock-txt { opacity: 1; }
.eg-dock-btn:hover, .eg-dock-btn:focus-visible { border-color: var(--cyan-bright); outline: none; }
.eg-dock-btn.hit { animation: eg-dock-hit .5s cubic-bezier(.2, .9, .3, 1.4); }
@keyframes eg-dock-hit {
  0% { transform: scale(.82); border-color: rgb(255, 196, 84); box-shadow: 0 0 40px rgba(255, 196, 84, .9); }
  100% { transform: none; }
}

/* Lo que apunta la mano: brillo; lo agarrado: flota como holograma */
.eg-hover { box-shadow: 0 0 0 1px rgba(var(--hud), .85), 0 0 22px rgba(var(--hud), .55) !important; filter: brightness(1.15); transition: box-shadow .15s ease, filter .15s ease; }
/* Lo agarrado se pone dorado. */
.eg-grabbed {
  border-color: rgba(255, 196, 84, .95) !important;
  box-shadow: 0 0 0 1.5px rgba(255, 196, 84, .95), 0 0 46px rgba(255, 170, 60, .55), 0 0 90px rgba(255, 196, 84, .2), 0 30px 60px rgba(0, 0, 0, .5) !important;
  filter: brightness(1.12) saturate(1.15);
  transition: none !important;
  will-change: translate, rotate, scale;
}
.eg-settle { transition: translate .5s cubic-bezier(.2, .9, .3, 1.2), rotate .5s cubic-bezier(.2, .9, .3, 1.2), scale .5s cubic-bezier(.2, .9, .3, 1.2) !important; }

/* Botón "Gestos" en la pantalla de Apex */
.ha-gest {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 9px;
  border-radius: 999px;
  border: 1px solid rgba(var(--hud), .3);
  background: rgba(4, 16, 32, .7);
  color: rgba(var(--hud), .95);
  font: inherit;
  font-size: 13px;
  letter-spacing: .04em;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
.ha-gest svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ha-gest:hover, .ha-gest:focus-visible { border-color: var(--line-strong); box-shadow: 0 0 14px rgba(var(--hud), .3); outline: none; }
.ha-gest.on {
  color: #00121f;
  background: linear-gradient(180deg, #9ff4ff, #34c6ff);
  border-color: rgba(197, 247, 255, .9);
  box-shadow: 0 0 18px rgba(var(--hud), .65);
}
.ha-gest.on svg { animation: eg-wave 1.6s ease-in-out infinite; transform-origin: 60% 90%; }
@keyframes eg-wave { 0%, 60%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg); } 30% { transform: rotate(10deg); } 45% { transform: rotate(-6deg); } }
.home-apex[data-neural] .ha-gest { opacity: 0; pointer-events: none; }
#openGestos.on { border-color: var(--line-strong); box-shadow: 0 0 14px rgba(var(--hud), .35); }
@media (max-width: 600px) {
  .ha-gest span { display: none; }
  .ha-gest { padding: 7px; top: 54px; right: 10px; }
  .eg-label { top: 30%; letter-spacing: .22em; }
  /* En el móvil: sin la píldora de estado (lo dice el visor) y el visor
     pequeño arriba a la izquierda, sin tapar la caja de texto ni los botones. */
  .eg-status { display: none; }
  .eg-cam {
    top: calc(var(--eg-top, 0px) + 64px);
    bottom: auto;
    left: 10px;
    width: 112px;
    transform: translateY(-20px) scale(.85);
  }
  .eg-cam-read { display: none; }
  .eg-cam-btn { width: 24px; height: 24px; top: 4px; }
  .eg-off { right: 4px; }
  .eg-help { right: 32px; }
  .eg-gear { right: 88px; width: 22px; }
  .eg-settings {
    top: calc(var(--eg-top, 0px) + 64px + 84px + 8px);
    bottom: auto;
    left: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100dvh - var(--eg-top, 0px) - 180px);
    overflow-y: auto;
  }
  .eg-practice { top: auto; bottom: calc(150px + env(safe-area-inset-bottom, 0px)); }
  .eg-hint { white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 30px); }
  .eg-dock { right: 6px; gap: 8px; top: 58%; }
  .eg-dock-btn { width: 44px; height: 44px; }
  .eg-dock-btn::before { inset: -4px; }
  .eg-dock-ico { font-size: 17px; }
  .eg-cam-lock { left: 8px; bottom: 6px; }
  .eg-legend {
    top: calc(var(--eg-top, 0px) + 64px + 84px + 8px);
    bottom: auto;
    left: 10px;
    width: calc(100vw - 20px);
    max-height: calc(100dvh - var(--eg-top, 0px) - 180px);
    overflow-y: auto;
  }
}

/* Con el modo encendido, el cursor del ratón no compite con la mano */
body.gestos-on { -webkit-user-select: none; user-select: none; }

@media (prefers-reduced-motion: reduce) {
  .eg-boot, .eg-cam-scan, .eg-intro-card::before, .eg-dock-btn::before { display: none; }
  .eg-radial-ring.b, .eg-gauge circle.v { animation: none !important; }
  .eg-frame i, .eg-cam, .eg-intro-card { transition: opacity .3s ease; }
}

/* =========================
   ✋ MODO HOLO — EL ESCRITORIO HOLOGRÁFICO
   Tu cámara a pantalla completa (como un espejo) y, encima, los widgets,
   el menú circular y el dock. Tapa la app entera: la mano solo puede tocar
   lo que hay aquí, nunca botones de €ERO sin querer.
   ========================= */
body.gestos-on { overflow: hidden; }
.eg-desk {
  position: fixed;
  inset: 0;
  z-index: 2147481800;
  overflow: hidden;
  background: #01060d;
  opacity: 0;
  transition: opacity .45s ease;
}
.eg-desk[hidden] { display: none; }
.eg-desk.on { opacity: 1; }
.eg-desk-video {
  position: absolute;
  object-fit: fill;
  transform: scaleX(-1);
  filter: brightness(.8) contrast(1.06) saturate(.85);
}
.eg-desk-shade {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(0, 0, 0, .1) 0 1px, transparent 1px 3px),
    radial-gradient(ellipse 85% 75% at 50% 45%, transparent 55%, rgba(0, 6, 16, .6)),
    linear-gradient(180deg, rgba(10, 40, 80, .18), rgba(0, 10, 25, .3));
}
.eg-desk-tag {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top, 0px));
  left: calc(18px + env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 8px;
  font: 700 11px "DejaVu Sans Mono", ui-monospace, monospace;
  letter-spacing: .28em;
  color: rgba(197, 247, 255, .9);
  text-shadow: 0 0 8px rgba(var(--hud), .8);
}
.eg-desk-tag i { width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); animation: eg-dot 2s ease-in-out infinite; }

/* Los controles van arriba a la derecha, en una barra */
.eg-cam {
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  left: auto;
  bottom: auto;
  width: auto;
  aspect-ratio: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px 5px 14px;
  border-radius: 999px;
  overflow: visible;
  background: rgba(2, 12, 26, .62);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.eg-cam .eg-cam-read, .eg-cam .eg-cam-lock, .eg-cam .eg-cam-hands { position: static; display: inline; }
.eg-cam .eg-cam-btn { position: static; width: 30px; height: 30px; }
.eg-legend, .eg-settings {
  top: calc(60px + env(safe-area-inset-top, 0px));
  right: calc(12px + env(safe-area-inset-right, 0px));
  left: auto;
  bottom: auto;
  max-height: calc(100dvh - 180px);
  overflow-y: auto;
}
.eg-status { top: calc(12px + env(safe-area-inset-top, 0px)); }
.eg-frame i { opacity: .55; }

/* Dock abajo, en fila, con su nombre debajo (como en un escritorio) */
.eg-dock {
  right: auto;
  left: 50%;
  top: auto;
  /* Un poco por encima del borde: para llegar, la mano no tiene que salirse de la imagen. */
  bottom: calc(11vh + env(safe-area-inset-bottom, 0px));
  flex-direction: row;
  gap: 14px;
  padding: 10px 16px 8px;
  border-radius: 22px;
  border: 1px solid rgba(var(--hud), .25);
  background: rgba(2, 12, 26, .45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateX(-50%);
  pointer-events: auto;
}
.eg-dock-btn { width: 52px; height: 52px; transform: translateY(70px) scale(.6); }
.eg-dock.on .eg-dock-btn { transform: none; }
.eg-dock-btn::before { inset: -4px; }
.eg-dock-ico { font-size: 20px; }
.eg-dock-txt {
  right: auto;
  top: auto;
  left: 50%;
  bottom: -17px;
  transform: translateX(-50%);
  padding: 0;
  border: 0;
  background: none;
  font-size: 8.5px;
  opacity: .85;
}
.eg-dock { padding-bottom: 22px; }
.eg-dock-btn[data-eg-dock="exit"] { border-color: rgba(255, 120, 90, .55); }
.eg-dock-btn[data-eg-dock="exit"] .eg-dock-ico { text-shadow: 0 0 10px rgba(255, 120, 90, .8); }

/* Widgets: escalables con las dos manos (--eg-zoom) y en dorado al agarrarlos */
.eg-widget { transform: scale(var(--eg-zoom, 1)); transform-origin: center; }
.eg-widget.eg-grabbed { transition: none !important; }

@media (max-width: 600px) {
  .eg-cam { gap: 5px; padding-left: 10px; }
  .eg-cam .eg-cam-read { display: none; }
  .eg-cam .eg-cam-btn { width: 28px; height: 28px; }
  .eg-status { display: none; }
  .eg-legend, .eg-settings { left: 10px; right: 10px; width: auto; top: calc(58px + env(safe-area-inset-top, 0px)); }
  .eg-dock { gap: 8px; padding: 8px 10px 20px; max-width: calc(100vw - 16px); }
  .eg-dock-btn { width: 40px; height: 40px; }
  .eg-dock-ico { font-size: 16px; }
  .eg-dock-txt { font-size: 7px; letter-spacing: .04em; bottom: -15px; }
  .eg-practice { bottom: calc(110px + env(safe-area-inset-bottom, 0px)); }
}

/* Cámara trasera: la imagen tal cual (sin espejo). Botones de cámara en varias líneas. */
.eg-desk.no-mirror .eg-desk-video { transform: none; }
.eg-seg-wrap { flex-wrap: wrap; }
.eg-seg-wrap button { flex: 1 1 30%; min-width: 92px; }

/* Con el escritorio abierto, la app de debajo no se dibuja (ni sus ~120
   animaciones): toda la potencia va a la cámara y a la mano. Se conserva tal
   cual y vuelve al salir. */
body.gestos-on > :not(#eroGestos):not(#egDesk):not(#egIntro):not(script):not(style) {
  content-visibility: hidden;
  visibility: hidden;
}

/* Apex dentro del escritorio: lo que dices y lo que te contesta */
.eg-widget[data-kind="apex"] { width: min(460px, calc(100vw - 40px)); }
.eg-apex-actions { display: flex; gap: 6px; }
.eg-apex-full {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(var(--hud), .4); background: rgba(2, 12, 26, .7); color: #fff; font-size: 13px;
}
.eg-apex-state {
  font: 700 10.5px "DejaVu Sans Mono", ui-monospace, monospace;
  letter-spacing: .22em;
  color: rgba(var(--hud), .95);
  margin: 2px 0 6px;
}
.eg-widget.listening .eg-apex-state::before {
  content: "";
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: #ff6a5a;
  box-shadow: 0 0 10px #ff6a5a;
  vertical-align: 0;
  animation: eg-dot .9s ease-in-out infinite;
}
.eg-widget.listening { border-color: rgba(255, 196, 84, .8); box-shadow: 0 0 34px rgba(255, 170, 60, .35); }
.eg-apex-you { margin: 0 0 6px; font-size: 13.5px; color: var(--muted); font-style: italic; min-height: 1em; }
.eg-apex-you:empty { display: none; }
.eg-apex-reply {
  max-height: 34vh;
  overflow-y: auto;
  font-size: 15px;
  line-height: 1.45;
  color: #fff;
  white-space: pre-wrap;
}
.eg-apex-reply:empty { display: none; }

/* Agrandar con el puño abierto de golpe */
.eg-widget.eg-zooming { transition: transform .5s cubic-bezier(.2, .9, .3, 1.3) !important; }

/* Empujar: salen volando al fondo. Tirar: vuelven desde el fondo. */
.eg-widget.eg-depth-out { animation: eg-depth-out .5s cubic-bezier(.5, 0, .9, .5) forwards !important; pointer-events: none; }
@keyframes eg-depth-out {
  to { opacity: 0; transform: perspective(700px) translateZ(-900px) scale(.4); filter: blur(6px); }
}
.eg-widget.eg-depth-in { animation: eg-depth-in .55s cubic-bezier(.2, .9, .3, 1.2) both !important; }
@keyframes eg-depth-in {
  from { opacity: 0; transform: perspective(700px) translateZ(-900px) scale(.4); filter: blur(6px); }
}

/* Tu mano está encima: se puede agarrar con el puño */
.eg-widget.eg-grabbable {
  border-color: rgba(197, 247, 255, .95);
  box-shadow: 0 0 0 1px rgba(197, 247, 255, .6), 0 0 36px rgba(var(--hud), .45);
}
.eg-widget.eg-grabbable { border-color: rgba(255, 196, 84, .7) !important; }

/* =========================
   ✋ MODO HOLO v2: la bola de Apex en el escritorio, widgets que salen del
   dock, sitio para varios y móvil más sencillo
   ========================= */
.eg-widget.eg-orb-widget {
  width: var(--orb, 170px);
  min-width: 0;
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  display: grid;
  justify-items: center;
  grid-template-columns: minmax(0, 1fr); /* la bola no se descentra con un subtítulo ancho */
  overflow: visible; /* el subtítulo puede ser más ancho que la bola */
  max-height: none;
}
.eg-orb {
  position: relative;
  width: var(--orb, 170px);
  height: var(--orb, 170px);
  border-radius: 50%;
  filter: drop-shadow(0 0 22px rgba(var(--hud), .55));
}
.eg-orb canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.eg-orb-widget.eg-grabbable .eg-orb, .eg-orb-widget.eg-grabbed .eg-orb { filter: drop-shadow(0 0 30px rgba(255, 196, 84, .75)); }
.eg-orb-widget.eg-grabbed, .eg-orb-widget.eg-grabbable { box-shadow: none !important; border: 0 !important; }
.eg-orb-widget.eg-grabbable header > span:first-child::after { content: none; }
.eg-orb-widget[data-state="listening"] .eg-orb { filter: drop-shadow(0 0 34px rgba(255, 120, 90, .6)); }
.eg-orb-sub {
  margin-top: 6px;
  width: max-content;
  max-width: min(420px, 80vw);
  padding: 6px 12px;
  border-radius: 10px;
  background: rgba(2, 12, 26, .92);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #fff;
  font-size: 14px;
  line-height: 1.35;
  text-align: center;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity .25s ease, transform .25s ease;
  pointer-events: none;
}
.eg-orb-sub.on { opacity: 1; transform: none; }
.eg-orb-sub.you { color: var(--muted); font-style: italic; }
/* Entrar en Apex: la bola va al centro y crece hasta llenar la pantalla */
.eg-orb-widget.eg-orb-enter {
  transition: translate .6s cubic-bezier(.6, 0, .4, 1), scale .6s cubic-bezier(.6, 0, .4, 1), opacity .6s ease .2s !important;
  translate: var(--to-x) var(--to-y) !important;
  scale: 7 !important;
  opacity: 0;
}
/* Sale volando desde el botón que lo abre */
.eg-widget.eg-spawn { animation: eg-spawn .55s cubic-bezier(.2, .9, .3, 1.15) both !important; }
@keyframes eg-spawn {
  from { opacity: 0; transform: translate(var(--from-x, 0), var(--from-y, 0)) scale(.15); filter: blur(4px) brightness(2); }
}
@media (max-width: 600px) {
  .eg-widget:not(.eg-orb-widget) { min-width: 0; padding: 8px 12px 10px; }
  .eg-clock-time { font-size: 30px; }
  .eg-orb-sub { font-size: 13px; }
  .eg-dock-btn { width: 50px; height: 50px; }
  .eg-dock-ico { font-size: 19px; }
  .eg-dock { gap: 12px; }
}

/* Modo Holo — rendimiento: sobre el vídeo en directo nada de desenfoques
   de fondo ni filtros (obligan a redibujar toda la pantalla en cada
   fotograma de la cámara). Mismo aspecto con fondos más opacos. */
.eg-desk *, .eg-desk *::before, .eg-desk *::after { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.eg-desk-video { filter: none; }
.eg-desk-shade {
  background:
    radial-gradient(ellipse 85% 75% at 50% 45%, rgba(0, 6, 16, .18) 55%, rgba(0, 6, 16, .62)),
    linear-gradient(180deg, rgba(10, 40, 80, .22), rgba(0, 10, 25, .34));
}
.eg-desk .eg-widget, .eg-desk .eg-dock { background-color: rgba(4, 18, 34, .86); }

/* Modo Holo — widget seleccionado (tocado como en una pantalla) */
.eg-widget.eg-selected {
  border-color: rgba(255, 196, 84, .95) !important;
  box-shadow: 0 0 0 1px rgba(255, 196, 84, .6), 0 0 34px rgba(255, 196, 84, .45), inset 0 0 22px rgba(255, 196, 84, .12) !important;
}
.eg-widget.eg-selected header > span:first-child::after { content: " · COGIDO"; color: rgb(255, 159, 58); }


/* Modo Holo — la bola de Apex se ve mejor sobre la cámara: un halo oscuro
   detrás (contraste) y más brillo. */
.eg-orb::before {
  content: "";
  position: absolute;
  inset: -22%;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 8, 20, .78) 38%, rgba(0, 8, 20, .45) 55%, transparent 72%);
  pointer-events: none;
}
.eg-orb { filter: brightness(1.25) saturate(1.25) drop-shadow(0 0 26px rgba(var(--hud), .8)); }
.eg-orb canvas { z-index: 1; }

/* Modo Holo — letrero de lo que está entendiendo: centrado bajo la barra
   de arriba, legible y también en el móvil. */
.eg-desk ~ .eg .eg-status, .eg .eg-status {
  top: calc(72px + env(safe-area-inset-top, 0px));
  max-width: min(92vw, 720px);
  padding: 8px 16px;
  font-size: 13px;
  letter-spacing: .06em;
  z-index: 5;
}
.eg .eg-status span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #e9fbff; }
@media (max-width: 700px) {
  .eg .eg-status { display: flex !important; top: calc(58px + env(safe-area-inset-top, 0px)); font-size: 11px; padding: 6px 10px; gap: 6px; }
  .eg .eg-status b { display: none; }
}

/* Modo Holo — muchos widgets sin tirones: cada widget se pinta aparte (no
   obliga a redibujar el resto), en su propia capa para moverlo, con un
   solo brillo y sin animaciones infinitas en el dock. */
.eg-desk .eg-widget {
  contain: layout paint style;
  will-change: translate, transform;
  box-shadow: 0 0 18px rgba(var(--hud), .22) !important;
}
.eg-desk .eg-widget.eg-grabbed, .eg-desk .eg-widget.eg-selected { box-shadow: 0 0 0 2px rgba(255, 196, 84, .85), 0 0 22px rgba(255, 196, 84, .35) !important; }
.eg-desk .eg-orb-widget { box-shadow: none !important; contain: layout style; }
.eg-desk .eg-dock-btn::before { animation: none !important; }
@keyframes eg-widget-in { from { opacity: 0; transform: perspective(700px) rotateX(35deg) scale(.7); } }

/* Modo Holo — el dock va ARRIBA: para apuntar arriba la mano entera sigue
   dentro de la imagen (abajo, la palma se salía y se perdía la mano). El
   letrero de estado pasa abajo. La bola, sin caja. */
.eg-desk ~ .eg-dock, .eg .eg-dock, .eg-dock {
  top: calc(64px + env(safe-area-inset-top, 0px)) !important;
  bottom: auto !important;
}
.eg .eg-status {
  top: auto !important;
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
}
.eg-desk .eg-widget.eg-orb-widget { background: none !important; box-shadow: none !important; border: 0 !important; }
@media (max-width: 700px) {
  .eg-dock { top: calc(54px + env(safe-area-inset-top, 0px)) !important; }
  .eg .eg-status { bottom: calc(12px + env(safe-area-inset-bottom, 0px)); }
}
.eg-legend, .eg-settings { top: calc(150px + env(safe-area-inset-top, 0px)) !important; max-height: calc(100dvh - 220px); }
@media (max-width: 700px) { .eg-legend, .eg-settings { top: calc(130px + env(safe-area-inset-top, 0px)) !important; } }
/* La práctica, abajo (arriba está el dock, que es lo que hay que practicar). */
.eg .eg-practice { top: auto !important; bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important; }

/* Modo Holo — paneles como en las películas: inclinados hacia ti según el
   lado, marco NARANJA mientras lo tienes cogido y VERDE un momento al
   soltarlo o confirmarlo. */
.eg-desk .eg-widget:not(.eg-orb-widget) {
  transform: perspective(900px) rotateY(var(--tilt, 0deg)) scale(var(--eg-zoom, 1));
  transition: transform .35s ease, border-color .25s ease, box-shadow .25s ease;
}
.eg-desk .eg-widget.eg-grabbed, .eg-desk .eg-widget.eg-selected {
  border-color: rgb(255, 159, 58) !important;
  box-shadow: 0 0 0 1px rgba(255, 159, 58, .9), 0 0 26px rgba(255, 159, 58, .45) !important;
}
.eg-desk .eg-widget.eg-confirm {
  border-color: rgb(61, 255, 168) !important;
  box-shadow: 0 0 0 1px rgba(61, 255, 168, .9), 0 0 28px rgba(61, 255, 168, .5) !important;
}
.eg-desk .eg-widget.eg-grabbed { transition: border-color .2s ease, box-shadow .2s ease !important; }

/* La bola de Apex nunca lleva caja: cogida, brilla en naranja; al soltarla, en verde. */
.eg-desk .eg-orb-widget, .eg-desk .eg-orb-widget.eg-selected, .eg-desk .eg-orb-widget.eg-grabbed,
.eg-desk .eg-orb-widget.eg-grabbable, .eg-desk .eg-orb-widget.eg-confirm {
  background: none !important; border: 0 !important; box-shadow: none !important; outline: 0 !important;
}
.eg-desk .eg-orb-widget.eg-selected .eg-orb, .eg-desk .eg-orb-widget.eg-grabbed .eg-orb { filter: brightness(1.25) drop-shadow(0 0 34px rgba(255, 159, 58, .9)); }
.eg-desk .eg-orb-widget.eg-confirm .eg-orb { filter: brightness(1.25) drop-shadow(0 0 34px rgba(61, 255, 168, .85)); }
.eg-desk .eg-orb-widget header > span:first-child::after { content: none !important; }
/* Avisos: cortos y, si no caben, en dos líneas (nunca cruzando la pantalla). */
.eg .eg-label { white-space: normal; max-width: min(86vw, 760px); text-align: center; letter-spacing: .18em; line-height: 1.35; }
/* Aviso de "estás muy cerca": grande y en el centro. */
.eg .eg-hint.on { font-size: clamp(14px, 2.4vw, 22px); }

/* Modo Holo — antes de entrar en el móvil: gira a horizontal y consejos */
.eg-phone .eg-intro-card { max-width: min(520px, 94vw); max-height: 92dvh; overflow-y: auto; }
.eg-phone-rot { width: 74px; height: 74px; margin: 4px auto 10px; display: grid; place-items: center; }
.eg-phone-rot i {
  width: 30px; height: 52px; border: 2.5px solid var(--cyan-bright); border-radius: 7px;
  box-shadow: 0 0 14px rgba(var(--hud), .6); position: relative;
  animation: eg-rotate 2.2s ease-in-out infinite;
}
.eg-phone-rot i::after { content: ""; position: absolute; left: 50%; bottom: 4px; width: 8px; height: 2px; margin-left: -4px; border-radius: 2px; background: var(--cyan-bright); }
@keyframes eg-rotate { 0%, 25% { transform: rotate(0); } 55%, 100% { transform: rotate(-90deg); } }
.eg-phone.land .eg-phone-rot i { animation: none; transform: rotate(-90deg); border-color: rgb(61, 255, 168); box-shadow: 0 0 14px rgba(61, 255, 168, .6); }
.eg-phone-state { margin: 0 auto 8px; max-width: 40ch; color: var(--muted); font-size: 14px; line-height: 1.4; }
.eg-phone-tips { list-style: none; margin: 6px 0 10px; padding: 0; display: grid; gap: 7px; text-align: left; }
.eg-phone-tips li { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; line-height: 1.35; color: var(--text); }
.eg-phone-tips li span { flex: 0 0 26px; font-size: 18px; text-align: center; }
.eg-phone-skip { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); margin: 4px 0 10px; }
.eg-phone .eg-intro-go.soft { opacity: .75; }
@media (orientation: landscape) and (max-height: 500px) {
  .eg-phone .eg-intro-card { padding: 14px 18px; }
  .eg-phone-rot { display: none; }
  .eg-phone-tips { grid-template-columns: 1fr 1fr; gap: 6px 14px; }
  .eg-phone-tips li { font-size: 13px; }
}

/* =========================================================
   Modo Holo — widgets con tus datos, panel "Más", foco y papelera.
   Compactos a propósito: 3-4 cosas por panel, 4 paneles como mucho.
   ========================================================= */
.eg-desk-tag b { color: #fff; font-weight: 700; }
/* Pantallas estrechas: la etiqueta del escritorio chocaba con la barra de la cámara (arriba a la derecha) */
@media (max-width: 820px) { .eg-desk-tag { display: none; } }
.eg-widget .eg-app { width: min(290px, 78vw); max-height: 46vh; overflow: hidden; font-size: 13px; }
.eg-widget[data-kind="answer"] .eg-app { width: min(380px, 84vw); max-height: 40vh; overflow-y: auto; }
.eg-app-load, .eg-app-empty { margin: 6px 0 2px; color: var(--muted); font-size: 13px; line-height: 1.4; }
.eg-list { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 6px; }
.eg-row {
  width: 100%; display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 10px;
  border: 1px solid rgba(var(--hud), .22); background: rgba(var(--hud), .06); color: var(--text);
  font: inherit; text-align: left; cursor: pointer;
}
.eg-row > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eg-row em { flex: none; font-style: normal; font-size: 11px; color: rgba(var(--hud), .95); }
.eg-row em.late { color: rgb(255, 159, 58); }
.eg-check i { flex: none; width: 16px; height: 16px; border-radius: 5px; border: 1.5px solid rgba(var(--hud), .8); }
.eg-check.done i { background: rgb(61, 255, 168); border-color: rgb(61, 255, 168); box-shadow: 0 0 10px rgba(61, 255, 168, .7); }
.eg-check.done span { text-decoration: line-through; opacity: .6; }
.eg-mail span { display: grid; white-space: normal; }
.eg-mail span b, .eg-mail span small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eg-mail span small { color: var(--muted); font-size: 12px; }
.eg-app-more { margin: 6px 0 0; font-size: 11.5px; color: var(--muted); text-align: right; }
.eg-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.eg-kpi { display: grid; gap: 1px; padding: 6px 4px; text-align: center; border-radius: 10px; background: rgba(var(--hud), .07); }
.eg-kpi b { font: 700 16px "DejaVu Sans Mono", ui-monospace, monospace; color: #fff; text-shadow: 0 0 10px rgba(var(--hud), .7); }
.eg-kpi small { font-size: 10.5px; color: var(--muted); }
.eg-bars { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 5px; }
.eg-bars li { display: grid; grid-template-columns: 1fr 90px 26px; align-items: center; gap: 6px; font-size: 12px; }
.eg-bars li span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eg-bars li i { height: 6px; border-radius: 4px; background: linear-gradient(90deg, rgba(var(--hud), .95) var(--w), rgba(var(--hud), .12) var(--w)); }
.eg-bars li b { text-align: right; }
.eg-alert { display: grid; gap: 6px; padding: 8px; border-radius: 10px; border: 1px solid rgba(var(--hud), .22); background: rgba(var(--hud), .06); }
.eg-alert > span { font-size: 13px; line-height: 1.3; }
.eg-alert.ok { border-color: rgb(61, 255, 168); box-shadow: 0 0 14px rgba(61, 255, 168, .4); }
.eg-yesno { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.eg-yesno button { padding: 7px; border-radius: 9px; font: 700 12.5px inherit; cursor: pointer; border: 1px solid; }
.eg-yes { color: #00170c; background: rgb(61, 255, 168); border-color: rgb(61, 255, 168); }
.eg-yes.armed { animation: eg-armed .8s ease-in-out infinite; }
@keyframes eg-armed { 50% { box-shadow: 0 0 16px rgba(61, 255, 168, .9); } }
.eg-no { color: #fff; background: rgba(255, 80, 80, .22); border-color: rgba(255, 90, 90, .8); }
.eg-notes { list-style: none; margin: 4px 0 8px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.eg-notes li { padding: 7px 8px; border-radius: 8px; background: rgba(255, 214, 102, .14); border: 1px solid rgba(255, 214, 102, .4); font-size: 12px; line-height: 1.3; max-height: 62px; overflow: hidden; }
.eg-dictate, .eg-full { justify-content: center; }
.eg-team { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 8px; }
.eg-member { display: grid; justify-items: center; gap: 3px; padding: 10px 6px; border-radius: 12px; border: 1px solid rgba(var(--hud), .3); background: rgba(var(--hud), .08); color: var(--text); font: inherit; cursor: pointer; }
.eg-member span { font-size: 22px; }
.eg-member b { font-size: 12px; text-align: center; line-height: 1.2; }
.eg-answer { font-size: 13.5px; line-height: 1.5; color: var(--text); }
.eg-widget[data-kind="answer"] .eg-answer { max-height: 38vh; overflow-y: auto; padding-right: 4px; }
.eg-answer-acts { margin-top: 10px; }
.eg-widget[data-kind="today"] .eg-list { max-height: 196px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
/* Se ve que hay más: sombra abajo; deslizándose, el borde brilla */
.eg-widget .eg-scrolling { box-shadow: inset 0 -18px 16px -14px rgba(var(--hud), .55), inset 0 18px 16px -14px rgba(var(--hud), .35); }
/* Panel "Más" (bajo el dock) */
.eg-more[hidden] { display: none; }
.eg-more {
  position: fixed; z-index: 2147481951; left: 50%; transform: translateX(-50%);
  top: calc(150px + env(safe-area-inset-top, 0px));
  display: grid; gap: 8px; padding: 10px 14px; border-radius: 18px;
  border: 1px solid rgba(var(--hud), .3); background: rgba(2, 12, 26, .9);
  animation: eg-pop .3s cubic-bezier(.2, .9, .3, 1.2) both;
}
.eg-more-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; padding-bottom: 20px; }
.eg-more .eg-dock-btn { opacity: 1; transform: none; }
.eg-more-desks { display: flex; align-items: center; justify-content: center; gap: 8px; font: 600 10.5px "DejaVu Sans Mono", ui-monospace, monospace; letter-spacing: .2em; color: rgba(var(--hud), .9); }
.eg-more-desks button { padding: 6px 12px; border-radius: 999px; border: 1px solid rgba(var(--hud), .4); background: rgba(var(--hud), .08); color: var(--text); font: 600 12px Inter, ui-sans-serif, system-ui, sans-serif; letter-spacing: 0; cursor: pointer; }
/* Número de avisos en el botón */
.eg-dock-btn { position: relative; }
.eg-badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: rgb(255, 159, 58); color: #1a0d00; font: 800 11px/18px Inter, ui-sans-serif, system-ui, sans-serif; font-style: normal; text-align: center; box-shadow: 0 0 10px rgba(255, 159, 58, .8); }
/* Foco: se apaga todo menos el widget con el que estás */
.eg-desk .eg-widget.eg-dim { opacity: .12; filter: grayscale(.6); pointer-events: none; transition: opacity .3s ease; }
.eg-desk.eg-focus .eg-dock { opacity: .35; }
.eg-desk.eg-focus .eg-desk-shade { background: rgba(0, 6, 16, .55); }
/* Papelera: el widget se desintegra */
.eg-desk .eg-widget.eg-dissolve { animation: eg-dissolve .5s ease-in forwards; }
@keyframes eg-dissolve { to { opacity: 0; transform: translateY(80px) scale(.6); filter: blur(6px) brightness(2); } }
@media (max-width: 700px) {
  .eg-widget .eg-app { width: min(240px, 70vw); max-height: 40vh; }
  .eg-more { top: calc(118px + env(safe-area-inset-top, 0px)); max-width: 94vw; }
  .eg-more .eg-dock-btn { width: 40px; height: 40px; }
}

/* Salir pide confirmación al mantener el dedo */
.eg-dock-btn.armed { border-color: rgb(255, 90, 90) !important; box-shadow: 0 0 18px rgba(255, 90, 90, .8) !important; animation: eg-armed .8s ease-in-out infinite; }

/* =========================================================
   Modo Holo — cada acción, clara y con efecto (ligero: transform/opacity)
   ========================================================= */
/* Botón pulsado: golpe de luz */
.eg-dock-btn.eg-hit, .eg-desk button.eg-hit { animation: eg-hit .5s cubic-bezier(.2, .9, .3, 1.3); }
@keyframes eg-hit {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 196, 84, .9); }
  35% { transform: scale(1.18); box-shadow: 0 0 0 10px rgba(255, 196, 84, 0), 0 0 30px rgba(255, 196, 84, .9); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(255, 196, 84, 0); }
}
/* Widget que aparece: se "materializa" con una línea de escaneo */
.eg-desk .eg-widget:not(.eg-orb-widget)::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(150, 240, 255, .95), transparent);
  opacity: 0; animation: eg-scan .7s ease-out .05s 1;
}
@keyframes eg-scan { 0% { opacity: 1; transform: translateY(0); } 100% { opacity: 0; transform: translateY(var(--scan-h, 160px)); } }
/* Cogido: se levanta un poco (sombra más profunda) */
.eg-desk .eg-widget.eg-selected:not(.eg-orb-widget), .eg-desk .eg-widget.eg-grabbed:not(.eg-orb-widget) {
  box-shadow: 0 0 0 1px rgba(255, 159, 58, .9), 0 0 26px rgba(255, 159, 58, .45), 0 24px 50px rgba(0, 0, 0, .55) !important;
}
/* Barrido de luz al cambiar de escritorio */
.eg-sweep {
  position: absolute; inset: 0; pointer-events: none; z-index: 30;
  background: linear-gradient(100deg, transparent 35%, rgba(120, 230, 255, .22) 48%, rgba(220, 250, 255, .55) 50%, rgba(120, 230, 255, .22) 52%, transparent 65%);
  background-size: 300% 100%; animation: eg-sweep .75s ease-in-out forwards;
}
@keyframes eg-sweep { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .eg-dock-btn.eg-hit, .eg-desk button.eg-hit, .eg-sweep { animation: none; }
  .eg-desk .eg-widget::after { display: none; }
}

/* Modo Holo — los widgets se despliegan como un holograma (una línea que se
   abre) y se pliegan al cerrarse. */
@keyframes eg-holo-in {
  0% { opacity: 0; clip-path: inset(49% 0 49% 0); transform: perspective(900px) rotateY(var(--tilt, 0deg)) scale(.96); filter: brightness(2.2); }
  35% { opacity: 1; clip-path: inset(49% 0 49% 0); }
  100% { opacity: 1; clip-path: inset(0 0 0 0); transform: perspective(900px) rotateY(var(--tilt, 0deg)) scale(var(--eg-zoom, 1)); filter: none; }
}
@keyframes eg-holo-out {
  0% { opacity: 1; clip-path: inset(0 0 0 0); }
  60% { opacity: 1; clip-path: inset(49% 0 49% 0); filter: brightness(2); }
  100% { opacity: 0; clip-path: inset(49% 30% 49% 30%); }
}
.eg-desk .eg-widget.eg-holo:not(.eg-orb-widget) { animation: eg-holo-in .45s cubic-bezier(.2, .8, .2, 1) backwards !important; }
/* Desde el dock: vuela hasta su sitio como una línea de luz y ahí se despliega */
.eg-desk .eg-widget.eg-spawn:not(.eg-orb-widget) { animation: eg-spawn-holo .6s cubic-bezier(.2, .8, .2, 1) backwards !important; }
@keyframes eg-spawn-holo {
  0% { opacity: 0; transform: translate(var(--from-x, 0), var(--from-y, 0)) scale(.3); clip-path: inset(49% 0 49% 0); filter: brightness(2.4); }
  45% { opacity: 1; transform: translate(0, 0) scale(1); clip-path: inset(49% 0 49% 0); filter: brightness(2); }
  100% { opacity: 1; transform: perspective(900px) rotateY(var(--tilt, 0deg)) scale(var(--eg-zoom, 1)); clip-path: inset(0 0 0 0); filter: none; }
}
.eg-desk .eg-widget.closing:not(.eg-orb-widget) { animation: eg-holo-out .32s ease-in forwards !important; }
/* Botón apuntado en el dock: un poco más grande (se ve claro a qué apuntas) */
.eg-dock .eg-dock-btn.eg-hover, .eg-more .eg-dock-btn.eg-hover { transform: scale(1.14); transition: transform .15s ease; }
@media (prefers-reduced-motion: reduce) {
  .eg-desk .eg-widget:not(.eg-orb-widget) { animation: none !important; }
}

/* Modo Holo en la tele: tarjeta de conexión y tablet en modo "sensor" */
.eg-tv[hidden] { display: none; }
.eg-tv {
  position: absolute; z-index: 40; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, 90vw); padding: 22px 24px; border-radius: 20px; text-align: center;
  background: rgba(2, 12, 26, .92); border: 1px solid rgba(var(--hud), .45);
  box-shadow: 0 0 40px rgba(var(--hud), .25); color: var(--text);
}
.eg-tv b { display: block; font: 700 13px "DejaVu Sans Mono", ui-monospace, monospace; letter-spacing: .25em; color: rgba(var(--hud), 1); margin-bottom: 10px; }
.eg-tv p { margin: 0 0 14px; font-size: 16px; line-height: 1.45; }
.eg-tv button { padding: 9px 22px; border-radius: 999px; border: 1px solid rgba(255, 90, 90, .7); background: rgba(255, 90, 90, .15); color: #fff; font: 600 14px Inter, ui-sans-serif, system-ui, sans-serif; cursor: pointer; }
.eg-tv.ok { top: auto; bottom: 70px; transform: translateX(-50%); border-color: rgba(61, 255, 168, .7); }
/* La tablet, conectada a la tele: solo la tarjeta (todo lo demás se oculta para ir más rápido) */
.eg-desk.eg-sensor #egWidgets, .eg-desk.eg-sensor .eg-dock, .eg-desk.eg-sensor .eg-more, .eg-desk.eg-sensor .eg-desk-shade { visibility: hidden; }
.eg-desk.eg-sensor ~ .eg .eg-hint, .eg-desk.eg-sensor .eg-hint, body:has(.eg-desk.eg-sensor) .eg-hint { display: none !important; }

/* Práctica en pantallas anchas: abajo a la izquierda, para no tapar el
   centro (donde aparecen los widgets que la propia práctica pide mover). */
@media (min-width: 900px) and (orientation: landscape) {
  .eg .eg-practice { left: 16px !important; transform: none !important; width: min(330px, 32vw) !important; }
}

/* Modo Holo — "↩ Deshacer" tras tirar un widget a la papelera. */
.eg-undo {
  position: absolute;
  left: 50%;
  bottom: calc(86px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%);
  z-index: 45;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 120, 120, .7);
  background: rgba(40, 6, 10, .85);
  color: #ffd2d2;
  font: 700 15px Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: .04em;
  box-shadow: 0 0 26px rgba(255, 90, 90, .35);
  pointer-events: auto;
  cursor: pointer;
}
.eg-undo[hidden] { display: none; }
.eg-undo.in { animation: eg-undo-in .35s cubic-bezier(.2, .9, .3, 1.3); }
.eg-undo.eg-hover { border-color: #ffb0b0; box-shadow: 0 0 34px rgba(255, 120, 120, .6); }
@keyframes eg-undo-in { from { opacity: 0; transform: translate(-50%, 16px) scale(.9); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* Modo Holo — que nada se pise:
   · con "Más" abierto, la práctica se aparta un momento;
   · en pantallas estrechas, también con la ayuda o los ajustes abiertos;
   · en pantallas bajas (móvil en horizontal), la práctica enseña solo el paso
     que toca, en una línea, abajo (antes tapaba el dock que pide usar). */
body:has(#egMore:not([hidden])) .eg .eg-practice { visibility: hidden; }
/* Con «Más» abierto, el menú manda: los widgets se apagan detrás y no se mezclan con él */
.eg-more { background: rgba(2, 12, 26, .97) !important; box-shadow: 0 18px 50px rgba(0, 0, 0, .55), 0 0 30px rgba(var(--hud), .18); }
#egWidgets .eg-widget { transition: opacity .2s ease; }
body:has(#egMore:not([hidden])) #egWidgets .eg-widget { opacity: .22; }
/* Igual con Ajustes y Ayuda: fondo opaco (sin desenfoque, lo de detrás se leía a través) y widgets atenuados */
.eg .eg-settings, .eg .eg-legend { background: rgba(2, 12, 26, .97); }
body:has(#egSettings:not([hidden])) #egWidgets .eg-widget, body:has(#egLegend:not([hidden])) #egWidgets .eg-widget { opacity: .3; }
body:has(#egMore:not([hidden])) .eg .eg-label { visibility: hidden; }
@media (max-width: 899px) {
  body:has(#egLegend:not([hidden])) .eg .eg-practice,
  body:has(#egSettings:not([hidden])) .eg .eg-practice { visibility: hidden; }
}
.eg .eg-hint.eg-hint-off { display: none; }
@media (max-height: 420px) { .eg .eg-status { display: none; } .eg .eg-hint.on.eg-hint-mini { bottom: calc(10px + env(safe-area-inset-bottom, 0px)); } }
/* Con widgets debajo: el aviso, en pequeño y pegado al estado */
.eg .eg-hint.on.eg-hint-mini { font-size: 10.5px; padding: 5px 12px; letter-spacing: .08em; opacity: .9; bottom: calc(58px + env(safe-area-inset-bottom, 0px)); white-space: nowrap; }
@media (max-height: 520px) {
  .eg .eg-practice:not([hidden]) {
    display: flex; align-items: center; gap: 10px;
    bottom: calc(54px + env(safe-area-inset-bottom, 0px)) !important;
    left: 50% !important; transform: translateX(-50%) !important;
    width: min(600px, calc(100vw - 120px)) !important;
    padding: 6px 10px;
  }
  .eg .eg-practice ol { margin: 0; flex: 1; min-width: 0; }
  .eg .eg-practice li:not(.now) { display: none; }
  .eg .eg-practice li { font-size: 13px; }
  .eg .eg-practice > b { white-space: nowrap; font-size: 10px; }
  .eg .eg-practice .eg-practice-skip { margin: 0; padding: 6px 10px; }
}
@media (max-height: 520px) {
  body:has(#egMore:not([hidden])) .eg .eg-status { visibility: hidden; }
}

/* Presentación del Modo Holo: solo lo esencial (4 gestos), en dos columnas
   si cabe; el resto en la ayuda. Antes era una lista larga con scroll. */
.eg-intro .eg-guide-short { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 8px; }
.eg-intro .eg-guide-short li { margin: 0; }
.eg-intro-more { margin: 10px 0 0; font-size: 13px; color: var(--muted); text-align: center; }
@media (min-width: 800px) {
  .eg-intro:has(.eg-guide-short) .eg-intro-card { width: min(820px, calc(100vw - 32px)); max-width: none; }
}
@media (max-height: 520px) {
  .eg-intro:has(.eg-guide-short) .eg-intro-card { width: min(820px, calc(100vw - 24px)); max-width: none; padding-top: 14px; }
  .eg-intro .eg-guide-short { grid-template-columns: 1fr 1fr; }
  .eg-intro:has(.eg-guide-short) .eg-intro-ico,
  .eg-intro:has(.eg-guide-short) .eg-intro-tag,
  .eg-intro:has(.eg-guide-short) .eg-intro-card > h2 + p { display: none; }
}

/* Ajustes en dos columnas en pantallas anchas: caben enteros sin scroll. */
@media (min-width: 900px) {
  .eg .eg-settings:not([hidden]) { width: min(660px, 58vw, calc(100vw - 372px)); grid-template-columns: 1fr 1fr; column-gap: 14px; align-content: start; }
  .eg .eg-settings > .eg-settings-title, .eg .eg-settings > .eg-settings-note, .eg .eg-settings > #egCamRow { grid-column: 1 / -1; }
}

/* Ayuda en dos columnas en pantallas anchas (cabe casi entera sin scroll). */
@media (min-width: 900px) {
  .eg .eg-legend:not([hidden]) { width: min(760px, 66vw, calc(100vw - 372px)); grid-template-columns: 1fr 1fr; column-gap: 8px; align-content: start; }
}

/* Entrar en la tele con un código */
.auth-tv { display: block; margin-top: 12px; text-align: center; font-size: 14px; color: var(--muted, #9fb3c8); text-decoration: underline; }
.eg-tv .eg-tv-code { margin-left: 8px; border-color: rgba(120, 220, 255, .7); background: rgba(120, 220, 255, .14); }
.eg-tv .eg-tv-code[hidden] { display: none; }
.eg-pair {
  position: fixed; inset: 0; z-index: 2147483000;
  display: grid; place-items: center;
  background: radial-gradient(ellipse at center, #06242f, #01070b);
  color: #e8fbff; font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}
.eg-pair-card { width: min(720px, calc(100vw - 40px)); text-align: center; padding: 28px; }
.eg-pair-tag { font: 700 13px/1 Inter, sans-serif; letter-spacing: .22em; color: #7fe7ff; }
.eg-pair h2 { margin: 14px 0 8px; font-size: clamp(22px, 3.4vw, 34px); }
.eg-pair-code {
  margin: 10px auto 18px; font: 800 clamp(56px, 12vw, 120px)/1.05 "JetBrains Mono", ui-monospace, monospace;
  letter-spacing: .12em; color: #fff; text-shadow: 0 0 28px rgba(80, 220, 255, .8);
}
.eg-pair p { margin: 8px auto; max-width: 600px; font-size: clamp(15px, 2vw, 20px); line-height: 1.45; color: #cfeaf3; }
.eg-pair .eg-pair-small { font-size: 14px; color: #8fb3c0; }
.eg-pair-pass { margin-top: 16px; padding: 12px 22px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .35); background: transparent; color: #e8fbff; font: 600 15px Inter, sans-serif; cursor: pointer; }
.eg-pair-pass:focus-visible { outline: 3px solid #7fe7ff; outline-offset: 3px; }

/* Portada: el botón "Probar gratis" se ve nada más entrar (antes había que
   bajar pasado el ejemplo). Se repite abajo, junto al precio. */
.landing-hero { margin: 0 0 20px; }
.landing-hero .landing-login { margin-top: 8px; }
.landing-price + .landing-compare + .landing-cta,
.landing-compare + .landing-cta { margin-top: 4px; }
@media (max-height: 760px), (max-width: 480px) {
  .landing-logo { width: min(150px, 42%); }
  .landing-title { margin-bottom: 8px; }
  .landing-sub { margin-bottom: 14px; }
}
.landing-title .lt-1 { color: inherit; }

/* "¿Estás en la tele?" solo donde tiene sentido: pantallas grandes sin táctil
   (en el móvil o la tablet solo estorbaba en el registro). */
@media (hover: none), (pointer: coarse), (max-width: 899px) {
  #tvCodeLink { display: none; }
}
#tvCodeLink { border: 0 !important; background: transparent !important; }

/* Móvil: la pestaña lateral de Proyectos ya no tapa el título ni las tarjetas. */
@media (max-width: 600px) {
  body:has(.pj-tab) #welcome { padding-right: 30px; }
  #welcome h1 { font-size: clamp(24px, 7.4vw, 32px); }
}

/* Accesos dentro de cada ventana (lo que antes eran botones sueltos del menú ＋). */
.modal-shortcuts { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 10px; }
.modal-shortcuts[hidden] { display: none; }
.modal-shortcut {
  padding: 7px 12px; border-radius: 999px;
  border: 1px solid rgba(120, 220, 255, .45); background: rgba(120, 220, 255, .08);
  color: inherit; font: 600 13px Inter, ui-sans-serif, system-ui, sans-serif; cursor: pointer;
}
.modal-shortcut:hover, .modal-shortcut:focus-visible { background: rgba(120, 220, 255, .18); }
.modal-shortcut.on { background: rgba(120, 220, 255, .28); border-color: #7fe7ff; cursor: default; }
.tools-group[hidden] { display: none !important; }

/* Modo Holo — 🗑 papelera al agarrar o llevar un widget. */
.eg-trash {
  position: absolute; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%); z-index: 44;
  width: 220px; padding: 12px 16px 10px; border-radius: 22px;
  display: grid; justify-items: center; gap: 2px;
  border: 2px dashed rgba(255, 110, 110, .6); background: rgba(40, 4, 8, .62);
  color: #ffd0d0; font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  pointer-events: none; transition: transform .18s ease, background .18s ease, border-color .18s, box-shadow .18s;
}
.eg-trash[hidden] { display: none; }
.eg-trash.in { animation: eg-trash-in .28s cubic-bezier(.2, .9, .3, 1.3); }
.eg-trash-ico { font-size: 30px; line-height: 1; transition: transform .18s; }
.eg-trash b { font-size: 14px; letter-spacing: .08em; text-transform: uppercase; }
.eg-trash small { font-size: 12px; opacity: .8; }
.eg-trash.hot { transform: translateX(-50%) scale(1.14); border-style: solid; border-color: #ff6b6b; background: rgba(120, 10, 20, .82); box-shadow: 0 0 40px rgba(255, 80, 80, .65); }
.eg-trash.hot .eg-trash-ico { transform: rotate(-12deg) scale(1.2); }
.eg-widget.eg-trash-hot { outline: 3px solid rgba(255, 90, 90, .9) !important; filter: saturate(.6) brightness(.85); }
@keyframes eg-trash-in { from { opacity: 0; transform: translate(-50%, 30px) scale(.85); } to { opacity: 1; transform: translate(-50%, 0) scale(1); } }

/* ===== Modo Holo — widgets con los que se juega ===== */
.eg-task-row { display: flex; gap: 6px; align-items: stretch; }
.eg-task-row > .eg-row { flex: 1; min-width: 0; }
.eg-task-row > span { flex: 1; min-width: 0; align-self: center; }
.eg-mini {
  flex: none; min-width: 38px; padding: 0 9px; border-radius: 10px;
  border: 1px solid rgba(var(--hud), .35); background: rgba(var(--hud), .08);
  color: var(--text); font: 700 14px Inter, ui-sans-serif, system-ui, sans-serif; cursor: pointer;
}
.eg-mini.eg-mini-x { color: #ffb3b3; border-color: rgba(255, 120, 120, .4); }
.eg-mini.armed { background: rgba(255, 80, 80, .3); border-color: #ff6b6b; font-size: 11px; }
.eg-mini:disabled { opacity: .45; }
.eg-progress { position: relative; height: 18px; margin: 2px 0 8px; border-radius: 999px; background: rgba(var(--hud), .1); overflow: hidden; }
.eg-progress i { position: absolute; inset: 0 auto 0 0; width: var(--w); background: linear-gradient(90deg, rgba(61, 255, 168, .55), rgba(61, 255, 168, .9)); box-shadow: 0 0 14px rgba(61, 255, 168, .6); transition: width .6s ease; }
.eg-progress span { position: relative; display: block; text-align: center; font: 700 11px/18px Inter, sans-serif; letter-spacing: .06em; }
.eg-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
/* Botones pequeños pero fáciles de acertar con la mano */
.eg-ask-chips { display: grid; gap: 6px; margin-bottom: 8px; }
.eg-ask-chips .eg-mini { width: 100%; min-height: 36px; padding: 8px 12px; border-radius: 10px; text-align: left; font-size: 13.5px; }
.eg-goal { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; }
.eg-goal .eg-progress { flex: 1; margin: 0; height: 26px; }
.eg-goal .eg-progress span { line-height: 26px; }
.eg-goal .eg-progress.full i { background: linear-gradient(90deg, rgba(255, 196, 84, .7), rgba(255, 220, 120, .95)); box-shadow: 0 0 16px rgba(255, 196, 84, .7); }
.eg-goal .eg-progress.full span { color: #241700; }
.eg-goal-pick { display: flex; align-items: center; gap: 6px; margin: 6px 0 2px; font-size: 12.5px; color: var(--muted); }
.eg-goal-pick span { flex: 1; }
.eg-goal-pick .eg-mini, .eg-goal .eg-mini { min-height: 32px; border-radius: 10px; }
.eg-quick .eg-mini { flex: 1 1 0; min-height: 36px; border-radius: 10px; font-size: 14px; font-weight: 700; }
.eg-acts > .eg-row { flex: 1 1 auto; width: auto; justify-content: center; }
.eg-acts > .eg-row[hidden] { display: none; }
.eg-bars .eg-bar-btn { all: unset; display: contents; cursor: pointer; }
.eg-bars li:has(.eg-bar-btn.eg-hover) { outline: 1px solid rgba(var(--hud), .7); border-radius: 6px; }
.eg-timer { display: grid; justify-items: center; gap: 6px; margin: 6px 0 2px; }
.eg-timer[hidden] { display: none; }
.eg-timer b { font: 800 30px/1 "JetBrains Mono", ui-monospace, monospace; color: #ffd66b; text-shadow: 0 0 16px rgba(255, 200, 80, .7); }
.eg-timer-bar { width: 100%; height: 6px; border-radius: 999px; background: rgba(255, 214, 107, .15); overflow: hidden; }
.eg-timer-bar i { display: block; height: 100%; background: #ffd66b; transition: width 1s linear; }
.eg-widget.eg-alarm { animation: eg-alarm .5s ease-in-out 6; }
@keyframes eg-alarm { 50% { box-shadow: 0 0 0 4px rgba(255, 214, 107, .9), 0 0 50px rgba(255, 200, 80, .8); } }
button.eg-gauge-btn { background: none; border: 0; color: inherit; font: inherit; cursor: pointer; border-radius: 14px; padding: 2px; }
button.eg-gauge-btn.eg-hover, button.eg-gauge-btn:focus-visible { background: rgba(var(--hud), .12); outline: 1px solid rgba(var(--hud), .6); }
.eg-slide-out { animation: eg-slide-out .4s ease forwards; }
@keyframes eg-slide-out { to { opacity: 0; transform: translateX(40px); } }
.eg-widget.eg-pulse { animation: eg-pulse-w .6s ease; }
@keyframes eg-pulse-w { 40% { box-shadow: 0 0 0 3px rgba(var(--hud), .8), 0 0 40px rgba(var(--hud), .6); } }
/* Notas con botones: una por fila, el texto ocupa lo que sobra. */
.eg-notes:has(.eg-task-row) { grid-template-columns: 1fr; }
.eg-notes li.eg-task-row { display: flex; align-items: center; gap: 6px; max-height: none; padding: 5px 5px 5px 9px; }
.eg-notes li.eg-task-row > span { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.eg-notes .eg-mini { min-height: 32px; }

/* ===== Modo Holo — llevar una nota con el dedo (a «Hoy» o a la papelera) ===== */
.eg-ghost {
  position: fixed; left: 0; top: 0; z-index: 60; pointer-events: none;
  padding: 10px 12px; border-radius: 10px; font: 500 13.5px Inter, ui-sans-serif, system-ui, sans-serif; color: #fff;
  background: rgba(40, 24, 6, .95); border: 1.5px solid rgba(255, 159, 58, .9);
  box-shadow: 0 0 22px rgba(255, 159, 58, .5), 0 18px 40px rgba(0, 0, 0, .5);
  transition: background .2s ease, border-color .2s ease, opacity .3s ease;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.eg-ghost.to-today { background: rgba(6, 40, 26, .95); border-color: rgba(61, 255, 168, .95); box-shadow: 0 0 26px rgba(61, 255, 168, .55), 0 18px 40px rgba(0, 0, 0, .5); }
.eg-ghost.to-trash { background: rgba(50, 8, 8, .95); border-color: rgba(255, 90, 90, .95); box-shadow: 0 0 26px rgba(255, 90, 90, .55); }
.eg-ghost.gone { opacity: 0; }
.eg-widget [data-drag-item].eg-lifted { opacity: .35; outline: 1.5px dashed rgba(255, 159, 58, .7); outline-offset: -2px; }
.eg-desk .eg-widget.eg-drop-target { box-shadow: 0 0 0 2px rgba(61, 255, 168, .95), 0 0 34px rgba(61, 255, 168, .5) !important; }

/* =========================================================
   Evaluación (nov 2026): letra legible y botones fáciles de pulsar
   - nada de textos de 7–8 px; etiquetas de los anillos a 11,5 px
   - zonas de toque de al menos 40 px de alto
   ========================================================= */
.wk-text small { font-size: 11.5px; }
.wk-pct small { font-size: 10px; }
#eroGreetWhen { font-size: 11.5px; }
.interface-footer { font-size: 9.5px; }
@media (max-width: 760px) { .interface-footer { font-size: 9px; } }
.pj-tab-text { font-size: 12px; }
.onboarding-toggle { min-height: 40px; }
.onboarding-hide { width: 40px; height: 40px; }
.landing-more { padding: 10px 6px; margin-top: 4px; }
.landing-login { min-height: 44px; padding: 10px 22px; }

/* Asa para coger una tarea con el dedo (y llevarla al reloj o a la papelera) */
.eg-task-row[data-drag-item="task"] > .eg-check { flex: 1; min-width: 0; }
.eg-task-row > .eg-grip { flex: 0 0 40px; width: 40px; margin-right: 6px; align-self: stretch; min-height: 36px; display: grid; place-items: center; border-radius: 8px; color: rgba(var(--hud), .7); font-size: 16px; letter-spacing: -1px; background: rgba(var(--hud), .06); border: 1px dashed rgba(var(--hud), .28); cursor: grab; }
.eg-focus { margin: 6px 0 2px; font-size: 13px; font-weight: 600; color: #ffd27a; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.eg-focus-ask { margin-top: 8px; padding: 8px 10px; border-radius: 10px; background: rgba(255, 196, 84, .1); border: 1px solid rgba(255, 196, 84, .45); font-size: 13px; color: #ffe2a8; }
.eg-focus-ask .eg-acts { margin-top: 6px; }
.eg-focus-ask .eg-row { flex: 1; }
/* Temporizador en marcha con el reloj cerrado */
.eg-timer-chip { position: absolute; left: 18px; top: 52px; z-index: 30; padding: 8px 14px; min-height: 40px; border-radius: 999px; font: 700 15px "JetBrains Mono", ui-monospace, monospace; color: #ffd27a; background: rgba(30, 20, 4, .92); border: 1.5px solid rgba(255, 196, 84, .7); box-shadow: 0 0 18px rgba(255, 196, 84, .35); cursor: pointer; }
.eg-timer-chip[hidden] { display: none; }
.eg-row.eg-undo-task, .eg-mini.eg-undo-sale { width: 100%; margin: 6px 0 2px; justify-content: center; color: #ffd27a; border-color: rgba(255, 196, 84, .55); background: rgba(255, 196, 84, .08); }

/* =========================================================
   Evaluación 2 (29 nov 2026)
   ========================================================= */
/* 1) Los avisos cortos salen ARRIBA y no se pueden tocar: nunca tapan un menú,
      una ventana o un botón (antes salían encima del menú de herramientas). */
.toast {
  top: calc(72px + env(safe-area-inset-top, 0px)); bottom: auto !important;
  pointer-events: none; z-index: 400;
  animation: toast-in .25s ease both;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, -8px); } to { opacity: 1; transform: translate(-50%, 0); } }
/* 2) En Apex, el pie «€ERO SYSTEM…» se cruzaba con las preguntas rápidas */
body.home-apex-open .interface-footer { visibility: hidden; }
/* 5) Pestañas de Mi trabajo: todas iguales (el borde discontinuo parecía «desactivado») */
/* 5) Con el menú de herramientas o una ventana abierta, la pestaña de Proyectos se aparta (se cruzaba con el menú) */
body:has(#toolsButton[aria-expanded="true"]) .pj-tab,
body:has(#storeModal:not([hidden])) .pj-tab { opacity: 0 !important; pointer-events: none !important; }
.eg-widget[data-kind="notes"] .eg-notes { max-height: 230px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.retry-send { margin-top: 8px; min-height: 40px; padding: 8px 16px; }
/* (el aviso ocupa una o dos líneas, no una columna estrecha de tres) */
.toast { width: max-content; max-width: min(520px, calc(100% - 32px)); text-align: center; }
