.hero-chat {
  position: relative;
  z-index: 4;
  width: min(92vw, 58rem);
  min-height: 5.25rem;
  margin: clamp(3.75rem, 8vh, 6.25rem) auto 0;
  text-align: left;
}

.hero-chat .sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.hero-chat__opener {
  display: flex;
  width: min(100%, 52rem);
  min-height: 4.75rem;
  margin: 0 auto;
  padding: .7rem .72rem .7rem .9rem;
  align-items: center;
  gap: .8rem;
  border: 1px solid #e8edf2;
  border-radius: 999px;
  color: #718094;
  background: #fff;
  box-shadow: 0 18px 46px #020a185c;
  cursor: pointer;
  font: inherit;
  font-size: 1.02rem;
  font-weight: 600;
  transition: border-color 220ms ease, background 220ms ease, transform 220ms cubic-bezier(.16,1,.3,1), box-shadow 220ms ease;
}
.hero-chat__opener[hidden] { display: none !important; }

.hero-chat__opener:hover,
.hero-chat__opener:focus-visible {
  border-color: #fff;
  background: #fff;
  box-shadow: 0 25px 65px #020a1880;
  transform: translateY(-3px) scale(1.01);
}

.hero-chat__opener:focus-visible,
.hero-chat__close:focus-visible,
.hero-chat__send:focus-visible,
.hero-chat textarea:focus-visible { outline: 3px solid #9bdcff; outline-offset: 3px; }

.hero-chat__open-icon {
  display: grid;
  flex: 0 0 auto;
  width: 3.7rem;
  height: 3.7rem;
  place-items: center;
  border-radius: 50%;
}

.hero-chat__open-icon { width: 3.4rem; height: 3.4rem; margin-left: auto; color: #fff; background: #101216; box-shadow: none; }
.hero-chat svg { width: 1.15rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.hero-chat__spark svg { width: 1.3rem; }

.hero-chat__panel {
  position: relative;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 30px;
  color: #eaf6ff;
  background: transparent;
  box-shadow: none;
  transform-origin: center top;
}
.hero-chat__panel[hidden] { display: none !important; }

.hero-chat__panel.is-opening { animation: hero-chat-open 420ms cubic-bezier(.16,1,.3,1) both; }
.hero-chat__header { display: flex; align-items: center; justify-content: space-between; padding: 0 .6rem .65rem; }
.hero-chat__status { display: inline-flex; align-items: center; gap: .5rem; color: #bfe7ff; font-size: .73rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.hero-chat__status i { width: .5rem; height: .5rem; border-radius: 50%; background: #73e2b4; box-shadow: 0 0 0 .25rem #73e2b41f; }
.hero-chat__close { display: grid; width: 2rem; height: 2rem; padding: 0; place-items: center; border: 0; border-radius: 9px; color: #bfe7ff; background: transparent; cursor: pointer; }
.hero-chat__close:hover { background: #d9efff17; }
.hero-chat__conversation { display: grid; max-height: 11rem; padding: .55rem .6rem 1rem; gap: .7rem; overflow-y: auto; scrollbar-color: #78bce8 transparent; }
.hero-chat__message { width: fit-content; max-width: 78%; margin: 0; padding: .8rem 1rem; border-radius: 18px; font-size: .95rem; line-height: 1.48; }
.hero-chat__message--agent { color: #dcefff; background: #173a59; }
.hero-chat__message--user { margin-left: auto; color: #07182c; background: #9bdcff; }
.hero-chat__message--error { color: #ffe5e8; background: #5a2030; }
.hero-chat__form { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; min-height: 4.75rem; padding: .55rem .65rem .55rem 1.35rem; border: 1px solid #e8edf2; border-radius: 999px; background: #fff; box-shadow: 0 20px 55px #020a1870; }
.hero-chat textarea { display: block; width: 100%; min-width: 0; min-height: 3rem; max-height: 7rem; padding: .78rem 0 .55rem; resize: none; border: 0; color: #14263b; background: transparent; font: inherit; font-size: 1rem; line-height: 1.45; caret-color: #0a5cff; }
.hero-chat textarea::placeholder { color: #7c8998; }
.hero-chat__send { display: grid; width: 3.4rem; height: 3.4rem; padding: 0; place-items: center; border: 0; border-radius: 50%; color: #fff; background: #101216; cursor: pointer; box-shadow: none; transition: background 180ms ease, transform 180ms cubic-bezier(.16,1,.3,1), opacity 180ms ease; }
.hero-chat__send:hover:not(:disabled) { background: #0a5cff; transform: translateY(-2px); }
.hero-chat__send:disabled { opacity: .35; cursor: not-allowed; }
.hero-chat__hint { margin: .5rem .35rem 0; color: #89a7be; font-size: .68rem; text-align: right; }
.hero-chat.is-thinking .hero-chat__status::after { content: "Thinking…"; margin-left: .45rem; color: #eaf6ff; animation: hero-chat-pulse 1.1s ease-in-out infinite alternate; }

@keyframes hero-chat-open {
  from { opacity: .35; transform: translateY(-.7rem) scale(.96); filter: blur(7px); clip-path: inset(0 7% 62% round 30px); }
  to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); clip-path: inset(0 round 30px); }
}

@keyframes hero-chat-pulse { to { opacity: .45; } }

/* Keep the hero's two primary choices equal and optically aligned. */
.agent-hero .agent-button {
  flex: 1 1 0;
  min-width: 16rem;
  min-height: 4.65rem;
  padding: .7rem .78rem .7rem 1.55rem;
  justify-content: space-between;
  border-radius: 999px;
  font-size: .98rem;
  line-height: 1;
}
.agent-hero .agent-hero__actions { width: min(92vw, 44rem); margin-right: auto; margin-left: auto; gap: 1.1rem; }
.agent-hero .agent-button__icon { width: 3.15rem; height: 3.15rem; flex: 0 0 auto; border-radius: 50%; }

@media (max-height: 760px) and (min-width: 561px) {
  .hero-chat { margin-top: 2.5rem; }
  .hero-chat__opener { min-height: 3.6rem; }
}

@media (max-width: 560px) {
  .hero-chat { width: 100%; margin-top: 2.5rem; }
  .hero-chat__opener { width: 100%; }
  .agent-hero .agent-hero__actions { width: 100%; }
  .agent-hero .agent-button { min-width: 0; width: 100%; }
  .hero-chat__opener { min-height: 4.6rem; font-size: .92rem; }
  .hero-chat__open-icon { width: 3.2rem; height: 3.2rem; }
  .hero-chat__panel { border-radius: 24px; }
  .hero-chat__message { max-width: 92%; }
}

/* Keep the mobile hero tall enough to carry its workflow prompt to the lower edge, while making the two CTAs feel secondary to the prompt. */
@media (max-width: 760px) {
  .custom-agent-page .agent-hero {
    min-height: 100svh;
    box-sizing: border-box;
  }

  .custom-agent-page .agent-hero__copy {
    display: flex;
    flex-direction: column;
    min-height: max(0px, calc(100svh - 10.5rem));
  }

  .custom-agent-page .agent-hero__actions {
    width: min(100%, 36rem);
    margin-top: 1.5rem;
    gap: .6rem;
  }

  .custom-agent-page .agent-hero .agent-button {
    min-width: 0;
    min-height: 3rem;
    padding: .35rem .4rem .35rem .85rem;
    gap: .45rem;
    font-size: .72rem;
  }

  .custom-agent-page .agent-hero .agent-button__icon {
    width: 2rem;
    height: 2rem;
  }

  .custom-agent-page .hero-chat {
    margin-top: auto;
  }

  .custom-agent-page .hero-chat__opener {
    min-height: 4rem;
    font-size: .86rem;
  }

  .custom-agent-page .hero-chat__open-icon {
    width: 2.8rem;
    height: 2.8rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-chat__panel.is-opening { animation: none; }
}

@media (max-width: 760px) {
  .custom-agent-page .agent-hero {
    min-height: 100svh;
    box-sizing: border-box;
  }

  .custom-agent-page .agent-hero__copy {
    display: flex;
    flex-direction: column;
    min-height: max(0px, calc(100svh - 10.5rem));
  }

  .custom-agent-page .agent-hero__actions {
    width: min(100%, 36rem);
    margin-top: 1.5rem;
    gap: .6rem;
  }

  .custom-agent-page .agent-hero .agent-button {
    min-width: 0;
    min-height: 3rem;
    padding: .35rem .4rem .35rem .85rem;
    gap: .45rem;
    font-size: .72rem;
  }

  .custom-agent-page .agent-hero .agent-button__icon {
    width: 2rem;
    height: 2rem;
  }

  .custom-agent-page .hero-chat {
    margin-top: auto;
  }

  .custom-agent-page .hero-chat__opener {
    min-height: 4rem;
    font-size: .86rem;
  }

  .custom-agent-page .hero-chat__open-icon {
    width: 2.8rem;
    height: 2.8rem;
  }
}
