html,
body,
#panorama {
  width: 100%;
  height: 100%;
  background: #0a1628;
}

body {
  margin: 0;
  overflow: hidden;
}

html,
body {
  margin: 0;
  padding: 0;
  font-family: 'Roboto', sans-serif;
}

#container {
  width: 100%;
  height: 100%;
}

/* Contenedor principal del overlay
   v1.16.0 Sprint 10.39 HOTFIX — Fondo blanco LEGACY removido.
   Este background data del onboarding light tema viejo (pre-rework dark).
   Hoy el modal externo (.overlay-content) ya tiene su propio gradient
   dark, y este .overlay-body interno tapaba todo con blanco haciendo
   invisibles los textos diseñados para fondo oscuro (#e2e8f0 / #64748b).
   Visible solo en sesiones sin cookie de visita previa (ej. incógnito).
   El resto de propiedades legacy (padding/borderRadius/etc) ya estaban
   sobrescritas por el inline style de tour.html — quedan inertes. */
.overlay-body {
  background: transparent;
  padding: 0;
  border-radius: 0;
  box-shadow: none;
  max-width: none;
  margin: 0;
  text-align: inherit;
  font-family: inherit;
}

/* Texto de los términos */
.legal-copy {
  font-size: 16px;
  color: #444;
  margin-bottom: 20px;
}

/* El enlace (href) resaltado */
.legal-link {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
  border-bottom: 1px solid transparent;
  transition: border 0.3s ease;
}

.legal-link:hover {
  border-bottom: 1px solid #007bff;
}

/* Estilo del Checkbox y su etiqueta */
.legal-acceptance {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  background: #f8f9fa;
  /* Gris muy clarito para el área de check */
  padding: 12px;
  border-radius: 8px;
  transition: background 0.3s;
}

.legal-acceptance:hover {
  background: #f1f3f5;
}

.checkbox-text {
  font-size: 14px;
  color: #666;
}

/* Botones */
.overlay-body-buttons {
  margin-top: 25px;
}

.button {
  display: inline-block;
  padding: 12px 30px;
  background-color: #28a745;
  /* Verde para invitar a la acción */
  color: white;
  text-decoration: none;
  border-radius: 25px;
  font-weight: bold;
  transition: all 0.3s ease;
}

/* Estado deshabilitado del botón */
.button.disabled {
  background-color: #ccc;
  cursor: not-allowed;
  opacity: 0.6;
  pointer-events: none;
}

.welcome-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 100;
  display: none;
}

.overlay-content {
  padding: 20px;
  position: relative;
  width: 90%;
  max-width: 400px;
  color: #fff;
}

.overlay-header {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 20px;
  text-align: center;
}

.overlay-body-content {
  font-size: 16px;
  margin-bottom: 20px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.overlay-body-buttons {
  display: flex;
  justify-content: center;
  flex-direction: column;
  gap: 0px;
}

.overlay-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}

.overlay-loading.hidden {
  display: none;
}

.overlay-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #ccc;
  border-top-color: #28a745;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

.overlay-loading-text {
  margin: 0;
  font-size: 14px;
  color: #444;
}

.overlay-body-text {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.legal-copy {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
}

.legal-acceptance {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
  font-size: 14px;
  cursor: pointer;
}

.legal-acceptance input {
  margin-top: 2px;
}

.chat-controls {
  position: fixed;
  bottom: 0;
  left: 0;
  width: calc(100% - 10px);
  height: 50px;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 10px 5px;
  z-index: 3;
  transition: bottom 0.2s;
}

.chat-controls.hidden {
  bottom: -100px;
}

.text-input-wrapper {
  flex-grow: 1;
  height: 52px;
  border-radius: 26px;
  border: 1.5px solid rgba(255,255,255,0.18);
  margin: 6px 8px;
  position: relative;
  background-color: rgba(15,23,42,0.55);
  box-shadow: 0 2px 12px rgba(0,0,0,0.3);
  backdrop-filter: blur(8px);
  transition: border-color 0.2s;
}

.text-input-wrapper:focus-within {
  border-color: rgba(99,102,241,0.6);
}

.text-input-wrapper.light {
  border: 1.5px solid rgba(99,102,241,0.35);
  background-color: rgba(15,23,42,0.75);
  box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.recording-info {
  display: none;
  align-items: center;
  justify-content: space-between;
  margin: 0 10px;
}

.recording-status {
  display: flex;
  align-items: center;
  height: 30px;
  margin: 10px 5px;
}

.recording-status-circle {
  height: 15px;
  width: 15px;
  border-radius: 100%;
  background-color: red;
  margin-right: 5px;
}

/* recording-hint eliminado — iter 127 */

#message {
  border: none;
  padding: 0 14px;
  height: 100%;
  margin-left: 4px;
  font-size: 15px;
  font-weight: 400;
  background-color: transparent;
  color: #f1f5f9;
  width: calc(100% - 36px);
  letter-spacing: 0.01em;
}

#message::placeholder {
  color: rgba(148, 163, 184, 0.7);
}

#message:focus {
  outline: none;
}

#message.light {
  color: #f1f5f9;
}

#message.light::placeholder {
  color: rgba(148, 163, 184, 0.6);
}

@keyframes springIn {
  0% {
    transform: scale(0);
  }

  100% {
    transform: scale(1);
  }
}

@keyframes springIn95 {
  0% {
    transform: scale(0.95);
  }

  100% {
    transform: scale(1);
  }
}

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

.action-button {
  height: 50px;
  width: 50px;
  border: 1.5px solid #ffffffb5;
  border-radius: 100%;
  font-size: 16px;
  margin: 0 5px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #0000003b;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  box-shadow: 4px 4px 7px #0000003b;
}

.action-button:active {
  transition: background-color, transform 0.2s;
  background-color: white;
}

.action-button.light {
  transition: background-color, transform 0.2s;
  background-color: white;
  border: 1px solid #cecece;
  box-shadow: none;
}

.start-voice {
  position: relative;
}

.start-voice:active {
  transform: scale(2);
}

.action-button svg {
  animation: 0.2s ease-out 0s 1 springIn;
  touch-action: none;
  user-select: none;
}

.action-button:active svg line,
.action-button:active svg path,
.action-button:active svg polygon {
  stroke: black;
}

.action-button.light svg line,
.action-button.light svg path,
.action-button.light svg polygon {
  stroke: black;
}

.chat {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 25%;
  overflow: hidden;
  z-index: 2;
  /* pointer-events: none; */
  -webkit-mask-image: linear-gradient(to top, black 0%, black 85%, transparent 100%);
  mask-image: linear-gradient(to top, black 0%, black 85%, transparent 100%);
}

@media (min-width: 768px) {
  .chat-content {
    width: 80%;
    height: 100%;
    position: relative;
    transform: translateX(-50%);
    left: 50%;
  }

  .chat-controls {
    width: 80%;
    left: 50%;
    transform: translateX(-50%);
  }
}

@media (min-width: 1024px) {
  .chat-content {
    width: 65%;
  }

  .chat-controls {
    width: 65%;
  }

  /* En desktop, el chat abierto ocupa solo un panel lateral derecho — no tapa el tour */
  .chat.open {
    left: auto !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 380px !important;
    height: 100% !important;
    border-left: 1px solid rgba(99,102,241,0.2);
    background: rgba(10,22,40,0.92) !important;
    backdrop-filter: blur(16px);
  }

  .chat.open .chat-content {
    width: 100%;
    transform: none;
    left: 0;
  }

  .chat.open .chat-controls {
    width: 100%;
    transform: none;
    left: 0;
  }

  .chat.open .chat-bubbles {
    max-height: calc(100% - 130px);
  }
}

.chat.open {
  pointer-events: all;
  -webkit-mask-image: unset;
  mask-image: unset;
  padding-top: 56px;  /* espacio para el header fijo */
}

/* Header del panel de chat */
.chat.open::before {
  content: var(--chat-panel-title, 'Conversación con Maia');
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  display: flex;
  align-items: center;
  padding: 0 20px;
  font-size: 14px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(99,102,241,0.15);
  background: rgba(10,22,40,0.6);
  backdrop-filter: blur(8px);
  z-index: 1;
}

.chat-bubbles {
  position: fixed;
  bottom: 60px;
  left: 0;
  width: 100%;
  max-height: calc(100% - 50px);
  padding: 12px 16px;
  box-sizing: border-box;
  overflow-y: scroll;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: rgba(99,102,241,0.3) transparent;
}

.chat.open .chat-bubbles {
  overflow-y: scroll;
  top: 50px;
  max-height: calc(100% - 120px);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* ── Burbujas flotantes en modo cerrado (voz activa, panel sin abrir) ──────── */
/* Solo las últimas 2 burbujas son visibles sobre la barra, como una ventana   */
/* de contexto inmediato. El resto del historial está disponible en el panel.  */
.chat:not(.open) .realtor-text-bubble-wrapper,
.chat:not(.open) .user-text-bubble-wrapper {
  /* Las burbujas están hidden por defecto en modo cerrado.                    */
  /* _syncFloatingBubbles() hace display:flex en las últimas 2 en tiempo real. */
}

/* Burbuja flotante de Maia en modo cerrado: fondo semitransparente */
.chat:not(.open) .realtor-text-bubble-wrapper .text-bubble {
  background-color: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(99,102,241,0.2);
}

/* Burbuja flotante del usuario en modo cerrado: azul con transparencia */
.chat:not(.open) .user-text-bubble-wrapper .text-bubble {
  background: linear-gradient(135deg, rgba(37,99,235,0.9) 0%, rgba(29,78,216,0.9) 100%);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.realtor-text-bubble-wrapper {
  display: flex;
  align-items: flex-start;
  margin-right: 4%;
  margin-bottom: 2px;
}

.realtor-text-bubble-wrapper .text-bubble {}

.user-text-bubble-wrapper {
  display: flex;
  justify-content: flex-end;
  margin-left: 4%;
  margin-bottom: 2px;
  /* Evitar que la burbuja quede recortada por el contenedor padre */
  overflow: visible;
  padding-right: 2px;
}

.user-text-bubble-wrapper .text-bubble {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  border-radius: 18px 18px 4px 18px;
}

.text-bubble {
  border-radius: 4px 18px 18px 18px;
  padding: 12px 16px;
  margin: 3px 0;
  max-width: calc(100% - 60px);
  font-size: 15px;
  font-weight: 400;
  line-height: 1.55;
  word-wrap: break-word;
  word-break: break-word;
  animation: 0.2s ease-out 0s 1 springIn95;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  background-color: rgba(30, 41, 59, 0.85);
  color: #f1f5f9;
  user-select: text;
}

.text-bubble svg {
  fill: #fff;
}

.avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-right: 10px;
  flex-shrink: 0;
}

.avatar-label {
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(99, 102, 241, 0.85);
  border-radius: 4px;
  padding: 1px 5px;
  margin-top: 4px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.avatar {
  height: 44px;
  width: 44px;
  border-radius: 100%;
  background-color: #fff;
  margin: 0;
  background-image: url(/portrait.png);
  background-size: 150%;
  background-position: 53% 21%;
  background-repeat: no-repeat;
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
  border: 2px solid rgba(99,102,241,0.4);
}

.realtor-text-bubble-wrapper .avatar.pending {
  animation: 1s ease-out bounce;
  animation-iteration-count: infinite;
}

.tool-button.hidden {
  transform: translateX(100px);
}

.chat.hidden {
  display: none;
}

.tool-button {
  position: fixed;
  height: 44px;
  width: 44px;
  border: none;
  font-size: 16px;
  margin: 0 5px;
  background-color: rgba(10,22,40,0.65);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 12px;
  -webkit-tap-highlight-color: transparent;
  touch-action: none;
  user-select: none;
  z-index: 10;
  cursor: pointer;
  transition: transform 0.2s, background-color 0.2s;
  filter: drop-shadow(0px 2px 8px rgba(0,0,0,0.4));
}

.tool-button:hover {
  transform: scale(1.08);
  background-color: rgba(99,102,241,0.3);
}

.view-mode {
  top: 27px;
  right: 5px;
  width: 55px;
}


.toggle-chat {
  top: 20px;
  right: 10px;
}

.share {
  top: 70px;
  right: 10px;
}

.volume {
  top: 120px;
  right: 10px;
}

/* v1.16.0 Sprint 10.17.1 — Modo solo texto.
   Posicionado entre el volume y el go-back. Cuando está activo (.active),
   tiene un acento visual sutil para indicar que el modo voz está apagado. */
.text-only-toggle {
  top: 170px;
  right: 10px;
}

/* v1.16.0 Sprint 10.20.3 — Color del icono del teclado en modo inactivo.
   El SVG inline usa stroke="currentColor" pero .tool-button no define color
   explícito → el icono queda gris/negro mientras los demás botones (que usan
   imágenes SVG externas pre-coloreadas) se ven blancos. Forzar #fff acá para
   mantener consistencia visual con el resto de la barra lateral del tour.
   La regla .active de abajo sigue ganando por especificidad cuando corresponde. */
.text-only-toggle svg {
  color: #fff;
}

.text-only-toggle.active {
  background-color: rgba(99,102,241,0.22);
  border-color: rgba(99,102,241,0.5);
  box-shadow: 0 0 0 2px rgba(99,102,241,0.18);
}

.text-only-toggle.active svg {
  color: rgb(165,180,252); /* indigo-300 — tono activo */
}

.go-back {
  top: 220px;  /* corrido para no chocar con text-only-toggle */
  right: 10px;
}

.volume.volume-on img:nth-child(1) {
  display: none;
}

.volume.volume-off img:nth-child(2) {
  display: none;
}


.close-button {
  position: fixed;
  top: 12px;
  right: 14px;
  height: 32px;
  width: 32px;
  background-color: rgba(99,102,241,0.15);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 50%;
  background-image: url('/x.svg');
  background-size: 14px;
  background-position: center;
  background-repeat: no-repeat;
  display: none;
  cursor: pointer;
  transition: background-color 0.2s;
}

.close-button:hover {
  background-color: rgba(99,102,241,0.3);
}

.chat.open .close-button {
  display: block;
  z-index: 10; /* sobre el header ::before (z-index:1) — sin esto el header tapaba el ✕ y no se podía cerrar */
}

/* ── Fix UX del chat abierto en desktop (iter post-deploy) ──
   El panel lateral (380px) y su header se extendían por toda la ventana y
   tapaban la toolbar (compartir/volumen) y el tour, sin forma de cerrar.
   body.chat-open ya lo agrega chat.js al abrir el panel. ── */
@media (min-width: 768px) {
  /* el header del panel ocupa SOLO el panel, no toda la ventana */
  .chat.open::before {
    left: auto;
    right: 0;
    width: 380px;
  }
  /* la toolbar (compartir/volumen/etc.) se corre a la izquierda del panel
     para quedar visible y clickeable, en vez de tapada por él */
  body.chat-open #tour-toolbar-pill {
    right: calc(380px + var(--space-4, 16px));
  }
}

.chat.open .chat-bubbles {
  pointer-events: all;
}

.chat-open .text-bubble {
  background-color: rgba(30, 41, 59, 0.92);
  color: #f1f5f9;
}

.chat-open .user-text-bubble-wrapper .text-bubble {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
}

.chat-open .text-input-wrapper {
  background-color: transparent;
}

.logo {
  display: none;
  position: fixed;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  font-weight: 200;
  font-size: 16px;
}

.logo-decal1 {
  height: 10px;
  width: 10px;
  border-top: 1px solid #676767;
  border-left: 1px solid #676767;
  position: fixed;
  left: -8px;
  top: -6px;
}

.logo-decal2 {
  height: 10px;
  width: 10px;
  border-bottom: 1px solid #676767;
  border-right: 1px solid #969696;
  position: fixed;
  right: -7px;
  bottom: -4px;
}

.chat.open .logo {
  display: block;
}

.time-slider-wrapper {
  height: calc(100% - 50px);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}

.time-slider {
  height: 24px;
  -webkit-appearance: none;
  appearance: none;
  margin: 10px 0;
  width: 100%;
  background-color: transparent;
  transform: rotate(90deg);
}

input[type=range]:focus {
  outline: none;
}

input[type=range]::-webkit-slider-runnable-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  /* animate: 0.2s — propiedad CSS inválida, removida */
  box-shadow: 0px 0px 0px #000000;
  background: #FFFFFF;
  border-radius: 25px;
  border: 0px solid #000000;
}

input[type=range]::-webkit-slider-thumb {
  box-shadow: 0px 0px 0px #000000;
  border: 0px solid #E3E3E3;
  height: 18px;
  width: 18px;
  border-radius: 34px;
  background: #FFFFFF;
  cursor: pointer;
  -webkit-appearance: none;
  margin-top: -7px;
}

input[type=range]:focus::-webkit-slider-runnable-track {
  background: #FFFFFF;
}

input[type=range]::-moz-range-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  /* animate: 0.2s — propiedad CSS inválida, removida */
  box-shadow: 0px 0px 0px #000000;
  background: #FFFFFF;
  border-radius: 25px;
  border: 0px solid #000000;
}

input[type=range]::-moz-range-thumb {
  box-shadow: 0px 0px 0px #000000;
  border: 0px solid #E3E3E3;
  height: 18px;
  width: 18px;
  border-radius: 34px;
  background: #FFFFFF;
  cursor: pointer;
}

input[type=range]::-ms-track {
  width: 100%;
  height: 4px;
  cursor: pointer;
  /* animate: 0.2s — propiedad CSS inválida, removida */
  background: transparent;
  border-color: transparent;
  color: transparent;
}

input[type=range]::-ms-fill-lower {
  background: #FFFFFF;
  border: 0px solid #000000;
  border-radius: 50px;
  box-shadow: 0px 0px 0px #000000;
}

input[type=range]::-ms-fill-upper {
  background: #FFFFFF;
  border: 0px solid #000000;
  border-radius: 50px;
  box-shadow: 0px 0px 0px #000000;
}

input[type=range]::-ms-thumb {
  margin-top: 1px;
  box-shadow: 0px 0px 0px #000000;
  border: 0px solid #E3E3E3;
  height: 18px;
  width: 18px;
  border-radius: 34px;
  background: #FFFFFF;
  cursor: pointer;
}

input[type=range]:focus::-ms-fill-lower {
  background: #FFFFFF;
}

input[type=range]:focus::-ms-fill-upper {
  background: #FFFFFF;
}

.time-controls {
  position: fixed;
  display: flex;
  flex-direction: column;
  top: 170px;
  right: 38px;
  justify-content: center;
  align-items: center;
  transform: translateX(50%);
  height: 30%;
}

.sun-icon {
  margin-bottom: 10px;
}

.moon-icon {
  margin-top: 10px;
}

.schedule-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  visibility: hidden;
  z-index: 4;
  background-color: rgba(0, 0, 0, 0.5);
}

.schedule-popup.open {
  pointer-events: all;
  display: flex;
  visibility: visible;
  align-items: center;
  justify-content: center;
}

.schedule-popup-content {
  width: 80%;
  height: 120px;
  background-color: #fff;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  transform: scale(0.95);
  transition: transform 0.2s;
}

.schedule-popup.open .schedule-popup-content {
  transform: scale(1);
}

.schedule-popup-header {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}

.schedule-popup-header-text {
  font-size: 20px;
  font-weight: 500;
}

.schedule-popup-close {
  height: 30px;
  width: 30px;
  background-color: transparent;
  background-image: url('/x.svg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  cursor: pointer;
}

.schedule-popup-body {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.schedule-popup-body-content {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* CSS */
.button {
  align-items: center;
  appearance: none;
  background-image: radial-gradient(100% 100% at 100% 0, #5adaff 0, #5468ff 100%);
  border: 0;
  border-radius: 6px;
  box-shadow: rgba(45, 35, 66, .4) 0 2px 4px, rgba(45, 35, 66, .3) 0 7px 13px -3px, rgba(58, 65, 111, .5) 0 -3px 0 inset;
  box-sizing: border-box;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  height: 48px;
  justify-content: center;
  line-height: 1;
  list-style: none;
  overflow: hidden;
  padding-left: 16px;
  padding-right: 16px;
  position: relative;
  text-align: left;
  text-decoration: none;
  transition: box-shadow .15s, transform .15s;
  user-select: none;
  -webkit-user-select: none;
  touch-action: manipulation;
  white-space: nowrap;
  will-change: box-shadow, transform;
  font-size: 18px;
}

.button:focus {
  box-shadow: #3c4fe0 0 0 0 1.5px inset, rgba(45, 35, 66, .4) 0 2px 4px, rgba(45, 35, 66, .3) 0 7px 13px -3px, #3c4fe0 0 -3px 0 inset;
}

.button:hover {
  box-shadow: rgba(45, 35, 66, .4) 0 4px 8px, rgba(45, 35, 66, .3) 0 7px 13px -3px, #3c4fe0 0 -3px 0 inset;
  transform: translateY(-2px);
}

.button:active {
  box-shadow: #3c4fe0 0 3px 7px inset;
  transform: translateY(2px);
}

.button.disabled,
.button[aria-disabled='true'] {
  pointer-events: none;
  opacity: 0.55;
  transform: none;
  box-shadow: rgba(45, 35, 66, .2) 0 2px 4px;
}

.pnlm-panorama-info {
  top: 0px;
  bottom: unset;
  display: none !important;
}

.pnlm-controls-container {
  display: none;
}

@keyframes bounce {

  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateY(0);
  }

  40% {
    transform: translateY(-13px);
  }

  60% {
    transform: translateY(-7px);
  }
}

@keyframes floating {
  0% {
    transform: translateY(0) rotate(45deg);
  }

  50% {
    transform: translateY(-10px) rotate(45deg);
  }

  100% {
    transform: translateY(0) rotate(45deg);
  }
}

/* ══════════════════════════════════════════════════════════════
   HOTSPOTS DE NAVEGACIÓN — diseño limpio y confiable
   ══════════════════════════════════════════════════════════════ */

.custom-hotspot {
  height: 45px;
  width: 45px;
  border-radius: 100%;
  border: 6px solid #ffffffdd;
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.354), 0 0 10px rgba(0, 0, 0, 0.135) inset;
  animation: pulse 2s infinite;
  outline: 2px solid #ffffffdd;
}

.custom-hotspot.arrow {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Cpath d='M15 3 L6 22 L15 17 L24 22 Z' fill='rgba(255,255,255,0.9)'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center center;
  background-size: 22px 22px;
}
/* El background-image rota junto con el elemento cuando Pannellum aplica rotateZ */

/* Área clickeable extendida — más fácil de clickear sin hover requerido */
.pnlm-hotspot-base {
  /* Transición suave al aparecer/desaparecer */
  transition: opacity 0.25s ease !important;
}

/* Label de destino: SIEMPRE visible, no depende de hover ────────── */
.hs-scene-label {
  position: fixed;
  bottom: -28px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.82);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.18);
  letter-spacing: 0.03em;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 1;
}

/* Cross-catalog portal NO necesita hs-scene-label — ya tiene texto en el pill */
.pnlm-hotspot-base.cross-catalog-portal .hs-scene-label {
  display: none !important;
}

/* Ocultar thumbnail hover — genera UX confusa */
.hs-destination-preview {
  display: none !important;
}

.floating-hotspot {
  background: url(/corner.svg) no-repeat center center;
  transform: rotate(45deg);
  background-size: 100%;
  height: 100px;
  width: 100px;
  filter: drop-shadow(3px 3px 7px rgba(0, 0, 0, .5));
  animation: floating 2s infinite;
  transform-origin: center;
  transition: transform 0.2s ease-in-out;
}

.floating-hotspot:hover {
  animation: none;
  transform: rotate(45deg) scale(1.1);
}

.floating-hotspot-title {
  display: none;
  position: fixed;
  top: 70%;
  left: 70%;
  transform: translate(-50%, -50%) rotate(-45deg);
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  text-align: center;
}

.floating-hotspot:hover .floating-hotspot-title {
  display: block;
  text-shadow: 0px 0px 10px #0000007d;
}

.grid {
  height: 100px;
  width: 100px;
  background: transparent;
  /* border-radius: 100%;
  border: 3px solid #fff; */
  /* perspective: 1000px; */
  box-shadow: 0 0 10px rgba(0, 0, 0, 0.354), 0 0 10px rgba(0, 0, 0, 0.135) inset;
  animation: pulse 3s infinite;
  outline: 2px solid white;
}

.custom-hotspot:hover {
  animation: none;
  outline-width: 3px;
  outline-color: #ffffff;
  border-color: #ffffff;
  opacity: 0.75;
}

/* ══════════════════════════════════════════════════════════════════════════
   CROSS-CATALOG PORTAL — hotspot que sale del espacio actual
   Visualmente DISTINTO de los círculos de navegación interna.
   Usa una pill/botón naranja con flecha, siempre visible, fácil de click.
   ══════════════════════════════════════════════════════════════════════════ */

/* El div principal del portal — reemplaza el círculo */
.pnlm-hotspot-base.cross-catalog-portal {
  width: auto !important;
  height: 42px !important;
  min-width: 110px;
  border-radius: 21px !important;
  background: linear-gradient(135deg, rgba(245,158,11,0.95), rgba(234,88,12,0.92)) !important;
  border: 2px solid rgba(255,200,80,0.6) !important;
  box-shadow: 0 3px 16px rgba(245,158,11,0.5), 0 0 0 3px rgba(245,158,11,0.15) !important;
  animation: portal-pulse 2.4s ease-in-out infinite !important;
  cursor: pointer !important;
  outline: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  padding: 0 14px 0 10px !important;
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease !important;
}
.pnlm-hotspot-base.cross-catalog-portal:hover {
  transform: scale(1.08) !important;
  box-shadow: 0 5px 22px rgba(245,158,11,0.7), 0 0 0 4px rgba(245,158,11,0.2) !important;
  animation: none !important;
}

/* Contenido interior del portal */
.cross-catalog-portal-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #1a0a00;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.01em;
  pointer-events: none;
  user-select: none;
}
.cross-catalog-portal-arrow {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.cross-catalog-portal-text {
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes portal-pulse {
  0%, 100% { box-shadow: 0 3px 16px rgba(245,158,11,0.5), 0 0 0 3px rgba(245,158,11,0.15); }
  50%       { box-shadow: 0 3px 20px rgba(245,158,11,0.7), 0 0 0 6px rgba(245,158,11,0.08); }
}

/* ── v1.7.85: Cross-catalog portal — rich preview card ───────────────────── */
.pnlm-hotspot-base.cross-catalog-portal--rich {
  width: auto !important;
  height: auto !important;
  min-width: 0 !important;
  border-radius: 14px !important;
  padding: 0 !important;
  overflow: visible !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  animation: none !important;
  /* FIX v1.7.88: Pannellum aplica rotateX/rotateY al hotspot base.
     Reseteamos aquí para que la card aparezca siempre vertical. */
  transform: none !important;
}
.pnlm-hotspot-base.cross-catalog-portal--rich:hover {
  transform: none !important;
  box-shadow: none !important;
  animation: none !important;
}
/* El hover scale va en la card hija, no en el hotspot base */
.pnlm-hotspot-base.cross-catalog-portal--rich:hover .ccp-card {
  transform: scale(1.04) translateY(-3px);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5) !important;
}
/* Wrapper: también resetear transform por si Pannellum aplica al tooltip div */
.cross-catalog-portal-wrap {
  transform: none !important;
}
.ccp-card {
  width: 180px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(10,16,34,0.92);
  border: 1.5px solid rgba(245,158,11,0.5);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 2px rgba(245,158,11,0.1);
  backdrop-filter: blur(10px);
  cursor: pointer;
  animation: portal-pulse-card 2.8s ease-in-out infinite;
  transition: transform .15s ease, box-shadow .15s ease;
}
@keyframes portal-pulse-card {
  0%,100% { box-shadow: 0 4px 20px rgba(0,0,0,0.5), 0 0 0 2px rgba(245,158,11,0.1); }
  50%      { box-shadow: 0 4px 24px rgba(245,158,11,0.4), 0 0 0 4px rgba(245,158,11,0.15); }
}
.ccp-thumb-wrap {
  position: relative;
  width: 100%;
  height: 90px;
  overflow: hidden;
}
.ccp-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* v1.15.0 Sprint 8 — enfocar el ecuador (centro vertical) para que las
     imágenes 360 equirectangulares se vean menos distorsionadas. Los polos
     (arriba/abajo) tienen mayor estiramiento; el centro es casi natural. */
  object-position: center 50%;
  display: block;
  transition: transform .3s ease;
}
/* v1.15.0 Sprint 8 — variant compacta sin imagen */
.cross-catalog-portal--compact .ccp-card { display: none; }
.cross-catalog-portal--compact .cross-catalog-portal-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 8px;
  background: rgba(15,23,42,0.92);
  border: 1.5px solid rgba(99,102,241,0.5);
  font-size: 13px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
}
.ccp-card:hover .ccp-thumb { transform: scale(1.06); }
.ccp-thumb-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 40%, rgba(10,16,34,0.7) 100%);
}
.ccp-body {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
}
.ccp-icon {
  font-size: 16px;
  color: #fbbf24;
  flex-shrink: 0;
  font-weight: 900;
}
.ccp-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.ccp-name {
  font-size: 12px;
  font-weight: 800;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ccp-cta {
  font-size: 10px;
  color: #fbbf24;
  font-weight: 600;
  letter-spacing: .02em;
}

/* ── v1.7.85: float-pulse — agitar botón flotante para llamar atención ─────── */
@keyframes float-shake {
  0%,100% { transform: translateX(0); }
  20%     { transform: translateX(-4px) rotate(-2deg); }
  40%     { transform: translateX(4px)  rotate(2deg); }
  60%     { transform: translateX(-3px) rotate(-1deg); }
  80%     { transform: translateX(3px)  rotate(1deg); }
}
#btn-guided-float.float-pulse {
  animation: float-shake 0.7s ease !important;
}

/* ── v1.7.86: Info hotspot rich card ──────────────────────────────────────── */
.pnlm-hotspot-base.info-hotspot--rich {
  width: auto !important;
  height: auto !important;
  border-radius: 12px !important;
  padding: 0 !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.ihs-card {
  min-width: 140px;
  max-width: 220px;
  background: rgba(10, 16, 34, 0.88);
  border: 1px solid rgba(99, 102, 241, 0.35);
  border-radius: 12px;
  padding: 10px 13px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 4px 18px rgba(0,0,0,0.45);
  cursor: default;
  animation: ihs-fade-in 0.2s ease;
}
@keyframes ihs-fade-in {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: none; }
}
.ihs-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
}
.ihs-icon {
  font-size: 18px;
  line-height: 1;
  flex-shrink: 0;
}
.ihs-title {
  font-size: 13px;
  font-weight: 800;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ihs-details {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.ihs-details li {
  font-size: 11px;
  color: #94a3b8;
  line-height: 1.4;
  padding-left: 4px;
  border-left: 2px solid rgba(99,102,241,0.3);
}

/* ── CTA / URL: badge verde con ícono de link ─────────────────────────────── */
.cross-catalog-label {
  position: fixed;
  top: 52px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 22, 40, 0.88);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 8px;
  white-space: nowrap;
  border: 1px solid rgba(99, 102, 241, 0.45);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
  letter-spacing: 0.02em;
}
.cross-catalog-label.cta-label {
  border-color: rgba(16, 185, 129, 0.5);
  background: rgba(10, 30, 20, 0.88);
  color: #6ee7b7;
}

/* ── Info hotspot: ícono ℹ con label ─────────────────────────────────────── */
.info-hotspot {
  width: 32px !important;
  height: 32px !important;
  border-radius: 50% !important;
  background: rgba(99, 102, 241, 0.2) !important;
  border: 2px solid rgba(99, 102, 241, 0.7) !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.3) !important;
  animation: pulse 2s infinite !important;
  outline: none !important;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
}
.info-hotspot::before {
  content: 'ℹ';
  color: rgba(99, 102, 241, 0.9);
  font-size: 16px;
  font-weight: 700;
  position: fixed;
}

.info-hotspot-label {
  position: fixed;
  top: 38px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 22, 40, 0.92);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 8px;
  white-space: normal;
  max-width: 220px;
  text-align: center;
  border: 1px solid rgba(99, 102, 241, 0.4);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  pointer-events: none;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
  line-height: 1.4;
}

/* ── Destination preview: thumbnail al hacer hover ───────────────────────── */
.hs-destination-preview {
  position: absolute;
  bottom: 58px;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.15);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
.hs-destination-preview img {
  width: 100%;
  height: 80px;
  object-fit: cover;
  display: block;
}
.hs-destination-label {
  background: rgba(10, 22, 40, 0.9);
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 600;
  padding: 4px 8px;
  text-align: center;
}
/* Mostrar preview al hacer hover en el hotspot */
.pnlm-hotspot-base:hover .hs-destination-preview {
  opacity: 1;
}

/* Label de destino siempre visible bajo la flecha (sin thumbnail) */
.hs-scene-label {
  position: fixed;
  bottom: -22px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10, 22, 40, 0.82);
  color: #e2e8f0;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
  pointer-events: none;
  border: 1px solid rgba(255,255,255,0.12);
  letter-spacing: 0.02em;
  max-width: 110px;
  overflow: hidden;
  text-overflow: ellipsis;
}

@keyframes pulse {
  0% {
    opacity: 0.6;
    outline-width: 2px;
  }

  50% {
    opacity: 0.2;
    outline-width: 1px;
  }

  100% {
    opacity: 0.7;
    outline-width: 2px;
  }
}

/* Share Modal */
.share-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0,0,0,.65);
  backdrop-filter: blur(4px);
  z-index: 1200;
  justify-content: center;
  align-items: center;
}

.share-modal.active {
  display: flex;
}

.share-modal-content {
  background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
  border: 1px solid rgba(99,102,241,.25);
  padding: 28px 24px 20px;
  border-radius: 20px;
  position: relative;
  width: 90%;
  max-width: 380px;
  box-shadow: 0 24px 64px rgba(0,0,0,.5);
}

.share-modal h3 {
  margin: 0 0 4px;
  color: #f1f5f9;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
}

.share-buttons {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 16px;
}

.share-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.05);
  cursor: pointer;
  transition: all .2s ease;
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
}

.share-icon:hover {
  transform: translateY(-2px);
  background: rgba(255,255,255,.1);
  border-color: rgba(255,255,255,.15);
}

.share-icon span {
  color: #cbd5e1;
  font-size: 10px;
}

.share-icon svg {
  width: 22px;
  height: 22px;
}

.share-icon.facebook svg  { fill: #1877f2; }
.share-icon.twitter svg   { fill: #e2e8f0; }
.share-icon.linkedin svg  { fill: #0a66c2; }
.share-icon.whatsapp svg  { fill: #25d366; }
.share-icon.telegram svg  { fill: #29b6f6; }
.share-icon.email svg     { fill: none; stroke: #a78bfa; }
.share-icon.copy svg      { fill: #94a3b8; }

.close-modal {
  position: fixed;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,.08);
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 50%;
}

.close-modal:hover {
  background-color: #f5f5f5;
}

.modal {
  display: none;
  justify-content: center;
  align-items: end;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  /* transition-behavior: allow-discrete — solo Chrome 117+, omitido por compat */
}

.modal-content {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px 10px 0px 0px;
  width: calc(100% - 10px);
  position: relative;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  /* transition-behavior: allow-discrete — solo Chrome 117+, omitido por compat */
}

@media (min-width: 768px) {
  .modal-content {
    width: 75%;
  }
}

@media (min-width: 1024px) {
  .modal-content {
    width: 50%;
  }
}

.modal.open {
  display: flex;
}


.modal.open {
  background-color: rgba(0, 0, 0, 0.5);
}

.modal.open .modal-content {
  transform: translateY(0px);
}

/* @starting-style no soportado en Firefox < 129 ni Safari < 17.5.
   Reemplazado por JS-based class toggle para la animación de entrada. */
/* @starting-style { ... } — removido */
.mic-permission-banner {
  position: fixed;
  left: 50%;
  bottom: 90px;
  top: auto;
  transform: translateX(-50%);
  width: min(520px, calc(100% - 24px));
  padding: 14px 18px;
  border-radius: 16px;
  z-index: 9999;
  font-family: sans-serif;
  font-size: 15px;
  line-height: 1.45;
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
  color: #fff;
  background: rgba(17,24,39,0.97);
  backdrop-filter: blur(8px);
  text-align: center;
  transition: opacity 0.3s ease;
}

.mic-permission-banner[data-level="error"] {
  background: rgba(127,29,29,0.97);
}

.bubble-action-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.bubble-action-button {
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 13px;
  cursor: pointer;
  background: #0f172a;
  color: #fff;
}

.bubble-action-button.secondary {
  background: #e5e7eb;
  color: #111827;
}

.bubble-action-text {
  white-space: pre-wrap;
}

.start-voice.disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.mic-cta-button {
  border: 0;
  border-radius: 999px;
  padding: 12px 18px;
  min-width: 172px;
  height: 46px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #b91c1c);
  box-shadow: 0 10px 24px rgba(127, 29, 29, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  animation: micPulse 1.8s ease-in-out infinite;
}

.mic-cta-button:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 14px 30px rgba(127, 29, 29, 0.42);
}

.mic-cta-button.hidden {
  display: none;
}

.mic-cta-button:disabled {
  opacity: 0.7;
  cursor: progress;
}

@keyframes micPulse {
  0%, 100% { box-shadow: 0 10px 24px rgba(127, 29, 29, 0.35); }
  50% { box-shadow: 0 12px 34px rgba(239, 68, 68, 0.45); }
}


/* ITER100_LEGACY_MODAL_QUARANTINE */
.modal[data-legacy-modal="disabled"],
.modal[data-legacy-modal="disabled"].open,
.rut-input-modal[data-legacy-modal="disabled"],
.email-input-modal[data-legacy-modal="disabled"],
.whatsapp-modal[data-legacy-modal="disabled"] {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}



/* ITER118_MIC_PROMPT_VISUAL_CLEANUP */
body.maia-mic-ready .microphone-cta,
body.maia-mic-ready .mic-permission-banner,
body[data-maia-mic-ui-state="recording"] .microphone-cta,
body[data-maia-mic-ui-state="processing"] .microphone-cta {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* recording-hint mic states eliminados — iter 127 */


/* ═══════════════════════════════════════════════════════════
   HU-09 · Micrófono — UX mejorada
   Estados: idle | connecting | ready | recording | processing | error | denied
   ═══════════════════════════════════════════════════════════ */

/* ── Variables de estado ─────────────────────────────────── */
:root {
  --maia-state-idle:       #64748b;
  --maia-state-connecting: #f59e0b;
  --maia-state-ready:      #10b981;
  --maia-state-recording:  #ef4444;
  --maia-state-speaking:   #818cf8;
  --maia-state-processing: #6366f1;
  --maia-state-error:      #ef4444;
  --maia-state-denied:     #ef4444;
}

/* ── Pill de estado eliminado (iter 127) ─────────────────── */
/* El elemento #maia-status-pill fue removido del HTML.       */
/* El feedback de estado se da solo a través del botón mic.  */



/* ── Botón mic mejorado: estados visuales ────────────────── */
.start-voice {
  transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
  /* Mobile: área táctil mínima de 48×48px para accesibilidad */
  min-width: 48px;
  min-height: 48px;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

/* Estado connecting: spinner */
body[data-maia-mic-ui-state="connecting"] .start-voice {
  background: rgba(245,158,11,0.2) !important;
  box-shadow: 0 0 0 3px rgba(245,158,11,0.3);
}

/* Estado recording: rojo pulsante */
body[data-maia-mic-ui-state="recording"] .start-voice {
  background: rgba(239,68,68,0.25) !important;
  box-shadow: 0 0 0 4px rgba(239,68,68,0.35);
  animation: recordingRing 1s ease-in-out infinite;
}

/* Estado speaking: Maia habla — púrpura suave */
body[data-maia-mic-ui-state="speaking"] .start-voice {
  background: rgba(129,140,248,0.18) !important;
  box-shadow: 0 0 0 4px rgba(129,140,248,0.25);
  animation: speakingRing 0.8s ease-in-out infinite;
}

/* Estado processing: morado quieto */
body[data-maia-mic-ui-state="processing"] .start-voice {
  background: rgba(99,102,241,0.2) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.3);
}

/* Estado thinking: Maia está procesando — pulso lento azul-violeta */
body[data-maia-mic-ui-state="thinking"] .start-voice {
  background: rgba(99,102,241,0.15) !important;
  box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
  animation: thinkingRing 1.8s ease-in-out infinite;
}

@keyframes thinkingRing {
  0%, 100% { box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
  50%       { box-shadow: 0 0 0 7px rgba(99,102,241,0.07); }
}

/* Estado error/denied */
body[data-maia-mic-ui-state="error"] .start-voice,
body[data-maia-mic-ui-state="denied"] .start-voice {
  opacity: 0.6;
}

@keyframes recordingRing {
  0%, 100% { box-shadow: 0 0 0 4px rgba(239,68,68,0.35); }
  50%       { box-shadow: 0 0 0 8px rgba(239,68,68,0.12); }
}

@keyframes speakingRing {
  0%, 100% { box-shadow: 0 0 0 4px rgba(129,140,248,0.25); }
  50%       { box-shadow: 0 0 0 8px rgba(129,140,248,0.08); }
}

/* ── Mobile: botón mic más grande en pantallas táctiles ──── */
@media (max-width: 768px) and (pointer: coarse) {
  .start-voice {
    width: 56px !important;
    height: 56px !important;
    border-radius: 50% !important;
  }
  .chat-controls {
    padding: 10px 12px;
  }
  /* Subtítulo más pequeño en mobile */
  #maia-subtitle {
    font-size: 13px !important;
    bottom: 76px !important;
    max-width: calc(100% - 24px) !important;
    padding: 6px 12px !important;
  }
}

/* ── Banner de micrófono — rediseño ──────────────────────── */
.mic-permission-banner {
  position: fixed;
  left: 50%;
  top: 16px;
  bottom: auto;
  transform: translateX(-50%);
  width: min(480px, calc(100% - 32px));
  padding: 13px 16px 13px 14px;
  border-radius: 14px;
  z-index: 9999;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  box-shadow: 0 16px 40px rgba(0,0,0,0.45);
  color: #f1f5f9;
  background: rgba(15, 23, 42, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255,255,255,0.1);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  /* entrada animada */
  animation: bannerIn 0.25s ease;
}

@keyframes bannerIn {
  from { opacity: 0; transform: translateX(-50%) translateY(-10px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

.mic-permission-banner::before {
  content: 'ℹ';
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 1px;
}

.mic-permission-banner[data-level="error"] {
  background: rgba(127, 29, 29, 0.95);
  border-color: rgba(239,68,68,0.3);
}
.mic-permission-banner[data-level="error"]::before { content: '⚠'; }

.mic-permission-banner[data-level="success"] {
  background: rgba(6, 78, 59, 0.95);
  border-color: rgba(16,185,129,0.3);
}
.mic-permission-banner[data-level="success"]::before { content: '✅'; }

/* ── Botón mic CTA — rediseño ────────────────────────────── */
.mic-cta-button {
  position: relative;
  border: 0;
  border-radius: 14px;
  padding: 13px 22px;
  min-width: 192px;
  height: auto;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  color: #fff;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  box-shadow: 0 10px 28px rgba(99,102,241,0.4);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
  animation: micCTAPulse 2.4s ease-in-out infinite;
  display: flex;
  align-items: center;
  gap: 8px;
}

.mic-cta-button::before {
  content: '🎙';
  font-size: 16px;
}

.mic-cta-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 16px 36px rgba(99,102,241,0.5);
}
.mic-cta-button.hidden { display: none; }
.mic-cta-button:disabled { opacity: 0.55; cursor: progress; animation: none; }

@keyframes micCTAPulse {
  0%, 100% { box-shadow: 0 10px 28px rgba(99,102,241,0.4); }
  50%       { box-shadow: 0 14px 36px rgba(139,92,246,0.55); }
}

/* ── Acciones del bubble ─────────────────────────────────── */
.bubble-action-button {
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 99px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  background: rgba(99,102,241,0.15);
  color: #e2e8f0;
  transition: background 0.15s, transform 0.1s;
}
.bubble-action-button:hover { background: rgba(99,102,241,0.3); transform: translateY(-1px); }

.bubble-action-button.secondary {
  background: rgba(255,255,255,0.08);
  color: #94a3b8;
}
.bubble-action-button.secondary:hover { background: rgba(255,255,255,0.14); color: #e2e8f0; }

/* ── Recording info – diseño mejorado ────────────────────── */
.recording-status-circle {
  height: 10px;
  width: 10px;
  border-radius: 50%;
  background-color: #ef4444;
  margin-right: 6px;
  animation: dotBlink 0.7s ease-in-out infinite;
}

/* ── Mobile: pill más abajo para no chocar con controles ─── */
@media (max-width: 480px) {
}

/* ── Ocultar error nativo de Pannellum (usamos overlays propios) ── */
.pnlm-error-msg,
.pnlm-load-box,
#panorama .pnlm-error-msg,
#panorama .pnlm-load-box {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* ── Streaming: burbuja activa de Maia visible incluso en chat cerrado ── */
/* En modo abierto: la burbuja streaming siempre visible */
.chat.open .realtor-text-bubble-wrapper.is-streaming {
  display: flex;
}
/* En modo cerrado: _syncFloatingBubbles() gestiona qué burbujas mostrar.
   El !important fue eliminado para que el inline style.display = 'none'
   funcione correctamente y evite la doble burbuja flotante (fix iter 130). */
.realtor-text-bubble-wrapper.is-streaming {
  display: flex;
}

.realtor-text-bubble-wrapper.is-streaming .text-bubble::after {
  content: '▋';
  display: inline-block;
  margin-left: 2px;
  animation: cursorBlink 0.7s step-end infinite;
  color: #818cf8;
  font-size: 0.9em;
}

/* Burbuja en modo streaming activo — cursor en la burbuja mientras Maia habla */
.text-bubble.maia-streaming {
  position: relative;
}
.text-bubble.maia-streaming::after {
  content: '▋';
  display: inline-block;
  margin-left: 2px;
  animation: cursorBlink 0.5s step-end infinite;
  color: #818cf8;
  font-size: 0.85em;
  vertical-align: middle;
}
/* Al finalizar (sin .maia-streaming) el cursor desaparece y el texto completo se ve limpio */
.text-bubble:not(.maia-streaming)::after {
  content: '';
  display: none;
}

@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0; }
}

/* ══════════════════════════════════════════════════════════════
   MEJORAS MOBILE TOUR — iteración 144
   Optimizaciones para portrait mode en smartphones
   ══════════════════════════════════════════════════════════════ */

/* Chat en mobile: ocupa full screen cuando está abierto */
@media (max-width: 768px) {
  .chat.open {
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-left: none !important;
  }

  /* Controles del chat más grandes para touch */
  .chat-controls {
    width: 100% !important;
    padding: 10px 14px 14px !important;
    gap: 10px !important;
  }

  .chat-input {
    font-size: 16px !important; /* Evita zoom automático de iOS */
    padding: 12px 14px !important;
  }

  /* Burbujas del chat con más espacio */
  .chat-bubbles {
    padding: 12px 10px !important;
  }

  .text-bubble {
    max-width: 88% !important;
    font-size: 14px !important;
    line-height: 1.5 !important;
  }

  /* Botón de voz más grande en mobile */
  .start-voice {
    min-width: 52px !important;
    min-height: 52px !important;
    flex-shrink: 0 !important;
  }

  /* Ocultar sidebar en mobile por defecto */
  .sidebar {
    transform: translateX(-100%) !important;
    z-index: 300 !important;
  }
  .sidebar.open {
    transform: translateX(0) !important;
  }

  /* Schedule popup más compacto */
  .schedule-popup {
    bottom: 60px !important;
    left: 50% !important;
    right: auto !important;
    transform: translateX(-50%) !important;
    width: min(340px, calc(100vw - 24px)) !important;
  }

  /* Subtítulo de Maia más compacto */
  #maia-subtitle {
    font-size: 13px !important;
    bottom: 68px !important;
    max-width: calc(100% - 20px) !important;
    padding: 5px 10px !important;
  }

  /* Flash de escena más pequeño */
  #scene-flash {
    font-size: 16px !important;
    padding: 8px 16px !important;
    top: 12px !important;
  }

  /* Ocultar texto largo de hotspots en mobile */
  .pnlm-hotspot-base .pnlm-hotspot-base__text {
    display: none !important;
  }
}

/* Portrait específico */
@media (max-width: 480px) and (orientation: portrait) {
  /* El viewer ocupa todo el viewport */
  #panorama {
    height: 100vh;   /* Fallback universal */
    height: 100svh;  /* Small viewport height — evita barra Chrome mobile */
  }

  /* Chat cerrado: icono más accesible */
  .chat:not(.open) .chat-toggle {
    bottom: 16px !important;
    right: 16px !important;
    width: 56px !important;
    height: 56px !important;
  }

  /* Welcome overlay centrado y compacto */
  .welcome-overlay {
    padding: 20px 16px !important;
  }

  .overlay-body-text {
    font-size: 14px !important;
  }
}

/* Landscape mobile: chat como panel lateral compacto */
@media (max-height: 500px) and (orientation: landscape) {
  .chat.open {
    width: 320px !important;
    left: auto !important;
    right: 0 !important;
    top: 0 !important;
    height: 100% !important;
  }

  .chat-bubbles {
    max-height: calc(100vh - 120px) !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE MULTI-DISPOSITIVO — Tour Virtual
   Cobertura: iPhone/Android · Tablet · Laptop · SmartTV/4K
   ══════════════════════════════════════════════════════════════ */

/* ── Tablet portrait (768–1024px) ───────────────────────────── */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Sidebar visible pero reducida */
  .sidebar {
    width: 200px !important;
  }

  /* Chat como panel lateral, 40% del viewport */
  .chat.open {
    width: 42vw !important;
    min-width: 300px !important;
    max-width: 420px !important;
  }

  /* Subtítulo más legible */
  #maia-subtitle {
    font-size: 14px !important;
    max-width: 60vw !important;
  }

  /* Hotspots con texto visible */
  .pnlm-hotspot-base .pnlm-hotspot-base__text {
    font-size: 12px !important;
  }

  /* Botón de agenda */
  .schedule-btn {
    bottom: 24px !important;
    right: 24px !important;
  }
}

/* ── Laptop / desktop estándar (1024–1920px) — base, sin overrides necesarios ─ */

/* ── SmartTV / pantallas grandes (≥1921px) ──────────────────── */
@media (min-width: 1921px) {
  /* El panorama ya ocupa 100vw×100vh; solo ajustar UI elements */

  /* Sidebar más ancha y fuente más grande */
  .sidebar {
    width: 280px !important;
    font-size: 16px !important;
  }

  /* Botón de voz — mucho más grande para ver desde el sofá */
  .start-voice {
    width: 72px !important;
    height: 72px !important;
    font-size: 28px !important;
  }

  /* Chat panel más ancho */
  .chat.open {
    width: 520px !important;
  }

  .text-bubble {
    font-size: 17px !important;
    line-height: 1.6 !important;
  }

  /* Subtítulo legible a distancia */
  #maia-subtitle {
    font-size: 18px !important;
    padding: 10px 24px !important;
    bottom: 80px !important;
  }

  /* Hotspots más grandes */
  .pnlm-hotspot-base {
    width: 36px !important;
    height: 36px !important;
  }

  .pnlm-hotspot-base .pnlm-hotspot-base__text {
    font-size: 15px !important;
    padding: 8px 14px !important;
  }

  /* Flash de escena */
  #scene-flash {
    font-size: 24px !important;
    padding: 14px 28px !important;
  }

  /* Schedule popup */
  .schedule-popup {
    width: 420px !important;
  }

  /* Welcome overlay */
  .welcome-overlay {
    padding: 48px 56px !important;
  }

  .overlay-title {
    font-size: 32px !important;
  }

  .overlay-body-text {
    font-size: 18px !important;
  }

  /* Botón de agendar visita */
  .schedule-btn {
    width: 72px !important;
    height: 72px !important;
    bottom: 28px !important;
    right: 28px !important;
    font-size: 28px !important;
  }
}

/* ── 4K (≥2560px) ────────────────────────────────────────────── */
@media (min-width: 2560px) {
  .start-voice {
    width: 88px !important;
    height: 88px !important;
    font-size: 34px !important;
  }

  .text-bubble {
    font-size: 20px !important;
  }

  #maia-subtitle {
    font-size: 22px !important;
    bottom: 100px !important;
  }

  .sidebar {
    width: 320px !important;
    font-size: 18px !important;
  }

  .chat.open {
    width: 600px !important;
  }
}

/* ── Touch navigation: deshabilitar hover effects en dispositivos táctiles ── */
@media (hover: none) and (pointer: coarse) {
  /* Los hotspots no necesitan hover en touch — tap directo */
  .pnlm-hotspot-base:hover .pnlm-hotspot-base__text {
    opacity: 1 !important;
  }

  /* Botones con área de toque mínima de 44×44px (WCAG 2.1) */
  .start-voice,
  .schedule-btn,
  .chat-btn,
  .lang-btn {
    min-width: 44px !important;
    min-height: 44px !important;
  }
}

/* ── Feedback buttons en burbujas de Maia ──────────────────────────────────── */
.maia-feedback-row {
  display: flex;
  gap: 4px;
  margin-top: 6px;
  opacity: 0;
  transition: opacity .2s;
}
.realtor-text-bubble-wrapper:hover .maia-feedback-row,
.maia-feedback-row[data-voted] {
  opacity: 1 !important;
}

/* Touch devices: siempre visible (no hay hover) */
@media (hover: none) {
  .maia-feedback-row {
    opacity: 0.65 !important;
  }
}
.maia-fb-btn {
  background: none;
  border: 1px solid rgba(255,255,255,.15);
  color: inherit;
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 13px;
  transition: background .15s, border-color .15s;
  line-height: 1.4;
}
.maia-fb-btn:hover:not(:disabled) {
  border-color: rgba(255,255,255,.35);
  background: rgba(255,255,255,.08);
}
.maia-fb-btn:disabled { cursor: default; }

/* ── Prefers-reduced-motion: respetar preferencias de accesibilidad ────────── */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration:        0.01ms !important;
    animation-iteration-count: 1      !important;
    transition-duration:       0.01ms !important;
    scroll-behavior:           auto   !important;
  }

  /* Mantener el pulse de hotspots pero a velocidad reducida */
  .custom-hotspot {
    animation: none !important;
  }
}

/* ── High contrast: mejorar legibilidad en displays de bajo contraste ──────── */
@media (prefers-contrast: high) {
  :root {
    --sidebar-bg: #000;
    --sidebar-text: #fff;
  }
  .custom-hotspot {
    border: 3px solid #fff !important;
    background: rgba(0,0,0,.8) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   SAFE AREA INSET — iPhone notch / Dynamic Island / Android cutout
   ═══════════════════════════════════════════════════════════════ */
@supports (padding: env(safe-area-inset-bottom)) {
  /* Sidebar: espacio extra en bottom para gesture bar iOS */
  .sidebar {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  /* Chat: no tapar el input por la barra de gestos */
  .chat-controls,
  .mic-bar,
  .voice-controls {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
    margin-bottom:  env(safe-area-inset-bottom);
  }

  /* Tool buttons: respetar el notch lateral en landscape */
  .tool-button {
    right: max(12px, calc(env(safe-area-inset-right) + 12px));
  }

  /* Onboarding overlay: no cortar contenido en notch */
  .welcome-overlay {
    padding-top:    max(20px, env(safe-area-inset-top));
    padding-bottom: max(20px, env(safe-area-inset-bottom));
  }
}

/* ═══════════════════════════════════════════════════════════════
   ADMIN SAFE AREA — bottom nav en iPhone
   ═══════════════════════════════════════════════════════════════ */
@supports (padding: env(safe-area-inset-bottom)) {
  .mobile-bottom-nav {
    padding-bottom: max(8px, env(safe-area-inset-bottom));
  }
  @media (max-width: 768px) {
    .main-content,
    .main {
      padding-bottom: max(72px, calc(64px + env(safe-area-inset-bottom))) !important;
    }
  }
}

/* ═══════════════════════════════════════════════════════════════
   TOUR CHAT — mejoras UX para móvil y tablet
   ═══════════════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  /* Chat más grande en móvil — ocupa más espacio para leer bien */
  .chat {
    width:      min(92vw, 380px) !important;
    max-height: 65vh              !important;
    font-size:  15px;
  }

  /* Burbujas de chat más legibles */
  .text-bubble {
    font-size: 14px;
    line-height: 1.55;
    padding: 10px 14px;
  }

  /* Área de input de texto más grande para touch */
  .chat-input,
  .chat textarea,
  input[type="text"].chat-text-input {
    font-size: 16px !important; /* iOS no zoom */
    min-height: 44px;
    padding: 10px 14px;
  }

  /* Botón de micrófono más grande */
  .mic-button,
  #mic-btn,
  .voice-button {
    min-width:  52px !important;
    min-height: 52px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TOUR CHAT — tablet (769px - 1024px)
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 769px) and (max-width: 1024px) {
  .chat {
    width: min(60vw, 420px) !important;
  }
}

/* ═══════════════════════════════════════════════════════════════
   TOUR SIDEBAR — tablet portrait
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 600px) and (max-width: 900px) and (orientation: portrait) {
  .sidebar {
    width: min(65vw, 260px);
  }
}

/* ══════════════════════════════════════════════════════════════
   SMART TV MODE — navegación D-pad + QR overlay
   Activado cuando body.tv-mode existe (inyectado por TvModeManager)
   ══════════════════════════════════════════════════════════════ */

/* Hotspot enfocado con D-pad: ring blanco grueso bien visible */
.tv-mode .pnlm-hotspot-base.tv-focused {
  outline: 4px solid #fff !important;
  outline-offset: 6px !important;
  box-shadow: 0 0 0 8px rgba(255,255,255,0.2), 0 0 30px rgba(255,255,255,0.3) !important;
  animation: tv-focus-pulse 1s ease-in-out infinite !important;
  z-index: 9999 !important;
}
.tv-mode .cross-catalog-portal.tv-focused {
  outline: 4px solid #fff !important;
  outline-offset: 4px !important;
  transform: scale(1.12) !important;
}
@keyframes tv-focus-pulse {
  0%,100% { box-shadow: 0 0 0 6px rgba(255,255,255,.2), 0 0 24px rgba(255,255,255,.25); }
  50%      { box-shadow: 0 0 0 10px rgba(255,255,255,.1), 0 0 36px rgba(255,255,255,.4); }
}

/* Nombre del hotspot enfocado — aparece en la parte inferior */
.tv-hotspot-name {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: rgba(10,22,40,0.92);
  color: #f1f5f9;
  font-size: 22px;
  font-weight: 700;
  padding: 10px 28px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 10000;
  white-space: nowrap;
}
.tv-hotspot-name.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* D-pad hint — aparece al entrar en TV mode */
.tv-dpad-hint {
  position: fixed;
  top: 20px;
  bottom: auto;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(10,22,40,0.88);
  color: #94a3b8;
  font-size: 15px;
  font-weight: 500;
  padding: 10px 24px;
  border-radius: 40px;
  border: 1px solid rgba(255,255,255,0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 10001;
  transition: opacity 0.6s ease;
  pointer-events: none;
  white-space: nowrap;
}
.tv-dpad-hint.tv-hint-out { opacity: 0; }
.tv-hint-sep { color: rgba(255,255,255,0.2); }
kbd {
  display: inline-block;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  padding: 1px 7px;
  font-size: 13px;
  font-family: inherit;
  color: #f1f5f9;
  margin: 0 3px;
}

/* QR overlay — chat en celular */
.tv-qr-overlay {
  position: fixed;
  bottom: 32px;
  right: 32px;
  background: rgba(10,22,40,0.95);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  padding: 24px 28px;
  z-index: 10002;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  min-width: 220px;
  transition: opacity 0.3s ease;
}
.tv-qr-overlay.tv-qr-hidden { opacity: 0; pointer-events: none; }
.tv-qr-close {
  position: fixed;
  top: 10px; right: 14px;
  background: none;
  border: none;
  color: rgba(255,255,255,0.4);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
}
.tv-qr-close:hover { color: #fff; }
.tv-qr-body { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.tv-qr-icon { font-size: 28px; line-height: 1; }
.tv-qr-title {
  color: #f1f5f9;
  font-size: 15px;
  font-weight: 700;
  max-width: 180px;
  line-height: 1.3;
}
.tv-qr-sub {
  color: #64748b;
  font-size: 12px;
}
.tv-qr-canvas {
  background: rgba(241,245,249,0.06);
  border-radius: 10px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 160px;
  min-height: 160px;
}
.tv-qr-canvas img,
.tv-qr-canvas canvas { border-radius: 6px; }
.tv-qr-url {
  color: #475569;
  font-size: 11px;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  word-break: break-all;
}

/* En TV mode: agrandar botones de la UI del tour para control remoto */
.tv-mode .tool-button {
  width: 64px !important;
  height: 64px !important;
  font-size: 26px !important;
}
.tv-mode .tool-button:focus-visible {
  outline: 4px solid #fff !important;
  outline-offset: 4px !important;
}
.tv-mode .sidebar .nav-item a,
.tv-mode .scene-link {
  padding: 16px 22px !important;
  font-size: 18px !important;
}
.tv-mode .sidebar .nav-item a:focus-visible,
.tv-mode .scene-link:focus-visible {
  outline: 3px solid #fff !important;
  outline-offset: 2px !important;
  background: rgba(255,255,255,0.08) !important;
}

/* ══════════════════════════════════════════════════════════════
   SAFE AREA INSETS — notch, Dynamic Island, punch-hole cams
   Usa env() CSS para respetar el área segura en iOS y Android
   ══════════════════════════════════════════════════════════════ */
:root {
  --sat: env(safe-area-inset-top,    0px);
  --sar: env(safe-area-inset-right,  0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left,   0px);
}
/* Sidebar izquierda — respetar notch lateral en landscape */
.sidebar {
  padding-left:  max(16px, var(--sal)) !important;
  padding-bottom: max(8px,  var(--sab)) !important;
}
/* Bottom nav mobile — respetar home indicator */
.mobile-bottom-nav {
  padding-bottom: var(--sab) !important;
}
/* Tour viewer — fullscreen sin recortar nada */
@media (max-width: 768px) {
  .pano-wrapper, #panorama, .pnlm-container {
    padding-top:    var(--sat);
    padding-bottom: var(--sab);
  }
  /* Botones derecha del tour — respetar borde derecho en landscape */
  .tool-buttons-right {
    right: max(12px, var(--sar)) !important;
  }
  /* Subtítulo de Maia — sobre el home indicator */
  #maia-subtitle {
    bottom: max(70px, calc(60px + var(--sab))) !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   PHABLET (481–767px) — teléfonos grandes, phablets
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 481px) and (max-width: 767px) {
  /* Sidebar como overlay: no ocupa espacio, slide-in */
  .sidebar {
    position: fixed !important;
    left: -100% !important;
    top: 0; bottom: 0;
    width: min(280px, 80vw) !important;
    z-index: 1000;
    transition: left 0.28s ease;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open { left: 0 !important; }
  .sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
  }
  .sidebar-backdrop.visible { display: block; }

  /* Chat ocupa ancho completo */
  .chat.open {
    width: 100vw !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 20px 20px 0 0 !important;
    bottom: 0 !important;
  }
  /* Maia subtitle más pequeño */
  #maia-subtitle {
    font-size: 12px !important;
    padding: 6px 14px !important;
  }
}

/* ══════════════════════════════════════════════════════════════
   PLANO DE PLANTA — overlay interactivo del tour público
   ══════════════════════════════════════════════════════════════ */

.fp-widget {
  position: fixed;
  z-index: 400;
  width: 180px;
  background: rgba(10, 20, 35, 0.92);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: width 0.25s ease, height 0.25s ease, opacity 0.2s ease;
  user-select: none;
}

/* Posiciones */
.fp-widget-bottom-left  { bottom: 80px; left: 16px; }
.fp-widget-bottom-right { bottom: 80px; right: 72px; }
.fp-widget-top-left     { top: 80px;    left: 16px; }
.fp-widget-top-right    { top: 80px;    right: 72px; }

/* Oculto / visible */
.fp-widget-hidden { opacity: 0; pointer-events: none; }

/* Colapsado: solo muestra el botón toggle */
.fp-widget.fp-collapsed { width: 40px; }
.fp-widget.fp-collapsed .fp-panel { display: none; }

/* Botón toggle */
.fp-toggle-btn {
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(255,255,255,0.08);
  color: #f1f5f9;
  font-size: 14px;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  overflow: hidden;
}
.fp-toggle-btn::after {
  content: 'Plano';
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.04em;
}
.fp-widget.fp-collapsed .fp-toggle-btn { justify-content: center; }
.fp-widget.fp-collapsed .fp-toggle-btn::after { display: none; }
.fp-toggle-btn:hover { background: rgba(255,255,255,0.05); }

/* Panel del plano */
.fp-panel {
  position: relative;
  width: 100%;
  padding: 8px;
}

/* Imagen del plano */
.fp-image {
  width: 100%;
  display: block;
  border-radius: 8px;
  opacity: 0.85;
  pointer-events: none;
}

/* Capa de dots sobre la imagen */
.fp-dots-layer {
  position: fixed;
  inset: 8px;
  pointer-events: none;
}

/* Dot individual por espacio */
.fp-dot {
  position: fixed;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--dot-color, #6366f1);
  border: 2px solid rgba(255,255,255,0.8);
  transform: translate(-50%, -50%);
  cursor: pointer;
  pointer-events: all;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}
.fp-dot:hover {
  transform: translate(-50%, -50%) scale(1.35);
  box-shadow: 0 2px 10px rgba(0,0,0,0.5);
  z-index: 2;
}
.fp-dot:hover .fp-dot-label { opacity: 1; transform: translateX(-50%) translateY(-2px); }

/* Dot activo (espacio actual) */
.fp-dot-active {
  width: 18px;
  height: 18px;
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255,255,255,0.3), 0 2px 8px rgba(0,0,0,0.4);
  animation: fp-dot-pulse 2s ease-in-out infinite;
  z-index: 1;
}
@keyframes fp-dot-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(255,255,255,0.3), 0 2px 8px rgba(0,0,0,0.4); }
  50%       { box-shadow: 0 0 0 6px rgba(255,255,255,0.12), 0 2px 12px rgba(0,0,0,0.5); }
}

/* Etiqueta del dot (tooltip) */
.fp-dot-label {
  position: fixed;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: rgba(10,20,35,0.95);
  color: #f1f5f9;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 5px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

/* Mobile: widget más pequeño */
@media (max-width: 480px) {
  .fp-widget { width: 140px; }
  .fp-widget-bottom-left  { bottom: 70px; left: 10px; }
  .fp-widget-bottom-right { bottom: 70px; right: 60px; }
}

/* TV mode: widget más grande */
.tv-mode .fp-widget { width: 260px; }
.tv-mode .fp-dot    { width: 20px; height: 20px; }
.tv-mode .fp-dot-active { width: 26px; height: 26px; }

/* ══════════════════════════════════════════════════════════════
   EDGE INDICATORS — indicadores de dirección para hotspots
   fuera del campo visual (inspirado en Google Street View)
   ══════════════════════════════════════════════════════════════ */

.hs-edge-indicator {
  position: fixed;
  z-index: 300;
  display: none;           /* oculto por defecto — JS lo muestra */
  align-items: center;
  gap: 5px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 20px;
  padding: 5px 10px 5px 6px;
  cursor: pointer;
  user-select: none;
  pointer-events: all;
  transition: opacity 0.2s ease, transform 0.15s ease;
  max-width: 140px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  /* Iniciar invisible para fade-in */
  opacity: 0;
}

.hs-edge-indicator.hs-edge-visible {
  display: flex;
  opacity: 1;
}

.hs-edge-indicator:hover {
  background: rgba(99, 102, 241, 0.85);
  border-color: rgba(255,255,255,0.4);
  transform: scale(1.06);
}

/* Flecha que apunta hacia el hotspot */
.hs-edge-arrow {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 11px;
  /* Rotación controlada por CSS var desde JS */
  transform: rotate(var(--arrow-rotate, 0deg));
  transition: transform 0.1s linear;
}

/* Label del destino */
.hs-edge-label {
  color: #f1f5f9;
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.02em;
}

/* Cross-catalog portal: color naranja para diferenciarse */
.hs-edge-indicator.hs-edge-tour {
  background: rgba(234, 88, 12, 0.85);
  border-color: rgba(255,150,50,0.4);
}
.hs-edge-indicator.hs-edge-tour:hover {
  background: rgba(234, 88, 12, 1);
}

/* ═══════════════════════════════════════════════════════════════════════════
   v1.16.0 Sprint 10.37 — Tour visitor UX
   - Typing indicator "Maia está escribiendo..." (3 dots animados staggered)
   - Timestamps por burbuja (hover-to-reveal + sticky en gap >=5min)
   - Tooltips custom para los .tool-button de la barra derecha (left-anchored)
   - Minimap "estás aquí" más grande
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Typing indicator (3 dots) ─────────────────────────────────────────────
   Estándar de chat moderno: WhatsApp/iMessage/Slack. Patrón staggered con
   un keyframe único y delays escalonados — más liviano que 3 keyframes. */
.maia-typing-bubble {
  display: inline-flex !important;
  align-items: center;
  gap: 6px;
  padding: 12px 16px !important;
  min-width: 0 !important;
  width: fit-content !important;
}
.maia-typing-bubble .typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.45;
  animation: maia-typing-bounce 1.2s ease-in-out infinite;
  display: inline-block;
}
.maia-typing-bubble .typing-dot:nth-child(2) { animation-delay: 0.18s; }
.maia-typing-bubble .typing-dot:nth-child(3) { animation-delay: 0.36s; }

@keyframes maia-typing-bounce {
  0%, 60%, 100% { transform: translateY(0);    opacity: 0.35; }
  30%           { transform: translateY(-4px); opacity: 0.85; }
}
@media (prefers-reduced-motion: reduce) {
  .maia-typing-bubble .typing-dot {
    animation: maia-typing-fade 1.8s ease-in-out infinite;
  }
  @keyframes maia-typing-fade {
    0%, 100% { opacity: 0.3; }
    50%      { opacity: 0.85; }
  }
}

/* ── Bubble timestamps ────────────────────────────────────────────────────
   Hover-to-reveal por default. Cuando hay gap >=5min, sticky (always-on)
   para anchored time reference en conversaciones largas — patrón estándar
   en clientes de chat modernos. */
.bubble-timestamp {
  font-size: 10px;
  color: rgba(255,255,255,0.35);
  margin: 2px 6px 4px;
  align-self: flex-end;
  opacity: 0;
  transition: opacity 0.18s ease-out;
  user-select: none;
  pointer-events: none;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.user-text-bubble-wrapper .bubble-timestamp { align-self: flex-end; }
.realtor-text-bubble-wrapper .bubble-timestamp { align-self: flex-start; margin-left: 60px; }
.user-text-bubble-wrapper:hover .bubble-timestamp,
.realtor-text-bubble-wrapper:hover .bubble-timestamp,
.bubble-timestamp.gap-marker { opacity: 1; }

/* ── Tooltips para .tool-button (barra derecha del tour) ──────────────────
   Best-practice UX: aparecen tras 300ms hover/focus, animados, posicionados
   a la izquierda del botón (porque la barra está pegada al borde derecho).
   Usan el aria-label que ya tienen los botones — sin duplicar texto en HTML.
   Accesibles: keyboard focus también dispara el tooltip.

   v1.16.0 Sprint 10.39 HOTFIX: REMOVIDO `.tool-button { position: relative }`
   que se había agregado en el 10.37 — sobrescribía el `position: fixed`
   original (línea ~626) y hacía que los botones perdieran su anchor al
   viewport, quedando invisibles dentro del flujo del documento.
   Los ::after / ::before con position:absolute se anclan correctamente al
   `position: fixed` original (fixed cuenta como "positioned"). */
.tool-button[aria-label]::after {
  content: attr(aria-label);
  position: absolute;
  right: calc(100% + 10px);
  top: 50%;
  transform: translateY(-50%) translateX(4px);
  background: rgba(15, 23, 42, 0.94);
  color: #f1f5f9;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease-out 0s, transform 0.15s ease-out 0s;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
  border: 1px solid rgba(255,255,255,0.08);
  letter-spacing: 0.01em;
  max-width: 240px;
}
.tool-button[aria-label]::before {
  content: '';
  position: absolute;
  right: calc(100% + 4px);
  top: 50%;
  transform: translateY(-50%);
  width: 0; height: 0;
  border-left: 6px solid rgba(15, 23, 42, 0.94);
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  opacity: 0;
  transition: opacity 0.15s ease-out;
  pointer-events: none;
}
.tool-button:hover[aria-label]::after,
.tool-button:focus-visible[aria-label]::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
  transition-delay: 0.3s;
}
.tool-button:hover[aria-label]::before,
.tool-button:focus-visible[aria-label]::before {
  opacity: 1;
  transition-delay: 0.3s;
}
/* Si el botón está hidden, NO mostrar tooltip */
.tool-button.hidden::after,
.tool-button.hidden::before { display: none !important; }

@media (max-width: 640px) {
  /* En mobile, no mostrar tooltips — el espacio es premium y el aria-label
     ya está disponible para screen readers / accesibilidad. */
  .tool-button[aria-label]::after,
  .tool-button[aria-label]::before { display: none; }
}

/* ── Minimap: padding interno + label más grande ──────────────────────────
   El viewBox del SVG se aumentó en _tour.js (200×120 → 240×180) y se
   reescalaron nodos/fuentes. Acá ajustamos solo el chrome del contenedor
   para que tenga aire suficiente con el SVG más grande. */
#tour-minimap {
  padding: 12px 14px 10px !important;
}
#tour-minimap > div:first-child {
  font-size: 10px !important;
  color: rgba(255,255,255,0.4) !important;
  margin-bottom: 8px !important;
}

/* ═══════════════════════════════════════════════════════════════════════════
   v1.16.0 Sprint 10.38 — Tour visitor UX (parte 2)
   - Listening indicator (5 wave bars animadas durante grabación de voz)
   - Focus styles fuertes en .tool-button (outline accent visible)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Listening indicator (5 wave bars) ────────────────────────────────────
   Equivalente al typing indicator pero del lado del usuario. Patrón estándar
   de apps de chat de voz (Discord, Telegram, iOS Voice Memos): barras
   verticales pulsando en alturas distintas con phase offsets. Mantengo el
   layout en .user-text-bubble-wrapper para que se alinee a la derecha. */
.maia-listening-bubble {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 10px 14px !important;
  min-width: 0 !important;
  width: fit-content !important;
}
.listening-wave {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  height: 18px;
}
.listening-wave .wave-bar {
  display: inline-block;
  width: 3px;
  height: 6px;
  background: currentColor;
  border-radius: 2px;
  opacity: 0.85;
  animation: maia-listen-wave 1s ease-in-out infinite;
  transform-origin: center;
}
.listening-wave .wave-bar:nth-child(1) { animation-delay: 0s;    }
.listening-wave .wave-bar:nth-child(2) { animation-delay: 0.12s; }
.listening-wave .wave-bar:nth-child(3) { animation-delay: 0.24s; }
.listening-wave .wave-bar:nth-child(4) { animation-delay: 0.36s; }
.listening-wave .wave-bar:nth-child(5) { animation-delay: 0.48s; }

@keyframes maia-listen-wave {
  0%, 100% { transform: scaleY(0.4);  opacity: 0.45; }
  50%      { transform: scaleY(2.6);  opacity: 1; }
}

.listening-label {
  font-size: 11px;
  opacity: 0.7;
  letter-spacing: 0.02em;
  font-style: italic;
}

@media (prefers-reduced-motion: reduce) {
  /* Sin scaling animation: solo fade pulse para evitar marear */
  .listening-wave .wave-bar {
    animation: maia-listen-fade 1.4s ease-in-out infinite;
    transform: scaleY(1.3);
  }
  @keyframes maia-listen-fade {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 1;   }
  }
}

/* ── Focus styles fuertes en .tool-button ─────────────────────────────────
   Antes los browsers (especialmente Chrome) ponían su outline default azul
   genérico, feo y a veces invisible sobre el fondo del tour. Ahora un ring
   accent purple visible + offset para que no toque el botón. Solo aplica
   con keyboard focus (focus-visible), no con click — best practice
   accesibilidad sin ruido visual al usuario de mouse. */
.tool-button:focus { outline: none; }
.tool-button:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 3px;
  border-radius: 50%;
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
}

/* También para los botones del composer (send, voice, etc) si los hay */
.action-button:focus { outline: none; }
.action-button:focus-visible {
  outline: 2px solid var(--accent, #6366f1);
  outline-offset: 2px;
}
