.hafu-sales-chat { --hsc-pink: #b91853; --hsc-dark: #33222b; --hsc-muted: #6e5e67; --hsc-line: #ecdfe5; box-sizing: border-box; position: fixed; inset: auto 22px 24px auto; width: 420px; max-width: calc(100vw - 32px); max-height: min(760px, calc(100dvh - 48px)); margin: 0; padding: 0; border: 1px solid #eadbe2; border-radius: 22px; background: #fff; color: var(--hsc-dark); box-shadow: 0 20px 70px #43203938; overflow: hidden; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 14px; line-height: 1.5; z-index: 100001; }
.hafu-sales-chat:not([open]) { display: none; }
.hafu-sales-chat[open] { overflow: clip; }
.hafu-sales-chat::backdrop { background: #29172242; }
.hafu-sales-chat *, .hafu-sales-chat *::before, .hafu-sales-chat *::after { box-sizing: border-box; }
.hafu-sales-chat button, .hafu-sales-chat input, .hafu-sales-chat textarea, .hafu-sales-chat select { font: inherit; }
.hafu-sales-chat button { cursor: pointer; text-transform: none; letter-spacing: normal; }
.hafu-sales-chat button:disabled { opacity: .55; cursor: wait; }
.hafu-sales-chat a { color: var(--hsc-pink); text-decoration: none; }
.hafu-sales-chat a:hover { text-decoration: underline; }
.hafu-sales-chat :focus-visible { outline: 3px solid #772047; outline-offset: 3px; }
.hafu-sales-chat__shell { position: relative; display: flex; flex-direction: column; height: min(710px, calc(100dvh - 50px)); min-height: 300px; overflow: clip; }
.hafu-sales-chat__header { display: flex; align-items: center; gap: 12px; flex: 0 0 auto; padding: 19px 18px; border-bottom: 1px solid var(--hsc-line); background: #fff9fb; }
.hafu-sales-chat__avatar { display: grid; place-items: center; flex: 0 0 42px; width: 42px; height: 42px; border-radius: 15px; background: var(--hsc-pink); color: #fff; font-size: 27px; font-weight: 800; line-height: 1; letter-spacing: -2px; }
.hafu-sales-chat__heading { flex: 1; min-width: 0; }
.hafu-sales-chat__heading h2 { margin: 0 0 3px; color: var(--hsc-dark); font-size: 18px; font-weight: 750; line-height: 1.25; }
.hafu-sales-chat__heading p { margin: 0; color: var(--hsc-muted); font-size: 11px; line-height: 1.5; }
.hafu-sales-chat__close { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 1px solid transparent; border-radius: 50%; background: transparent; color: var(--hsc-muted); font-size: 28px !important; font-weight: 400; line-height: 1; }
.hafu-sales-chat__close:hover { border-color: var(--hsc-line); background: #fff; }
.hafu-sales-chat__context { display: flex; align-items: center; gap: 9px; flex: 0 0 auto; padding: 10px 16px; border-bottom: 1px solid var(--hsc-line); background: #fff9fb; color: var(--hsc-muted); font-size: 11px; }
.hafu-sales-chat__context[hidden] { display: none; }
.hafu-sales-chat__context > span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.hafu-sales-chat__context > button { flex: 0 0 auto; min-height: 34px; padding: 4px 3px; border: 0; background: transparent; color: var(--hsc-pink); font-size: 11px; text-decoration: underline; }
.hafu-sales-chat__log { flex: 1 1 auto; min-height: 0; padding: 20px 16px 8px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; background: #fff; }
.hafu-sales-chat__message { position: relative; display: flex; justify-content: flex-start; margin: 0 0 13px; }
.hafu-sales-chat__message.is-user { justify-content: flex-end; }
.hafu-sales-chat__bubble { max-width: 94%; padding: 12px 14px; border: 1px solid #eee4e9; border-radius: 15px 15px 15px 4px; background: #faf7f9; color: var(--hsc-dark); line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.hafu-sales-chat__message.is-user .hafu-sales-chat__bubble { max-width: 87%; border-color: var(--hsc-pink); border-radius: 15px 15px 4px 15px; background: var(--hsc-pink); color: #fff; }
.hafu-sales-chat__panel { width: 100%; max-width: 100%; padding: 0; border: 0; background: transparent; white-space: normal; }
.hafu-sales-chat__panel-title { margin: 0 0 10px; font-size: 15px; line-height: 1.4; }
.hafu-sales-chat__panel p { margin: 0 0 10px; }
.hafu-sales-chat__panel label { display: block; margin: 8px 0 6px; color: var(--hsc-dark); font-size: 13px; font-weight: 600; }
.hafu-sales-chat__panel input, .hafu-sales-chat__panel textarea, .hafu-sales-chat__panel select { width: 100%; min-height: 42px; padding: 10px 12px; border: 1px solid #d9c9d1; border-radius: 10px; background: #fff; color: var(--hsc-dark); font-size: 14px; line-height: 1.5; }
.hafu-sales-chat__panel textarea { min-height: 84px; resize: vertical; }
.hafu-sales-chat__panel input[type="checkbox"] { width: 18px; min-height: 18px; margin-right: 8px; vertical-align: middle; accent-color: var(--hsc-pink); }
.hafu-sales-chat__panel small { display: block; margin: 7px 0; color: var(--hsc-muted); font-size: 11px; line-height: 1.5; }
.hafu-sales-chat__action { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; margin: 4px 6px 4px 0; padding: 9px 13px; border: 1px solid var(--hsc-pink); border-radius: 10px; background: var(--hsc-pink); color: #fff !important; font-size: 12px !important; font-weight: 650; line-height: 1.4; text-align: center; text-decoration: none !important; }
.hafu-sales-chat__action:hover { border-color: #941342; background: #941342; color: #fff; }
.hafu-sales-chat__action.is-secondary { background: #fff; color: var(--hsc-pink) !important; }
.hafu-sales-chat__action.is-secondary:hover { background: #fff2f7; }
.hafu-sales-chat__products { display: grid; gap: 12px; }
.hafu-sales-chat__product { display: grid; grid-template-columns: 86px minmax(0, 1fr); gap: 11px; padding: 12px; border: 1px solid var(--hsc-line); border-radius: 14px; background: #fff; }
.hafu-sales-chat__product.has-no-image { grid-template-columns: minmax(0, 1fr); }
.hafu-sales-chat__product-image { width: 86px; height: 100px; border: 1px solid #f0e7ec; border-radius: 8px; background: #fff; object-fit: contain; }
.hafu-sales-chat__product-image[hidden] { display: none; }
.hafu-sales-chat__product-detail { min-width: 0; }
.hafu-sales-chat__product-name { display: block; color: var(--hsc-dark) !important; font-size: 13px; font-weight: 700; line-height: 1.4; }
.hafu-sales-chat__product-model { margin: 4px 0 !important; color: var(--hsc-muted); font-size: 11px; line-height: 1.4; }
.hafu-sales-chat__product-price { margin: 5px 0 !important; color: var(--hsc-pink); font-size: 14px; font-weight: 750; line-height: 1.4; }
.hafu-sales-chat__product-note { margin: 4px 0 0 !important; color: var(--hsc-muted); font-size: 10px !important; line-height: 1.4; }
.hafu-sales-chat__product-actions { display: flex; flex-wrap: wrap; gap: 6px; grid-column: 1 / -1; }
.hafu-sales-chat__product-actions .hafu-sales-chat__action { flex: 1 1 auto; margin: 0; padding: 9px; font-size: 11px !important; }
.hafu-sales-chat__sources { display: flex; flex-wrap: wrap; gap: 4px 10px; color: var(--hsc-muted); font-size: 10px; line-height: 1.5; }
.hafu-sales-chat__sources a { text-decoration: underline; }
.hafu-sales-chat__preview { display: block; width: 100%; max-height: 420px; margin: 0 auto; border: 1px solid var(--hsc-line); border-radius: 12px; background: #fff; object-fit: contain; }
.hafu-sales-chat__prompts { display: flex; gap: 7px; flex: 0 0 auto; padding: 8px 16px 10px; overflow-x: auto; scrollbar-width: thin; }
.hafu-sales-chat__prompts button { flex: 0 0 auto; min-height: 36px; padding: 7px 10px; border: 1px solid #e8cad7; border-radius: 20px; background: #fff; color: #94224c; font-size: 11px; line-height: 1.4; }
.hafu-sales-chat__prompts button:hover { background: #fff3f8; }
.hafu-sales-chat__status { flex: 0 0 auto; padding: 4px 16px 10px; color: var(--hsc-muted); font-size: 11px; line-height: 1.5; overflow-wrap: anywhere; }
.hafu-sales-chat__status[hidden] { display: none; }
.hafu-sales-chat__status.is-error { color: #a41d37; }
.hafu-sales-chat__retry { min-height: 32px; padding: 4px 7px; border: 0; background: transparent; color: #a41d37; font-weight: 700 !important; text-decoration: underline; }
.hafu-sales-chat__form { display: flex; align-items: flex-end; gap: 9px; flex: 0 0 auto; margin: 0; padding: 12px 16px 6px; border-top: 1px solid var(--hsc-line); background: #fff; }
.hafu-sales-chat__input { display: block; flex: 1; min-width: 0; height: 46px; max-height: 100px; margin: 0; padding: 12px; border: 1px solid #d9c9d1; border-radius: 12px; background: #fff; color: var(--hsc-dark); font-size: 14px; line-height: 20px; resize: vertical; }
.hafu-sales-chat__input::placeholder { color: #8f8088; opacity: 1; }
.hafu-sales-chat__send { flex: 0 0 auto; min-width: 60px; min-height: 46px; padding: 11px 14px; border: 1px solid var(--hsc-pink); border-radius: 12px; background: var(--hsc-pink); color: #fff; font-size: 13px; font-weight: 700; line-height: 1.4; }
.hafu-sales-chat__send:hover { background: #941342; }
.hafu-sales-chat__note { flex: 0 0 auto; margin: 0; padding: 5px 18px 13px; color: #85767e; font-size: 9px; line-height: 1.5; text-align: center; }
.hafu-sales-chat__sr { position: absolute !important; width: 1px !important; height: 1px !important; margin: -1px !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; }
@media (max-width: 600px) {
  .hafu-sales-chat { inset: auto 0 0; width: 100%; max-width: 100%; max-height: calc(100dvh - 16px); border-right: 0; border-bottom: 0; border-left: 0; border-radius: 22px 22px 0 0; }
  .hafu-sales-chat__shell { height: min(740px, calc(100dvh - 16px)); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .hafu-sales-chat__header { padding: 17px 16px 14px; }
  .hafu-sales-chat__input, .hafu-sales-chat__panel input, .hafu-sales-chat__panel textarea, .hafu-sales-chat__panel select { font-size: 16px; }
  .hafu-sales-chat__log { padding-right: 14px; padding-left: 14px; }
  .hafu-sales-chat__prompts { padding-right: 14px; padding-left: 14px; }
}
@media (max-height: 500px) {
  .hafu-sales-chat { inset-block: 5px; max-height: calc(100dvh - 10px); }
  .hafu-sales-chat__shell { height: calc(100dvh - 12px); min-height: 0; }
  .hafu-sales-chat__header { padding-block: 9px; }
  .hafu-sales-chat__prompts, .hafu-sales-chat__note { display: none; }
  .hafu-sales-chat__form { padding-top: 8px; }
}
@media (prefers-reduced-motion: no-preference) {
  .hafu-sales-chat[open] { animation: hafu-sales-enter .18s ease-out; }
  @keyframes hafu-sales-enter { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
}

/* A spacious conversation workspace; only the transcript scrolls. */
.hafu-sales-chat { inset: 16px; width: min(1440px, calc(100vw - 32px)); max-width: none; height: calc(100dvh - 32px); max-height: none; margin: auto; border-radius: 20px; }
.hafu-sales-chat__shell { height: 100%; min-height: 0; }
.hafu-sales-chat__header { padding: 16px 24px; }
.hafu-sales-chat__heading h2 { font-size: 21px; }
.hafu-sales-chat__heading p { font-size: 12px; }
.hafu-sales-chat__workspace { display: grid; grid-template-columns: minmax(0, 1fr) 290px; flex: 1; min-height: 0; overflow: clip; }
.hafu-sales-chat__conversation { display: flex; flex-direction: column; min-width: 0; min-height: 0; overflow: clip; }
.hafu-sales-chat__aside { min-width: 0; padding: 27px 23px; border-left: 1px solid var(--hsc-line); background: #fff8fb; overflow-y: auto; }
.hafu-sales-chat__aside h3 { margin: 8px 0 20px; color: var(--hsc-dark); font-size: 18px; line-height: 1.4; overflow-wrap: anywhere; }
.hafu-sales-chat__eyebrow { margin: 0; color: var(--hsc-pink); font-size: 10px; font-weight: 750; letter-spacing: 1.5px; }
.hafu-sales-chat__context-preview { display: block; width: 100%; max-height: 220px; object-fit: contain; background: #fff; border: 1px solid var(--hsc-line); border-radius: 12px; }
.hafu-sales-chat__context-preview[hidden] { display: none; }
.hafu-sales-chat__steps { counter-reset: hafu-chat-step; margin: 22px 0; padding: 0; list-style: none; }
.hafu-sales-chat__steps li { display: flex; align-items: center; gap: 10px; margin: 15px 0; font-size: 12px; }
.hafu-sales-chat__steps li::before { counter-increment: hafu-chat-step; content: counter(hafu-chat-step); display: grid; place-items: center; flex: 0 0 25px; width: 25px; height: 25px; border-radius: 50%; background: #f8dfea; color: #9e1647; font-size: 11px; font-weight: 750; }
.hafu-sales-chat__aside .hafu-sales-chat__action { width: 100%; margin-right: 0; }
.hafu-sales-chat__aside-note { color: var(--hsc-muted); font-size: 11px; line-height: 1.7; }
.hafu-sales-chat__log { padding: 24px 26px 8px; }
.hafu-sales-chat__bubble { max-width: 90%; }
.hafu-sales-chat__products { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hafu-sales-chat__product { grid-template-columns: 90px minmax(0, 1fr); }
.hafu-sales-chat__product-image { width: 90px; height: 105px; }
.hafu-sales-chat__prompts, .hafu-sales-chat__form, .hafu-sales-chat__status { padding-right: 26px; padding-left: 26px; }
.hafu-sales-chat__lead { padding: 22px; border: 1px solid #e7c3d3; border-radius: 16px; background: #fffafd; }
.hafu-sales-chat__lead-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hafu-sales-chat__lead-grid.is-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hafu-sales-chat__lead details { margin: 16px 0; padding: 12px; border: 1px solid var(--hsc-line); border-radius: 10px; background: #fff; }
.hafu-sales-chat__lead summary { cursor: pointer; color: var(--hsc-dark); font-size: 13px; font-weight: 650; }
.hafu-sales-chat__lead .hafu-sales-chat__consent { display: flex; align-items: flex-start; gap: 8px; font-size: 12px; line-height: 1.6; font-weight: 400; }
.hafu-sales-chat__consent input { flex: 0 0 18px; margin: 3px 0 0 !important; }
.hafu-sales-chat__lead-note { margin-top: 15px !important; color: var(--hsc-muted); font-size: 11px; }
.hafu-sales-chat__lead-preview { display: block; width: 100%; height: 220px; margin-bottom: 16px; object-fit: contain; background: #fff; border: 1px solid var(--hsc-line); border-radius: 10px; }
@media (max-width: 1000px) { .hafu-sales-chat__workspace { grid-template-columns: minmax(0, 1fr) 230px; } .hafu-sales-chat__aside { padding: 20px 16px; } .hafu-sales-chat__products { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 700px) {
  .hafu-sales-chat { inset: 0; width: 100%; height: 100dvh; border: 0; border-radius: 0; }
  .hafu-sales-chat__shell { height: 100%; padding-bottom: env(safe-area-inset-bottom, 0px); }
  .hafu-sales-chat__workspace { display: flex; flex-direction: column; }
  .hafu-sales-chat__conversation { flex: 1; }
  .hafu-sales-chat__aside { display: none; }
  .hafu-sales-chat__header { padding: 12px 14px; }
  .hafu-sales-chat__heading h2 { font-size: 18px; }
  .hafu-sales-chat__log { padding: 18px 14px 8px; }
  .hafu-sales-chat__prompts, .hafu-sales-chat__form, .hafu-sales-chat__status { padding-right: 14px; padding-left: 14px; }
  .hafu-sales-chat__lead { padding: 14px; }
  .hafu-sales-chat__lead-grid, .hafu-sales-chat__lead-grid.is-two { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .hafu-sales-chat__lead-grid:not(.is-two) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hafu-sales-chat__input, .hafu-sales-chat__panel input, .hafu-sales-chat__panel textarea { font-size: 16px; }
}
@media (max-height: 500px) { .hafu-sales-chat { inset: 0; height: 100dvh; } .hafu-sales-chat__shell { height: 100%; min-height: 0; } .hafu-sales-chat__header { padding-block: 7px; } }
