/* Vaucai — familia visual del Vaucai por la web (ADR-121).
   UNA PÁGINA MÁS DE LA WEB: cero paleta propia — todo sale de los tokens
   ADR-007 de /assets/styles.css (negro #0a0a0a / #000 móvil, azul Vaucai
   #007FFF, Inter). Cubre las vistas de la familia:
     · /app/            — el Vaucai completo en el ordenador (Jarvis)
     · /app/movil.html  — aterrizaje móvil: la card de CUENTA (sin Vaucai)
     · /cuenta/         — Mi cuenta = LA MISMA card de cuenta
   Todas cargan /assets/styles.css (tokens + nav del sitio) + este fichero.
   ⚠ styles.css estiliza `nav` A PELO (flex de cabecera): dentro de estas
   vistas NO se usa <nav> salvo el del chrome del sitio. */

:root {
  /* Halo Jarvis en el azul de marca (halo.js lo lee de aquí). */
  --halo-rgb: 51, 153, 255;
  /* Superficies de la familia, derivadas del lenguaje del sitio. */
  --va-tile: rgba(255, 255, 255, 0.045);
  --va-tile-hover: rgba(255, 255, 255, 0.09);
  --va-card-grad: linear-gradient(180deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  --va-user-bubble: rgba(0, 127, 255, 0.16);
  --va-user-border: rgba(0, 127, 255, 0.34);
  --va-glow: 0 18px 44px rgba(32, 106, 244, 0.28);
}

/* ── Esqueleto: el nav del sitio arriba, el contenido llena el resto ── */
.vaweb-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}
.vaweb-body.is-app { height: 100vh; height: 100dvh; overflow: hidden; }
/* En la ventana del Vaucai el globo de soporte sobra (ya hablas con tu
   Vaucai) y tapaba el botón de enviar. */
.vaweb-body.is-app .vaucai-sc-launcher { display: none !important; }

/* ═════════════════ ORDENADOR — /app/ (Vaucai Jarvis) ═════════════════ */

.vaweb {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  border-top: 1px solid var(--border-soft);
}
@media (max-width: 820px) {
  .vaweb { grid-template-columns: 1fr; }
  .vaweb-side { display: none; }
}

/* ── Menú lateral (para VER, no para actuar) ── */
.vaweb-side {
  border-right: 1px solid var(--border-soft);
  padding: 22px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  background: var(--bg-deep);
}
.vaweb-side-title {
  font-family: 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-soft);
  padding: 10px 12px 6px;
}
.vaweb-menu {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.vaweb-menu-item {
  display: block;
  width: 100%;
  min-width: 0;
  text-align: left;
  text-decoration: none;
  color: var(--muted);
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 9px 12px;
  border-radius: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, color 0.15s ease;
}
.vaweb-menu-item:hover { background: var(--va-tile); color: var(--fg); }
.vaweb-menu-item.is-active { background: var(--va-tile); color: var(--fg); font-weight: 600; }
.vaweb-new { color: var(--accent-hover); font-weight: 600; }
.vaweb-menu-sep { height: 1px; background: var(--border-soft); margin: 10px 4px; }
.vaweb-convs {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
  max-height: 42vh;
  overflow-y: auto;
  overflow-x: hidden;
  margin: 2px 0 4px;
}
/* Fila de conversación: título + menú ⋯ (aparece al pasar el ratón, como
   Claude). El menú es un desplegable anclado a la fila. */
.vaweb-conv-row {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.vaweb-conv-row:hover, .vaweb-conv-row.is-active { background: var(--va-tile); }
.vaweb-conv {
  display: block;
  flex: 1;
  min-width: 0;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  color: var(--muted);
  padding: 7px 8px 7px 12px;
  border-radius: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.88rem;
  line-height: 1.4;
  transition: color 0.15s ease;
}
.vaweb-conv-row:hover .vaweb-conv { color: var(--fg); }
.vaweb-conv-row.is-active .vaweb-conv { color: var(--fg); font-weight: 600; }
.vaweb-conv-dots {
  flex: none;
  width: 26px;
  height: 26px;
  margin-right: 4px;
  border: 0;
  border-radius: 7px;
  background: none;
  color: var(--muted-soft);
  font: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.vaweb-conv-row:hover .vaweb-conv-dots,
.vaweb-conv-dots.is-open,
.vaweb-conv-dots:focus-visible { opacity: 1; }
.vaweb-conv-dots:hover, .vaweb-conv-dots.is-open { background: var(--va-tile-hover); color: var(--fg); }
/* position: FIXED (no absolute): el menú NO puede vivir dentro del recorte de
   `.vaweb-convs` (overflow-y:auto) — si no, se recorta Y dispara la barra de
   scroll con flechas. Fixed escapa del overflow y no cuenta para el scroll; JS
   lo coloca junto a los ⋯ (getBoundingClientRect). */
.vaweb-conv-menu {
  position: fixed;
  z-index: 1000;
  min-width: 210px;
  padding: 6px;
  border-radius: 12px;
  background: #171b22;
  border: 1px solid var(--border-light);
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.6);
}
.vaweb-conv-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg-soft);
  padding: 9px 11px;
  border-radius: 8px;
  transition: background 0.15s ease;
}
.vaweb-conv-menu-item svg { width: 16px; height: 16px; flex: none; }
.vaweb-conv-menu-item:hover { background: var(--va-tile-hover); }
.vaweb-conv-menu-item.is-danger { color: var(--error); }
.vaweb-conv-menu-item.is-danger:hover { background: rgba(239, 68, 68, 0.12); }
.vaweb-conv-menu-item.is-armed { background: rgba(239, 68, 68, 0.12); font-weight: 600; }

/* ── Zona principal: halo + chat + composer ── */
.vaweb-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.vaweb-halo { display: flex; justify-content: center; padding: 18px 0 2px; flex: none; }
.vaweb-halo canvas { width: 116px; height: 116px; }

.vaweb-log {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 22px clamp(16px, 5vw, 72px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.vaweb-msg {
  max-width: 720px;
  padding: 12px 16px;
  border-radius: 16px;
  word-wrap: break-word;
  line-height: 1.6;
  font-size: 0.98rem;
}
.vaweb-msg.is-user {
  align-self: flex-end;
  background: var(--va-user-bubble);
  border: 1px solid var(--va-user-border);
  color: var(--fg);
  border-bottom-right-radius: 5px;
}
.vaweb-msg.is-bot {
  align-self: flex-start;
  background: var(--va-card-grad);
  border: 1px solid var(--border-soft);
  color: var(--fg-soft);
  border-bottom-left-radius: 5px;
}
.vaweb-msg.is-media img, .vaweb-msg.is-media video {
  max-width: 100%;
  border-radius: 10px;
  display: block;
}
.vaweb-msg.is-media audio { width: 260px; max-width: 100%; }
.vaweb-cap { margin-top: 6px; font-size: 0.9rem; color: var(--muted); }

.vaweb-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.vaweb-chip {
  display: inline-block;
  text-decoration: none;
  font-size: 0.84rem;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: var(--va-tile);
  color: var(--accent-hover);
  cursor: pointer;
  font: inherit;
  transition: background 0.15s ease;
}
.vaweb-chip:hover { background: var(--va-tile-hover); }
.vaweb-chip.is-tg { color: var(--muted); cursor: default; }

.vaweb-msg.is-typing { display: inline-flex; gap: 4px; align-items: center; }
.vaweb-msg.is-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--muted);
  animation: vablink 1.2s infinite ease-in-out both;
}
.vaweb-msg.is-typing span:nth-child(2) { animation-delay: 0.18s; }
.vaweb-msg.is-typing span:nth-child(3) { animation-delay: 0.36s; }
@keyframes vablink { 0%, 80%, 100% { opacity: 0.3; } 40% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .vaweb-msg.is-typing span { animation: none; } }

/* Gate (sin sesión / sesión caducada) */
.vaweb-gate { padding: 22px clamp(16px, 5vw, 72px); color: var(--muted); }
.vaweb-btn, .vaweb-gate a {
  display: inline-block;
  margin-top: 10px;
  text-decoration: none;
  background: var(--accent);
  color: #fff;
  padding: 12px 22px;
  border-radius: 13px;
  font-weight: 600;
  box-shadow: var(--va-glow);
  transition: transform 0.18s var(--ease-cinematic), background 0.2s ease;
}
.vaweb-btn:hover, .vaweb-gate a:hover { transform: translateY(-2px); background: #1f5fe0; }

/* Composer — bien visible sobre el negro (antes se fundía con el fondo). */
.vaweb-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex: none;
  padding: 14px clamp(16px, 5vw, 72px) 20px;
  border-top: 1px solid var(--border-light);
  background: rgba(255, 255, 255, 0.025);
}
.vaweb-composer textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  font: inherit;
  color: var(--fg);
  background: #16191f;
  border: 1px solid var(--border-light);
  border-radius: 14px;
  padding: 12px 15px;
  max-height: 160px;
  line-height: 1.4;
}
.vaweb-composer textarea::placeholder { color: var(--muted-soft); }
.vaweb-composer textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.vaweb-mic {
  flex: none;
  width: 44px; height: 44px;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  background: var(--va-tile);
  color: var(--fg);
  font-size: 1.05rem;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.vaweb-mic:hover { background: var(--va-tile-hover); }
.vaweb-mic.is-rec { background: var(--accent); border-color: var(--accent); box-shadow: var(--va-glow); }
.vaweb-mic:active { transform: scale(0.96); }
.vaweb-send {
  flex: none;
  width: 44px; height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.18s var(--ease-cinematic);
}
.vaweb-send:hover { background: var(--accent-hover); transform: translateY(-1px); }
.vaweb-send:disabled { opacity: 0.5; cursor: default; transform: none; }

/* ═════════ CARD DE CUENTA — /app/movil.html + /cuenta/ ═════════
   Mera información de la cuenta bajo botones-tile (acordeón):
   Vaucai · Suscripción · Integraciones · Facturación · Ajustes,
   y el CTA grande «Abrir chat en Telegram» como cierre. */

.vaweb-movil-main {
  flex: 1;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px 48px;
}
.vaweb-card {
  width: 100%;
  max-width: 480px;
  background: var(--va-card-grad);
  border: 1px solid var(--border-soft);
  border-radius: 22px;
  padding: 28px 20px 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}
.vaweb-card-greeting {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  font-size: clamp(1.5rem, 6.4vw, 1.8rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--fg);
  text-wrap: balance;
}
.vaweb-card-date { color: var(--muted); margin-top: 6px; }
.vaweb-card-weather { color: var(--fg-soft); margin-top: 10px; font-size: 1.02rem; }
.vaweb-card-loading { color: var(--muted); margin-top: 26px; font-size: 0.95rem; }

/* Tiles (botones elegantes, 2 por fila) */
.vaweb-tiles { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; }
.vaweb-tile-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.vaweb-tile-row.is-single { grid-template-columns: 1fr; }
.vaweb-tile {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 13px 10px;
  border-radius: 14px;
  background: var(--va-tile);
  border: 1px solid var(--border-soft);
  color: var(--fg);
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.vaweb-tile:hover { background: var(--va-tile-hover); }
.vaweb-tile:active { background: var(--va-tile-hover); transform: scale(0.98); }
.vaweb-tile.is-open {
  background: var(--va-tile-hover);
  border-color: rgba(0, 127, 255, 0.45);
  color: var(--accent-hover);
}

/* Panel desplegable de cada tile */
.vaweb-detail {
  display: none;
  border: 1px solid var(--border-soft);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
  padding: 16px;
}
.vaweb-detail.is-open { display: flex; flex-direction: column; gap: 12px; animation: vafade 0.22s ease both; }
@keyframes vafade { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .vaweb-detail.is-open { animation: none; } }

.vaweb-kv { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.vaweb-kv-label { color: var(--muted); font-size: 0.88rem; }
.vaweb-kv-value { color: var(--fg); font-size: 1.05rem; font-weight: 700; }
.vaweb-kv-sub { color: var(--muted-soft); font-size: 0.85rem; }
.vaweb-settings { gap: 10px; }
.vaweb-select {
  font: inherit;
  font-size: 0.92rem;
  color: var(--fg);
  background: var(--surface-elevated);
  border: 1px solid var(--border-light);
  border-radius: 10px;
  padding: 8px 10px;
  cursor: pointer;
}
.vaweb-select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.vaweb-select:disabled { opacity: 0.5; cursor: default; }
.vaweb-saved { color: #4ade80; font-size: 0.84rem; font-weight: 600; }

/* Aviso inline bajo el control que falló. Sustituye a los `alert()` nativos de
   «Mi cuenta»: un popup gris del sistema operativo en medio de una superficie
   cuidada rompe la sensación de producto, y la calidad se nota justo ahí, en el
   estado de error, no en el happy path.

   Se llama `-note` y NO `-msg`: `.vaweb-msg` YA es la burbuja del chat del
   Vaucai (arriba, :216) y las tres páginas comparten esta hoja, así que
   reusar ese nombre reestilizaría el chat vivo. */
.vaweb-note {
  display: block;
  margin-top: 8px;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--muted);
}
.vaweb-note.is-error { color: #f87171; }

/* CTA de cierre: la única puerta al Vaucai desde el móvil. */
.vaweb-launch {
  display: block;
  text-decoration: none;
  text-align: center;
  font-weight: 600;
  padding: 15px 16px;
  border-radius: 14px;
  background: var(--accent);
  color: #fff;
  box-shadow: var(--va-glow);
  transition: transform 0.18s var(--ease-cinematic), background 0.2s ease;
}
.vaweb-launch:hover { transform: translateY(-2px); background: #1f5fe0; }
.vaweb-launch.is-cta { margin-top: 8px; padding: 17px 16px; font-size: 1.06rem; font-weight: 700; }
/* CTA por dispositivo: móvil → Telegram (única puerta al Vaucai allí);
   ordenador → «Habla con tu Vaucai» abre la vista /app/. */
.vaweb-launch.is-cta-app { display: none; }
@media (min-width: 821px) {
  .vaweb-launch.is-cta-tg { display: none; }
  .vaweb-launch.is-cta-app { display: block; }
}
.vaweb-card-gate { margin-top: 22px; color: var(--muted); }

/* ── Componentes de los paneles (integraciones · facturas · estado) ── */
.acct-status { display: inline-flex; align-items: center; gap: 7px; font-size: 0.88rem; color: var(--muted); }
.acct-status .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-soft); flex: none; }
.acct-status.is-ok .dot { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
.acct-status.is-ok { color: #4ade80; }
.acct-status.is-pending .dot { background: #eab308; }
.acct-status.is-pending { color: #eab308; }

.acct-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  font: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--fg-soft);
  background: var(--va-tile);
  border: 1px solid var(--border-light);
  border-radius: 13px;
  padding: 12px 18px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.acct-btn:hover { background: var(--va-tile-hover); }
.acct-btn--block { display: flex; width: 100%; }
.acct-btn--danger { color: var(--error); border-color: rgba(239, 68, 68, 0.35); background: rgba(239, 68, 68, 0.06); }
.acct-btn--danger:hover { background: rgba(239, 68, 68, 0.12); }
.vaweb-btn-sm { padding: 7px 14px; font-size: 0.85rem; flex: none; }

.badge {
  display: inline-block;
  width: fit-content;
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  color: #4ade80;
  border: 1px solid rgba(34, 197, 94, 0.3);
}
.badge.is-trial {
  background: rgba(0, 127, 255, 0.14);
  color: var(--accent-hover);
  border-color: rgba(0, 127, 255, 0.35);
}
.badge.is-muted {
  background: var(--va-tile);
  color: var(--muted);
  border-color: var(--border-light);
}

.acct-integration {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--va-tile);
  border: 1px solid var(--border-soft);
}
.acct-integration-icon {
  width: 36px; height: 36px;
  flex: none;
  border-radius: 10px;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.acct-integration-icon img, .acct-integration-icon svg { width: 20px; height: 20px; display: block; }
.acct-integration-icon.is-initial {
  background: var(--surface-elevated);
  color: var(--fg-soft);
  font-weight: 700;
  font-size: 0.95rem;
}
.acct-integration-meta { min-width: 0; flex: 1; }
.acct-integration-name { font-weight: 600; color: var(--fg); font-size: 0.93rem; }
.acct-integration-acct {
  color: var(--muted);
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.acct-integration-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #4ade80;
  font-size: 0.78rem;
  flex: none;
}
.acct-integration-state .dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.55);
}

.acct-empty { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.acct-empty-text { min-width: 0; }
.acct-empty p { margin: 0; font-size: 0.92rem; line-height: 1.5; color: var(--fg-soft); }
.acct-empty .sub { display: block; color: var(--muted-soft); font-size: 0.84rem; margin-top: 4px; }

.acct-invoice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 13px;
  background: var(--va-tile);
  border: 1px solid var(--border-soft);
}
.acct-invoice-main { min-width: 0; flex: 1; }
.acct-invoice-month { font-weight: 600; color: var(--fg); font-size: 0.93rem; }
.acct-invoice-date { color: var(--muted-soft); font-size: 0.8rem; }
.acct-invoice-amount { font-weight: 700; color: var(--fg); white-space: nowrap; }
.acct-invoices-empty { margin: 0; color: var(--muted); font-size: 0.92rem; }
