/* Asistente educativo. Usa los tokens de assets/css/style.css (--bg, --ink, --cyan, --violet…). */
#annicare-assistant {
  --asst-panel: #11161C;
  --asst-ink: var(--ink, #F2F4F6);
  --asst-mute: var(--mute, #9AA5B1);
  --asst-dim: var(--dim, #7F8A96);
  --asst-cyan: var(--cyan, #1B8ED6);
  --asst-cyan2: var(--cyan2, #6BB8EA);
  --asst-line: var(--line, rgba(233, 238, 242, .10));
  --asst-line2: var(--line2, rgba(233, 238, 242, .18));
  --asst-go: var(--go, #22C55E);
  --asst-violet: var(--violet, #22C55E);
  --asst-ease: var(--ease, cubic-bezier(.22, 1, .36, 1));
  --asst-fd: var(--fd, 'Sora', system-ui, sans-serif);
  --asst-fb: var(--fb, 'Inter', system-ui, sans-serif);
  --asst-fm: var(--fm, 'JetBrains Mono', ui-monospace, monospace);
  color: var(--asst-ink);
  font-family: var(--asst-fb);
  font-weight: 400;
}

#annicare-assistant [hidden] { display: none !important; }

/* Reinicio de tipografía con especificidad casi nula (:where). Antes era «#annicare-assistant button» (1,0,1) y
   pisaba el tamaño, la familia y el color de todas las clases de botón (.asst-iconbtn, .asst-send, .asst-jump…):
   salían a 16 px en vez de 11 px y con el texto claro sobre verde. */
:where(#annicare-assistant) button,
:where(#annicare-assistant) textarea {
  font: inherit;
  color: inherit;
}

#annicare-assistant :focus-visible {
  outline: 2px solid var(--asst-cyan2);
  outline-offset: 3px;
}

/* Lanzador y aviso «no disponible»: abajo a la derecha, apilados sobre el botón de WhatsApp.
   Arriba tapaban el menú y la barra de filtros. En móvil el aviso es un círculo de 44 px;
   el texto queda para lectores de pantalla y se despliega unos segundos al tocarlo. */
.asst-off {
  position: fixed;
  z-index: 110;
  right: 17px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 44px;
  height: 44px;
  max-width: calc(100vw - 34px);
  margin: 0;
  padding: 0;
  border: 1px solid var(--asst-line2);
  border-radius: 999px;
  background: rgba(17, 22, 28, .92);
  color: var(--asst-mute);
  font-size: 13px;
  line-height: 1.4;
}

.asst-off .asst-logo { flex: none; opacity: .5; }

.asst-off::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 50%;
  width: 28px;
  height: 1.5px;
  margin: -1px 0 0 -14px;
  background: var(--asst-mute);
  transform: rotate(-45deg);
}

.asst-off-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.asst-off.asst-off-show {
  width: auto;
  padding: 0 14px 0 11px;
}

.asst-off.asst-off-show::after { display: none; }

.asst-off.asst-off-show .asst-off-text {
  position: static;
  width: auto;
  height: auto;
  margin: 0;
  overflow: visible;
  clip: auto;
}

.asst-launch {
  position: fixed;
  z-index: 110;
  right: 17px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--asst-line2);
  border-radius: 999px;
  background: rgba(11, 13, 16, .72);
  color: var(--asst-ink);
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.asst-launch-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.asst-logo {
  width: 22px;
  height: 22px;
  display: block;
  overflow: visible;
}

.asst-logo path {
  fill: none;
  stroke: var(--asst-ink);
  stroke-width: .55;
  stroke-linejoin: round;
}

.asst-logo path + path { stroke: var(--asst-cyan); stroke-width: .4; }
.asst-logo circle { fill: var(--asst-violet); }

.asst-scrim {
  position: fixed;
  inset: 0;
  z-index: 125;
  background: rgba(0, 0, 0, .45);
  touch-action: none;
}

.asst-panel {
  position: fixed;
  z-index: 130;
  inset: 0;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  border: 0;
  border-radius: 0;
  background: var(--asst-panel);
  box-shadow: none;
  overflow: hidden;
  container-type: inline-size;
  container-name: asst;
}

/* Cabecera en una sola fila: marca a la izquierda (se encoge y parte en dos líneas si hace falta, nunca se corta),
   «Nuevo chat» y cerrar a la derecha. Antes eran dos filas (116 px); en 320 px de ancho, tres (166 px). */
.asst-head {
  flex: none;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 8px 14px;
  border-bottom: 1px solid var(--asst-line);
}

.asst-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
}

.asst-brand .asst-logo { flex: none; }

.asst-titles { min-width: 0; }

.asst-head h2 {
  margin: 0;
  font-family: var(--asst-fd);
  font-weight: 400;
  font-size: 16px;
  line-height: 1.25;
  letter-spacing: -.02em;
  overflow-wrap: anywhere;
}

.asst-head p {
  margin: 1px 0 0;
  color: var(--asst-mute);
  font-size: 12px;
  line-height: 1.35;
}

.asst-head-actions {
  flex: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.asst-iconbtn {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--asst-line2);
  border-radius: 999px;
  background: transparent;
  cursor: pointer;
  font-family: var(--asst-fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.asst-iconbtn:hover { border-color: var(--asst-cyan); color: var(--asst-cyan2); }

/* Cerrar: botón redondo con una equis. */
.asst-iconbtn.asst-x { width: 44px; padding: 0; }
.asst-x svg { display: block; width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; }

/* La conversación es lo único que se desplaza: cabecera arriba y campo abajo quedan fijos. */
.asst-body {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.asst-log {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: var(--asst-line2) transparent;
  padding: 16px 16px 12px;
}

#annicare-assistant .asst-log:focus-visible { outline-offset: -2px; }

/* Queda respuesta por debajo: el borde inferior se desvanece y aparece «Bajar». */
.asst-body::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 56px; /* antes 92 px: tapaba casi la mitad de una conversación baja */
  background: linear-gradient(to bottom, rgba(17, 22, 28, 0), var(--asst-panel) 70%);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--asst-ease);
}

.asst-body.asst-more::after { opacity: 1; }

.asst-jump {
  position: absolute;
  z-index: 1;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--asst-line2);
  border-radius: 999px;
  background: var(--asst-panel);
  box-shadow: 0 10px 28px rgba(0, 0, 0, .45);
  cursor: pointer;
  font-family: var(--asst-fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  white-space: nowrap;
}

.asst-jump::after {
  content: '';
  width: 6px;
  height: 6px;
  margin-top: -3px;
  border-right: 1.5px solid var(--asst-cyan2);
  border-bottom: 1.5px solid var(--asst-cyan2);
  transform: rotate(45deg);
}

.asst-jump:hover { border-color: var(--asst-cyan); color: var(--asst-cyan2); }

.asst-greet {
  margin: 0 0 8px;
  max-width: 22em;
  font-family: var(--asst-fd);
  font-weight: 300;
  font-size: 24px;
  line-height: 1.15;
  letter-spacing: -.02em;
}

.asst-copy,
.asst-answer,
.asst-user {
  font-size: 15px;
  line-height: 1.55;
}

.asst-copy { margin: 0 0 10px; max-width: 62ch; color: var(--asst-ink); }

.asst-not {
  margin: 0 0 12px;
  padding: 0;
  list-style: none;
  color: var(--asst-mute);
  font-size: 14px;
  line-height: 1.5;
}

.asst-not li { margin: 0 0 4px; }

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

.asst-suggest button {
  width: 100%;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--asst-line2);
  border-radius: 14px;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-size: 14px;
  line-height: 1.5;
}

.asst-suggest button:hover { border-color: var(--asst-cyan); color: var(--asst-cyan2); }

.asst-kicker {
  margin: 0 0 8px;
  color: var(--asst-mute);
  font-size: 14px;
}

/* La nota de laboratorio iba pegada a «Puedes empezar por aquí» y se leían como un solo párrafo. */
.asst-note + .asst-kicker { margin-top: 10px; }

.asst-user {
  margin: 0 0 14px 18%;
  padding: 10px 14px;
  border: 1px solid rgba(27, 142, 214, .35);
  border-radius: 18px 18px 4px 18px;
  background: rgba(27, 142, 214, .12);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.asst-answer {
  margin: 0;
  padding: 0 0 0 12px;
  border-left: 1px solid var(--asst-line2);
  max-width: 62ch;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.asst-note {
  margin: 8px 0 0;
  color: var(--asst-dim);
  font-size: 12px;
  line-height: 1.4;
}

.asst-sources { margin-top: 16px; }
.asst-sources h3 {
  margin: 0 0 8px;
  font-family: var(--asst-fb);
  font-size: 14px;
  font-weight: 500;
}

.asst-card {
  margin: 0 0 10px;
  padding: 12px 12px 4px;
  border: 1px solid var(--asst-line2);
  border-radius: 14px;
  background: rgba(8, 10, 13, .35);
}

.asst-card-top {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.asst-seal {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--asst-line2);
  border-radius: 8px;
  color: var(--asst-cyan2);
  font-family: var(--asst-fm);
  font-size: 12px;
}

.asst-card h4 {
  margin: 0;
  font-family: var(--asst-fd);
  font-weight: 400;
  font-size: 17px;
  line-height: 1.3;
}

.asst-card .asst-snap {
  margin: 2px 0 0;
  color: var(--asst-mute);
  font-size: 12px;
  line-height: 1.4;
}

/* Ficha: categorías, datos en rejilla, secuencia y estudios plegados */
.asst-card-meta { min-width: 0; }
.asst-card h4 { overflow-wrap: anywhere; }

.asst-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
}

.asst-chips li {
  padding: 3px 9px;
  border: 1px solid rgba(27, 142, 214, .35);
  border-radius: 999px;
  background: rgba(27, 142, 214, .12);
  color: var(--asst-cyan2);
  font-family: var(--asst-fm);
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.asst-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 14px;
  margin: 12px 0 0;
  border-top: 1px dashed var(--asst-line2);
}

.asst-fact {
  min-width: 0;
  padding: 9px 0;
  border-bottom: 1px dashed var(--asst-line);
}

.asst-fact-wide { grid-column: 1 / -1; }

.asst-fact dt {
  margin: 0 0 2px;
  color: var(--asst-mute);
  font-family: var(--asst-fm);
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.asst-fact dd {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.asst-fact dd.asst-seq {
  margin-top: 5px;
  padding: 8px 10px;
  border: 1px solid var(--asst-line);
  border-radius: 10px;
  background: rgba(8, 10, 13, .6);
  font-family: var(--asst-fm);
  font-size: 12.5px;
  line-height: 1.65;
  word-break: break-word;
}

.asst-fact-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.asst-fact-list li,
.asst-refs li {
  position: relative;
  padding-left: 13px;
}

.asst-fact-list li::before,
.asst-refs li::before {
  content: '';
  position: absolute;
  left: 1px;
  top: .62em;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--asst-cyan);
}

.asst-studies summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 44px;
  margin: 0; /* antes 0 -6px: el resumen medía 12 px más que su caja y asomaba por la derecha */
  padding: 0;
  color: var(--asst-cyan2);
  cursor: pointer;
  list-style: none;
  font-family: var(--asst-fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.asst-studies summary::-webkit-details-marker { display: none; }

#annicare-assistant .asst-studies summary:focus-visible {
  outline-offset: -2px;
  border-radius: 8px;
}

.asst-studies summary::after {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  margin: -3px 4px 0 0;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform .2s var(--asst-ease);
}

.asst-studies[open] summary::after {
  margin-top: 3px;
  transform: rotate(-135deg);
}

.asst-refs {
  margin: 0;
  padding: 2px 0 6px;
  list-style: none;
}

.asst-refs li {
  margin: 0 0 6px;
  color: var(--asst-mute);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.asst-callout {
  margin: 0;
  padding: 14px;
  border: 1px solid var(--asst-line2);
  border-radius: 14px;
}

.asst-callout h3 {
  margin: 0 0 6px;
  font-family: var(--asst-fd);
  font-size: 17px;
  font-weight: 400;
}

.asst-callout p { margin: 0; font-size: 15px; line-height: 1.55; }

.asst-empty {
  border-style: dashed;
}

.asst-error {
  border-color: rgba(255, 107, 129, .55);
  background: rgba(255, 107, 129, .08);
}

.asst-error h3 { color: #FF8A9B; }

.asst-retry {
  margin-top: 12px;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--asst-cyan);
  color: #041014;
  cursor: pointer;
  font-family: var(--asst-fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.asst-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--asst-mute);
  font-size: 14px;
}

.asst-loading .asst-logo path.m {
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  animation: asst-draw 1.4s var(--asst-ease) infinite;
}

@keyframes asst-draw {
  50% { stroke-dashoffset: 0; }
  100% { stroke-dashoffset: -24; }
}

.asst-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Campo de pregunta: antes ocupaba 174 px (campo de 48, contador siempre visible y aviso en 4 líneas). */
.asst-compose {
  flex: none;
  padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--asst-line);
  background: var(--asst-panel);
}

.asst-row { display: flex; gap: 8px; align-items: flex-end; }

/* La caja (borde, fondo, relleno) es la etiqueta que envuelve al <textarea>, y el <textarea> va sin relleno: así su
   alto es siempre un número entero de líneas. Con el relleno dentro del <textarea>, el texto se veía también a través
   del relleno y la línea siguiente asomaba cortada por abajo. */
.asst-field {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 10px 12px;
  border: 1px solid var(--asst-line2);
  border-radius: 12px;
  background: rgba(8, 10, 13, .6);
  cursor: text;
}

.asst-compose textarea {
  display: block;
  width: 100%;
  max-height: calc(5 * 24px); /* cinco líneas; assets/js/assistant.js ajusta el alto a lo escrito */
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  resize: none;
  font-size: 16px; /* menos de 16 px y Safari de iPhone amplía la página al enfocar */
  line-height: 24px;
}

/* El texto de ayuda va siempre en una línea (assistant.js elige el corto si el largo no cabe). */
.asst-compose textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* El foco se dibuja en la caja, no en el <textarea> de dentro. */
#annicare-assistant .asst-field textarea:focus-visible { outline: none; }

#annicare-assistant .asst-field:focus-within {
  border-color: var(--asst-cyan);
  box-shadow: 0 0 0 3px rgba(27, 142, 214, .18);
  outline: 2px solid var(--asst-cyan2);
  outline-offset: 3px;
}

.asst-send,
.asst-cancel {
  flex: none;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
  font-family: var(--asst-fm);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.asst-send {
  border: 0;
  background: var(--asst-go);
  color: #03140A;
}

.asst-send:disabled { opacity: .45; cursor: default; }

.asst-cancel {
  border: 1px solid var(--asst-line2);
  background: transparent;
}

/* Botón de enviar y, encima, el contador. El contador solo aparece cerca del límite (400 de 500) y ocupa el hueco
   que deja el campo al crecer: no gasta una línea propia ni hace saltar el campo al escribir la primera letra. */
.asst-side {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 4px;
}

.asst-meta {
  color: var(--asst-dim);
  font-size: 12px;
  line-height: 16px;
  font-variant-numeric: tabular-nums;
}

.asst-compose:not(.asst-near) .asst-meta { display: none; }

/* Aviso «faltan caracteres»: solo al intentar enviar menos de tres. */
.asst-hintmsg {
  display: none;
  margin: 4px 0 0;
  color: var(--asst-dim);
  font-size: 12px;
  line-height: 16px;
  text-align: right;
}

.asst-compose.asst-hint .asst-hintmsg { display: block; }

.asst-legal {
  margin: 6px 0 0;
  padding-left: 10px;
  border-left: 1px solid var(--asst-violet);
  color: var(--asst-dim);
  font-size: 11px;
  line-height: 1.4;
}

.asst-pm-link {
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-top: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--asst-cyan2);
  cursor: pointer;
  font-size: 14px;
  text-align: left;
}

html.asst-open #buybar {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* En móvil el panel ocupa la pantalla: la página de atrás queda quieta mientras está abierto. */
@media (max-width: 719px) {
  html.asst-open,
  html.asst-open body {
    overflow: hidden;
  }
}

/* Con un cajón, un modal o la carga inicial abiertos el lanzador se retira, igual que WhatsApp. */
html.locked .asst-launch,
html.locked .asst-off,
html.loading .asst-launch,
html.loading .asst-off {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

@media (min-width: 720px) {
  .asst-off {
    right: 16px;
    bottom: 24px;
    width: auto;
    height: auto;
    max-width: min(280px, calc(100vw - 32px));
    padding: 10px 12px;
    border-radius: 14px;
  }
  .asst-off .asst-logo,
  .asst-off::after { display: none; }
  .asst-off-text {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
  }
  .asst-launch {
    right: 16px;
    bottom: 24px;
    width: auto;
    height: 40px;
    padding: 0 16px;
  }
  /* El botón de WhatsApp ocupa la esquina inferior derecha. */
  body.has-wa .asst-launch,
  body.has-wa .asst-off,
  body:has(#wa) .asst-launch,
  body:has(#wa) .asst-off {
    right: 24px;
    bottom: 92px;
  }
  .asst-launch-label {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    font-family: var(--asst-fm);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: .14em;
    text-transform: uppercase;
  }
  .asst-scrim { display: none; }
  .asst-log { padding: 18px 18px 12px; }
  .asst-panel {
    inset: 16px 16px 16px auto;
    width: clamp(400px, 30vw, 500px); /* antes 440 px fijos: en una pantalla ancha quedaba estrecho */
    height: auto;
    max-height: calc(100dvh - 32px);
    min-height: 0;
    border: 1px solid var(--asst-line2);
    border-radius: 22px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
  }
}

/* Hasta 760 px el botón de WhatsApp mide 50 px y va a 16 px del borde; con la barra fija de
   abajo (html.bb-on) sube por encima de ella, y el lanzador sube con él. */
@media (max-width: 760px) {
  .asst-launch,
  .asst-off { transition: bottom .45s var(--asst-ease); }
  body.has-wa .asst-launch,
  body.has-wa .asst-off,
  body:has(#wa) .asst-launch,
  body:has(#wa) .asst-off {
    bottom: calc(76px + env(safe-area-inset-bottom));
  }
  html.bb-on .asst-launch,
  html.bb-on .asst-off {
    bottom: calc(var(--bbh, 72px) + 12px);
  }
  html.bb-on body.has-wa .asst-launch,
  html.bb-on body.has-wa .asst-off,
  html.bb-on body:has(#wa) .asst-launch,
  html.bb-on body:has(#wa) .asst-off {
    bottom: calc(var(--bbh, 72px) + 72px);
  }
}

/* Con ratón los botones de la cabecera y «Bajar» no necesitan 44 px. */
@media (min-width: 720px) and (pointer: fine) {
  .asst-iconbtn { min-height: 36px; }
  .asst-iconbtn.asst-x { width: 36px; }
  .asst-jump { min-height: 36px; }
}

/* Pantalla baja (móvil en horizontal): todo lo fijo se aprieta para dejar sitio a la conversación. */
@media (max-height: 560px) {
  .asst-sub { display: none; }
  .asst-head { padding-top: 4px; padding-bottom: 4px; }
  .asst-log { padding-top: 10px; }
  .asst-compose { padding-top: 6px; }
  .asst-compose textarea { max-height: calc(2 * 24px); }
  .asst-legal { margin-top: 4px; }
}

/* Lo mismo con el teclado del móvil abierto (.asst-short la pone assets/js/assistant.js según lo que queda visible). */
.asst-short .asst-sub { display: none; }
.asst-short .asst-head { padding-top: 4px; padding-bottom: 4px; }
.asst-short .asst-log { padding-top: 10px; }
.asst-short .asst-compose { padding-top: 6px; }
.asst-short .asst-compose textarea { max-height: calc(2 * 24px); }
.asst-short .asst-legal { margin-top: 4px; }

@container asst (max-width: 420px) {
  .asst-greet { font-size: 22px; }
}

/* Panel muy estrecho (320–360 px): sin subtítulo y título un punto menor; así la cabecera sigue en una fila. */
@container asst (max-width: 360px) {
  .asst-sub { display: none; }
  .asst-head h2 { font-size: 15px; }
  .asst-iconbtn { padding: 0 10px; }
}

html.rm .asst-loading .asst-logo path.m { animation: none; stroke-dashoffset: 0; }
html.rm .asst-studies summary::after,
html.rm .asst-body::after,
html.rm .asst-launch,
html.rm .asst-off { transition: none; }
@media (prefers-reduced-motion: reduce) {
  .asst-loading .asst-logo path.m { animation: none; stroke-dashoffset: 0; }
  .asst-studies summary::after,
  .asst-body::after,
  .asst-launch,
  .asst-off { transition: none; }
}

/* Tarjeta Pro (visitantes sin sesión de admin o Pro) */
.asst-upsell {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 2px 16px;
}

.asst-upsell-kicker {
  margin: 0;
  color: var(--asst-cyan2);
  font-family: var(--asst-fm);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.asst-upsell-title {
  margin: 0;
  font-family: var(--asst-fd);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -.03em;
  line-height: 1.15;
}

.asst-upsell-prices {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--asst-line2);
  border-radius: 16px;
  background: rgba(27, 142, 214, .12);
}

.asst-upsell-list {
  margin: 0;
  color: var(--asst-dim);
  font-size: 14px;
}

.asst-upsell-list s {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  color: var(--asst-mute);
}

.asst-upsell-now {
  margin: 0;
  font-family: var(--asst-fd);
  font-size: 26px;
  letter-spacing: -.03em;
  line-height: 1.2;
}

.asst-upsell-now strong {
  font-weight: 500;
  color: var(--asst-ink);
}

.asst-upsell-promo {
  margin: 6px 0 0;
  align-self: flex-start;
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(34, 197, 94, .16);
  color: var(--asst-go);
  font-family: var(--asst-fm);
  font-size: 11px;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.asst-upsell-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 16px;
  border: 0;
  border-radius: 999px;
  background: var(--asst-cyan);
  color: #041014;
  font: inherit;
  font-weight: 500;
  text-decoration: none;
  text-align: center;
  cursor: pointer;
  width: 100%;
}
button.asst-upsell-cta:disabled {
  opacity: 0.6;
  cursor: wait;
}

.asst-upsell-cta:hover {
  background: var(--asst-cyan2);
}

.asst-upsell-soonbtn {
  cursor: default;
  background: transparent;
  border: 1px solid var(--asst-line2);
  color: var(--asst-ink);
}

.asst-upsell-login {
  margin: 0;
  color: var(--asst-mute);
  font-size: 13px;
  line-height: 1.45;
}

.asst-upsell-login a {
  color: var(--asst-cyan2);
}
