/* Cartuul website assistant — the hero in the shape of Cartuul 2's Help Center: one centred card (kicker, title, one big
   ask box, "Popular:" chips, the calls to action), a product screen under it that follows the example questions.
   Class prefix ctg- / hero-agent- on purpose: the site already owns .cta-* and .hero-* (home css, nav_styles). */

/* ── The ask box + thread + chips (block assistant_hero) ─────────────────────── */
.ctg {
  --ctg-border: rgba(255, 255, 255, 0.09);
  --ctg-border-bright: rgba(255, 255, 255, 0.16);
  --ctg-text: var(--text, #f8fafc);
  --ctg-soft: var(--text-soft, #cbd5e1);
  --ctg-muted: var(--text-muted, #7888a0);
  --ctg-green: var(--accent-green, #22c55e);
  --ctg-blue: var(--accent-blue, #38bdf8);
  --ctg-indigo: var(--accent-indigo, #6366f1);
  position: relative;
  width: 100%;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
  text-align: center;
  color: var(--ctg-text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}
.ctg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* the ask box */
.ctg-form { position: relative; display: flex; align-items: center; }
.ctg-form-ic { position: absolute; left: 20px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ctg-green); pointer-events: none; }
.ctg.is-busy .ctg-form-ic, .ctg.is-demo .ctg-form-ic { animation: ctg-twinkle 1.6s ease-in-out infinite; }
@keyframes ctg-twinkle { 0%, 100% { opacity: 1; transform: translateY(-50%) scale(1); } 50% { opacity: 0.55; transform: translateY(-50%) scale(0.88); } }
.ctg-form input {
  flex: 1; min-width: 0;
  height: 60px;
  font: inherit; font-size: 17px;
  color: var(--ctg-text);
  background: rgba(2, 8, 23, 0.72);
  border: 1px solid var(--ctg-border-bright);
  border-radius: 16px;
  padding: 0 64px 0 52px;
  outline: none;
  box-shadow: 0 18px 50px -24px rgba(0, 0, 0, 0.9), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.ctg-form input::placeholder { color: var(--ctg-muted); }
.ctg-form input:focus { border-color: rgba(34, 197, 94, 0.7); box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.14), 0 18px 50px -24px rgba(0, 0, 0, 0.9); }
.ctg-form input:disabled { opacity: 0.75; }
.ctg-send {
  position: absolute; right: 9px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 42px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 12px; cursor: pointer;
  color: #04111f;
  background: linear-gradient(135deg, var(--ctg-green), var(--ctg-blue));
  box-shadow: 0 8px 20px -10px rgba(34, 197, 94, 0.9);
  transition: filter 0.12s ease;
}
.ctg-send:hover { filter: brightness(1.08); }
.ctg-send:disabled { opacity: 0.45; cursor: default; }
.ctg-stop { position: absolute; right: 58px; top: 50%; transform: translateY(-50%); font: inherit; font-size: 12.5px; color: var(--ctg-soft); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--ctg-border-bright); border-radius: 9px; padding: 7px 10px; cursor: pointer; }
.ctg-kbd { position: absolute; right: 60px; top: 50%; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--ctg-border); background: rgba(255, 255, 255, 0.04); font: 600 12px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--ctg-muted); pointer-events: none; }
.ctg.is-busy .ctg-kbd, .ctg-form input:focus ~ .ctg-kbd { display: none; }

/* the conversation: appears under the box once the visitor asks */
.ctg-thread {
  display: flex; flex-direction: column; gap: 10px;
  max-height: min(440px, 55vh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px;
  text-align: left;
  background: rgba(2, 8, 23, 0.45);
  border: 1px solid var(--ctg-border);
  border-radius: 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.14) transparent;
}
.ctg-thread[hidden] { display: none; }
.ctg-msg { display: flex; flex: 0 0 auto; }
.ctg-user { justify-content: flex-end; }
.ctg-assistant { justify-content: flex-start; }
.ctg-bubble {
  max-width: 86%;
  padding: 11px 14px;
  border-radius: 16px;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ctg-text);
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.ctg-user .ctg-bubble { background: linear-gradient(135deg, rgba(34, 197, 94, 0.92), rgba(56, 189, 248, 0.92)); color: #04111f; font-weight: 500; border-bottom-right-radius: 5px; white-space: pre-wrap; }
.ctg-assistant .ctg-bubble { background: rgba(255, 255, 255, 0.055); border: 1px solid var(--ctg-border); color: var(--ctg-soft); border-bottom-left-radius: 5px; max-width: 96%; }
.ctg-bubble.is-error { border-color: rgba(248, 113, 113, 0.4); }
.ctg-body p { margin: 0 0 8px; color: inherit; font-size: inherit; line-height: inherit; }
.ctg-body p:last-child { margin-bottom: 0; }
.ctg-body ul { margin: 4px 0 8px 18px; padding: 0; }
.ctg-body li { margin: 2px 0; }
.ctg-body a { color: var(--ctg-blue); text-decoration: underline; text-underline-offset: 2px; }
.ctg-body strong { color: #fff; font-weight: 600; }
.ctg-typing { display: inline-flex; gap: 4px; align-items: center; height: 18px; }
.ctg-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--ctg-soft); opacity: 0.5; animation: ctg-dot 1.2s ease-in-out infinite; }
.ctg-typing i:nth-child(2) { animation-delay: 0.15s; }
.ctg-typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ctg-dot { 0%, 80%, 100% { transform: translateY(0); opacity: 0.4; } 40% { transform: translateY(-4px); opacity: 1; } }

.ctg-sources { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--ctg-border); }
.ctg-sources-label { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ctg-muted); margin-right: 2px; }
.ctg-source { font-size: 12px; color: var(--ctg-soft); background: rgba(255, 255, 255, 0.06); border: 1px solid var(--ctg-border); border-radius: 999px; padding: 3px 9px; text-decoration: none; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.ctg-source:hover { border-color: var(--ctg-border-bright); color: #fff; }

.ctg-screen { margin: 12px 0 2px; }
.ctg-screen img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; object-position: left top; border-radius: 10px; border: 1px solid var(--ctg-border-bright); background: #0b1220; }
.ctg-screen figcaption { font-size: 12px; color: var(--ctg-muted); margin-top: 7px; line-height: 1.4; }
.ctg-screen figcaption strong { color: var(--ctg-soft); font-weight: 600; }
.ctg-screen figcaption a { color: var(--ctg-blue); }

.ctg-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.ctg-tool { background: transparent; border: 1px solid var(--ctg-border); color: var(--ctg-muted); border-radius: 999px; padding: 3px 9px; font: inherit; font-size: 12.5px; line-height: 1.2; cursor: pointer; }
.ctg-tool:hover, .ctg-tool.is-on { color: #fff; border-color: var(--ctg-border-bright); background: rgba(255, 255, 255, 0.06); }
.ctg-report { display: flex; gap: 6px; width: 100%; margin-top: 6px; }
.ctg-report textarea { flex: 1; min-width: 0; resize: vertical; font: inherit; font-size: 13px; color: var(--ctg-text); background: rgba(2, 8, 23, 0.6); border: 1px solid var(--ctg-border); border-radius: 10px; padding: 8px 10px; }
.ctg-thanks { font-size: 12.5px; color: var(--ctg-soft); }

/* "Popular:" chips, centred and wrapping like the Help Center's */
.ctg-chips { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.ctg-chips-label { font-size: 12.5px; font-weight: 600; color: var(--ctg-muted); margin-right: 2px; }
.ctg-chip {
  font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2;
  color: var(--ctg-text);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--ctg-border);
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.ctg-chip:hover { color: #fff; border-color: rgba(34, 197, 94, 0.6); background: rgba(34, 197, 94, 0.08); }
.ctg-chip:focus-visible, .ctg-send:focus-visible, .ctg-tool:focus-visible, .ctg-stop:focus-visible { outline: 2px solid var(--ctg-green); outline-offset: 2px; }
.ctg-foot { margin: -2px 0 0; font-size: 12px; line-height: 1.45; color: var(--ctg-muted); }
.ctg-foot a { color: var(--ctg-soft); text-decoration: underline; text-underline-offset: 2px; }

/* ── The hero: the card, the product screen under it (bin/hero-agent.php) ──── */
.hero-section.hero-agent { display: block; text-align: center; min-height: 0; padding: 112px 24px 40px; }
.hero-section.hero-agent .container { display: block; }
.hero-agent-card {
  position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 18px;
  padding: 56px 40px 44px;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background:
    radial-gradient(70% 120% at 0% 0%, rgba(34, 197, 94, 0.14), transparent 60%),
    radial-gradient(60% 110% at 100% 100%, rgba(56, 189, 248, 0.14), transparent 65%),
    rgba(12, 20, 38, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 40px 100px -40px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  animation: fadeUp 0.7s var(--ease, ease) both;
}
.hero-agent .hero-kicker { margin: 0; }
.hero-agent .hero-h1 { font-size: clamp(38px, 4.8vw, 66px); line-height: 1.06; margin: 2px 0 0; max-width: 900px; text-wrap: balance; }
.hero-fn a { font-size: 0.34em; vertical-align: super; color: var(--text-muted, #7888a0); text-decoration: none; margin-left: 4px; font-weight: 600; }
.hero-fn a:hover { color: var(--text-soft, #cbd5e1); }
.hero-agent .hero-sub { margin: 0 auto 6px; max-width: 640px; font-size: 18px; line-height: 1.6; text-wrap: balance; }
.hero-agent-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 8px; }
.hero-agent-proof { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 0; padding: 0; list-style: none; }
.hero-agent-proof li { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-muted, #7888a0); }
.hero-agent-proof li::before { content: ''; flex: 0 0 auto; width: 16px; height: 16px; border-radius: 50%; background: rgba(34, 197, 94, 0.14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.6L12 5.5' fill='none' stroke='%2322c55e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 12px no-repeat; }

/* the product screen that follows the example questions */
.hero-agent-stage { position: relative; z-index: 0; max-width: 1040px; margin: 44px auto 0; animation: fadeUp 0.9s 0.2s var(--ease, ease) both; }
.hero-agent-stage::before { content: ''; position: absolute; left: 10%; right: 10%; top: 30%; bottom: -8%; background: radial-gradient(ellipse at 50% 60%, rgba(56, 189, 248, 0.2), rgba(99, 102, 241, 0.12) 50%, transparent 72%); filter: blur(40px); z-index: -1; pointer-events: none; }
.ctg-stage-frame { margin: 0; overflow: hidden; border-radius: 20px; border: 1px solid rgba(255, 255, 255, 0.14); background: rgba(12, 20, 38, 0.7); box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6); }
.ctg-stage-bar { display: flex; align-items: center; gap: 8px; padding: 12px 18px; background: rgba(0, 0, 0, 0.3); border-bottom: 1px solid rgba(255, 255, 255, 0.08); font-size: 12px; color: var(--text-muted, #7888a0); text-align: left; }
.ctg-stage-bar .ctg-pins { display: inline-flex; gap: 6px; margin-right: 10px; }
.ctg-stage-bar .ctg-pins i { width: 10px; height: 10px; border-radius: 50%; background: #ef4444; }
.ctg-stage-bar .ctg-pins i:nth-child(2) { background: #fbbf24; }
.ctg-stage-bar .ctg-pins i:nth-child(3) { background: var(--accent-green, #22c55e); }
.ctg-stage-bar .ctg-stage-q { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-soft, #cbd5e1); }
.ctg-stage-bar .ctg-stage-q:empty { display: none; }
.ctg-stage-frame img { display: block; width: 100%; height: auto; max-height: 560px; object-fit: cover; object-position: left top; transition: opacity 0.35s ease; }
.ctg-stage-frame img.is-switching { opacity: 0.4; }
.ctg-stage-caption { margin: 14px 0 0; font-size: 13px; line-height: 1.5; color: var(--text-muted, #7888a0); }
.ctg-stage-caption strong { color: var(--text-soft, #cbd5e1); font-weight: 600; margin-right: 6px; }

/* under the screen: the apps and the providers */
.hero-agent-meta { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 14px 28px; margin: 32px auto 0; }
.hero-agent-apps { display: inline-flex; align-items: center; flex-wrap: wrap; justify-content: center; gap: 10px; }
.hero-agent-apps a { display: inline-flex; border-radius: 8px; opacity: 0.9; transition: transform 0.25s var(--ease, ease), opacity 0.25s var(--ease, ease); }
.hero-agent-apps a:hover { opacity: 1; transform: translateY(-2px); }
.hero-agent-apps img { height: 36px; width: auto; display: block; }
.hero-agent-apps span { font-size: 12px; color: var(--text-muted, #7888a0); margin-left: 4px; }
.hero-agent-providers { display: inline-flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; margin: 0; font-size: 12px; color: var(--text-muted, #7888a0); }
.hero-agent-providers b { font-weight: 600; color: var(--text-soft, #cbd5e1); margin-right: 4px; }
.hero-agent-providers span { font-size: 12px; font-weight: 500; color: var(--text-soft, #cbd5e1); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); border-radius: 999px; padding: 3px 9px; }
.hero-footnote { margin: 36px auto 0; max-width: 900px; font-size: 11.5px; line-height: 1.55; color: var(--text-muted, #7888a0); text-align: center; }
.hero-footnote a { color: var(--text-soft, #cbd5e1); }

@media (max-width: 760px) {
  .hero-agent-card { padding: 36px 20px 30px; gap: 16px; }
  .hero-agent .hero-sub { font-size: 16.5px; }
  .ctg-chip:nth-child(n + 5) { display: none; }
  .ctg-stage-frame img { max-height: 380px; }
}
@media (max-width: 640px) {
  .hero-section.hero-agent { padding: 100px 16px 36px; }
  .hero-agent-card { padding: 32px 16px 26px; border-radius: 22px; gap: 14px; }
  .hero-agent .hero-kicker { font-size: 10px; letter-spacing: 1px; padding: 7px 14px; }
  .hero-agent .hero-h1 { font-size: clamp(32px, 9.6vw, 38px); }
  .hero-agent .hero-sub { font-size: 16px; line-height: 1.55; }
  .ctg { gap: 12px; }
  .ctg-form input { height: 54px; font-size: 16px; padding: 0 58px 0 46px; border-radius: 14px; }
  .ctg-form-ic { left: 16px; width: 18px; height: 18px; }
  .ctg-send { width: 38px; height: 38px; right: 8px; }
  .ctg-kbd { display: none; }
  .ctg-thread { padding: 12px; max-height: 60vh; }
  .ctg-bubble { max-width: 92%; font-size: 14.5px; }
  .ctg-chip { font-size: 12.5px; padding: 7px 12px; }
  .hero-agent-actions { width: 100%; gap: 10px; }
  .hero-agent-actions .btn { flex: 1 1 0; padding: 15px 14px; font-size: 14.5px; }
  .hero-agent-proof { display: grid; grid-template-columns: repeat(2, auto); justify-content: center; gap: 8px 18px; }
  .hero-agent-stage { margin-top: 28px; }
  .ctg-stage-frame { border-radius: 16px; }
  .ctg-stage-bar { padding: 10px 14px; }
  .ctg-stage-frame img { max-height: 260px; }
  .hero-agent-meta { gap: 14px; margin-top: 26px; }
  .hero-footnote { margin-top: 28px; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  .ctg-form-ic, .ctg-typing i { animation: none; }
  .hero-agent-card, .hero-agent-stage, .hero-agent-apps a { animation: none; transition: none; }
}

/* ── The conversation above the input, the follow-ups under it ──────────────── */
.ctg-thread { position: relative; }
.ctg-clear { position: sticky; top: 0; align-self: flex-end; z-index: 1; margin: -6px -6px -4px 0; font: inherit; font-size: 11.5px; color: var(--ctg-muted); background: rgba(9, 16, 32, 0.85); border: 1px solid var(--ctg-border); border-radius: 999px; padding: 4px 10px; cursor: pointer; backdrop-filter: blur(6px); }
.ctg-clear:hover { color: #fff; border-color: var(--ctg-border-bright); }
.ctg-avatar { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; margin: 2px 9px 0 0; background: radial-gradient(circle at 30% 30%, #fff 0, var(--ctg-green) 30%, var(--ctg-indigo) 100%); box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.06); }
.ctg-assistant .ctg-bubble { max-width: calc(96% - 33px); }
.ctg-tool--speak { display: inline-flex; align-items: center; gap: 5px; }
.ctg-tool--speak svg { width: 13px; height: 13px; }
.ctg-tool--speak.is-on { color: var(--ctg-green); border-color: rgba(34, 197, 94, 0.5); }

.ctg-next { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 8px; }
.ctg-next[hidden] { display: none; }
.ctg-next-label { font-size: 12.5px; font-weight: 600; color: var(--ctg-muted); margin-right: 2px; }
.ctg-next-chip { font: inherit; font-size: 13px; font-weight: 500; line-height: 1.2; color: var(--ctg-text); background: rgba(56, 189, 248, 0.08); border: 1px solid rgba(56, 189, 248, 0.3); border-radius: 999px; padding: 8px 14px; cursor: pointer; transition: background 0.15s ease, border-color 0.15s ease; animation: ctg-rise 0.3s ease both; }
.ctg-next-chip:hover { background: rgba(56, 189, 248, 0.16); border-color: rgba(56, 189, 248, 0.55); }
.ctg-next-chip:focus-visible, .ctg-mic:focus-visible, .ctg-clear:focus-visible { outline: 2px solid var(--ctg-green); outline-offset: 2px; }
@keyframes ctg-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.ctg-chips[hidden] { display: none; }

.ctg-mic { position: absolute; right: 58px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--ctg-border); background: rgba(255, 255, 255, 0.04); color: var(--ctg-soft); cursor: pointer; transition: background 0.15s ease, color 0.15s ease; }
.ctg-mic[hidden] { display: none; }
.ctg-mic svg { width: 19px; height: 19px; }
.ctg-mic:hover { color: #fff; background: rgba(255, 255, 255, 0.09); }
.ctg.has-mic .ctg-form input { padding-right: 112px; }
.ctg.has-mic .ctg-kbd { display: none; }
.ctg.has-mic .ctg-stop { right: 108px; }
.ctg.is-listening .ctg-mic { color: #fff; background: rgba(239, 68, 68, 0.88); border-color: rgba(239, 68, 68, 0.95); animation: ctg-listen 1.2s ease-in-out infinite; }
@keyframes ctg-listen { 0%, 100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.45); } 50% { box-shadow: 0 0 0 9px rgba(239, 68, 68, 0); } }
.ctg.is-listening .ctg-form input { border-color: rgba(239, 68, 68, 0.6); }
.ctg-hint { margin: -6px 0 0; font-size: 12px; color: #fca5a5; }
.ctg-hint[hidden] { display: none; }

@media (max-width: 640px) {
  .ctg-mic { right: 54px; width: 38px; height: 38px; }
  .ctg.has-mic .ctg-form input { padding-right: 102px; }
  .ctg.has-mic .ctg-stop { right: 100px; }
  .ctg-avatar { width: 22px; height: 22px; margin-right: 8px; }
  .ctg-assistant .ctg-bubble { max-width: calc(100% - 30px); }
  .ctg-next-chip:nth-child(n + 4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .ctg-next-chip, .ctg.is-listening .ctg-mic { animation: none; }
}
