/* Hablar: validadora de metro y boletos (ver static/hablar.js y docs/hablar-validadora). */
/* Colores de Hablar: en la pantalla y en la capa del vuelo (que va fuera de #temas) */
#temas.hb, .hb-capa {
  --hb-azul: #213F86; --hb-tinta: #1B336F; --hb-rojo: #D42A32; --hb-crema: #FCF8F1;
  --hb-linea: #E8DFD2; --hb-gris: #6F675E; --hb-verde: #2FB36B; --hb-suave: #E6EBF7;
}
#temas.hb {
  display: flex; flex-direction: column; gap: 0; width: 100%; max-width: 560px; margin: 0 auto; text-align: left;
  font-family: 'Nunito', ui-rounded, system-ui, sans-serif;
}
#temas.hb[hidden] { display: none; }
.hb button { font-family: inherit; }
.hb button:focus-visible, .hb input:focus-visible { outline: 3px solid #FFC533; outline-offset: 2px; }

/* Arriba: el título «Hablar» y, a la derecha, la chapa de idioma y nivel (diseño «Tu mezcla», 24 nov 2026) */
.hb-arriba { display: flex; align-items: center; gap: 10px; }
.hb-titulo-pantalla { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-size: 31px; line-height: 1.1; letter-spacing: -.015em; color: #383838; }
.hb-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--hb-suave); color: var(--hb-azul); font-weight: 800; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.hb-abajo { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

/* La validadora (y su copia temporal arriba): fina y clara en reposo, azul mientras valida */
.hb-maq { position: relative; margin-top: 14px; }
.hb-maq-cuerpo { height: 34px; border-radius: 11px; background: #EBEEF6; display: flex; align-items: flex-start; gap: 7px; padding: 7px 12px 0; transition: background .25s, box-shadow .25s; }
.hb-luz { position: relative; width: 7px; height: 7px; margin-top: 3px; border-radius: 50%; background: #B7C0D8; flex: none; transition: background .25s; }
.hb-luz::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #2FB36B; opacity: 0; box-shadow: 0 0 10px 2px rgba(47, 179, 107, .75); transition: opacity .2s ease; }
.hb-validada .hb-luz::after { opacity: 1; }
.hb-rotulo { font-weight: 900; font-size: 10.5px; line-height: 13px; letter-spacing: .1em; text-transform: uppercase; color: #8A95B3; transition: color .25s; }
.hb-ranura { position: absolute; left: 10px; right: 10px; bottom: 6px; height: 5px; border-radius: 3px; background: #C3CAE0; transition: background .25s, box-shadow .25s; }
.hb-activa .hb-maq-cuerpo { background: var(--hb-azul, #213F86); box-shadow: 0 6px 16px rgba(20, 37, 79, .25); }
.hb-activa .hb-luz { background: rgba(255, 255, 255, .3); }
.hb-activa .hb-rotulo { color: rgba(255, 255, 255, .85); }
.hb-activa .hb-ranura { background: #0B1736; box-shadow: inset 0 2px 3px rgba(0, 0, 0, .55); }
.hb-maq-temp { position: fixed; margin: 0; z-index: 2; filter: drop-shadow(0 6px 12px rgba(20, 37, 79, .18)); }
.hb-maq-temp .hb-maq-cuerpo { border-radius: 0 0 11px 11px; }
@media (prefers-reduced-motion: reduce) { .hb-maq-cuerpo, .hb-luz, .hb-rotulo, .hb-ranura { transition: none; } }

/* El boleto principal */
.hb-bol { position: relative; margin-top: 12px; border-radius: 20px; background: #fff; box-shadow: 0 0 0 1.5px var(--hb-azul), 0 10px 24px -12px rgba(20, 37, 79, .25); }
.hb-cab { display: flex; align-items: center; gap: 8px; margin: 0 16px; padding: 13px 0 0; flex-wrap: wrap; }
.hb-cab strong { font-weight: 900; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--hb-azul, #213F86); }
.hb-cab .solo-pro { margin-left: auto; font-style: normal; }
/* «Pruébalo gratis»: dorado suave (con Pro no sale; sin regalo dice «Pro», como siempre) */
.hb-bol .hb-cab .solo-pro.prueba-regalo { padding: 3px 8px; border: 0; border-radius: 99px; background: #FFF6DC; color: #8A5A00; font-size: 11.5px; font-weight: 900; letter-spacing: 0; text-transform: none; }
.hb-metro { position: relative; display: inline-flex; gap: 5px; align-items: center; flex: none; }
.hb-metro::before { content: ""; position: absolute; left: 2px; right: 2px; top: 50%; height: 3px; margin-top: -1.5px; background: #D42A32; border-radius: 2px; }
.hb-metro i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: #fff; box-shadow: 0 0 0 2px #D42A32; }
.hb-cuerpo { padding: 8px 16px 12px; }
.hb-pregunta { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-size: 23px; line-height: 1.12; letter-spacing: -.01em; color: var(--hb-tinta); text-wrap: balance; }
.hb-campo { margin-top: 12px; display: flex; align-items: center; gap: 9px; min-height: 52px; padding: 0 14px; border-radius: 14px; background: var(--hb-crema); box-shadow: inset 0 0 0 1.5px #D9D0C2; cursor: text; }
.hb-campo:focus-within { background: #fff; box-shadow: inset 0 0 0 2px var(--hb-azul), 0 0 0 4px rgba(33, 63, 134, .10); }
.hb-lapiz { width: 18px; height: 18px; flex: none; fill: none; stroke: var(--hb-azul); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.hb-campo .hb-lapiz { stroke: #877F75; stroke-width: 2.2; }
.hb-campo input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 13px 0; font: 600 16.5px/1.3 'Nunito', system-ui, sans-serif; color: #383838; }
.hb-campo input::placeholder { color: #9A9187; }
.hb-campo input:focus-visible { outline: 0; }
/* Bajo el campo: la idea de un toque (azul suave) y «Personalizar» (gris, con su numerito) */
.hb-selectores { margin-top: 10px; display: flex; align-items: center; gap: 8px; min-height: 32px; }
.hb .hb-idea { display: inline-flex; align-items: center; gap: 6px; min-width: 0; min-height: 32px; padding: 0 11px 0 9px; border: 0; border-radius: 999px; background: var(--hb-suave); color: var(--hb-azul); font-weight: 800; font-size: 13.5px; white-space: nowrap; overflow: hidden; cursor: pointer; }
.hb-idea svg { width: 15px; height: 15px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.hb-idea span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.hb .hb-personalizar { margin-left: auto; flex: none; display: inline-flex; align-items: center; gap: 5px; min-height: 32px; padding: 0 4px 0 6px; border: 0; border-radius: 8px; background: none; color: var(--hb-gris); font-weight: 800; font-size: 13.5px; cursor: pointer; }
.hb-personalizar svg { width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; }
.hb-personalizar b { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--hb-azul); color: #fff; font-size: 11px; font-weight: 900; display: grid; place-items: center; }
.hb-personalizar b[hidden] { display: none; }
.hb-elegido { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.hb-elegido[hidden] { display: none; }
.hb-elegido span { display: inline-flex; align-items: center; height: 26px; padding: 0 10px; border-radius: 99px; background: #F4EDE2; color: var(--hb-gris); font-size: 12.5px; font-weight: 800; }

/* La hoja de un selector: sube desde abajo (va fuera de #temas: lleva sus colores). */
dialog.hb-hoja {
  --hb-azul: #213F86; --hb-tinta: #1B336F; --hb-crema: #FCF8F1; --hb-linea: #E8DFD2; --hb-gris: #6F675E; --hb-suave: #E6EBF7;
  display: none; flex-direction: column; width: min(480px, 100vw); max-width: 100vw; max-height: 90vh; margin: auto auto 0; overflow-y: auto;
  padding: 0 20px calc(22px + env(safe-area-inset-bottom)); border: 0; border-radius: 28px 28px 0 0; background: var(--hb-crema);
  box-shadow: 0 -10px 40px rgba(10, 14, 30, .25); font-family: 'Nunito', ui-rounded, system-ui, sans-serif; color: #383838; text-align: left;
}
dialog.hb-hoja[open] { display: flex; animation: hoja-sube .28s cubic-bezier(.2, .8, .2, 1); }
dialog.hb-hoja::backdrop { background: rgba(30, 26, 22, .42); }
dialog.hb-hoja:focus, dialog.hb-hoja:focus-visible { outline: none; }
dialog.hb-hoja button { font-family: inherit; }
dialog.hb-hoja button:focus-visible, dialog.hb-hoja input:focus-visible { outline: 3px solid #FFC533; outline-offset: 2px; }
@media (min-width: 700px) { dialog.hb-hoja { margin: auto; border-radius: 28px; } }
@media (prefers-reduced-motion: reduce) { dialog.hb-hoja[open] { animation: none; } }
.hb-hoja-asa { flex: none; width: 38px; height: 5px; margin: 10px auto 14px; border-radius: 3px; background: var(--hb-linea); }
.hb-hoja-titulo { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-size: 20px; line-height: 1.2; color: var(--hb-tinta); text-wrap: balance; }
.hb-hoja-nota { margin: 6px 0 14px; font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--hb-gris); }
.hb-hoja-pastillas { display: flex; flex-wrap: wrap; gap: 7px; }
.hb-hoja-pastillas button { min-height: 38px; padding: 4px 14px; border: 0; border-radius: 999px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--hb-linea); color: #383838; font-weight: 800; font-size: 14px; cursor: pointer; }
.hb-hoja-pastillas button small { margin-left: 3px; font-size: 12.5px; font-weight: 700; opacity: .7; }
.hb-hoja-pastillas button.hb-elegida { background: var(--hb-azul); box-shadow: none; color: #fff; }
/* «Personalizar»: Situación, Gramática y Nivel en grupos, y «Listo» */
.hb-grupo { margin-top: 14px; }
.hb-hoja-nota + .hb-grupo { margin-top: 2px; }
.hb-grupo-titulo { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; color: var(--hb-gris); }
.hb-grupo .hb-otra { margin-top: 10px; }
.hb-grupo-nota { margin: 8px 2px 0; font-size: 13px; font-weight: 700; line-height: 1.35; color: var(--hb-gris); }
.hb-listo { flex: none; width: 100%; min-height: 50px; margin-top: 20px; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--hb-azul); color: #fff; font-weight: 900; font-size: 16px; cursor: pointer; }
/* «Este mensaje» (el «···» de cada respuesta de Léa en el chat): escuchar más lento y reportar */
.hb-hoja-nota[lang] { font-weight: 700; color: #383838; }
.hb-hoja-menu { display: flex; flex-direction: column; gap: 8px; }
.hb-hoja-menu button { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 10px 14px; border: 0; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px var(--hb-linea); color: #383838; text-align: left; cursor: pointer; }
.hb-hoja-menu svg { width: 20px; height: 20px; flex: none; fill: none; stroke: var(--hb-azul); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hb-hoja-menu strong { display: block; font-weight: 800; font-size: 15.5px; line-height: 1.25; }
.hb-hoja-menu small { display: block; font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--hb-gris); }
.hb-otra { margin-top: 14px; display: flex; align-items: center; gap: 8px; min-height: 50px; padding: 0 6px 0 14px; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1.5px #CFC6B8; cursor: text; }
.hb-otra:focus-within { box-shadow: inset 0 0 0 2px var(--hb-azul); }
.hb-otra .hb-lapiz { width: 17px; height: 17px; flex: none; fill: none; stroke: var(--hb-azul); stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.hb-otra input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; padding: 12px 0; font: 600 16px/1.3 'Nunito', system-ui, sans-serif; color: #383838; }
.hb-otra input::placeholder { color: #8E857B; }
.hb-otra input:focus-visible { outline: 0 !important; }
.hb-otra button { flex: none; min-height: 38px; padding: 0 16px; border: 0; border-radius: 999px; background: var(--hb-azul); color: #fff; font-weight: 800; font-size: 14px; cursor: pointer; }
.hb-corte { position: relative; height: 0; margin: 0 12px; border-top: 1.5px dashed rgba(33, 63, 134, .22); }
.hb-corte::before, .hb-corte::after { content: ""; position: absolute; top: -9px; width: 16px; height: 16px; border-radius: 50%; background: var(--hb-crema, #FCF8F1); box-shadow: inset 0 0 0 1.5px var(--hb-azul, #213F86); }
.hb-corte::before { left: -20px; clip-path: inset(0 0 0 50%); }
.hb-corte::after { right: -20px; clip-path: inset(0 50% 0 0); }
.hb-talon { padding: 12px 16px 14px; }
.hb-bol .hb-corte { margin: 0 14px; }
.hb-bol .hb-corte::before { left: -22px; } .hb-bol .hb-corte::after { right: -22px; }
.hb-boton { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 8px 16px; border: 0; border-radius: 999px; background: var(--hb-azul); color: #fff; font-weight: 800; font-size: 16.5px; line-height: 1.2; cursor: pointer; }
.hb-bol .hb-boton { min-height: 50px; font-weight: 900; }
.hb-boton svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.hb-boton:disabled { background: #E4E9F4; color: #6F7EA6; cursor: default; }

/* La pila: la conversación libre en su tarjeta y las situaciones como filas ligeras */
.hb-pila { margin-top: 10px; display: flex; flex-direction: column; padding-bottom: 8px; }
#temas.hb .hb-tk { position: relative; display: flex; flex-direction: row; align-items: center; gap: 12px; width: 100%; margin: 0; border: 0; text-align: left; color: #383838; cursor: pointer; transform: none; }
#temas.hb .hb-tk:active { transform: scale(.985); }
.hb-dibujo { flex: none; width: 42px; height: 42px; border-radius: 30%; display: grid; place-items: center; background: #e4e9f4; }
.hb-dibujo[data-tono="0"] { background: #fdebd9; } .hb-dibujo[data-tono="1"] { background: #fbe3df; } .hb-dibujo[data-tono="2"] { background: #fbf0d0; }
.hb-dibujo[data-tono="3"] { background: #e8efd9; } .hb-dibujo[data-tono="4"] { background: #f7e4ea; } .hb-dibujo[data-tono="5"] { background: #e4e9f4; }
.hb-dibujo img { width: 84%; height: 84%; object-fit: contain; }
.hb-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.hb-ceja { font-weight: 900; font-size: 10.5px; letter-spacing: .7px; text-transform: uppercase; color: #D42A32; }
.hb-titulo { font-weight: 900; font-size: 16px; line-height: 1.2; color: var(--hb-tinta, #1B336F); }
.hb-detalle { font-weight: 700; font-size: 13px; line-height: 1.3; color: var(--hb-gris, #6F675E); }
#temas.hb .hb-tk small.ultima { color: var(--hb-azul); font-weight: 800; font-size: 12px; }
#temas.hb .hb-tk small.ultima:empty { display: none; }
#temas.hb .hb-tk .solo-pro, #temas.hb .hb-tk .pw-tema-pro { position: static; align-self: center; flex: none; font-style: normal; }
.hb-chev { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
/* «Conversación libre»: tarjeta aparte con su dibujo, «Sin tema: Léa te sigue» y el botón redondo azul */
#temas.hb .hb-libre, .hb-copia.hb-libre { min-height: 66px; padding: 11px 6px 11px 12px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 1px rgba(33, 63, 134, .14), 0 1px 2px rgba(40, 30, 10, .04), 0 6px 18px rgba(40, 30, 10, .05); }
.hb-libre .hb-dibujo { width: 44px; height: 44px; border-radius: 12px; background: var(--hb-suave, #E6EBF7); }
.hb-libre .hb-dibujo img { width: 34px; height: 34px; }
#temas.hb .hb-libre .hb-titulo, .hb-copia.hb-libre .hb-titulo { font-size: 16.5px; }
#temas.hb .hb-libre .hb-detalle, .hb-copia.hb-libre .hb-detalle { font-size: 13.5px; }
.hb-ir { flex: none; width: 38px; height: 38px; border-radius: 50%; background: var(--hb-azul, #213F86); display: grid; place-items: center; }
.hb-ir svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
/* «Situaciones sugeridas»: filas sin tarjeta, separadas por una línea fina */
.hb-encabezado { margin: 26px 4px 4px; font-size: 12px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; color: #877F75; }
.hb-filas { margin: 0 4px; }
#temas.hb .hb-fila, .hb-copia.hb-fila { min-height: 60px; padding: 10px 4px; border-radius: 0; background: none; box-shadow: none; border-bottom: 1px solid var(--hb-linea, #E8DFD2); }
#temas.hb .hb-fila:last-child { border-bottom: 0; }
.hb-fila .hb-dibujo { width: 32px; height: 32px; border-radius: 0; background: none !important; }
.hb-fila .hb-dibujo img { width: 32px; height: 32px; }
#temas.hb .hb-fila .hb-titulo, .hb-copia.hb-fila .hb-titulo { font-weight: 800; font-size: 15.5px; color: #383838; }
#temas.hb .hb-fila .hb-detalle, .hb-copia.hb-fila .hb-detalle { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.hb-tk-talon { flex: none; display: grid; place-items: center; color: #B5ADA2; }

/* Movimiento reducido: el boleto se marca en verde (además del cambio de pantalla) */
.hb-marcado { outline: 3px solid #2FB36B !important; outline-offset: 2px; }

/* La capa del vuelo (encima de todo, sin recibir toques) */
.hb-capa { position: fixed; inset: 0; z-index: 900; pointer-events: none; }
.hb-vuelo { position: fixed; inset: 0; }
.hb-copia { position: fixed !important; margin: 0 !important; box-sizing: border-box; will-change: transform, opacity; }
.hb-copia.hb-tk { display: flex; flex-direction: row; align-items: center; gap: 12px; padding: 9px 0 9px 12px; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(33, 63, 134, .16); font-family: 'Nunito', system-ui, sans-serif; color: #383838; text-align: left; }
.hb-copia.hb-tk .solo-pro, .hb-copia.hb-tk .pw-tema-pro { display: none; }
.hb-copia.hb-libre { padding: 11px 6px 11px 12px; border-radius: 18px; }
.hb-copia.hb-fila { padding: 9px 12px; border-bottom: 0; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px rgba(33, 63, 134, .16); }
.hb-grande { position: fixed; border-radius: 16px; background: #fff; box-shadow: 0 0 0 1.5px #213F86; overflow: hidden; will-change: transform, opacity; font-family: 'Nunito', system-ui, sans-serif; color: #383838; }
.hb-grande .hb-cab { flex-wrap: nowrap; padding: 12px 0 9px; border-bottom: 1px solid var(--hb-linea, #E8DFD2); }
.hb-grande .hb-cab strong { font-size: 11.5px; letter-spacing: .9px; }
.hb-modo { margin-left: auto; font-weight: 800; font-size: 12px; color: #213F86; background: #E6EBF7; padding: 2px 9px; border-radius: 999px; }
.hb-g-cuerpo { display: flex; gap: 14px; align-items: center; padding: 14px 16px 16px; }
.hb-g-cuerpo .hb-g-dibujo { width: 76px; height: 76px; }
.hb-g-cuerpo h3 { margin: 0; font-family: 'Fraunces', Georgia, serif; font-weight: 800; font-size: 25px; line-height: 1.1; color: #1B336F; }
.hb-g-cuerpo p { margin: 4px 0 0; font-weight: 700; font-size: 14px; line-height: 1.3; color: #6F675E; }
.hb-grande .hb-corte::before, .hb-grande .hb-corte::after { left: -21px; }
.hb-grande .hb-corte::after { left: auto; right: -21px; }
.hb-g-talon { display: flex; align-items: center; gap: 8px; padding: 12px 18px 15px; font-weight: 800; font-size: 14.5px; color: #213F86; }
.hb-g-talon svg { width: 18px; height: 18px; flex: none; }

/* La conversación se abre desde la ranura (sin el fundido de siempre) */
.hb-transicion::view-transition-old(root), .hb-transicion::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
/* La pastilla «🔒 PRO» del regalo gastado (pintarHablarConPro) va antes del talón */
#temas.hb .hb-tk .hb-tx { order: 1; } #temas.hb .hb-tk .solo-pro, #temas.hb .hb-tk .pw-tema-pro { order: 2; } #temas.hb .hb-tk .hb-tk-talon, #temas.hb .hb-tk .hb-ir { order: 3; }
#temas.hb .hb-tk .hb-dibujo { order: 0; }

/* Sin el título grande de antes (queda para los lectores de pantalla) */
#bienvenida[data-vista="libre"] > #pregunta { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* Por encima de los estilos de .opcion de siempre */
#temas.hb .hb-tk .hb-detalle { color: #6F675E; font-size: 13px; font-weight: 700; }
#temas.hb .hb-libre .hb-detalle { font-size: 13.5px; }
#temas.hb .hb-tk svg.hb-chev { width: 16px; height: 16px; fill: none; stroke: #B5ADA2; stroke-width: 2.4; }
#temas.hb .hb-tk .hb-ir svg { width: 18px; height: 18px; fill: none; stroke: #fff; stroke-width: 2.6; }
#temas.hb .hb-titulo-pantalla { color: #383838; font-size: 31px; font-weight: 800; }
#temas.hb .hb-boton:disabled { opacity: 1; background: #E4E9F4; color: #6F7EA6; }
