html,
body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  background: #0f172a;
  color: #e2e8f0;
  --inav-purple: #7c3aed;
  --inav-teal: #22d3ee;
  --inav-gradient: linear-gradient(90deg, #22d3ee 0%, #7c3aed 100%);
}

.app-body {
  min-height: 100dvh;
  min-height: 100vh;
  height: 100%;
  display: flex;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  box-sizing: border-box;
  position: relative;
}

/* lbs 24/08/2026: marcas INAV + GO! en el footer. El icono ya no vive en un topbar. */
.go-os-footer {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.4rem 1rem calc(0.45rem + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.94) 35%);
}

.go-os-footer-brands {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-shrink: 0;
}

.go-os-footer-inav {
  display: block;
  height: 28px;
  width: auto;
  object-fit: contain;
}

.go-os-footer-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.go-os-footer-logo img {
  display: block;
  height: 28px;
  width: auto;
}

.go-os-footer p {
  margin: 0;
  font-size: 0.7rem;
  line-height: 1.4;
  color: #94a3b8;
  max-width: 42rem;
}

.go-os-footer a {
  color: var(--inav-teal);
  font-weight: 650;
  text-decoration: none;
}

.go-os-footer a:hover {
  color: #a78bfa;
}

.app-shell {
  flex: 1;
  display: flex;
  min-height: 0;
  width: 100%;
  padding: 1.5rem;
  padding-bottom: calc(1.5rem + var(--vv-offset, 0px));
}

.avatar-layout {
  display: flex;
  gap: 1.5rem;
  width: 100%;
  min-height: 0;
  flex: 1;
  position: relative;
}

.avatar-stage {
  flex: 1;
  position: relative;
  border-radius: 1.5rem;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.8);
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: #020617;
  min-height: 0;
}

.avatar-stage video,
.avatar-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border: 0;
  background: #020617;
}

.avatar-stage .avatar-status-pill {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  padding: 0.4rem 1rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.85);
  color: #4ade80;
  font-size: 0.85rem;
  border: 1px solid rgba(74, 222, 128, 0.5);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
  max-width: calc(100% - 8rem);
}

/* lbs 23/08/2026: minutero flotante sobre el avatar; el tope vive en LiveAvatar:InteractionMaxMinutes. */
.avatar-stage .avatar-countdown {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: rgba(6, 40, 20, 0.88);
  color: #4ade80;
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  border: 1px solid rgba(74, 222, 128, 0.65);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

.avatar-stage .avatar-countdown[hidden] {
  display: none !important;
}

.avatar-stage .avatar-countdown-icon {
  font-size: 1.05rem;
}

.avatar-stage .avatar-countdown.is-ending {
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.95);
  box-shadow: 0 0 18px rgba(74, 222, 128, 0.45);
}

.avatar-stage .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  text-align: center;
  padding: 2rem;
}

.start-consent {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 1.25rem;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.25) 0%, rgba(2, 6, 23, 0.82) 48%, rgba(2, 6, 23, 0.94) 100%);
}

.start-consent[hidden] {
  display: none !important;
}

.start-consent-card {
  width: min(520px, 100%);
  max-height: min(72%, 100%);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 1.25rem;
  padding: 1.35rem 1.4rem 1.5rem;
  box-shadow: 0 24px 50px rgba(2, 6, 23, 0.65);
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.start-consent-card h2 {
  margin: 0;
  font-size: 1.2rem;
  color: #f8fafc;
}

.start-consent-card p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.5;
  color: #cbd5e1;
}

.start-consent-card .consent {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  font-size: 0.95rem;
  color: #f1f5f9;
  text-align: left;
}

.start-consent-card .consent input {
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  flex-shrink: 0;
  accent-color: var(--inav-teal);
}

.start-consent-error {
  min-height: 1em;
  margin: 0;
  color: #f87171;
  font-size: 0.85rem;
}

.start-consent-cta {
  width: 100%;
  min-height: 52px;
  border: none;
  border-radius: 999px;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
}

.user-preview-shell {
  position: absolute;
  right: 0.85rem;
  bottom: 0.85rem;
  z-index: 4;
  width: min(148px, 28%);
  aspect-ratio: 3 / 4;
  border-radius: 0.85rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: #0f172a;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.7);
  overflow: hidden;
}

.user-preview-shell:not(.is-live):not(.is-processing) {
  display: none;
}

.user-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-preview-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.75rem;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.78);
  pointer-events: none;
}

.user-preview-shell.is-processing {
  border-color: rgba(129, 140, 248, 0.5);
}

.control-panel {
  width: min(420px, 38%);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-height: 0;
  position: relative;
}

.chat-panel {
  background: #0b141a;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 1.25rem;
  overflow: hidden;
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.55);
}

.control-panel button {
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
  transition: transform 120ms ease, box-shadow 120ms ease, opacity 120ms ease;
}

.primary {
  background: var(--inav-gradient);
  color: #0f172a;
}

button.primary {
  border: none;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  padding: 0.85rem 1.6rem;
  cursor: pointer;
}

.secondary {
  background: rgba(2, 6, 23, 0.4);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.danger {
  padding: 5px;
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border: 1px solid rgba(248, 113, 113, 0.4);
}

.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(124, 58, 237, 0.4);
}

.primary:disabled,
.secondary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.chat-thread {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.85rem 0.8rem 0.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background:
    linear-gradient(180deg, rgba(11, 20, 26, 0.92), rgba(11, 20, 26, 0.92)),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.015) 0 12px, transparent 12px 24px);
}

.chat-msg {
  display: flex;
  max-width: 88%;
}

.chat-msg-avatar {
  align-self: flex-start;
}

.chat-msg-user,
.chat-msg-live {
  align-self: flex-end;
  margin-left: auto;
}

.chat-msg-system {
  align-self: center;
  max-width: 92%;
}

.chat-bubble {
  padding: 0.45rem 0.7rem 0.35rem;
  border-radius: 0.85rem;
  line-height: 1.4;
  font-size: 0.95rem;
  word-break: break-word;
}

.chat-msg-avatar .chat-bubble {
  background: #1f2c34;
  color: #e9edef;
  border-top-left-radius: 0.2rem;
}

.chat-msg-user .chat-bubble,
.chat-msg-live .chat-bubble {
  background: #005c4b;
  color: #e9edef;
  border-top-right-radius: 0.2rem;
}

.chat-msg-live .chat-bubble {
  opacity: 0.82;
}

.chat-bubble-text {
  display: block;
}

.chat-bubble-meta {
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.28rem;
  margin-top: 0.2rem;
}

.chat-bubble-time {
  font-size: 0.68rem;
  color: rgba(233, 237, 239, 0.65);
}

.chat-ticks {
  font-size: 0.72rem;
  letter-spacing: -0.12em;
  color: rgba(233, 237, 239, 0.7);
  line-height: 1;
}

.chat-ticks.is-read {
  color: #53bdeb;
}

.chat-chip {
  display: inline-block;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  background: rgba(17, 27, 33, 0.88);
  color: #94a3b8;
  font-size: 0.75rem;
  letter-spacing: 0.01em;
  text-align: center;
}

.chat-msg-system.danger .chat-chip {
  color: #fca5a5;
  background: rgba(127, 29, 29, 0.45);
}

.chat-composer {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  padding: 0.55rem 0.7rem 0.75rem;
  background: #1f2c34;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
}

.chat-composer[hidden] {
  display: none !important;
}

.chat-mode-btn {
  align-self: flex-start;
  min-height: 44px;
  padding: 0.45rem 0.95rem !important;
  font-size: 0.85rem !important;
  background: rgba(2, 6, 23, 0.35);
  color: var(--inav-teal);
  border: 1px solid rgba(34, 211, 238, 0.35) !important;
}

.chat-mode-btn[aria-pressed="true"] {
  background: rgba(0, 92, 75, 0.45);
  color: #bbf7d0;
  border-color: rgba(74, 222, 128, 0.45) !important;
}

.chat-voice-hint {
  font-size: 0.9rem;
  color: #e2e8f0;
  padding: 0.35rem 0.55rem;
  line-height: 1.35;
  max-height: 4.5rem;
  overflow-y: auto;
  background: rgba(0, 92, 75, 0.35);
  border-radius: 0.75rem;
}

.chat-voice-hint[hidden],
.chat-input-row[hidden] {
  display: none !important;
}

.chat-input-row {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
}

.chat-input-row textarea {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  resize: none;
  border: none;
  border-radius: 1.15rem;
  padding: 0.7rem 0.95rem;
  font: inherit;
  font-size: 1rem;
  background: #2a3942;
  color: #e9edef;
}

.chat-input-row textarea:focus {
  outline: 2px solid rgba(56, 189, 248, 0.55);
  outline-offset: 1px;
}

.chat-send-btn {
  min-width: 44px;
  min-height: 44px;
  padding: 0.55rem 1rem !important;
  border-radius: 999px;
  background: #00a884;
  color: #052e16;
  font-size: 0.9rem !important;
}

.chat-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.cancel-row {
  display: flex;
  justify-content: center;
  padding: 0 0.7rem 0.7rem;
}

.cancel-row.is-hidden {
  display: none;
}

.cancel-row .danger {
  min-height: 44px;
  width: 100%;
  border-radius: 999px;
}

.status {
  display: inline-flex;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
  font-size: 0.85rem;
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.status.danger {
  background: rgba(248, 113, 113, 0.15);
  color: #f87171;
  border-color: rgba(248, 113, 113, 0.25);
}

.knowledge-tag {
  display: inline-flex;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: #bae6fd;
  font-size: 0.85rem;
  background: rgba(15, 23, 42, 0.6);
}

.interaction-gate {
  position: absolute;
  inset: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: rgba(2, 6, 23, 0.95);
  padding-bottom: 3.6rem;
}

/* lbs 24/08/2026: mismo eje vertical que el PIN (center). overflow solo si el portal no cabe. */
.interaction-gate.has-welcome {
  overflow-y: auto;
  align-items: center;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.interaction-gate .gate-panel {
  position: absolute;
  width: 100%;
  height: 50%;
  background: radial-gradient(circle at top, rgba(124, 58, 237, 0.14), rgba(2, 6, 23, 0.98));
  transition: transform 800ms cubic-bezier(0.77, 0, 0.18, 1);
}

.interaction-gate .gate-panel.top {
  top: 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.interaction-gate .gate-panel.bottom {
  bottom: 0;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.interaction-gate .gate-card {
  position: relative;
  z-index: 2;
  background: rgba(4, 7, 19, 0.95);
  border-radius: 1.75rem;
  padding: 2.5rem;
  width: min(440px, 90%);
  box-shadow: 0 35px 80px rgba(2, 6, 23, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.25);
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  animation: gatePulse 2.5s infinite;
}

/* lbs 24/08/2026: portal /i/{token}. Mas alto que el PIN; el CTA no debe cortarse en movil. */
.interaction-gate .gate-card.is-welcome {
  width: min(560px, 92%);
  max-height: min(92dvh, 920px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  text-align: left;
  animation: none;
  padding: 2rem 1.75rem 1.6rem;
  padding-bottom: calc(1.6rem + env(safe-area-inset-bottom));
  gap: 0.95rem;
  margin-block: auto;
}

.interaction-gate .gate-card.is-welcome h2 {
  margin: 0;
  font-size: clamp(1.45rem, 4vw, 1.85rem);
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #f8fafc;
}

.interaction-gate .gate-card.is-welcome [data-gate-copy] {
  margin: 0;
  color: #cbd5e1;
  font-size: 0.98rem;
  line-height: 1.55;
}

.link-welcome-brand {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--inav-teal);
}

.gate-wordmark {
  display: block;
  width: min(220px, 72%);
  height: auto;
  margin: 0 auto 0.15rem;
  object-fit: contain;
}

.interaction-gate .gate-card.is-welcome .gate-wordmark {
  margin: 0 auto 0.35rem;
  width: min(240px, 80%);
}

.link-welcome {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.welcome-facts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  min-height: 8.6rem;
}

.welcome-fact {
  margin: 0;
  padding: 0.7rem 0.8rem;
  border-radius: 0.95rem;
  background: rgba(15, 23, 42, 0.88);
  border: 1px solid rgba(124, 58, 237, 0.28);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-height: 4.05rem;
  box-sizing: border-box;
}

.welcome-fact.is-skeleton .welcome-fact-v {
  display: block;
  min-height: 1.15em;
  border-radius: 0.35rem;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0.12) 0%, rgba(148, 163, 184, 0.32) 50%, rgba(148, 163, 184, 0.12) 100%);
  background-size: 200% 100%;
  animation: welcomeSkeleton 1.25s ease-in-out infinite;
}

@keyframes welcomeSkeleton {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.welcome-fact-k {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #94a3b8;
}

.welcome-fact-v {
  font-size: 0.95rem;
  font-weight: 650;
  color: #f1f5f9;
  line-height: 1.35;
}

.welcome-camera {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 0.95rem;
  background: rgba(34, 211, 238, 0.08);
  border: 1px solid rgba(34, 211, 238, 0.28);
  color: #e0f2fe;
  font-size: 0.9rem;
  line-height: 1.5;
}

.welcome-closed {
  margin: 0;
  min-height: 3.2rem;
  padding: 0.85rem 0.95rem;
  border-radius: 0.95rem;
  background: rgba(248, 113, 113, 0.1);
  border: 1px solid rgba(248, 113, 113, 0.35);
  color: #fecaca;
  font-size: 0.95rem;
  line-height: 1.5;
  box-sizing: border-box;
}

/* lbs 24/08/2026: oculto de verdad; reservar altura descuadraba el portal vs PIN. */
.welcome-closed[hidden] {
  display: none !important;
}

.interaction-gate .gate-card.is-welcome .consent {
  align-items: flex-start;
}

.interaction-gate .gate-card.is-welcome .primary {
  width: 100%;
  min-height: 52px;
  white-space: nowrap;
}

.interaction-gate form {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.interaction-gate input[type="email"],
.interaction-gate input[type="text"] {
  width: 100%;
  border-radius: 0.75rem;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 0.75rem;
  font-size: 1rem;
  background: rgba(2, 6, 23, 0.4);
  color: #f8fafc;
}

.interaction-gate label {
  text-align: left;
  font-size: 0.95rem;
  color: #e2e8f0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.interaction-gate .consent {
  flex-direction: row;
  align-items: flex-start;
  gap: 0.5rem;
}

.interaction-gate .consent input {
  width: auto;
  margin-top: 0.3rem;
}

.interaction-gate .gate-error {
  color: #f87171;
  min-height: 1em;
}

.oauth-panel {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.oauth-panel[hidden],
.interaction-gate [hidden] {
  display: none !important;
}

.interaction-gate .gate-card.is-welcome .welcome-closed[hidden] {
  display: none !important;
}

.oauth-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 600;
  color: #0f172a;
  background: #e2e8f0;
}

.oauth-btn.google {
  background: #fff;
  color: #1f2937;
  border: 1px solid rgba(148, 163, 184, 0.5);
}

.oauth-btn.microsoft {
  background: #2f2f2f;
  color: #fff;
}

.oauth-btn.go {
  background: var(--inav-gradient);
  color: #0f172a;
}

.gate-timer {
  color: var(--inav-teal);
  font-size: 0.9rem;
  min-height: 1em;
}

@media (max-width: 640px) {
  .interaction-gate .gate-card {
    width: min(100%, 92%);
    padding: 1.5rem 1.15rem;
  }

  .interaction-gate .gate-card.is-welcome {
    width: min(100%, 94%);
    max-height: calc(100dvh - 5.5rem);
    padding: 1.25rem 1.05rem 1.15rem;
    padding-bottom: calc(1.15rem + env(safe-area-inset-bottom));
  }

  .go-os-footer {
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;
    padding-top: 0.65rem;
  }

  .go-os-footer-brands {
    justify-content: center;
  }

  .go-os-footer p {
    font-size: 0.65rem;
  }

  .welcome-facts {
    grid-template-columns: 1fr;
  }
}

.interaction-gate.dismissed .gate-panel.top {
  transform: translateY(-120%);
}

.interaction-gate.dismissed .gate-panel.bottom {
  transform: translateY(120%);
}

.interaction-gate.dismissed .gate-card {
  animation: gateExit 600ms forwards;
}

@media (max-width: 1024px) {
  .app-shell {
    padding: 0.65rem;
    padding-bottom: calc(0.65rem + var(--vv-offset, 0px));
  }

  .avatar-layout {
    flex-direction: column;
    min-height: 0;
    height: 100%;
  }

  .avatar-stage {
    flex: 0 0 auto;
    height: min(42dvh, 42vh);
    min-height: 180px;
    border-radius: 1rem;
  }

  .control-panel {
    width: 100%;
    flex: 1;
    min-height: 0;
    border-radius: 1rem;
  }

  .user-preview-shell {
    width: min(104px, 26%);
    right: 0.55rem;
    bottom: 0.55rem;
  }

  .start-consent {
    position: fixed;
    inset: 0;
    z-index: 8;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    padding-bottom: calc(1rem + env(safe-area-inset-bottom));
    background: rgba(2, 6, 23, 0.92);
  }

  .start-consent-card {
    max-height: calc(100dvh - 2rem);
  }
}

@media (max-width: 640px) {
  .app-shell {
    padding: 0;
    padding-bottom: var(--vv-offset, 0px);
  }

  .avatar-layout {
    gap: 0;
  }

  .avatar-stage {
    height: min(38dvh, 38vh);
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .control-panel {
    border-radius: 0;
    border-left: 0;
    border-right: 0;
  }

  .avatar-stage .avatar-status-pill {
    font-size: 0.75rem;
    padding: 0.3rem 0.7rem;
    max-width: calc(100% - 6.5rem);
  }

  .avatar-stage .avatar-countdown {
    font-size: 0.95rem;
    padding: 0.35rem 0.7rem;
  }

  .start-consent {
    position: fixed;
    inset: 0;
    z-index: 8;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
    padding-bottom: calc(0.75rem + env(safe-area-inset-bottom));
    background: rgba(2, 6, 23, 0.92);
  }

  .start-consent-card {
    max-height: calc(100dvh - 1.5rem);
    padding: 1.1rem 1rem 1.2rem;
  }
}

@keyframes gatePulse {
  0% {
    box-shadow: 0 35px 80px rgba(2, 6, 23, 0.85);
  }
  50% {
    box-shadow: 0 40px 95px rgba(59, 130, 246, 0.4);
  }
  100% {
    box-shadow: 0 35px 80px rgba(2, 6, 23, 0.85);
  }
}

@keyframes gateExit {
  0% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0;
    transform: scale(0.92) translateY(-20px);
  }
}




/* Fondo de bloqueo (Overlay) */
.custom-alert-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.3s ease;
    padding: 10px; /* Agregado: para que no pegue a los bordes en móviles */
    box-sizing: border-box; /* Asegura que el padding no rompa el ancho */
}

/* Caja de la alerta - AQUÍ ESTÁN LOS CAMBIOS PRINCIPALES */
.custom-alert-box {
    background: #0a0e17; 
    border: 1px solid #2a3b55;
    border-radius: 12px;
    
    /* --- LÓGICA RESPONSIVA --- */
    width: 100%;          /* Intenta ocupar todo el ancho disponible */
    max-width: 800px;     /* Pero detente si llegas a 800px (Tu requerimiento) */
    min-width: 300px;     /* Evita que se haga demasiado pequeña en relojes o foldables */
    /* ------------------------- */

    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    color: #ffffff;
    font-family: 'Segoe UI', sans-serif;
    position: relative; 
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Cabecera */
.custom-alert-header {
    background: linear-gradient(90deg, #1e2a3a 0%, #0f1520 100%);
    padding: 12px 15px;
    border-bottom: 1px solid #2a3b55;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: move; 
    user-select: none;
}

.custom-alert-title {
    font-weight: 600;
    font-size: 14px;
    color: #e0e0e0;
}

.custom-alert-close {
    cursor: pointer;
    color: #888;
    font-size: 18px;
    transition: color 0.2s;
    padding: 0 5px; /* Área de click un poco más grande para dedos en móvil */
}

.custom-alert-close:hover {
    color: #ff4d4d;
}

/* Cuerpo del mensaje */
.custom-alert-body {
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    /* En móviles muy pequeños, esto asegura que el texto no se salga */
    overflow-y: auto; 
    max-height: 80vh; /* Evita que la alerta sea más alta que la pantalla */
}

.custom-alert-icon {
    font-size: 24px;
    flex-shrink: 0; /* Importante: Evita que el icono se aplaste si hay mucho texto */
}

.custom-alert-message {
    font-size: 14px;
    line-height: 1.6;
    color: #cfcfcf;
    word-break: break-word; /* Rompe palabras largas para no romper el layout móvil */
    flex-grow: 1;
}

/* Botón de acción */
.custom-alert-footer {
    padding: 0 20px 20px 20px;
    display: flex;
    justify-content: flex-end; /* Generalmente se ve mejor a la derecha en alertas anchas */
    gap: 10px;
}

.custom-alert-btn {
    background: linear-gradient(90deg, #3b82f6 0%, #8b5cf6 100%);
    border: none;
    color: white;
    padding: 8px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap; /* Evita que el texto del botón se rompa */
}

.custom-alert-btn:hover {
    opacity: 0.9;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* --- MEDIA QUERY EXTRA PARA MÓVILES PEQUEÑOS --- */
@media (max-width: 480px) {
    .custom-alert-box {
        max-width: 95%; /* Asegura margen en teléfonos */
    }
    
    .custom-alert-body {
        padding: 15px; /* Reduce un poco el padding para ganar espacio */
        flex-direction: column; /* Opcional: Icono arriba, texto abajo en pantallas muy angostas */
        align-items: center;
        text-align: center;
    }

    .custom-alert-footer {
        justify-content: center; /* Botón centrado en móvil */
    }
    
    .custom-alert-icon {
        margin-bottom: 10px; /* Separación si se ponen en columna */
    }
}
