/* Centera v3 · web chat widget ("Talk to it"). Opt-in per page; needs centera.css first (tokens, .btn, .bubble, .typing).
   Phone first: at 390px the panel is the screen width minus 12px per side; from 640px it is a 380px phone-sized panel.
   Motion uses the --dur-* tokens, which centera.css sets to 0ms under prefers-reduced-motion. */
.cw-launch {
  position: fixed; right: var(--gutter); bottom: calc(var(--gutter) + env(safe-area-inset-bottom, 0px)); z-index: 80;
  gap: 8px; min-height: 52px; padding: 0 20px 0 16px; border-radius: var(--radius-pill);
}
.cw-launch svg { flex: none; }
.cw-launch[aria-expanded="true"] { visibility: hidden; }
/* pages that load the launcher: keep the footer's last row (copyright + EN/ES toggle) clear of it at the end of the page */
.site-footer { padding-bottom: calc(var(--gutter) + 52px + 12px + env(safe-area-inset-bottom, 0px)); }

.cw-panel {
  position: fixed; z-index: 95; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  height: min(640px, calc(100dvh - 24px - env(safe-area-inset-bottom, 0px)));
  display: flex; flex-direction: column; overflow: hidden;
  background: #0F0F16; border: 1px solid var(--line-2); border-radius: var(--radius-xl); box-shadow: var(--shadow-3);
  opacity: 0; transform: translateY(12px);
  transition: opacity var(--dur-3) var(--ease-out), transform var(--dur-3) var(--ease-out);
}
.cw-panel[hidden] { display: none; }
.cw-panel.is-open { opacity: 1; transform: none; }
@media (min-width: 640px) {
  .cw-panel { left: auto; right: var(--gutter); bottom: var(--gutter); width: 380px; height: min(640px, calc(100dvh - var(--nav-h) - 32px)); }
}

.cw-head { display: flex; align-items: center; gap: var(--space-3); padding: 10px 8px 10px 16px; border-bottom: 1px solid var(--line); background: rgba(255, 255, 255, 0.02); }
.cw-head > div { flex: 1; min-width: 0; }
.cw-title { font-size: 16px; font-weight: 700; line-height: 1.2; }
.cw-sub { font-size: 13px; color: var(--muted); }
.cw-x { flex: none; display: grid; place-items: center; width: var(--tap); height: var(--tap); border: 0; border-radius: var(--radius); background: none; color: var(--bone); font-size: 26px; line-height: 1; cursor: pointer; }
.cw-x:hover { background: var(--surface-3); }

.cw-disc { padding: 10px 16px; background: var(--ember-tint); border-bottom: 1px solid var(--ember-line); font-size: 14px; line-height: 1.45; }
.cw-disc strong { display: block; color: var(--bone); font-weight: 700; }
.cw-disc span { color: var(--bone-2); }

.cw-log { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: flex; flex-direction: column; gap: var(--space-2); padding: 14px 12px; font-size: 16px; line-height: 1.45; }
.cw-log .bubble { white-space: pre-wrap; overflow-wrap: anywhere; }
.cw-log .bubble a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.cw-log .bubble-desk a { color: var(--ember-soft); }
.cw-rest { border: 1px solid var(--line-2); }

.cw-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 12px 10px; }
.cw-chips[hidden] { display: none; }
.cw-chip { min-height: var(--tap); padding: 0 14px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--bone); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; transition: border-color var(--dur-2) var(--ease), background var(--dur-2) var(--ease); }
.cw-chip:hover { border-color: var(--ember-line); background: var(--surface-3); }

.cw-hand { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius); background: var(--surface-1); border: 1px solid var(--line-2); }
.cw-hand p { font-size: 15px; color: var(--bone-2); }

.cw-form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid var(--line); }
.cw-in { flex: 1; min-width: 0; min-height: var(--tap); padding: 10px 14px; border-radius: var(--radius-pill); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--bone); font: inherit; font-size: 16px; }
.cw-in::placeholder { color: var(--muted); }
.cw-in:disabled { opacity: 0.55; }
.cw-form .btn { flex: none; border-radius: var(--radius-pill); }
.cw-foot { padding: 0 12px 4px; text-align: center; font-size: 14px; }
.cw-foot a { display: inline-flex; align-items: center; min-height: var(--tap); color: var(--ember-soft); text-decoration: underline; text-underline-offset: 3px; }
