.sales-ai {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(520px, 1.3fr);
  gap: clamp(46px, 7vw, 96px);
  margin-top: clamp(76px, 8vw, 118px);
  padding: clamp(56px, 7vw, 92px);
  overflow: hidden;
  border: 0;
  border-radius: 36px;
  color: var(--pearl);
  background:
    radial-gradient(circle at 12% 18%, rgba(184, 216, 209, 0.2), transparent 32%),
    radial-gradient(circle at 88% 82%, rgba(234, 211, 212, 0.16), transparent 27%),
    var(--jade-deep);
  box-shadow: 0 30px 72px rgba(31, 73, 66, 0.2);
}

.sales-ai::after {
  content: "";
  position: absolute;
  top: 0;
  right: clamp(38px, 6vw, 82px);
  width: 1px;
  height: 82px;
  background: linear-gradient(to bottom, rgba(217, 235, 231, 0), rgba(217, 235, 231, 0.42));
}

.sales-ai__copy { align-self: start; padding-top: 10px; }
.sales-ai__copy h2 { max-width: 8ch; color: var(--pearl); }
.sales-ai__copy > p { max-width: 37ch; margin: 28px 0 0; color: #c8d9d3; font-size: 16px; line-height: 1.8; }
.sales-ai__scope { display: grid; gap: 0; margin: 42px 0 0; padding: 0; list-style: none; border-top: 1px solid rgba(217, 235, 231, 0.18); }
.sales-ai__scope li { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding: 15px 0; border-bottom: 1px solid rgba(217, 235, 231, 0.18); color: #d9e8e3; font-size: 13px; line-height: 1.55; }
.sales-ai__scope svg { width: 18px; height: 18px; margin-top: 1px; color: var(--mist-strong); stroke-width: 1.6; }

.sales-chat {
  position: relative;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  border-radius: 28px;
  color: var(--ink);
  background: var(--pearl);
  box-shadow: 0 26px 64px rgba(13, 38, 33, 0.3);
}

.sales-chat__header { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 20px 24px; border-bottom: 1px solid var(--line); }
.sales-chat__identity { display: flex; align-items: center; gap: 11px; min-width: 0; }
.sales-chat__mark { display: grid; width: 34px; height: 34px; flex: 0 0 auto; place-items: center; border-radius: 50%; color: var(--jade-deep); background: var(--mist); }
.sales-chat__mark svg { width: 18px; height: 18px; stroke-width: 1.7; }
.sales-chat__identity strong { display: block; font-size: 15px; }
.sales-chat__status { display: flex; align-items: center; gap: 7px; margin-top: 2px; color: var(--muted); font-size: 11px; }
.sales-chat__status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--jade); box-shadow: 0 0 0 3px rgba(40, 92, 83, 0.09); }
.sales-chat__status[data-state="loading"]::before { background: #bd8d57; animation: sales-status 1s ease-in-out infinite alternate; }
.sales-chat__status[data-state="error"]::before { background: var(--rose-ink); }
.sales-chat__status[data-state="complete"]::before { background: #7d8984; box-shadow: none; }
.sales-chat__reset { min-height: 44px; padding: 0 12px; border: 0; border-radius: 12px; color: var(--jade); background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; }
.sales-chat__reset:hover { background: var(--ground); }

.sales-chat__messages { display: grid; align-content: start; gap: 0; height: min(480px, 55vh); min-height: 360px; overflow-y: auto; padding: 8px 24px 0; scroll-behavior: smooth; }
.sales-message { display: grid; grid-template-columns: 60px minmax(0, 1fr); gap: 16px; padding: 21px 0; border-bottom: 1px solid var(--line); }
.sales-message__label { color: var(--jade); font-size: 11px; font-weight: 600; letter-spacing: 0.04em; }
.sales-message p { max-width: 68ch; margin: 0; color: #33443f; font-size: 14px; line-height: 1.78; white-space: pre-wrap; }
.sales-message--user { grid-template-columns: 60px minmax(0, 1fr); }
.sales-message--user .sales-message__label { color: var(--rose-ink); }
.sales-message--user p { color: #5d494c; }
.sales-message[data-state="loading"] p { color: var(--muted); animation: sales-loading 1s ease-in-out infinite alternate; }
.sales-message[data-state="error"] p, .sales-message[data-state="refusal"] p { color: var(--rose-ink); }
.sales-chat__prompts { display: flex; gap: 8px; overflow-x: auto; padding: 16px 24px 2px; scrollbar-width: thin; }
.sales-chat__prompts button { min-width: max-content; min-height: 44px; padding: 0 12px; border: 1px solid rgba(40, 92, 83, 0.14); border-radius: 12px; color: #405a52; background: var(--paper); font-size: 11px; cursor: pointer; transition: color 160ms ease, background 160ms ease, border-color 160ms ease; }
.sales-chat__prompts button:hover { border-color: rgba(40, 92, 83, 0.32); color: var(--jade-deep); background: var(--mist); }
.sales-chat__prompts button:disabled { cursor: default; opacity: 0.5; }

.sales-chat__cta { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin: 16px 24px 0; padding: 15px 16px; border: 0; border-radius: 14px; color: var(--jade-deep); background: var(--mist); text-align: left; cursor: pointer; }
.sales-chat__cta strong, .sales-chat__cta span { display: block; }
.sales-chat__cta strong { font-size: 13px; }
.sales-chat__cta span { margin-top: 3px; color: #405d55; font-size: 11px; }
.sales-chat__cta svg { width: 20px; height: 20px; flex: 0 0 auto; transition: transform 160ms ease; }
.sales-chat__cta:hover svg { transform: translateX(3px); }
.sales-chat__cta[hidden], .sales-chat__actions[hidden] { display: none; }

.sales-chat__composer { padding: 18px 24px 22px; }
.sales-chat__field { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 12px; padding: 8px 8px 8px 15px; border: 1px solid rgba(55, 99, 85, 0.2); border-radius: 16px; background: var(--paper); transition: border-color 160ms ease, box-shadow 160ms ease, background 160ms ease; }
.sales-chat__field:focus-within { border-color: rgba(40, 92, 83, 0.5); background: white; box-shadow: 0 0 0 3px rgba(40, 92, 83, 0.08); }
.sales-chat__field textarea { width: 100%; min-height: 58px; max-height: 132px; resize: vertical; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 14px; line-height: 1.55; }
.sales-chat__field textarea::placeholder { color: #64736d; }
.sales-chat__send { display: inline-flex; min-height: 44px; align-items: center; gap: 8px; padding: 0 15px; border: 0; border-radius: 13px; color: white; background: var(--jade); font-size: 12px; font-weight: 600; cursor: pointer; }
.sales-chat__send svg { width: 16px; height: 16px; }
.sales-chat__send:disabled { cursor: wait; opacity: 0.58; }
.sales-chat__meta { display: flex; justify-content: space-between; gap: 14px; margin-top: 9px; color: #596862; font-size: 11px; line-height: 1.5; }
.sales-chat__notice { max-width: 64ch; }
.sales-chat__actions { display: flex; justify-content: flex-end; padding: 0 24px 20px; }
.sales-chat__retry { min-height: 44px; padding: 0 14px; border: 1px solid rgba(125, 83, 88, 0.22); border-radius: 12px; color: var(--rose-ink); background: transparent; font-size: 12px; font-weight: 600; cursor: pointer; }

@keyframes sales-loading { from { opacity: 0.48; } to { opacity: 1; } }
@keyframes sales-status { from { opacity: 0.45; } to { opacity: 1; } }

@media (max-width: 1120px) {
  .sales-ai { grid-template-columns: 1fr; }
  .sales-ai__copy { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(280px, 1.2fr); column-gap: 48px; }
  .sales-ai__copy > p { margin-top: 0; }
  .sales-ai__scope { grid-column: 1 / -1; grid-template-columns: repeat(3, 1fr); gap: 18px; border-top: 0; }
  .sales-ai__scope li { border-top: 1px solid rgba(217, 235, 231, 0.18); }
}

@media (max-width: 760px) {
  .sales-ai { gap: 38px; margin: 64px -18px 0; padding: 64px 18px 24px; border-radius: 0; }
  .sales-ai::after { right: 30px; height: 54px; }
  .sales-ai__copy { display: block; padding: 0 4px; }
  .sales-ai__copy > p { margin-top: 22px; }
  .sales-ai__scope { display: grid; grid-template-columns: 1fr; gap: 0; margin-top: 30px; border-top: 1px solid rgba(217, 235, 231, 0.18); }
  .sales-ai__scope li { border-top: 0; }
  .sales-chat { border-radius: 24px 24px 0 0; box-shadow: 0 22px 52px rgba(13, 38, 33, 0.28); }
  .sales-chat__header { padding: 17px 16px; }
  .sales-chat__messages { height: 300px; min-height: 260px; padding-right: 16px; padding-left: 16px; }
  .sales-message { grid-template-columns: 42px minmax(0, 1fr); gap: 10px; }
  .sales-chat__prompts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); overflow: visible; padding-right: 16px; padding-left: 16px; }
  .sales-chat__prompts button { min-width: 0; min-height: 44px; height: auto; padding: 10px 8px; line-height: 1.35; }
  .sales-chat__cta { margin-right: 16px; margin-left: 16px; }
  .sales-chat__composer { padding: 16px; }
  .sales-chat__field { grid-template-columns: 1fr; }
  .sales-chat__send { justify-content: center; }
  .sales-chat__meta { align-items: flex-start; flex-direction: column; }
  .sales-chat__actions { padding-right: 16px; padding-left: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .sales-chat__messages { scroll-behavior: auto; }
  .sales-chat__status::before, .sales-message[data-state="loading"] p { animation: none; }
}

/* Distilled conversation surface: the chat belongs to the section, not to a card. */
.sales-ai {
  grid-template-columns: minmax(240px, 0.58fr) minmax(520px, 1.42fr);
  align-items: stretch;
  gap: clamp(54px, 8vw, 120px);
  padding: clamp(64px, 7vw, 96px);
}

.sales-ai__copy {
  align-self: center;
  padding: 0;
}

.sales-ai__copy h2 {
  max-width: 7ch;
  font-size: clamp(46px, 3.5vw, 52px);
  line-height: 1.08;
  white-space: nowrap;
}

.sales-ai__copy > p {
  max-width: 22ch;
  margin-top: 24px;
  color: #d6e4df;
  font-size: 17px;
  line-height: 1.7;
}

.sales-chat {
  display: flex;
  min-height: 650px;
  flex-direction: column;
  overflow: visible;
  border-radius: 0;
  color: var(--pearl);
  background: transparent;
  box-shadow: none;
}

.sales-chat__header {
  padding: 0 0 18px;
  border-bottom-color: rgba(217, 235, 231, 0.16);
}

.sales-chat__mark {
  color: var(--mist);
  background: rgba(217, 235, 231, 0.1);
}

.sales-chat__identity strong {
  color: var(--pearl);
}

.sales-chat__status {
  color: #aac3bb;
}

.sales-chat__status::before {
  background: #8fc5b4;
  box-shadow: none;
}

.sales-chat__reset {
  color: #c7dbd4;
}

.sales-chat__reset:hover {
  background: rgba(217, 235, 231, 0.09);
}

.sales-chat__messages {
  flex: 1;
  height: min(430px, 52vh);
  min-height: 330px;
  gap: 6px;
  padding: 22px 0 8px;
}

.sales-message {
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
  padding: 14px 0;
  border-bottom: 0;
}

.sales-message__label {
  color: #9fc3b7;
  white-space: nowrap;
}

.sales-message p {
  max-width: 60ch;
  color: #eef5f2;
  font-size: 15px;
  line-height: 1.72;
}

.sales-message--user {
  display: flex;
  justify-content: flex-end;
}

.sales-message--user .sales-message__label {
  display: none;
}

.sales-message--user p {
  max-width: min(78%, 520px);
  padding: 11px 15px;
  border-radius: 16px 16px 4px 16px;
  color: var(--pearl);
  background: rgba(217, 235, 231, 0.13);
}

.sales-chat__prompts {
  gap: 8px;
  padding: 12px 0 10px;
}

.sales-chat__prompts button {
  border-color: transparent;
  color: #d8e7e2;
  background: rgba(217, 235, 231, 0.08);
}

.sales-chat__prompts button:hover {
  border-color: transparent;
  color: var(--pearl);
  background: rgba(217, 235, 231, 0.15);
}

.sales-chat__cta {
  width: calc(100% - 132px);
  margin: 4px 0 16px 132px;
  color: var(--pearl);
  background: var(--jade);
  box-shadow: 0 12px 30px rgba(11, 34, 29, 0.18);
}

.sales-chat__cta:hover {
  background: var(--jade-deep);
}

.sales-chat__cta strong {
  color: var(--pearl);
}

.sales-chat__cta span {
  color: rgba(245, 246, 240, 0.72);
}

.sales-chat__composer {
  padding: 10px 0 0;
}

.sales-chat__field {
  padding: 8px 8px 8px 17px;
  border: 0;
  border-radius: 18px;
  background: var(--pearl);
  box-shadow: 0 18px 44px rgba(11, 34, 29, 0.22);
}

.sales-chat__field:focus-within {
  border-color: transparent;
  background: white;
  box-shadow: 0 18px 46px rgba(11, 34, 29, 0.26), 0 0 0 3px rgba(184, 216, 209, 0.18);
}

.sales-chat__field textarea {
  min-height: 48px;
}

.sales-chat__meta {
  color: #a9beb7;
}

.sales-chat__notice {
  max-width: none;
}

.sales-chat__actions {
  padding: 8px 0 0;
}

.sales-chat__retry {
  color: #e2c7c9;
  border-color: rgba(234, 211, 212, 0.3);
}

@media (max-width: 1120px) {
  .sales-ai { grid-template-columns: 1fr; }
  .sales-ai__copy { display: block; max-width: 680px; }
  .sales-ai__copy > p { max-width: none; }
  .sales-chat { min-height: 620px; }
}

@media (max-width: 760px) {
  .sales-ai { gap: 46px; padding: 60px 18px 34px; }
  .sales-ai__copy { padding: 0 4px; }
  .sales-ai__copy > p { margin-top: 18px; }
  .sales-chat { min-height: 570px; border-radius: 0; box-shadow: none; }
  .sales-chat__header { padding: 0 4px 16px; }
  .sales-chat__messages { height: 300px; min-height: 260px; padding: 18px 4px 6px; }
  .sales-message { grid-template-columns: 40px minmax(0, 1fr); gap: 10px; }
  .sales-message--user p { max-width: 88%; }
  .sales-chat__prompts { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 10px 0 8px; }
  .sales-chat__prompts button { min-height: 48px; }
  .sales-chat__messages > .sales-chat__cta { width: 100%; margin: 4px 0 14px; }
  .sales-chat__composer { padding: 8px 0 0; }
  .sales-chat__field { grid-template-columns: minmax(0, 1fr) auto; }
  .sales-chat__send span { display: none; }
  .sales-chat__send { width: 44px; padding: 0; justify-content: center; }
  .sales-chat__meta { gap: 6px; }
  .sales-chat__actions { padding-right: 0; padding-left: 0; }
}

/* Page-integrated mode: no colored stage and no enclosing chat surface. */
.sales-ai {
  margin-top: 0;
  padding: clamp(96px, 10vw, 148px) 0;
  overflow: visible;
  border-top: 1px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  box-shadow: none;
}

.sales-ai::after {
  display: none;
}

.sales-ai__copy h2 {
  color: var(--ink);
}

.sales-ai__copy > p {
  color: #465a53;
}

.sales-chat {
  color: var(--ink);
}

.sales-chat__header {
  border-bottom-color: var(--line);
}

.sales-chat__mark {
  color: var(--jade-deep);
  background: var(--mist);
}

.sales-chat__identity strong {
  color: var(--ink);
}

.sales-chat__status {
  color: var(--muted);
}

.sales-chat__status::before {
  background: var(--jade);
}

.sales-chat__reset {
  color: var(--jade);
}

.sales-chat__reset:hover {
  background: rgba(217, 235, 231, 0.72);
}

.sales-message__label {
  color: var(--jade);
}

.sales-message p {
  color: #33443f;
}

.sales-message--user p {
  color: var(--jade-deep);
  background: var(--mist);
}

.sales-chat__prompts button {
  color: #405a52;
  background: rgba(217, 235, 231, 0.48);
}

.sales-chat__prompts button:hover {
  color: var(--jade-deep);
  background: var(--mist);
}

.sales-chat__field {
  border: 1px solid rgba(55, 99, 85, 0.18);
  background: rgba(251, 252, 250, 0.88);
  box-shadow: none;
}

.sales-chat__field:focus-within {
  border-color: rgba(40, 92, 83, 0.48);
  box-shadow: 0 0 0 3px rgba(40, 92, 83, 0.08);
}

.sales-chat__meta {
  color: var(--muted);
}

.sales-chat__retry {
  color: var(--rose-ink);
  border-color: rgba(125, 83, 88, 0.22);
}

@media (max-width: 1120px) {
  .sales-ai {
    padding: clamp(90px, 10vw, 124px) 0;
  }
}

@media (max-width: 760px) {
  .sales-ai {
    gap: 42px;
    margin: 0;
    padding: 86px 0;
  }

  .sales-ai__copy {
    padding: 0;
  }

  .sales-chat {
    min-height: 560px;
  }

  .sales-chat__header,
  .sales-chat__messages {
    padding-right: 0;
    padding-left: 0;
  }
}

/* Empty-state alignment: begin the composer beside the section title. */
.sales-ai {
  align-items: start;
}

.sales-ai__copy {
  align-self: start;
}

.sales-chat--idle {
  align-self: center;
  min-height: 0;
}

.sales-ai__copy h2 {
  max-width: none;
  white-space: normal;
}

.sales-ai__copy h2 span {
  display: block;
  white-space: nowrap;
}

.sales-chat--idle .sales-chat__messages {
  display: none;
}

.sales-chat--idle .sales-chat__composer {
  padding-top: 0;
}

.sales-chat--idle .sales-chat__prompts {
  padding-top: 10px;
}

.sales-chat--idle .sales-chat__reset {
  display: none;
}

.sales-chat__actions {
  gap: 8px;
}

/* Quiet generation feedback: visible motion stays inside the assistant row. */
.sales-message__typing {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  align-items: center;
  gap: 5px;
}

.sales-message__typing span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  animation: sales-typing-dot 900ms cubic-bezier(0.16, 1, 0.3, 1) infinite;
}

.sales-message__typing span:nth-child(2) { animation-delay: 120ms; }
.sales-message__typing span:nth-child(3) { animation-delay: 240ms; }

@keyframes sales-typing-dot {
  0%, 60%, 100% { opacity: 0.32; transform: translateY(0); }
  30% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
  .sales-message__typing span {
    animation: none;
    opacity: 0.7;
  }
}
