/* Asistente guiado de CyC Gestoría: usa los colores y tipografías del tema. */
:root {
  --cyc-ast-primary: var(--primary, oklch(49.4% .089 358));
  --cyc-ast-on-primary: var(--primary-foreground, oklch(98.5% .005 80));
  --cyc-ast-bg: var(--background, oklch(98.2% .006 80));
  --cyc-ast-card: var(--card, #fff);
  --cyc-ast-text: var(--foreground, oklch(29% .005 285));
  --cyc-ast-muted: var(--muted-foreground, oklch(49% .012 300));
  --cyc-ast-border: var(--border, oklch(90% .01 60));
  --cyc-ast-soft: var(--secondary, oklch(94.9% .012 40));
  --cyc-ast-gold: var(--gold, oklch(72.7% .033 66.5));
  --cyc-ast-display: var(--font-display, "Cormorant Garamond", Georgia, serif);
  --cyc-ast-sans: "Karla", ui-sans-serif, system-ui, sans-serif;
}

/* Botón que abre el asistente */
.cyc-ast-launcher {
  position: fixed; z-index: 60; right: 24px; bottom: 24px;
  display: flex; align-items: center; gap: 14px;
  padding: 10px 22px 10px 12px; max-width: calc(100vw - 32px);
  font: 500 16px/1.3 var(--cyc-ast-sans); color: var(--cyc-ast-on-primary);
  background: var(--cyc-ast-primary); border: 0; border-radius: 4px; cursor: pointer;
  box-shadow: 0 0 0 4px oklch(98.2% .006 80 / .9), 0 18px 40px -16px oklch(29% .05 358 / .55);
  transition: transform .2s ease, box-shadow .2s ease;
}
.cyc-ast-launcher:hover { transform: translateY(-2px); }
.cyc-ast-launcher:focus-visible { outline: 2px solid var(--cyc-ast-gold); outline-offset: 4px; }
.cyc-ast-launcher img { width: 46px; height: 46px; flex: none; margin: -6px 0; padding: 4px; border-radius: 50%; background: var(--cyc-ast-bg); box-shadow: 0 4px 10px -4px rgb(0 0 0 / .35); }
.cyc-ast-launcher svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cyc-ast-abierto .cyc-ast-launcher { opacity: 0; pointer-events: none; }

/* El botón flotante de WhatsApp y su saludo se reemplazan por el asistente (que termina en WhatsApp) */
[data-cyc-saludo], a[aria-label="Chatear por WhatsApp"] { display: none !important; }

/* Panel */
.cyc-ast-backdrop { position: fixed; inset: 0; z-index: 69; background: oklch(29% .02 358 / .35); }
.cyc-ast-panel {
  position: fixed; z-index: 70; right: 24px; bottom: 24px;
  width: min(410px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--cyc-ast-bg); color: var(--cyc-ast-text);
  border: 1px solid var(--cyc-ast-border); border-radius: 6px;
  box-shadow: 0 30px 70px -30px oklch(29% .05 358 / .6);
  font: 400 15px/1.5 var(--cyc-ast-sans);
}
.cyc-ast-panel[hidden] { display: none; }
.cyc-ast-header {
  display: flex; align-items: center; gap: 12px; padding: 16px 14px 16px 18px;
  background: var(--cyc-ast-primary); color: var(--cyc-ast-on-primary);
}
.cyc-ast-header img { width: 52px; height: 52px; flex: none; padding: 4px; border-radius: 50%; background: var(--cyc-ast-bg); }
.cyc-ast-heading { flex: 1; min-width: 0; }
.cyc-ast-heading h2 { margin: 0; font: 600 26px/1 var(--cyc-ast-display); color: inherit; letter-spacing: .01em; }
.cyc-ast-heading p { margin: 4px 0 0; font-size: 12.5px; opacity: .85; }
.cyc-ast-header button {
  width: 40px; height: 40px; display: grid; place-items: center; flex: none;
  background: transparent; border: 0; border-radius: 4px; color: inherit; cursor: pointer;
}
.cyc-ast-header button:hover { background: oklch(100% 0 0 / .12); }
.cyc-ast-header button:focus-visible { outline: 2px solid var(--cyc-ast-gold); }
.cyc-ast-header svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cyc-ast-progress {
  margin: 0; padding: 10px 18px; font-size: 11px; font-weight: 700; letter-spacing: .14em;
  color: var(--cyc-ast-muted); background: var(--cyc-ast-soft); border-bottom: 1px solid var(--cyc-ast-border);
}
.cyc-ast-log { flex: 1; overflow-y: auto; padding: 18px 16px 8px; overscroll-behavior: contain; }
.cyc-ast-msg { margin-bottom: 14px; max-width: 88%; }
.cyc-ast-msg p { margin: 0; white-space: pre-line; padding: 12px 16px; border-radius: 4px; }
.cyc-ast-msg-bot p { background: var(--cyc-ast-card); border: 1px solid var(--cyc-ast-border); border-left: 2px solid var(--cyc-ast-primary); }
.cyc-ast-msg-bot a { color: var(--cyc-ast-primary); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
.cyc-ast-msg-label { display: flex; align-items: center; gap: 6px; margin: 0 0 6px 2px; font-size: 12px; font-weight: 600; color: var(--cyc-ast-muted); }
.cyc-ast-msg-label img { width: 24px; height: 24px; }
.cyc-ast-msg-user { margin-left: auto; }
.cyc-ast-msg-user p { background: var(--cyc-ast-primary); color: var(--cyc-ast-on-primary); }
.cyc-ast-choices { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 16px 14px; }
.cyc-ast-choices:empty { display: none; }
.cyc-ast-opt {
  font: 600 14px/1.3 var(--cyc-ast-sans); color: var(--cyc-ast-primary); text-align: left;
  padding: 9px 14px; background: var(--cyc-ast-card); border: 1px solid var(--cyc-ast-primary);
  border-radius: 4px; cursor: pointer; text-decoration: none; transition: background .15s, color .15s;
}
.cyc-ast-opt:hover, .cyc-ast-opt:focus-visible { background: var(--cyc-ast-primary); color: var(--cyc-ast-on-primary); outline: none; }
.cyc-ast-opt-check[aria-pressed="true"] { background: var(--cyc-ast-primary); color: var(--cyc-ast-on-primary); }
.cyc-ast-opt-check[aria-pressed="true"]::before { content: "✓ "; }
.cyc-ast-opt-next { flex-basis: 100%; text-align: center; background: var(--cyc-ast-primary); color: var(--cyc-ast-on-primary); }
.cyc-ast-opt-next:hover, .cyc-ast-opt-next:focus-visible { background: oklch(42% .09 358); }
.cyc-ast-opt-next:disabled { background: var(--cyc-ast-soft); color: var(--cyc-ast-muted); border-color: var(--cyc-ast-border); cursor: default; }
.cyc-ast-opt-wa { display: inline-flex; align-items: center; gap: 8px; background: #25D366; border-color: #25D366; color: #fff; }
.cyc-ast-opt-wa:hover, .cyc-ast-opt-wa:focus-visible { background: #25D366; color: #fff; filter: brightness(.94); }
.cyc-ast-opt-wa svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cyc-ast-composer { display: flex; gap: 8px; padding: 12px 14px; background: var(--cyc-ast-card); border-top: 1px solid var(--cyc-ast-border); }
.cyc-ast-composer input {
  flex: 1; min-width: 0; font: 400 15px/1.4 var(--cyc-ast-sans); color: var(--cyc-ast-text);
  padding: 11px 14px; background: var(--cyc-ast-bg); border: 1px solid var(--cyc-ast-border); border-radius: 4px;
}
.cyc-ast-composer input:focus { outline: 2px solid var(--cyc-ast-primary); outline-offset: -1px; }
.cyc-ast-send {
  width: 46px; flex: none; display: grid; place-items: center; border: 0; border-radius: 4px;
  background: var(--cyc-ast-primary); color: var(--cyc-ast-on-primary); cursor: pointer;
}
.cyc-ast-send:disabled { background: var(--cyc-ast-soft); color: var(--cyc-ast-muted); cursor: default; }
.cyc-ast-send svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cyc-ast-note { margin: 0; padding: 0 14px 12px; background: var(--cyc-ast-card); font-size: 11.5px; color: var(--cyc-ast-muted); text-align: center; }

html.cyc-ast-sin-scroll, html.cyc-ast-sin-scroll body { overflow: hidden; }
html.cyc-ast-sin-scroll body { position: fixed; width: 100%; }

/* Celular: botón a lo ancho y panel a pantalla completa */
@media (max-width: 640px) {
  .cyc-ast-launcher { left: 16px; right: 16px; bottom: 20px; justify-content: center; padding: 8px 14px 8px 8px; gap: 10px; font-size: 14.5px; }
  .cyc-ast-launcher:hover { transform: translateY(-2px); }
  .cyc-ast-launcher img { width: 40px; height: 40px; }
  .cyc-ast-launcher .cyc-ast-largo { display: none; }
  .cyc-ast-panel { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; }
}
@media (min-width: 641px) { .cyc-ast-launcher .cyc-ast-corto { display: none; } }
@media (prefers-reduced-motion: reduce) { .cyc-ast-launcher { transition: none; } }
