/* Fina con la marca de getfinaptico.com (04-12-2026, encargo de Fàtima vía la Coordinadora).
 * widget.js es copia del repo chatbot_getfinaptico y se queda igual (otros clientes usan el mismo widget): aquí solo
 * se pisa su <style> con selectores más fuertes (body #cbw-chat-root …), así que no depende del orden de carga.
 * Valores = tokens de gf2026.css (v3), escritos tal cual porque las páginas antiguas no cargan gf2026.css.
 * Contraste calculado (WCAG 2.x): texto #E8F1EC sobre panel 17,2:1 y sobre burbuja de Fina 14,9:1; secundario 9,3-10,7:1;
 * texto oscuro sobre menta 12,1:1; borde del campo 3,5:1 (1.4.11). Sin movimiento nuevo. */
body #cbw-chat-root { font-family: "Geist", system-ui, sans-serif !important; color: oklch(95% 0.012 160); }
body #cbw-chat-root #cbw-panel { background: oklch(14% 0.02 180); border: 1px solid oklch(38% 0.035 178); border-radius: 20px;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.65); }
body #cbw-chat-root #cbw-header { background: oklch(22% 0.03 180); color: oklch(95% 0.012 160); padding: 12px 16px;
  border-bottom: 1px solid oklch(30% 0.03 180); font-weight: 600; letter-spacing: -0.005em; }
body #cbw-chat-root #cbw-header .cbw-hsub { color: oklch(80% 0.025 170); opacity: 1; font-size: 12px; }
body #cbw-chat-root #cbw-header button { color: oklch(95% 0.012 160); width: 32px; height: 32px; border-radius: 999px; font-size: 20px; }
body #cbw-chat-root #cbw-header button:hover { background: oklch(30% 0.03 180); }
body #cbw-chat-root #cbw-privacy { background: oklch(18% 0.026 180); color: oklch(80% 0.025 170);
  border-bottom: 1px solid oklch(30% 0.03 180); font-size: 12px; }
body #cbw-chat-root #cbw-msgs { background: oklch(14% 0.02 180); padding: 14px; gap: 10px;
  scrollbar-color: oklch(38% 0.035 178) transparent; }
body #cbw-chat-root .cbw-bubble { border-radius: 16px; font-size: 14.5px; line-height: 1.45; }
body #cbw-chat-root .cbw-bubble.bot { background: oklch(22% 0.03 180); color: oklch(95% 0.012 160);
  border: 1px solid oklch(30% 0.03 180); border-bottom-left-radius: 6px; }
body #cbw-chat-root .cbw-bubble.user { background: oklch(82% 0.15 172); color: oklch(14% 0.02 180); border-bottom-right-radius: 6px; }
body #cbw-chat-root .cbw-bubble.typing,
body #cbw-chat-root .cbw-bubble.note { background: transparent; border: none; color: oklch(80% 0.025 170); }
body #cbw-chat-root .cbw-bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
body #cbw-chat-root .cbw-bubble.bot a { color: oklch(82% 0.15 172); }
body #cbw-chat-root #cbw-form { background: oklch(18% 0.026 180); border-top: 1px solid oklch(30% 0.03 180); padding: 10px; gap: 8px; }
body #cbw-chat-root #cbw-input { background: oklch(14% 0.02 180); color: oklch(95% 0.012 160); border: 1px solid oklch(52% 0.035 178);
  border-radius: 12px; padding: 9px 12px; font-size: 16px; /* 16 px: iOS no hace zoom al escribir */ }
body #cbw-chat-root #cbw-input::placeholder { color: oklch(72% 0.025 175); opacity: 1; }
body #cbw-chat-root #cbw-input:focus { border-color: oklch(82% 0.15 172); }
body #cbw-chat-root #cbw-send { background: oklch(82% 0.15 172); color: oklch(14% 0.02 180); border-radius: 999px; padding: 8px 16px; font-weight: 500; }
body #cbw-chat-root #cbw-fab { background: oklch(82% 0.15 172); color: oklch(14% 0.02 180); box-shadow: 0 16px 32px -12px rgba(0, 0, 0, 0.6); }
body #cbw-chat-root a:focus-visible,
body #cbw-chat-root button:focus-visible,
body #cbw-chat-root #cbw-input:focus-visible { outline: 2px solid oklch(82% 0.15 172); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { body #cbw-chat-root #cbw-fab { transition: none; } }

/* Burbuja flotante (04-12, decisión de Fàtima): siempre abajo a la derecha, en todas las anchuras.
 * --gf-cookie-h: alto de la futura banda de cookies; la banda lo pondrá en <html> y la burbuja sube sobre ella.
 * #gf-chat (el hueco al final del <body>) reserva el alto de la burbuja: el final del pie se puede leer sin que lo tape. */
body #cbw-chat-root { bottom: calc(var(--gf-cookie-h, 0px) + 24px) !important; right: 24px !important; }
body #cbw-chat-root #cbw-fab { width: 56px; height: 56px; }
body #cbw-chat-root #cbw-panel { bottom: 72px; max-height: calc(100vh - 120px - var(--gf-cookie-h, 0px)); }
#gf-chat { height: 96px; }
html.gf-menu-open body #cbw-chat-root { display: none; } /* con el menú móvil abierto no tapa sus enlaces */
@media (max-width: 760px) {
  body #cbw-chat-root { bottom: calc(var(--gf-cookie-h, 0px) + 16px) !important; right: 16px !important; }
  body #cbw-chat-root #cbw-fab { width: 52px; height: 52px; }
  body #cbw-chat-root #cbw-panel { bottom: 64px; width: calc(100vw - 32px); max-width: 400px;
    max-height: calc(100svh - 96px - var(--gf-cookie-h, 0px)); }
  #gf-chat { height: 84px; }
}
