/* Club Fortuna · soporte web propio. El widget comparte tokens visuales con el landing. */
#cf-widget-root {
  --cf-void: #050a12;
  --cf-panel: #0c1727;
  --cf-panel-alt: #13243a;
  --cf-line: rgba(218, 185, 105, .18);
  --cf-line-strong: rgba(218, 185, 105, .38);
  --cf-gold: #d8ae4d;
  --cf-gold-bright: #f6d98a;
  --cf-ink: #f5f1e8;
  --cf-ink-soft: #afbac8;
  --cf-ink-faint: #718095;
  --cf-radius-sm: 10px;
  --cf-radius-md: 14px;
  --cf-type-h3: clamp(1.45rem, 5vw, 1.75rem);
  --cf-type-body: .78rem;
  --cf-type-small: .64rem;
  position: fixed;
  right: max(16px, env(safe-area-inset-right));
  bottom: max(16px, env(safe-area-inset-bottom));
  z-index: 9999;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
#cf-widget-root *, #cf-widget-root *::before, #cf-widget-root *::after { box-sizing: border-box; }
#cf-widget-root button, #cf-widget-root input, #cf-widget-root textarea { font: inherit; }
#cf-widget-root button:focus-visible, #cf-widget-root input:focus-visible, #cf-widget-root textarea:focus-visible { outline: 3px solid rgba(246, 217, 138, .7); outline-offset: 2px; }
.cf-bubble {
  position: relative;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  overflow: hidden;
  padding: 0;
  border: 1px solid var(--cf-line-strong);
  border-radius: 50%;
  color: var(--cf-ink);
  background: linear-gradient(145deg, #1c3658, #0d1b2d);
  box-shadow: 0 16px 36px rgba(0, 0, 0, .46), 0 0 0 5px rgba(216, 174, 77, .07);
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}
.cf-bubble:hover { transform: translateY(-3px); border-color: var(--cf-gold-bright); box-shadow: 0 20px 40px rgba(0, 0, 0, .5), 0 0 0 5px rgba(216, 174, 77, .11); }
.cf-bubble img { width: 100%; height: 100%; padding: 5px; object-fit: contain; border-radius: 50%; clip-path: circle(50% at 50% 50%); }
.cf-bubble::after { display: none; }
.cf-bubble-dot { display: none; }

.cf-panel {
  position: absolute;
  right: 0;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 32px));
  height: min(560px, calc(100dvh - 110px));
  overflow: hidden;
  border: 1px solid var(--cf-line-strong);
  border-radius: 23px;
  background: var(--cf-panel);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .58), 0 0 0 5px rgba(216, 174, 77, .05);
  animation: cf-panel-in .18s ease both;
}
.cf-panel.hidden { display: none; }
@keyframes cf-panel-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.cf-panel-header { display: flex; align-items: center; gap: 11px; min-height: 76px; padding: 13px 15px; border-bottom: 1px solid var(--cf-line); background: linear-gradient(135deg, #10223a, #172e4b); }
.cf-panel-header-info { display: flex; align-items: center; gap: 10px; min-width: 0; }
.cf-header-logo { display: grid; place-items: center; width: 44px; height: 44px; flex: 0 0 44px; overflow: hidden; border: 1px solid var(--cf-line-strong); border-radius: 50%; background: rgba(3, 8, 15, .42); }
.cf-header-logo img { width: 38px; height: 38px; object-fit: contain; border-radius: 50%; clip-path: circle(50% at 50% 50%); }
.cf-panel-title { margin: 0; color: var(--cf-ink); font-size: var(--cf-type-body); font-weight: 800; }
.cf-panel-status { display: inline-flex; align-items: center; gap: 7px; margin: 4px 0 0; color: var(--cf-ink-soft); font-size: 11.5px; font-weight: 600; letter-spacing: .01em; text-transform: none; }
.cf-online-dot { display: inline-block; width: 8px; height: 8px; flex: 0 0 8px; border-radius: 50%; background: #3ec97e; box-shadow: 0 0 0 3px rgba(62, 201, 126, .16); }
.cf-online-label { display: inline-flex !important; align-items: center; gap: 6px; text-transform: none !important; letter-spacing: .01em !important; color: #afbac8 !important; font-size: 11.5px !important; font-weight: 600 !important; }
.cf-close-btn { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; margin-left: auto; padding: 0; border: 1px solid transparent; border-radius: var(--cf-radius-sm, 10px); color: var(--cf-ink-soft); background: transparent; cursor: pointer; }
.cf-close-btn:hover { color: var(--cf-ink); border-color: var(--cf-line); background: rgba(255, 255, 255, .07); }
.cf-panel-body { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow-y: auto; padding: 20px 16px 16px; background: radial-gradient(340px 260px at 50% 0%, rgba(216, 174, 77, .08), transparent 74%), var(--cf-panel); }

.cf-welcome { display: flex; flex: 1; flex-direction: column; align-items: stretch; justify-content: center; min-height: 100%; text-align: center; }
.cf-welcome-emblem { display: grid; place-items: center; width: 66px; height: 66px; margin: 0 auto 17px; overflow: hidden; border: 1px solid var(--cf-line-strong); border-radius: 50%; background: linear-gradient(145deg, rgba(216, 174, 77, .17), rgba(17, 36, 59, .86)); box-shadow: 0 12px 25px rgba(0, 0, 0, .2); }
.cf-welcome-emblem img { width: 53px; height: 53px; object-fit: contain; border-radius: 50%; clip-path: circle(50% at 50% 50%); }
.cf-welcome h3 { margin: 0 0 8px; color: var(--cf-ink); font-family: Fraunces, Georgia, serif; font-size: var(--cf-type-h3); font-weight: 600; letter-spacing: -.035em; }
.cf-welcome p { margin: 0 auto; max-width: 285px; color: var(--cf-ink-soft); font-size: var(--cf-type-body); line-height: 1.65; }
.cf-welcome-actions { display: grid; gap: 9px; margin-top: 25px; }
.cf-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 14px; border: 1px solid transparent; border-radius: 12px; font-size: var(--cf-type-small); font-weight: 800; transition: transform .18s ease, background .18s ease, border-color .18s ease, filter .18s ease; cursor: pointer; }
.cf-btn:hover { transform: translateY(-2px); }
.cf-btn:disabled { cursor: wait; opacity: .56; transform: none; }
.cf-btn-gold { color: #171108; background: linear-gradient(135deg, var(--cf-gold-bright), var(--cf-gold)); border-color: rgba(255, 225, 144, .58); box-shadow: 0 9px 21px rgba(216, 174, 77, .15); }
.cf-btn-gold:hover { filter: brightness(1.06); }
.cf-btn-outline { color: var(--cf-gold-bright); background: transparent; border-color: var(--cf-line-strong); }
.cf-btn-outline:hover { background: rgba(216, 174, 77, .11); }
.cf-btn-link { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; padding: 5px 0; border: 0; color: var(--cf-ink-faint); background: transparent; font-size: var(--cf-type-small); text-decoration: underline; cursor: pointer; }
.cf-btn-link:hover { color: var(--cf-ink); }
.cf-private-note { margin-top: 24px !important; color: var(--cf-ink-faint) !important; font-size: 10px !important; }
.cf-security-note { margin: 0; color: var(--cf-ink-faint); font-size: var(--cf-type-small); line-height: 1.6; }

.cf-user-card { margin-bottom: 16px; padding: 15px; border: 1px solid var(--cf-line); border-radius: 14px; background: rgba(19, 36, 58, .78); text-align: left; }
.cf-user-card p { margin: 0 0 3px; color: var(--cf-ink-faint); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.cf-user-card strong { display: block; overflow-wrap: anywhere; color: var(--cf-ink); font-size: var(--cf-type-body); }
.cf-back-link { margin-bottom: 15px; }

.cf-chat { display: flex; flex: 1; flex-direction: column; min-height: 0; }
.cf-chat-messages { display: flex; flex: 1; flex-direction: column; gap: 9px; min-height: 0; overflow-y: auto; padding: 2px 2px 13px; }
.cf-msg { max-width: 86%; padding: 10px 12px; border-radius: 14px; color: var(--cf-ink); font-size: var(--cf-type-body); line-height: 1.5; overflow-wrap: anywhere; }
.cf-msg-system { align-self: center; max-width: 100%; padding: 8px; color: var(--cf-ink-faint); background: transparent; font-size: 10px; text-align: center; }
.cf-msg-agent { align-self: flex-start; border: 1px solid var(--cf-line); border-top-left-radius: 5px; background: var(--cf-panel-alt); }
.cf-msg-user { align-self: flex-end; border: 1px solid rgba(216, 174, 77, .4); border-top-right-radius: 5px; background: rgba(216, 174, 77, .15); }
.cf-day-divider { align-self: center; margin: 8px 0 1px; color: var(--cf-ink-faint); font-size: 9px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.cf-older { align-self: center; margin-bottom: 8px; }
.cf-agent-typing { display: flex; align-items: center; gap: 4px; align-self: flex-start; padding: 9px 12px; border: 1px solid var(--cf-line); border-radius: 12px; background: var(--cf-panel-alt); }
.cf-agent-typing span { width: 5px; height: 5px; border-radius: 50%; background: var(--cf-ink-faint); animation: cf-blink 1.1s infinite ease-in-out; }
.cf-agent-typing span:nth-child(2) { animation-delay: .15s; }
.cf-agent-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cf-blink { 0%, 80%, 100% { opacity: .25; } 40% { opacity: 1; } }
.cf-chat-input-row { display: flex; align-items: end; gap: 7px; padding-top: 12px; border-top: 1px solid var(--cf-line); }
.cf-chat-input-row textarea { flex: 1; min-width: 0; min-height: 42px; max-height: 112px; resize: vertical; padding: 11px 12px; border: 1px solid var(--cf-line); border-radius: 13px; color: var(--cf-ink); background: var(--cf-panel-alt); font-size: 12px; line-height: 1.4; }
.cf-chat-input-row textarea::placeholder { color: var(--cf-ink-faint); }
.cf-chat-input-row textarea:focus { border-color: var(--cf-gold); }
.cf-chat-input-row > button { display: grid; place-items: center; width: 40px; min-width: 40px; height: 42px; padding: 0; border: 1px solid var(--cf-line); border-radius: 12px; color: var(--cf-gold-bright); background: rgba(216, 174, 77, .08); cursor: pointer; }
.cf-chat-input-row > button:hover { border-color: var(--cf-line-strong); background: rgba(216, 174, 77, .16); }
.cf-chat-input-row > button[type="submit"] { color: #171108; border-color: rgba(255, 225, 144, .5); background: linear-gradient(135deg, var(--cf-gold-bright), var(--cf-gold)); }
.cf-chat-input-row > button:disabled { cursor: wait; opacity: .55; }
.cf-inline-form { display: flex; flex-direction: column; gap: 8px; margin-top: 7px; text-align: left; }
.cf-inline-form label { color: var(--cf-ink-soft); font-size: 10px; font-weight: 700; }
.cf-inline-form input { width: 100%; padding: 11px 12px; border: 1px solid var(--cf-line); border-radius: 11px; color: var(--cf-ink); background: var(--cf-panel-alt); font-size: 12px; }
.cf-inline-form input:focus { border-color: var(--cf-gold); }
.cf-inline-form .cf-btn { width: 100%; margin-top: 8px; }
.cf-form-error { margin: 0 !important; color: #ff9baa !important; font-size: 10px !important; }
.cf-image-link { display: block; max-width: 100%; }
.cf-chat-image { display: block; max-width: 100%; border: 1px solid var(--cf-line); border-radius: var(--cf-radius-sm); object-fit: contain; }
.cf-pdf-link { display: inline-flex; align-items: center; gap: 6px; color: var(--cf-gold-bright); font-weight: 700; text-decoration: underline; }
.cf-icon { display: block; width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.8; }
.cf-icon-sm { width: 16px; height: 16px; }

.cf-image-viewer { position: fixed; inset: 0; z-index: 10001; display: grid; place-items: center; padding: 18px; background: rgba(1, 4, 9, .86); backdrop-filter: blur(10px); }
.cf-image-viewer[hidden] { display: none; }
.cf-image-viewer-card { position: relative; display: flex; flex-direction: column; width: min(100%, 900px); max-height: calc(100dvh - 36px); padding: 16px; border: 1px solid var(--cf-line-strong); border-radius: 20px; background: var(--cf-panel); box-shadow: 0 30px 90px rgba(0, 0, 0, .58); }
.cf-image-viewer-close { position: absolute; top: 10px; right: 10px; z-index: 1; display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid var(--cf-line); border-radius: 11px; color: var(--cf-ink); background: rgba(5, 10, 18, .75); }
.cf-image-viewer-stage { display: grid; place-items: center; min-height: 180px; overflow: auto; padding: 34px 8px 13px; border-radius: 13px; background: #03070d; }
.cf-image-viewer-stage img { max-width: 100%; max-height: calc(100dvh - 170px); object-fit: contain; transform-origin: center; transition: transform .15s ease; }
.cf-image-viewer-controls { display: flex; justify-content: center; gap: 8px; padding-top: 12px; }
.cf-image-viewer-controls button { min-width: 42px; min-height: 35px; border: 1px solid var(--cf-line); border-radius: 9px; color: var(--cf-gold-bright); background: var(--cf-panel-alt); font-size: 12px; }
.cf-image-viewer-controls button:hover { border-color: var(--cf-line-strong); }

@media (max-width: 520px) {
  #cf-widget-root { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .cf-bubble { width: 56px; height: 56px; border-radius: 50%; }
  .cf-bubble img { width: 100%; height: 100%; padding: 4px; }
  .cf-panel { right: 0; bottom: 70px; width: calc(100vw - 24px); height: min(68dvh, 540px); border-radius: 20px; }
  .cf-panel-header { min-height: 68px; }
  .cf-panel-body { padding: 16px 13px 13px; }
  .cf-welcome h3 { font-size: 25px; }
  .cf-msg { max-width: 90%; }
}


/* ---- vista vacía del chat: centrada visualmente entre cabecera y composer ---- */
.cf-chat-empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; margin: auto 0; padding: 12px 18px 40px; text-align: center; }
.cf-chat-empty-icon { display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid var(--cf-line); border-radius: 50%; color: var(--cf-gold-bright); background: rgba(216, 174, 77, .08); }
.cf-chat-empty-icon .cf-icon { width: 18px; height: 18px; }
.cf-chat-empty p { margin: 0; max-width: 240px; color: var(--cf-ink-faint); font-size: 12px; line-height: 1.55; }

/* ---- pulido de cabecera y composer ---- */
.cf-panel-header { min-height: 78px; padding: 14px 16px; gap: 12px; }
.cf-panel-title { font-size: 14px; letter-spacing: -.01em; }
.cf-close-btn { width: 38px; height: 38px; flex-basis: 38px; border-radius: 11px; }
.cf-chat-input-row textarea { border-radius: 14px; }
.cf-chat-input-row > button { border-radius: 13px; }

/* =========================================================
   Bloque 2 · Soft prompt de notificaciones del cliente.
   Se inserta en <body>, FUERA de #cf-widget-root: por eso no usa los tokens --cf-* del widget
   ni las clases .cf-btn (allí no resuelven). Componente autocontenido con colores explícitos
   del branding (navy profundo + dorado/ámbar). La lógica (ids, cooldown, permisos) no cambia.
   ========================================================= */
.cf-notify { position: fixed; inset: 0; z-index: 10002; display: grid; place-items: center; box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  background: rgba(3, 7, 14, .82); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: #f5f1e8; -webkit-font-smoothing: antialiased; }
.cf-notify *, .cf-notify *::before, .cf-notify *::after { box-sizing: border-box; }
.cf-notify-card { position: relative; width: min(440px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto;
  padding: 40px 34px 30px; text-align: center; border-radius: 28px; border: 1px solid rgba(246, 218, 133, .22);
  background: linear-gradient(180deg, #14294a 0%, #0c1a30 58%, #0a1526 100%);
  box-shadow: 0 32px 80px rgba(0, 0, 0, .62), 0 0 0 1px rgba(255, 255, 255, .03), inset 0 1px 0 rgba(255, 255, 255, .06); }
.cf-notify-close { position: absolute; top: 14px; right: 14px; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; margin: 0;
  border: 1px solid rgba(255, 255, 255, .10); border-radius: 12px; color: #b9c4d4; background: rgba(255, 255, 255, .04); cursor: pointer;
  transition: color .16s ease, border-color .16s ease, background .16s ease; }
.cf-notify-close:hover { color: #fff; border-color: rgba(246, 218, 133, .38); background: rgba(255, 255, 255, .09); }
.cf-notify-close:focus-visible { outline: 3px solid rgba(246, 218, 133, .6); outline-offset: 2px; }
.cf-notify-close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; stroke-linejoin: round; }
.cf-notify-icon { display: grid; place-items: center; width: 88px; height: 88px; margin: 2px auto 22px; border-radius: 50%; color: #1a1306;
  background: linear-gradient(160deg, #f9dd90 0%, #e3b93e 55%, #d1a437 100%);
  box-shadow: 0 16px 36px rgba(216, 174, 77, .32), 0 0 0 9px rgba(227, 185, 62, .10), inset 0 1px 0 rgba(255, 255, 255, .45); }
.cf-notify-icon svg { width: 42px; height: 42px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cf-notify-card h3 { margin: 0 0 12px; color: #ffffff; font-family: Fraunces, Georgia, serif; font-size: clamp(26px, 2.4vw, 31px); font-weight: 600; letter-spacing: -.03em; line-height: 1.08; text-wrap: balance; }
.cf-notify-card p { margin: 0 auto; max-width: 330px; color: #c9d3e1; font-size: 16.5px; line-height: 1.6; }
.cf-notify-actions { display: grid; gap: 12px; margin-top: 28px; }
.cf-notify-btn { display: inline-flex; align-items: center; justify-content: center; width: 100%; min-height: 56px; padding: 0 20px; margin: 0;
  border-radius: 16px; border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 800; letter-spacing: .01em; line-height: 1; cursor: pointer; text-align: center; -webkit-tap-highlight-color: transparent;
  transition: transform .14s ease, filter .14s ease, background .14s ease, border-color .14s ease, box-shadow .14s ease; }
.cf-notify-btn:focus-visible { outline: 3px solid rgba(246, 218, 133, .62); outline-offset: 3px; }
.cf-notify-btn:disabled { cursor: wait; opacity: .6; transform: none; }
.cf-notify-primary { color: #1a1206; background: linear-gradient(180deg, #fbe19a 0%, #e8bd4a 100%); border-color: rgba(255, 232, 160, .6);
  box-shadow: 0 12px 26px rgba(0, 0, 0, .35), 0 10px 26px rgba(227, 185, 62, .26), inset 0 1px 0 rgba(255, 255, 255, .42); }
.cf-notify-primary:hover { filter: brightness(1.04); transform: translateY(-1px); }
.cf-notify-primary:active { filter: brightness(.97); transform: translateY(0); }
.cf-notify-secondary { color: #e8edf5; background: rgba(255, 255, 255, .05); border-color: rgba(255, 255, 255, .14); font-weight: 700; }
.cf-notify-secondary:hover { background: rgba(255, 255, 255, .09); border-color: rgba(246, 218, 133, .35); }
.cf-notify-secondary:active { background: rgba(255, 255, 255, .06); }
.cf-notify-note { margin: 22px auto 0; padding-top: 16px; max-width: 320px; border-top: 1px solid rgba(255, 255, 255, .07); color: #8f9cb0; font-size: 12.5px; line-height: 1.5; }
@media (max-width: 520px) {
  .cf-notify-card { width: calc(100vw - 28px); max-width: 420px; padding: 30px 22px 24px; border-radius: 26px; }
  .cf-notify-close { top: 12px; right: 12px; width: 38px; height: 38px; border-radius: 11px; }
  .cf-notify-icon { width: 76px; height: 76px; margin-bottom: 18px; }
  .cf-notify-icon svg { width: 36px; height: 36px; }
  .cf-notify-card h3 { font-size: clamp(25px, 7vw, 28px); }
  .cf-notify-card p { font-size: 15.5px; }
  .cf-notify-actions { margin-top: 24px; gap: 10px; }
  .cf-notify-btn { min-height: 54px; font-size: 15px; }
  .cf-notify-note { margin-top: 18px; padding-top: 14px; font-size: 12px; }
}
@media (max-width: 340px) { .cf-notify-card { padding: 26px 18px 22px; } .cf-notify-card h3 { font-size: 24px; } .cf-notify-card p { font-size: 15px; } }
@media (max-height: 620px) { .cf-notify-card { padding-top: 26px; } .cf-notify-icon { width: 64px; height: 64px; margin-bottom: 14px; } .cf-notify-icon svg { width: 30px; height: 30px; } .cf-notify-actions { margin-top: 20px; } }
@media (prefers-reduced-motion: no-preference) { .cf-notify-card { animation: cf-notify-in .22s ease-out; } @keyframes cf-notify-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } } }


/* =========================================================
   V1 VISUAL · widget de soporte
   Píldora flotante etiquetada · sheet en mobile · cuerpo con
   superficie propia · escala tipográfica · botones del sistema.
   ids, eventos y widget.js intactos.
   ========================================================= */
#cf-widget-root {
  --cf-void: #05080f;
  --cf-panel: #0b1629;
  --cf-panel-alt: #152740;
  --cf-body: #10203a;
  --cf-header: #0a1424;
  --cf-line: rgba(255, 255, 255, .08);
  --cf-line-strong: rgba(227, 185, 62, .32);
  --cf-gold: #e3b93e;
  --cf-gold-bright: #f6da85;
  --cf-ink: #f5f1e8;
  --cf-ink-soft: #aab5c4;
  --cf-ink-faint: #7d8899;
  --cf-radius-sm: 12px;
  --cf-radius-md: 16px;
  --cf-type-h3: clamp(1.5rem, 5vw, 1.7rem);
  --cf-type-body: .95rem;
  --cf-type-small: .8125rem;
}

/* ---- píldora flotante: [icono] Hablar con cajero > ---- */
.cf-bubble {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: auto;
  height: 56px;
  padding: 4px 8px 4px 4px;
  overflow: visible;
  border: 0;
  border-radius: 999px;
  color: #161108;
  background: var(--cf-gold);
  box-shadow: 0 12px 28px rgba(0, 0, 0, .42), 0 6px 18px rgba(227, 185, 62, .28);
  transition: transform .18s ease, background .18s ease, box-shadow .18s ease;
}
.cf-bubble:hover { transform: translateY(-2px); border-color: transparent; background: var(--cf-gold-bright); box-shadow: 0 16px 34px rgba(0, 0, 0, .46), 0 8px 22px rgba(227, 185, 62, .34); }
.cf-bubble:active { transform: translateY(0); }
.cf-bubble-icon { display: grid; place-items: center; width: 48px; height: 48px; flex: 0 0 48px; border-radius: 50%; color: var(--cf-gold-bright); background: var(--cf-header); }
.cf-bubble-icon .cf-icon { width: 24px; height: 24px; stroke-width: 1.9; }
.cf-bubble-label { font-size: 15px; font-weight: 800; letter-spacing: 0; white-space: nowrap; }
.cf-bubble-chevron { display: grid; place-items: center; width: 24px; height: 24px; flex: 0 0 24px; color: #161108; }
.cf-bubble-chevron .cf-icon { width: 18px; height: 18px; stroke-width: 2.2; }
.cf-bubble[aria-expanded="true"] .cf-bubble-chevron .cf-icon { transform: rotate(90deg); }

/* ---- panel ---- */
.cf-panel {
  bottom: 72px;
  width: min(400px, calc(100vw - 32px));
  height: min(640px, calc(100dvh - 104px));
  border: 1px solid var(--cf-line-strong);
  border-radius: 24px;
  background: var(--cf-body);
  box-shadow: 0 28px 80px rgba(0, 0, 0, .6);
}
.cf-panel-header { min-height: 76px; padding: 14px 16px; gap: 12px; border-bottom: 1px solid var(--cf-line-strong); background: var(--cf-header); }
.cf-header-logo { width: 44px; height: 44px; flex-basis: 44px; border-color: rgba(227, 185, 62, .35); background: var(--cf-void); }
.cf-header-logo img { width: 100%; height: 100%; object-fit: cover; }
.cf-panel-title { font-size: 16px; font-weight: 800; letter-spacing: -.01em; }
.cf-panel-status { margin-top: 3px; font-size: 12.5px; }
.cf-close-btn { width: 40px; height: 40px; flex-basis: 40px; border-radius: 12px; }
.cf-panel-body { padding: 20px 16px 16px; background: radial-gradient(360px 240px at 50% 0%, rgba(227, 185, 62, .07), transparent 72%), var(--cf-body); }

/* ---- botones del widget = sistema global ---- */
.cf-btn { min-height: 52px; padding: 0 20px; border: 1px solid transparent; border-radius: 999px; font-size: 15px; font-weight: 700; letter-spacing: 0; box-shadow: none; }
.cf-btn:hover { transform: translateY(-1px); }
.cf-btn-gold { color: #161108; background: var(--cf-gold); border-color: transparent; box-shadow: 0 10px 24px rgba(227, 185, 62, .25), inset 0 1px 0 rgba(255, 255, 255, .28); }
.cf-btn-gold:hover { filter: none; background: var(--cf-gold-bright); }
.cf-btn-outline { color: var(--cf-ink); background: var(--cf-panel-alt); border-color: var(--cf-line); }
.cf-btn-outline:hover { background: #1c3252; border-color: rgba(246, 218, 133, .35); }
.cf-btn:disabled, .cf-btn-gold:disabled, .cf-btn-outline:disabled { cursor: default; opacity: 1; color: var(--cf-ink-faint); background: var(--cf-panel-alt); border-color: var(--cf-line); box-shadow: none; filter: none; transform: none; }
.cf-btn-link { padding: 6px 0; font-size: 14px; }

/* ---- gate / bienvenida ---- */
.cf-welcome-emblem { width: 72px; height: 72px; margin-bottom: 16px; border-color: rgba(227, 185, 62, .35); background: var(--cf-void); box-shadow: 0 12px 28px rgba(0, 0, 0, .3); }
.cf-welcome-emblem img { width: 100%; height: 100%; object-fit: cover; }
.cf-welcome h3 { margin-bottom: 8px; font-size: 26px; letter-spacing: -.03em; }
.cf-welcome p { max-width: 300px; font-size: 15px; line-height: 1.55; }
.cf-welcome-actions { gap: 10px; margin-top: 22px; }
.cf-private-note { margin-top: 18px !important; font-size: 12px !important; letter-spacing: .02em; }
.cf-security-note { font-size: 13px; }
.cf-user-card { padding: 16px; border-color: var(--cf-line); border-radius: 12px; background: var(--cf-void); }
.cf-user-card p { font-size: 11px; }
.cf-user-card strong { font-size: 17px; }

/* ---- formulario inline (login dentro del widget) ---- */
.cf-inline-form label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.cf-inline-form input { min-height: 50px; padding: 12px 14px; border-color: var(--cf-line); border-radius: 12px; background: var(--cf-void); font-size: 16px; }
.cf-inline-form input:focus { border-color: var(--cf-gold-bright); box-shadow: 0 0 0 3px rgba(227, 185, 62, .22); }
.cf-form-error { font-size: 13px !important; }

/* ---- chat ---- */
.cf-msg { max-width: 84%; padding: 11px 14px; border-radius: 16px; font-size: 15px; line-height: 1.5; }
.cf-msg-agent { border-color: var(--cf-line); border-top-left-radius: 6px; background: var(--cf-panel-alt); }
.cf-msg-user { border-color: rgba(227, 185, 62, .35); border-top-right-radius: 6px; background: rgba(227, 185, 62, .16); }
.cf-msg-system { font-size: 12px; }
.cf-day-divider { font-size: 10px; }
.cf-chat-empty-icon { width: 52px; height: 52px; }
.cf-chat-empty p { max-width: 260px; font-size: 14px; }
.cf-chat-input-row { gap: 8px; padding-top: 12px; border-top: 1px solid var(--cf-line); }
.cf-chat-input-row textarea { min-height: 48px; padding: 13px 14px; border-color: var(--cf-line); border-radius: 16px; background: var(--cf-void); font-size: 15px; }
.cf-chat-input-row > button { width: 48px; min-width: 48px; height: 48px; border-color: var(--cf-line); border-radius: 50%; color: var(--cf-gold-bright); background: var(--cf-panel-alt); }
.cf-chat-input-row > button[type="submit"] { color: #161108; border-color: transparent; background: var(--cf-gold); box-shadow: 0 8px 18px rgba(227, 185, 62, .25); }
.cf-chat-input-row > button[type="submit"]:hover { background: var(--cf-gold-bright); }

/* ---- popup de notificaciones: armonizar botones con el sistema (tarjeta intacta) ---- */
.cf-notify-btn { min-height: 54px; border-radius: 999px; font-size: 15px; font-weight: 700; }
.cf-notify-primary { background: #e3b93e; border-color: transparent; box-shadow: 0 10px 24px rgba(227, 185, 62, .25), inset 0 1px 0 rgba(255, 255, 255, .28); }
.cf-notify-primary:hover { filter: none; background: #f6da85; }
.cf-notify-secondary { background: #152740; border-color: rgba(255, 255, 255, .08); color: #f5f1e8; }
.cf-notify-secondary:hover { background: #1c3252; border-color: rgba(246, 218, 133, .35); }
.cf-notify-card { border-radius: 24px; }

/* ---- mobile: sheet a pantalla completa desde abajo ---- */
@media (max-width: 600px) {
  #cf-widget-root { right: max(12px, env(safe-area-inset-right)); bottom: max(12px, env(safe-area-inset-bottom)); }
  .cf-bubble { height: 54px; }
  .cf-bubble-icon { width: 46px; height: 46px; flex-basis: 46px; }
  .cf-bubble-label { font-size: 14px; }
  .cf-panel {
    position: fixed;
    inset: auto 0 0 0;
    width: 100%;
    height: min(92dvh, 100dvh);
    max-height: 100dvh;
    border: 0;
    border-top: 1px solid var(--cf-line-strong);
    border-radius: 24px 24px 0 0;
    animation: cf-sheet-in .22s ease both;
  }
  .cf-panel-header { min-height: 72px; padding: 12px 14px calc(12px) 14px; }
  .cf-panel-body { padding: 18px 14px calc(14px + env(safe-area-inset-bottom)); }
  .cf-welcome h3 { font-size: 26px; }
  .cf-msg { max-width: 88%; }
}
@keyframes cf-sheet-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: reduce) {
  .cf-panel { animation: none; }
  .cf-bubble, .cf-btn { transition: none; }
}

/* la píldora no compite con el modal de cuenta ni con el popup de notificaciones (sólo visual) */
body.cf-account-open #cf-widget-bubble, body:has(#cf-notify-prompt) #cf-widget-bubble { opacity: 0; pointer-events: none; transition: opacity .16s ease; }
/* AUTH FIX · el contenedor del widget es fixed y z-index:9999. La regla de arriba solo desvanece
   la BURBUJA: el ROOT conservaba su caja y pointer-events:auto, y en moviles (<=600px, donde el
   CTA del modal es sticky al fondo) se superponia al boton y se tragaba el tap. El boton estaba
   habilitado y el formulario era valido, pero el submit nunca se disparaba.
   Se neutraliza el ROOT mientras el modal de auth esta abierto. */
body.cf-account-open #cf-widget-root,
body:has(#cf-notify-prompt) #cf-widget-root { pointer-events: none; }
/* El panel del chat recupera sus eventos: #cf-notify-prompt SOLO se muestra con el chat abierto
   (widget.js: WidgetState.isOpen && view===chat), asi que sin esta linea el prompt dejaria el
   chat muerto. Verificado por prueba: sin ella, input y boton de enviar quedan inalcanzables. */
body.cf-account-open #cf-widget-panel,
body:has(#cf-notify-prompt) #cf-widget-panel { pointer-events: auto; }

/* =========================================================
   POLISH FINAL · widget: burbujas diferenciadas, saltos de
   línea, adjunto preparado con preview, indicador de escritura.
   ========================================================= */
/* burbujas: dos superficies navy claramente distintas del cuerpo (#10203a), texto blanco */
.cf-msg { color: #ffffff; white-space: pre-wrap; overflow-wrap: anywhere; word-break: break-word; max-width: 84%; padding: 11px 14px; border-radius: 16px; }
.cf-msg-agent { border: 0; border-top-left-radius: 6px; background: #1d3459; box-shadow: 0 2px 8px rgba(0, 0, 0, .18); }
.cf-msg-user { border: 1px solid rgba(227, 185, 62, .28); border-top-right-radius: 6px; background: #071022; box-shadow: 0 2px 8px rgba(0, 0, 0, .22); }
.cf-msg-system { color: var(--cf-ink-faint); background: transparent; box-shadow: none; white-space: normal; }
.cf-msg a { color: var(--cf-gold-bright); text-decoration: underline; overflow-wrap: anywhere; }
.cf-pdf-link { color: var(--cf-gold-bright); }
.cf-chat-image { border-color: rgba(255, 255, 255, .12); }
/* el indicador "escribiendo" respeta [hidden] (display:flex lo pisaba) */
.cf-agent-typing[hidden] { display: none; }
/* adjunto preparado */
.cf-chat-pending { padding-top: 10px; }
.cf-chat-pending[hidden] { display: none; }
.cf-chat-pending-card { display: flex; align-items: center; gap: 10px; padding: 8px; border: 1px solid var(--cf-line); border-radius: 14px; background: var(--cf-panel-alt); }
.cf-chat-pending-thumb { width: 52px; height: 52px; flex: 0 0 52px; object-fit: cover; border-radius: 10px; background: var(--cf-void); }
.cf-chat-pending-icon { display: grid; place-items: center; width: 52px; height: 52px; flex: 0 0 52px; border-radius: 10px; color: var(--cf-gold-bright); background: rgba(227, 185, 62, .12); }
.cf-chat-pending-meta { display: grid; flex: 1; gap: 2px; min-width: 0; }
.cf-chat-pending-meta strong { overflow: hidden; color: var(--cf-ink); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.cf-chat-pending-meta small { color: var(--cf-ink-faint); font-size: 12px; }
.cf-chat-pending-remove { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 36px; padding: 0; border: 1px solid var(--cf-line); border-radius: 50%; color: var(--cf-ink-soft); background: transparent; cursor: pointer; }
.cf-chat-pending-remove:hover { color: var(--cf-ink); border-color: var(--cf-line-strong); background: rgba(255, 255, 255, .06); }
.cf-chat-input-row > button:disabled { cursor: wait; opacity: .6; }
