.lead-form[data-lead-ui] { --lead-error: #a62920; }
:where([data-theme=dark]) .lead-form[data-lead-ui] { --lead-error: #ffada2; }
.lead-form[data-lead-ui] .lead-hint,
.lead-form[data-lead-ui] .lead-err {
  font-size: 12px;
  font-weight: 500;
  line-height: 1.4;
  overflow-wrap: anywhere;
}
.lead-form[data-lead-ui] .lead-hint { color: var(--muted); }
.lead-form[data-lead-ui] .lead-err,
.lead-form[data-lead-ui] .lead-status { color: var(--lead-error); }
.lead-form[data-lead-ui] [aria-invalid="true"] { border-color: var(--lead-error); }
.lead-actions .button[aria-disabled="true"] { opacity: .6; cursor: progress; }

.lead-announcement,
.lead-form[data-lead-ui] .lead-status:empty {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

@media (max-width: 760px) {
  body[data-lead-mobile-clear] .yb-dock,
  body[data-lead-mobile-clear] .to-top,
  body[data-lead-mobile-clear] #genagent-launcher:not([aria-expanded="true"]),
  body[data-lead-mobile-clear] #genagent-teaser {
    visibility: hidden;
    pointer-events: none;
  }
  .lead-form[data-lead-ui] { gap: 12px; }
  .lead-form[data-lead-ui] label { min-width: 0; gap: 5px; }
  .lead-form[data-lead-ui] label:not(.lead-trap) :is(input, textarea, select),
  .lead-form[data-lead-ui] .lead-actions .button {
    font-size: 16px;
    min-width: 0;
    min-height: 46px;
    scroll-margin-block: 68px 16px;
  }
  .lead-form[data-lead-ui] .lead-actions {
    display: grid;
    grid-template-columns: minmax(0,1fr);
    gap: 7px;
  }
  .lead-form[data-lead-ui] .lead-actions .button { width: 100%; }
  .lead-form[data-lead-ui] .lead-note { font-size: 12px; line-height: 1.4; }
}

#lead .lead-form#lead-form { scroll-margin-block-start: clamp(64px, 8vw, 96px); }

.lead-copy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .4rem .75rem;
  margin-block-start: .65rem;
}

.lead-copy-actions .button {
  min-height: 44px;
  padding: .5rem .9rem;
  font-size: .875rem;
}

.lead-copy-feedback { color: var(--ink); }

.lead-form .lead-copy-text {
  flex: 0 0 100%;
  box-sizing: border-box;
  width: 100%;
  min-height: 8rem;
}

@media (max-width: 760px) {
  .lead.lead-merged { grid-template-columns: minmax(0, 1fr); }
  .lead-merged :is(.lead-copy, .lead-form) { min-width: 0; }
  .lead-merged .cta-actions .button {
    min-width: 0;
    white-space: normal;
    text-align: center;
    text-wrap: balance;
  }
}

/* Keep the enquiry card to the left of the 380px chat window. */
@media (min-width: 761px) {
  body:has(> #genagent-launcher[aria-expanded="true"]) #lead:has(> .lead-form) {
    --lead-chat-gutter: max(45px, (100vw - var(--page)) / 2);
    --lead-chat-reserve: 432px;
    max-inline-size: min(100%, calc(100vw - var(--lead-chat-gutter) - var(--lead-chat-reserve)));
    margin-inline-end: auto;
  }

  body:has(> #genagent-launcher[aria-expanded="true"]) #lead.wrap:has(> .lead-form) {
    margin-inline-start: var(--lead-chat-gutter);
  }

  body:has(> #genagent-launcher[aria-expanded="true"]) #lead > .lead-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body:has(> #genagent-launcher[aria-expanded="true"]) #lead :is(.lead-form label, .lead-form input, .lead-form select, .lead-form textarea, .cta-actions .button) {
    min-inline-size: 0;
    max-inline-size: 100%;
  }

  body:has(> #genagent-launcher[aria-expanded="true"]) #lead .cta-actions .button {
    white-space: normal;
  }
}
@media (761px <= width <= 1050px) {
  body:has(> #genagent-launcher[aria-expanded="true"]) #lead:has(> .lead-form) {
    --lead-chat-gutter: 32px;
  }
}

@media (761px <= width < 1280px) {
  body:has(> #genagent-launcher[aria-expanded="true"]) #lead:has(> .lead-form) {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: clamp(18px, 2.3vw, 28px);
  }

  body:has(> #genagent-launcher[aria-expanded="true"]) #lead > .lead-form {
    grid-template-columns: minmax(0, 1fr);
  }

}

/* On compact screens the chat is a separate, dismissible full-screen view. */
@media (500px <= width <= 760px) {
  body > #genagent-frame {
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    border-radius: 0 !important;
  }
}

