/* Asiatrip · base de todas las pantallas. Colores y letras de asiatrip.co.uk. */
@font-face { font-family: "Jost"; font-style: normal; font-weight: 300 700; font-display: swap; src: url("/fuentes/jost.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: normal; font-weight: 500 600; font-display: swap; src: url("/fuentes/cormorant.woff2") format("woff2"); }
@font-face { font-family: "Cormorant Garamond"; font-style: italic; font-weight: 500; font-display: swap; src: url("/fuentes/cormorant-italica.woff2") format("woff2"); }

:root {
  --rojo: #cc0000;
  --rojo-oscuro: #a30000;
  --rojo-claro: #fff0f0;
  --rojo-borde: #f3cfcf;
  --tinta: #1e1e1e;
  --tinta-2: #4a4a4a;
  --suave: #6a6a6a;
  --tenue: #8f8f8f;
  --linea: #e2e2e2;
  --linea-suave: #ededed;
  --fondo: #f4f4f4;
  --fondo-2: #fafafa;
  --tarjeta: #ffffff;
  --lateral: #171717;
  --verde: #1d7348;
  --verde-claro: #e7f3ec;
  --ambar: #8f5400;
  --ambar-claro: #fff3de;
  --ambar-borde: #f2d6a6;
  --sombra: 0 1px 2px rgb(30 30 30 / 5%), 0 2px 6px rgb(30 30 30 / 4%);
  --sombra-alta: 0 14px 36px rgb(30 30 30 / 16%), 0 2px 6px rgb(30 30 30 / 6%);
  --radio: 14px;
  --fuente: "Jost", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
  --ancho-lateral: 236px;
  --ola: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cg fill='none' stroke='%231e1e1e' stroke-opacity='.05'%3E%3Cpath d='M0 24a24 24 0 0 1 48 0M7 24a17 17 0 0 1 34 0M14 24a10 10 0 0 1 20 0M-24 12a24 24 0 0 1 48 0M-17 12a17 17 0 0 1 34 0M-10 12a10 10 0 0 1 20 0M24 12a24 24 0 0 1 48 0M31 12a17 17 0 0 1 34 0M38 12a10 10 0 0 1 20 0'/%3E%3C/g%3E%3C/svg%3E");
  --ola-clara: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='24' viewBox='0 0 48 24'%3E%3Cg fill='none' stroke='%23ffffff' stroke-opacity='.07'%3E%3Cpath d='M0 24a24 24 0 0 1 48 0M7 24a17 17 0 0 1 34 0M14 24a10 10 0 0 1 20 0M-24 12a24 24 0 0 1 48 0M-17 12a17 17 0 0 1 34 0M-10 12a10 10 0 0 1 20 0M24 12a24 24 0 0 1 48 0M31 12a17 17 0 0 1 34 0M38 12a10 10 0 0 1 20 0'/%3E%3C/g%3E%3C/svg%3E");
  --flecha: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%236a6a6a' stroke-width='2.5' d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 15px/1.5 var(--fuente); color: var(--tinta); background: var(--fondo); -webkit-font-smoothing: antialiased; }
button { font: inherit; cursor: pointer; color: inherit; }
input, select, textarea { font-family: var(--fuente); color: var(--tinta); }
button:focus-visible, a:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--rojo); outline-offset: 2px; }
[hidden] { display: none !important; }
ul, ol { list-style: none; margin: 0; padding: 0; }
p { margin: 0; }
a { color: var(--rojo); }
::selection { background: rgb(204 0 0 / 16%); }

/* ---------- Botones y piezas comunes ---------- */
.boton { display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid var(--linea); background: var(--tarjeta); color: var(--tinta); border-radius: 999px; padding: 8px 16px; font-weight: 500; font-size: 14px; line-height: 1.3; transition: border-color .15s, color .15s, background .15s, box-shadow .15s; white-space: nowrap; text-decoration: none; }
.boton:hover:not(:disabled) { border-color: var(--tinta); }
.boton.primario { background: var(--rojo); border-color: var(--rojo); color: #fff; box-shadow: 0 2px 8px rgb(204 0 0 / 22%); }
.boton.primario:hover:not(:disabled) { background: var(--rojo-oscuro); border-color: var(--rojo-oscuro); color: #fff; }
.boton.primario:disabled { background: #dba6a6; border-color: #dba6a6; color: #fff; box-shadow: none; opacity: 1; }
.boton:disabled { opacity: .55; cursor: not-allowed; }
.boton svg { flex: none; }
.enlace { background: none; border: 0; color: var(--rojo); padding: 4px 6px; font-weight: 500; text-decoration: none; }
.enlace:hover { color: var(--rojo-oscuro); text-decoration: underline; text-underline-offset: 3px; }
.boton-chico { padding: 6px 12px; font-size: 13px; }
.enlace-chico { font-size: 13px; padding: 2px 0; text-align: left; }
.titulo-chico { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--tenue); }
.suave { color: var(--suave); font-size: 13px; }
.pequena { font-size: 12.5px; line-height: 1.45; text-wrap: pretty; }
.icono { background: none; border: 0; color: var(--suave); padding: 7px; line-height: 0; border-radius: 10px; transition: background .15s, color .15s; }
.icono:hover:not(:disabled) { background: var(--fondo); color: var(--rojo); }
.icono:disabled { opacity: .35; cursor: not-allowed; }

.pastilla { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; border-radius: 999px; font-size: 12px; font-weight: 500; white-space: nowrap; line-height: 1.35; }
.pastilla::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
.pastilla:empty { display: none; }
.pastilla.demo { background: var(--ambar-claro); color: var(--ambar); }
.pastilla.real { background: var(--verde-claro); color: var(--verde); }
.pastilla.neutra { background: var(--fondo); color: var(--tinta-2); }
.pastilla.ejecutiva { background: var(--rojo-claro); color: var(--rojo-oscuro); }
.pastilla.automatico { background: var(--verde-claro); color: var(--verde); }
.pastilla.apagado { background: var(--rojo); color: #fff; }

.etq { display: inline-flex; align-items: center; font-size: 11.5px; font-weight: 500; border-radius: 6px; padding: 1px 8px; line-height: 1.6; white-space: nowrap; }
.etq.quiere_comprar { background: var(--rojo); color: #fff; }
.etq.interesado { background: var(--rojo-claro); color: var(--rojo-oscuro); box-shadow: inset 0 0 0 1px var(--rojo-borde); }
.etq.curioso { background: var(--fondo); color: var(--tinta-2); }
.etq.libre { background: var(--tarjeta); color: var(--tinta-2); box-shadow: inset 0 0 0 1px var(--linea); }
.etq.urgente { background: var(--ambar-claro); color: var(--ambar); box-shadow: inset 0 0 0 1px var(--ambar-borde); }
.etq.reservo { background: var(--verde-claro); color: var(--verde); }
.etq.espera { background: var(--ambar-claro); color: var(--ambar); }
.etq.neutra { background: var(--fondo); color: var(--tinta-2); }

.avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-size: 14px; font-weight: 600; letter-spacing: .02em; background: #ececec; color: var(--tinta); text-transform: uppercase; }
.avatar.quiere_comprar { background: var(--rojo); color: #fff; }
.avatar.interesado { background: var(--rojo-claro); color: var(--rojo-oscuro); box-shadow: inset 0 0 0 1px var(--rojo-borde); }
.avatar-grande { width: 44px; height: 44px; font-size: 15px; }

/* ---------- La estructura: menú lateral + contenido ---------- */
.app-shell { display: grid; grid-template-columns: var(--ancho-lateral) minmax(0, 1fr); min-height: 100%; }
.app-contenido { min-width: 0; }

.lateral { position: sticky; top: 0; height: 100vh; background: var(--lateral); color: #fff; display: flex; flex-direction: column; padding: 18px 14px 16px; gap: 24px; z-index: 20; overflow-y: auto; scrollbar-width: none; }
.lateral::after { content: ""; position: absolute; inset: auto 0 0 0; height: 200px; pointer-events: none; background: var(--ola-clara); -webkit-mask: linear-gradient(transparent, #000); mask: linear-gradient(transparent, #000); }
.lateral > * { position: relative; z-index: 1; }
.lateral-marca { display: flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; padding: 2px 4px; }
.lateral-logo { width: 46px; height: 46px; border-radius: 50%; background: #fff; object-fit: cover; flex: none; box-shadow: 0 0 0 3px rgb(255 255 255 / 8%); }
.lateral-nombre { display: grid; line-height: 1.1; min-width: 0; }
.lateral-nombre strong { font-family: var(--serif); font-size: 26px; font-weight: 600; letter-spacing: .01em; }
.lateral-nombre small { font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase; color: rgb(255 255 255 / 55%); margin-top: 2px; }

.menu-principal { display: grid; gap: 3px; }
.menu-titulo { font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: rgb(255 255 255 / 40%); padding: 0 12px 6px; }
.menu-principal a { position: relative; display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 11px; color: rgb(255 255 255 / 70%); font-weight: 400; font-size: 14.5px; text-decoration: none; white-space: nowrap; transition: background .15s, color .15s; }
.menu-principal a svg { flex: none; width: 20px; height: 20px; }
.menu-principal a:hover { background: rgb(255 255 255 / 6%); color: #fff; }
.menu-principal a[aria-current="page"] { background: rgb(255 255 255 / 9%); color: #fff; font-weight: 500; }
.menu-principal a[aria-current="page"]::before { content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rojo); }
.menu-principal a[aria-current="page"] svg { color: #ff5252; }

.lateral-pie { margin-top: auto; display: grid; gap: 8px; padding: 14px 4px 0; border-top: 1px solid rgb(255 255 255 / 9%); }
.lateral-pie .pastilla { justify-self: start; white-space: normal; }
.lateral-pie .pastilla.demo { background: rgb(255 186 0 / 14%); color: #ffcf66; }
.lateral-pie .pastilla.real { background: rgb(70 200 130 / 14%); color: #7ee2a8; }
.lateral-pie .pastilla.neutra { background: rgb(255 255 255 / 8%); color: rgb(255 255 255 / 78%); }
.lateral-pie .pastilla.apagado { background: var(--rojo); color: #fff; }
.enlace-lateral { background: none; border: 0; padding: 4px 0; text-align: left; color: rgb(255 255 255 / 70%); font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; justify-self: start; }
.enlace-lateral:hover { color: #fff; }

/* ---------- Encabezado de cada pantalla ---------- */
.antetitulo { display: block; font-size: 11px; font-weight: 500; letter-spacing: .2em; text-transform: uppercase; color: var(--rojo); margin-bottom: 4px; }

/* ---------- Conversaciones ---------- */
.pagina-panel { overflow: hidden; }
.pagina-panel .app-shell { height: 100%; }
.panel { height: 100vh; display: grid; grid-template: "lista hilo ficha" minmax(0, 1fr) / 320px minmax(0, 1fr) 300px; }

.lista { grid-area: lista; background: var(--tarjeta); border-right: 1px solid var(--linea); display: flex; flex-direction: column; min-height: 0; }
.lista-cabecera { padding: 20px 18px 2px; }
.lista-cabecera h1 { margin: 0; font-family: var(--serif); font-size: 32px; font-weight: 600; line-height: 1.05; }
.buscador { padding: 12px 16px 4px; position: relative; }
.buscador svg { position: absolute; left: 29px; top: calc(50% + 4px); translate: 0 -50%; color: var(--tenue); pointer-events: none; }
.buscador input { width: 100%; font-size: 14px; padding: 10px 12px 10px 38px; border: 1px solid transparent; border-radius: 12px; background: var(--fondo); transition: border-color .15s, background .15s; }
.buscador input:focus { background: var(--tarjeta); border-color: var(--linea); outline: none; box-shadow: 0 0 0 3px rgb(204 0 0 / 10%); }
.filtros { display: flex; gap: 2px; margin: 10px 16px 0; padding: 3px; background: var(--fondo); border-radius: 12px; }
.filtro { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: none; border: 0; border-radius: 9px; padding: 7px 4px; color: var(--suave); font-weight: 500; font-size: 13px; white-space: nowrap; transition: background .15s, color .15s; }
.filtro:hover { color: var(--tinta); }
.filtro.activo { background: var(--tarjeta); color: var(--tinta); box-shadow: var(--sombra); }
.filtros-etiqueta { display: flex; flex-wrap: wrap; gap: 6px; padding: 12px 16px 14px; border-bottom: 1px solid var(--linea-suave); }
.filtro-etiqueta { background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 999px; padding: 4px 11px; color: var(--tinta-2); font-weight: 400; font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; transition: border-color .15s, background .15s, color .15s; }
.filtro-etiqueta:hover { border-color: var(--tinta); color: var(--tinta); }
.filtro-etiqueta.activo { background: var(--tinta); border-color: var(--tinta); color: #fff; }
.cuenta { display: inline-block; background: var(--rojo); color: #fff; font-weight: 600; font-size: 11px; border-radius: 999px; padding: 0 7px; line-height: 19px; min-width: 19px; text-align: center; }

.conversaciones { overflow-y: auto; flex: 1; min-height: 0; padding: 6px 8px 12px; }
.conversaciones:empty { display: none; }
.conversacion { position: relative; width: 100%; text-align: left; background: none; border: 0; border-radius: 12px; padding: 12px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; transition: background .12s; }
.conversacion:hover { background: var(--fondo-2); }
.conversacion.activa { background: var(--rojo-claro); }
.conversacion.activa::before { content: ""; position: absolute; left: -8px; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rojo); }
.conversacion-texto { display: grid; gap: 4px; min-width: 0; }
.fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
.nombre { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; font-size: 14.5px; }
.hora { color: var(--tenue); font-size: 12px; white-space: nowrap; }
.vista { color: var(--suave); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; flex: 1; }
.fila-etiqueta { display: flex; flex-wrap: wrap; gap: 4px; }
.marca { font-size: 11.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.marca::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.marca.ejecutiva { color: var(--rojo); }
.marca.automatico { color: var(--verde); }
.viaje { font-size: 11.5px; color: var(--tenue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.vacio { padding: 24px 20px; color: var(--suave); text-wrap: pretty; font-size: 14px; }
.vacio.centrado { display: grid; place-items: center; align-content: center; gap: 12px; height: 100%; text-align: center; }
.vacio-ilustracion { width: 112px; height: 112px; border-radius: 50%; background: var(--tarjeta); display: grid; place-items: center; box-shadow: var(--sombra); }
.vacio-ilustracion img { width: 80px; height: 80px; border-radius: 50%; }
.vacio-titulo { font-family: var(--serif); font-size: 28px; font-weight: 600; color: var(--tinta); line-height: 1.1; }

.hilo { grid-area: hilo; min-width: 0; min-height: 0; background: #f6f5f3 var(--ola); }
.hilo-contenido { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.hilo-cabecera { display: flex; align-items: center; gap: 12px; padding: 12px 20px; background: var(--tarjeta); border-bottom: 1px solid var(--linea); min-height: 70px; }
.hilo-titulo { display: grid; min-width: 0; flex: 1; line-height: 1.3; }
.hilo-titulo strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; font-weight: 600; }
.hilo-titulo .suave { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.volver, .ver-ficha { display: none; }
/* Sin conversación abierta, el espacio de la ficha es del hilo. */
.panel:not(.con-hilo) .hilo { grid-column: 2 / -1; }

.linea { flex: 1; overflow-y: auto; min-height: 0; padding: 22px 6% 28px; display: flex; flex-direction: column; gap: 10px; }
.linea > * { flex: none; }
.burbuja { position: relative; max-width: min(74%, 560px); padding: 9px 14px 7px; border-radius: 16px; display: grid; gap: 3px; background: var(--tarjeta); box-shadow: 0 1px 1.5px rgb(30 30 30 / 10%); }
.burbuja.entrante { align-self: flex-start; border-top-left-radius: 5px; }
.burbuja.saliente { align-self: flex-end; border-top-right-radius: 5px; }
.burbuja.sistema { background: #fdfdfc; box-shadow: inset 0 0 0 1px var(--linea), 0 1px 1.5px rgb(30 30 30 / 6%); }
.burbuja.ejecutiva { background: var(--rojo-claro); box-shadow: inset 0 0 0 1px var(--rojo-borde); }
.burbuja.fallida { background: #fff6f6; box-shadow: inset 0 0 0 1.5px var(--rojo); }
.autor { font-size: 10.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--tenue); padding-right: 24px; }
.burbuja.ejecutiva > .autor:first-of-type { color: var(--rojo); }
.cuerpo { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.5; }
.burbuja.entrante > .cuerpo:first-of-type { padding-right: 18px; }
.pie { font-size: 11px; color: var(--tenue); justify-self: end; }
.detalle-error { font-size: 12px; color: var(--rojo-oscuro); font-weight: 500; }
.adjunto { font-size: 13.5px; color: var(--rojo); font-weight: 500; }
.nota { align-self: center; max-width: 88%; text-align: center; font-size: 12px; color: var(--tinta-2); background: rgb(255 255 255 / 90%); box-shadow: inset 0 0 0 1px var(--linea); border-radius: 999px; padding: 4px 12px; text-wrap: pretty; }
.nota-traspaso { background: var(--tinta); color: #fff; box-shadow: none; font-weight: 500; }
.nota-aviso { background: var(--ambar-claro); color: var(--ambar); box-shadow: inset 0 0 0 1px var(--ambar-borde); font-weight: 500; }
.nota-fallo { background: var(--rojo-claro); color: var(--rojo-oscuro); box-shadow: inset 0 0 0 1px var(--rojo-borde); font-weight: 500; }
.nota-reserva { background: var(--verde-claro); color: var(--verde); box-shadow: none; font-weight: 500; }
.mas-mensaje { position: absolute; top: 4px; right: 6px; background: none; border: 0; color: var(--suave); font-weight: 700; letter-spacing: 1px; padding: 0 6px; border-radius: 6px; opacity: 0; line-height: 20px; transition: opacity .12s; }
.burbuja:hover .mas-mensaje, .mas-mensaje:focus-visible { opacity: 1; }
.mas-mensaje:hover { background: rgb(30 30 30 / 7%); }
.menu-mensaje { position: absolute; top: 26px; right: 4px; z-index: 4; width: 220px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 14px; box-shadow: var(--sombra-alta); padding: 6px; display: grid; gap: 1px; }
.menu-reacciones { display: flex; justify-content: space-between; padding: 2px 2px 6px; margin-bottom: 3px; border-bottom: 1px solid var(--linea-suave); }
.reaccion-opcion { background: none; border: 0; font-size: 18px; padding: 3px 4px; border-radius: 8px; line-height: 1.2; }
.reaccion-opcion:hover, .reaccion-opcion.activa { background: var(--rojo-claro); }
.menu-opcion { background: none; border: 0; text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 13.5px; color: var(--tinta); }
.menu-opcion:hover { background: var(--fondo); }
.cita-burbuja { font-size: 12.5px; color: var(--tinta-2); border-left: 3px solid var(--rojo); background: rgb(30 30 30 / 4%); padding: 4px 8px; border-radius: 6px; overflow-wrap: anywhere; }
.traduccion { font-size: 13.5px; border-top: 1px dashed var(--linea); padding-top: 5px; display: grid; gap: 1px; white-space: pre-wrap; }
.reacciones { position: absolute; bottom: -10px; left: 12px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 999px; padding: 0 7px; font-size: 12px; line-height: 18px; box-shadow: var(--sombra); }
.burbuja.oculta { opacity: .55; box-shadow: inset 0 0 0 1px var(--linea); background: transparent; }
.burbuja.destacada { box-shadow: inset 3px 0 0 var(--rojo), 0 1px 1.5px rgb(30 30 30 / 10%); }
.adjunto-imagen img { display: block; max-width: min(280px, 100%); max-height: 260px; border-radius: 10px; object-fit: cover; }
.adjunto-audio { width: 250px; max-width: 100%; height: 38px; }
.ver-ocultos { align-self: center; font-size: 12.5px; }
.escribiendo .linea::after { content: "El sistema está escribiendo..."; align-self: flex-end; font-size: 12px; color: var(--suave); background: var(--tarjeta); padding: 4px 12px; border-radius: 999px; box-shadow: var(--sombra); }

.caja { position: relative; margin: 0 20px 18px; padding: 8px 10px 10px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 18px; display: grid; gap: 6px; box-shadow: 0 6px 20px rgb(30 30 30 / 7%); }
.caja:focus-within { border-color: #c9c9c9; }
.caja-fila { display: flex; gap: 8px; align-items: flex-end; }
.herramientas-caja { display: flex; align-items: center; gap: 2px; flex: 1; }
.herramientas-caja #sugerir { margin-left: auto; }
.pildora-caja { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12.5px; background: var(--fondo); color: var(--tinta-2); padding: 5px 12px; border-radius: 10px; }
.pildora-caja.sugerencia { background: var(--ambar-claro); color: var(--ambar); }
.pildora-texto { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.grabando { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.punto-rojo { width: 10px; height: 10px; border-radius: 50%; background: var(--rojo); animation: latido 1.2s infinite; }
@keyframes latido { 50% { opacity: .35; } }
.grabando-tiempo { font-variant-numeric: tabular-nums; font-weight: 600; }
.panel-emojis { position: absolute; left: 12px; bottom: calc(100% + 6px); z-index: 4; width: 300px; display: grid; grid-template-columns: repeat(8, 1fr); gap: 2px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 14px; box-shadow: var(--sombra-alta); padding: 8px; }
.emoji-opcion { background: none; border: 0; font-size: 20px; padding: 3px; border-radius: 8px; line-height: 1.2; }
.emoji-opcion:hover { background: var(--fondo); }
.caja textarea { flex: 1; resize: none; font-size: 14.5px; line-height: 1.45; padding: 9px 6px; border: 0; background: transparent; min-width: 0; outline: none; }
.caja textarea:focus-visible { outline: none; }
.caja textarea:disabled { color: var(--tenue); }
.caja #enviar { padding: 9px 20px; }
.aviso { font-size: 12.5px; color: var(--ambar); background: var(--ambar-claro); padding: 7px 12px; border-radius: 10px; text-wrap: pretty; }
.error-envio { font-size: 12.5px; color: var(--rojo-oscuro); font-weight: 500; }

.ficha { grid-area: ficha; background: var(--tarjeta); border-left: 1px solid var(--linea); padding: 20px 18px; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; gap: 18px; min-height: 0; }
.ficha > * { min-width: 0; }
.ficha h2 { font-family: var(--serif); font-size: 26px; margin: 0; font-weight: 600; line-height: 1.05; }
.ficha dl { margin: 0; display: grid; border: 1px solid var(--linea-suave); border-radius: 12px; overflow: hidden; }
.ficha dt { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--tenue); padding: 9px 12px 0; }
.ficha dd { margin: 0; overflow-wrap: anywhere; padding: 1px 12px 9px; font-size: 14px; border-bottom: 1px solid var(--linea-suave); }
.ficha dd:last-child { border-bottom: 0; }
.ficha dt:has(+ dd.destacado), .ficha dd.destacado { background: var(--ambar-claro); }
.ficha dd.destacado { color: #5c3700; font-weight: 500; }
.clasificacion { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.clasificacion label { display: grid; gap: 5px; font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--tenue); }
.clasificacion select, .fila-pausa select { font-size: 14px; padding: 7px 28px 7px 10px; border: 1px solid var(--linea); border-radius: 10px; background: var(--tarjeta) var(--flecha) no-repeat right 10px center; appearance: none; width: 100%; min-width: 0; letter-spacing: normal; text-transform: none; font-weight: 400; }
.acciones { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); padding-top: 16px; border-top: 1px solid var(--linea-suave); }
.control-pausa { display: grid; gap: 6px; grid-template-columns: minmax(0, 1fr); }
.fila-pausa { display: flex; gap: 6px; min-width: 0; }
.fila-pausa .boton, .etiqueta-form .boton { flex: none; }
.etiquetas-libres { display: grid; gap: 8px; grid-template-columns: minmax(0, 1fr); }
.chips-etiquetas { display: flex; flex-wrap: wrap; gap: 5px; }
.chips-etiquetas:empty { display: none; }
.chip-etiqueta { display: inline-flex; align-items: center; gap: 2px; font-size: 12.5px; font-weight: 500; background: var(--fondo); border-radius: 999px; padding: 2px 4px 2px 10px; }
.chip-quitar { background: none; border: 0; color: var(--suave); padding: 0 5px; line-height: 18px; font-size: 15px; border-radius: 50%; }
.chip-quitar:hover { color: var(--rojo); background: var(--rojo-claro); }
.chip-propuesta { font-size: 12.5px; font-weight: 500; background: var(--rojo-claro); color: var(--rojo-oscuro); border: 1px dashed var(--rojo-borde); border-radius: 999px; padding: 2px 10px; }
.etiqueta-form { display: flex; gap: 6px; min-width: 0; }
.etiqueta-form input { flex: 1; width: 100%; min-width: 0; font-size: 13.5px; padding: 7px 10px; border: 1px solid var(--linea); border-radius: 10px; }

/* ---------- Entrar ---------- */
.pagina-login { position: relative; min-height: 100%; display: grid; grid-template-rows: auto 1fr; background: var(--lateral); color: #fff; overflow: hidden; }
.pagina-login::before { content: ""; position: absolute; inset: 0; background: var(--ola-clara); background-size: 72px 36px; -webkit-mask: radial-gradient(ellipse at 50% 60%, #000 10%, transparent 75%); mask: radial-gradient(ellipse at 50% 60%, #000 10%, transparent 75%); pointer-events: none; }
.login-marca { position: relative; z-index: 1; display: flex; align-items: baseline; gap: 10px; padding: 28px 36px; }
.login-marca strong { font-family: var(--serif); font-size: 28px; font-weight: 600; }
.login-marca small { font-size: 11px; letter-spacing: .24em; text-transform: uppercase; color: rgb(255 255 255 / 55%); }
.login-centro { position: relative; display: grid; justify-items: center; align-content: center; gap: 28px; padding: 24px 16px 64px; }
.login-sol { position: absolute; left: 50%; top: 50%; width: min(520px, 70vw); aspect-ratio: 1; border-radius: 50%; background: var(--rojo); translate: -50% -79%; box-shadow: 0 0 120px rgb(204 0 0 / 35%); }
.tarjeta-login { position: relative; z-index: 1; width: min(400px, 100%); display: grid; gap: 12px; background: var(--tarjeta); color: var(--tinta); border-radius: 24px; padding: 36px 34px 30px; box-shadow: 0 30px 80px rgb(0 0 0 / 45%); }
.logo-grande { width: 88px; height: 88px; border-radius: 50%; justify-self: center; margin: -80px 0 4px; background: #fff; box-shadow: 0 8px 24px rgb(0 0 0 / 25%), 0 0 0 6px #fff; }
.tarjeta-login h1 { margin: 0; font-family: var(--serif); font-size: 34px; font-weight: 600; line-height: 1.05; text-align: center; }
.tarjeta-login .suave { margin-bottom: 10px; font-size: 14px; text-align: center; }
.tarjeta-login input { font-size: 15px; padding: 12px 14px; border: 1px solid var(--linea); border-radius: 12px; }
.tarjeta-login input:focus { outline: none; border-color: var(--tinta); box-shadow: 0 0 0 3px rgb(204 0 0 / 12%); }
.tarjeta-login label { font-weight: 500; font-size: 14px; }
.tarjeta-login .boton { padding: 12px 18px; font-size: 15px; margin-top: 4px; }
.error-login { color: var(--rojo-oscuro); font-size: 13px; font-weight: 500; }
.login-lema { position: relative; z-index: 1; margin: 0; font-family: var(--serif); font-style: italic; font-size: 24px; color: rgb(255 255 255 / 78%); text-align: center; }

/* ---------- Pantallas medianas: el menú se angosta ---------- */
@media (max-width: 1280px) {
  .panel { grid-template-columns: 290px minmax(0, 1fr) 270px; }
  .linea { padding-inline: 4%; }
}
@media (max-width: 1100px) {
  :root { --ancho-lateral: 76px; }
  .lateral { padding: 18px 12px 16px; align-items: center; }
  .lateral-nombre, .menu-titulo, .menu-principal a span, .lateral-pie .pastilla, .enlace-lateral span { display: none; }
  .lateral-pie { padding: 12px 0 0; justify-items: center; }
  .menu-principal a { justify-content: center; padding: 11px; }
  .menu-principal a[aria-current="page"]::before { left: -12px; }
}
@media (max-width: 1000px) {
  .panel { grid-template: "lista ficha" auto "lista hilo" minmax(0, 1fr) / 280px minmax(0, 1fr); }
  .panel:not(.con-hilo) .hilo { grid-column: 2; grid-row: 1 / -1; }
  .ficha { border-left: 0; border-bottom: 1px solid var(--linea); flex-flow: row wrap; align-items: center; gap: 10px 18px; padding: 10px 16px; max-height: 220px; }
  .ficha h2, .ficha .pequena { display: none; }
  .clasificacion { grid-auto-flow: column; grid-template-columns: none; }
  .ficha dl { display: flex; flex-wrap: wrap; gap: 4px 14px; flex: 1; min-width: 0; border: 0; border-radius: 0; }
  .ficha dl > dt { display: none; }
  .ficha dd { padding: 0; border: 0; font-size: 13px; }
  .ficha dd.destacado { padding: 0 6px; border-radius: 6px; }
  .etiquetas-libres { flex: 1 1 100%; }
  .acciones { grid-auto-flow: column; border: 0; padding-top: 0; }
  .acciones .boton { padding: 6px 12px; font-size: 13px; }
}

/* ---------- Teléfono: el menú pasa arriba ---------- */
@media (max-width: 720px) {
  .app-shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); }
  .lateral { height: auto; flex-direction: row; align-items: center; padding: 8px 12px; gap: 10px; overflow: visible; }
  .lateral::after { display: none; }
  .lateral-logo { width: 34px; height: 34px; }
  .menu-principal { display: flex; gap: 2px; flex: 1; justify-content: space-around; }
  .menu-principal a { padding: 9px; }
  .menu-principal a[aria-current="page"]::before { left: 9px; right: 9px; top: auto; bottom: -8px; width: auto; height: 3px; border-radius: 3px 3px 0 0; }
  .lateral-pie { display: none; }
  .panel { height: 100%; grid-template: "lista" minmax(0, 1fr) / minmax(0, 1fr); }
  .panel:not(.con-hilo) .hilo { grid-column: auto; grid-row: auto; }
  .hilo { display: none; grid-area: lista; }
  .con-hilo .hilo { display: block; }
  .con-hilo .lista { display: none; }
  .volver, .ver-ficha { display: inline-block; }
  .ficha { grid-area: lista; display: none; z-index: 2; flex-direction: column; align-items: stretch; max-height: none; }
  .ficha-abierta .ficha:not([hidden]) { display: flex; }
  .ficha h2 { display: block; }
  .clasificacion { grid-auto-flow: row; grid-template-columns: 1fr 1fr; }
  .ficha dl { display: grid; border: 1px solid var(--linea-suave); border-radius: 12px; }
  .ficha dl > dt { display: block; }
  .ficha dd { padding: 1px 12px 9px; border-bottom: 1px solid var(--linea-suave); }
  .acciones { grid-auto-flow: row; padding-top: 14px; border-top: 1px solid var(--linea-suave); }
  .hilo-cabecera { padding: 10px 12px; gap: 8px; min-height: 62px; }
  .hilo-cabecera .avatar { display: none; }
  .hilo-cabecera .pastilla { font-size: 11px; padding: 3px 9px; }
  .caja { margin: 0 8px 8px; }
  .linea { padding: 16px 12px 24px; }
  .burbuja { max-width: 86%; }
  #turno { display: none; }
  .login-marca { padding: 20px; }
  .tarjeta-login { padding: 32px 22px 24px; }
  .login-lema { font-size: 20px; }
}

/* ---------- Dentro de la demostración: menú angosto ---------- */
.embebido { --ancho-lateral: 64px; }
.embebido .lateral { padding: 14px 8px; align-items: center; gap: 16px; }
.embebido .lateral-logo { width: 38px; height: 38px; }
.embebido .lateral-nombre, .embebido .menu-titulo, .embebido .menu-principal a span, .embebido .lateral-pie .pastilla, .embebido .enlace-lateral span { display: none; }
.embebido .lateral-pie { padding: 10px 0 0; justify-items: center; }
.embebido .menu-principal a { justify-content: center; padding: 10px; }
.embebido .menu-principal a[aria-current="page"]::before { left: -8px; }
.embebido .lista-cabecera h1 { font-size: 27px; }
@media (min-width: 1001px) {
  .embebido .panel { grid-template-columns: 270px minmax(0, 1fr) 250px; }
}
@media (min-width: 721px) and (max-width: 1000px) {
  .embebido .panel { grid-template: "lista ficha" auto "lista hilo" minmax(0, 1fr) / 250px minmax(0, 1fr); }
}
@media (max-width: 720px) {
  .embebido .lateral { padding: 8px 12px; gap: 10px; }
}

/* ---------- Bandeja: termómetro, reloj, modos, análisis, respuestas rápidas y avisos ---------- */
.menu-principal .menu-cuenta { margin-left: auto; background: var(--rojo); color: #fff; font-size: 11px; font-weight: 600; border-radius: 999px; padding: 0 7px; line-height: 19px; min-width: 19px; text-align: center; }
@media (max-width: 1100px) {
  .menu-principal .menu-cuenta { position: absolute; top: 3px; right: 2px; padding: 0 5px; line-height: 16px; font-size: 10px; min-width: 16px; }
}
.embebido .menu-principal .menu-cuenta { position: absolute; top: 2px; right: 0; padding: 0 5px; line-height: 16px; font-size: 10px; min-width: 16px; }

.filtro-caliente { border-color: var(--rojo-borde); color: var(--rojo-oscuro); }
.filtro-caliente.activo { background: var(--rojo); border-color: var(--rojo); color: #fff; }
.filtro-caliente.activo .cuenta { background: #fff; color: var(--rojo); }

.termo-pastilla { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; border-radius: 6px; padding: 1px 7px; line-height: 1.6; font-variant-numeric: tabular-nums; }
.termo-pastilla.caliente { background: var(--rojo); color: #fff; }
.termo-pastilla.tibio { background: var(--ambar-claro); color: var(--ambar); box-shadow: inset 0 0 0 1px var(--ambar-borde); }
.termo-pastilla.frio { background: var(--fondo); color: var(--suave); }
.reloj { display: flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; }
.reloj::before { content: ""; width: 12px; height: 12px; flex: none; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E") center / contain no-repeat; }
.reloj.bien { color: var(--verde); }
.reloj.medio { color: var(--ambar); }
.reloj.malo { color: var(--rojo); }
.reloj.sugerencia { color: #6a45b3; }
.marca.sugiere { color: #6a45b3; }

.termo { display: grid; gap: 8px; padding: 14px; border-radius: 14px; background: var(--fondo-2); border: 1px solid var(--linea-suave); }
.termo:empty { display: none; }
.termo.nivel-caliente { background: var(--rojo-claro); border-color: var(--rojo-borde); }
.termo.nivel-tibio { background: var(--ambar-claro); border-color: var(--ambar-borde); }
.termo-cabeza { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; }
.termo-titulo { display: grid; gap: 2px; }
.termo-nivel { font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1; }
.nivel-caliente .termo-nivel { color: var(--rojo); }
.nivel-tibio .termo-nivel { color: var(--ambar); }
.termo-numero { font-size: 32px; font-weight: 500; line-height: 1; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.termo-numero small { font-size: 14px; color: var(--suave); font-weight: 400; }
.termo-barra { height: 8px; border-radius: 4px; background: rgb(30 30 30 / 8%); overflow: hidden; }
.termo-barra span { display: block; height: 100%; border-radius: 4px; background: var(--suave); }
.nivel-caliente .termo-barra span { background: var(--rojo); }
.nivel-tibio .termo-barra span { background: #e39a0b; }
.termo-paso { font-weight: 500; font-size: 13.5px; line-height: 1.4; }
.termo-senales { display: flex; flex-wrap: wrap; gap: 4px; }
.termo-senales li { font-size: 11.5px; background: rgb(255 255 255 / 75%); border-radius: 6px; padding: 1px 7px; }
.termo-falta { font-size: 12.5px; color: var(--tinta-2); }

.analisis { display: grid; gap: 10px; padding: 14px; border: 1px solid var(--linea-suave); border-radius: 14px; }
.analisis-cabeza { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.analisis-cuerpo { display: grid; gap: 10px; }
.analisis-bloque { display: grid; gap: 3px; }
.analisis-titulo { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--tenue); }
.analisis-bloque p, .analisis-bloque li { font-size: 13.5px; line-height: 1.45; }
.analisis-bloque ul { list-style: disc; padding-left: 18px; display: grid; gap: 2px; }
.analisis-siguiente { font-size: 13.5px; font-weight: 500; background: var(--verde-claro); color: var(--verde); border-radius: 10px; padding: 8px 10px; line-height: 1.4; }

.modo-control { display: grid; gap: 6px; }
.segmentos-modo { display: flex; gap: 2px; padding: 3px; background: var(--fondo); border-radius: 12px; }
.segmentos-modo button { flex: 1; border: 0; background: none; border-radius: 9px; padding: 7px 4px; font-size: 13px; font-weight: 500; color: var(--suave); transition: background .15s, color .15s; }
.segmentos-modo button:hover { color: var(--tinta); }
.segmentos-modo button.activo { background: var(--tarjeta); color: var(--tinta); box-shadow: var(--sombra); }
.segmentos-modo button[data-modo="sugiere"].activo { color: #6a45b3; }
.segmentos-modo button[data-modo="manual"].activo { color: var(--rojo-oscuro); }

.panel-rapidas { position: absolute; left: 12px; bottom: calc(100% + 6px); z-index: 5; width: min(420px, calc(100% - 24px)); max-height: 360px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; gap: 8px; background: var(--tarjeta); border: 1px solid var(--linea); border-radius: 16px; box-shadow: var(--sombra-alta); padding: 10px; }
.panel-rapidas input { font-size: 13.5px; padding: 8px 12px; border: 1px solid var(--linea); border-radius: 10px; }
.panel-rapidas input:focus { outline: none; border-color: var(--tinta); }
.rapidas-lista { overflow-y: auto; display: grid; gap: 2px; align-content: start; }
.rapida { width: 100%; text-align: left; background: none; border: 0; border-radius: 10px; padding: 8px 10px; display: grid; gap: 2px; }
.rapida strong { font-size: 13px; font-weight: 600; }
.rapida span { font-size: 12.5px; color: var(--suave); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.rapida:hover, .rapida.elegida { background: var(--rojo-claro); }
.rapidas-vacio { padding: 8px 10px; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 70; display: flex; align-items: center; gap: 12px; max-width: min(440px, calc(100vw - 40px)); padding: 12px 12px 12px 16px; background: var(--lateral); color: #fff; border-radius: 14px; box-shadow: var(--sombra-alta); font-size: 13.5px; border-left: 4px solid var(--rojo); }
.toast-sugerencia { border-left-color: #8b4fd6; }
.toast .boton { background: rgb(255 255 255 / 10%); border-color: rgb(255 255 255 / 20%); color: #fff; flex: none; }
.toast .boton:hover:not(:disabled) { background: rgb(255 255 255 / 18%); border-color: rgb(255 255 255 / 35%); }
.clasificacion { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
