.sy-chatbot{
  --sy-chat-surface: #ffffff;
  --sy-chat-surface-soft: #F7F8FC;
  --sy-chat-border: #E5E7EF;
  --sy-chat-muted: #72768A;
  --sy-chat-text-light: #ffffff;
  --sy-chat-success: #22C55E;
  --sy-chat-error: #DC2626;
  --sy-chat-warning: #F59E0B;
  --sy-chat-body-font: 14px;
  --sy-chat-title-font: 15px;
  color: var(--sy-chat-text, #25283D);
  position: fixed;
  right: var(--sy-chat-offset-x);
  bottom: var(--sy-chat-offset-y);
  z-index: var(--sy-chat-z);
  font-family: var(--sy-chat-font-family, Inter, system-ui, sans-serif);
}

.sy-chatbot *{ box-sizing: border-box; }

.sy-chatbot--bottom-left{ right: auto; left: var(--sy-chat-offset-x); }
.sy-chatbot--top-right{ bottom: auto; top: var(--sy-chat-offset-y); }
.sy-chatbot--top-left{ right: auto; bottom: auto; left: var(--sy-chat-offset-x); top: var(--sy-chat-offset-y); }

.sr-only{
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ── Launcher ── */
.sy-chat-launcher{
  position: relative;
  width: var(--sy-chat-button-size);
  height: var(--sy-chat-button-size);
  border: 0;
  border-radius: 50%;
  background: var(--sy-chat-primary);
  color: var(--sy-chat-text-light);
  box-shadow: 0 14px 28px var(--sy-chat-shadow);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease;
}

.sy-chat-launcher:hover{ transform: translateY(-2px) scale(1.02); filter: brightness(1.05); box-shadow: 0 16px 32px rgba(17,17,34,.24); }
.sy-chat-launcher:focus-visible{ outline: 3px solid #ffffffcc; outline-offset: 3px; }

.sy-chat-launcher-pulse{
  position: absolute; inset: 0; border-radius: 50%;
  border: 2px solid var(--sy-chat-primary);
  animation: sy-chat-pulse 2.2s cubic-bezier(0.2,0.6,0.4,1) 3;
  pointer-events: none;
}

.sy-chatbot.is-open .sy-chat-launcher-pulse{ display: none; }
.sy-chatbot.has-notified .sy-chat-launcher{ animation: sy-chat-notify .5s ease 1; }

.sy-chat-launcher-icon{
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  line-height: 1; opacity: 0; transform: rotate(-40deg) scale(.4);
  transition: opacity .22s ease, transform .22s cubic-bezier(0.34,1.56,0.64,1);
}

.sy-chat-launcher-icon svg{ width: 46%; height: 46%; }
.sy-chat-launcher-icon--chat{ opacity: 1; transform: none; }
.sy-chatbot.is-open .sy-chat-launcher-icon--chat{ opacity: 0; transform: rotate(40deg) scale(.4); }
.sy-chatbot.is-open .sy-chat-launcher-icon--close{ opacity: 1; transform: none; }

.sy-chat-badge{
  position: absolute; right: -2px; top: -4px; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 12px; background: var(--sy-chat-error); color: #fff; font-size: 11px; line-height: 20px;
  font-weight: 700; border: 2px solid #fff; opacity: 1; animation: sy-chat-badge-in .35s cubic-bezier(0.34,1.56,0.64,1);
}

/* ── Floating panel (desktop) ── */
.sy-chat-window{
  position: absolute;
  right: 0;
  bottom: calc(var(--sy-chat-button-size) + 14px);
  width: min(max(var(--sy-chat-window-width), 410px), 440px, calc(100vw - 32px));
  height: min(var(--sy-chat-window-height), calc(100dvh - var(--sy-chat-offset-y) - var(--sy-chat-button-size) - 34px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--sy-chat-surface);
  border: 1px solid var(--sy-chat-border);
  border-radius: var(--sy-chat-radius);
  box-shadow: 0 24px 70px rgba(22,26,45,.18);
  opacity: 0;
  transform: translateY(12px) scale(.98);
  pointer-events: none;
  transition: opacity .22s ease, transform .22s ease;
}

.sy-chatbot--top-right .sy-chat-window,
.sy-chatbot--top-left .sy-chat-window{ top: calc(var(--sy-chat-button-size) + 14px); bottom: auto; }

.sy-chatbot.is-open .sy-chat-window{ opacity: 1; transform: none; pointer-events: auto; }
.sy-chat-window:focus{ outline: none; }

/* ── Header ── */
.sy-chat-header{
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; padding: 12px 10px 12px 14px; background: var(--sy-chat-primary); color: #fff; flex: 0 0 auto;
}

.sy-chat-brand{ display: flex; align-items: center; gap: 10px; min-width: 0; }

.sy-chat-logo{ width: 32px; height: 32px; border-radius: 10px; object-fit: contain; background: #fff; flex: 0 0 auto; }
.sy-chat-logo--fallback{
  width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: var(--sy-chat-secondary); color: var(--sy-chat-primary); font-weight: 800; font-size: 12px; flex: 0 0 auto;
}

.sy-chat-brand-copy{ min-width: 0; }
.sy-chat-brand-copy strong{
  display: block; font-size: var(--sy-chat-title-font); letter-spacing: .1px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.sy-chat-status{
  display: flex; align-items: center; gap: 5px; margin-top: 2px;
  color: rgba(255,255,255,.85); font-size: 11px; white-space: nowrap;
}

.sy-chat-status-dot{ position: relative; width: 6px; height: 6px; border-radius: 50%; background: var(--sy-chat-success); flex: 0 0 auto; }
.sy-chat-status-dot::after{
  content: ''; position: absolute; inset: -3px; border-radius: 50%; background: var(--sy-chat-success);
  opacity: .55; animation: sy-chat-online-ping 2.4s ease-out infinite;
}
.sy-chatbot[data-status="offline"] .sy-chat-status-dot,
.sy-chatbot[data-status="error"] .sy-chat-status-dot{ background: var(--sy-chat-error); }
.sy-chatbot[data-status="offline"] .sy-chat-status-dot::after,
.sy-chatbot[data-status="error"] .sy-chat-status-dot::after{ background: var(--sy-chat-error); }
.sy-chatbot[data-status="human"] .sy-chat-status-dot{ background: var(--sy-chat-secondary); }
.sy-chatbot[data-status="human"] .sy-chat-status-dot::after{ background: var(--sy-chat-secondary); }

.sy-chat-header-actions{ display: flex; align-items: center; gap: 2px; flex: 0 0 auto; }

.sy-chat-icon-btn{
  width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #fff;
  cursor: pointer; display: grid; place-items: center; transition: background .18s ease;
}
.sy-chat-icon-btn svg{ width: 19px; height: 19px; }
.sy-chat-icon-btn:hover{ background: rgba(255,255,255,.16); }
.sy-chat-icon-btn:focus-visible{ outline: 2px solid rgba(255,255,255,.75); outline-offset: -2px; }
.sy-chat-icon-btn[aria-expanded="true"]{ background: rgba(255,255,255,.22); }

.sy-chat-menu-wrap{ position: relative; }
.sy-chat-menu{
  position: absolute; top: calc(100% + 6px); right: 0; width: 226px; background: var(--sy-chat-surface);
  border: 1px solid var(--sy-chat-border); border-radius: 12px; box-shadow: 0 16px 40px rgba(22,26,45,.18);
  padding: 6px; z-index: 5; opacity: 1; animation: sy-chat-menu-in .16s ease;
}
.sy-chat-menu-item{
  width: 100%; display: flex; align-items: center; gap: 10px; border: 0; background: none; text-align: left;
  padding: 9px 10px; border-radius: 8px; font-size: 13px; color: var(--sy-chat-text); cursor: pointer;
}
.sy-chat-menu-item svg{ width: 16px; height: 16px; color: var(--sy-chat-muted); flex: 0 0 auto; }
.sy-chat-menu-item:hover{ background: var(--sy-chat-surface-soft); }
.sy-chat-menu-item:focus-visible{ outline: 2px solid var(--sy-chat-primary); outline-offset: -2px; }
.sy-chat-menu-value{ margin-left: auto; color: var(--sy-chat-muted); font-size: 11px; }

.sy-chat-connection{
  flex: 0 0 auto; padding: 7px 14px; font-size: 12px; text-align: center;
  background: color-mix(in srgb, var(--sy-chat-warning) 14%, #fff); color: #8a5a05;
}
.sy-chat-connection.is-error{ background: color-mix(in srgb, var(--sy-chat-error) 12%, #fff); color: #9d2020; }
.sy-chat-connection.is-success{ background: color-mix(in srgb, var(--sy-chat-success) 14%, #fff); color: #176a37; }

/* ── Scrollable body ── */
.sy-chat-body{ position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; background: var(--sy-chat-surface-soft); }

.sy-chat-welcome{
  padding: 22px 20px 6px; text-align: center; display: flex; flex-direction: column; align-items: center;
}
.sy-chat-welcome[hidden]{ display: none; }
.sy-chat-welcome-avatar{
  width: 52px; height: 52px; border-radius: 50%; background: var(--sy-chat-surface); border: 1px solid var(--sy-chat-border);
  display: grid; place-items: center; margin-bottom: 12px; box-shadow: 0 6px 18px rgba(22,26,45,.08);
}
.sy-chat-welcome-avatar img{ width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.sy-chat-welcome-avatar svg{ width: 24px; height: 24px; color: var(--sy-chat-primary); }
.sy-chat-welcome h2{ margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--sy-chat-text); line-height: 1.35; }
.sy-chat-welcome p{ margin: 0 0 16px; font-size: 13px; color: var(--sy-chat-muted); line-height: 1.5; max-width: 320px; }

.sy-chat-welcome-actions{ display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; max-width: 340px; margin-bottom: 6px; }
.sy-chat-welcome-chip{
  display: flex; align-items: center; gap: 7px; border: 1px solid var(--sy-chat-border); background: var(--sy-chat-surface);
  border-radius: 12px; padding: 10px 10px; font-size: 12.5px; color: var(--sy-chat-text); cursor: pointer; font-weight: 600;
  transition: border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}
.sy-chat-welcome-chip svg{ width: 15px; height: 15px; color: var(--sy-chat-primary); flex: 0 0 auto; }
.sy-chat-welcome-chip:hover{ border-color: var(--sy-chat-primary); transform: translateY(-1px); box-shadow: 0 6px 16px rgba(22,26,45,.08); }
.sy-chat-welcome-chip:focus-visible{ outline: 2px solid var(--sy-chat-primary); outline-offset: 1px; }

.sy-chat-messages{
  flex: 1; overflow-y: auto; overflow-x: hidden; padding: 14px; scrollbar-width: thin; scrollbar-color: #d9dbe8 transparent;
}

.sy-chat-date-sep{ text-align: center; margin: 4px 0 14px; }
.sy-chat-date-sep span{
  display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--sy-chat-surface);
  border: 1px solid var(--sy-chat-border); color: var(--sy-chat-muted); font-size: 10.5px; font-weight: 600;
}

.sy-chat-history-skeleton{ display: grid; gap: 10px; padding: 4px 0 10px; }
.sy-chat-skel-row{ display: flex; gap: 8px; }
.sy-chat-skel-row.is-user{ justify-content: flex-end; }
.sy-chat-skel-bubble{
  height: 34px; width: 62%; border-radius: 12px;
  background: linear-gradient(90deg, #e9ebf4 25%, #f3f4f9 37%, #e9ebf4 63%);
  background-size: 400% 100%; animation: sy-chat-shimmer 1.4s ease infinite;
}
.sy-chat-skel-row.is-user .sy-chat-skel-bubble{ width: 46%; }

.sy-chat-message{ display: flex; gap: 8px; margin: 0 0 3px; opacity: 1; animation: sy-chat-in .2s ease; }
.sy-chat-message + .sy-chat-message{ margin-top: 12px; }
.sy-chat-message.is-grouped{ margin-top: 3px; }
.sy-chat-message--assistant, .sy-chat-message--agent{ justify-content: flex-start; }
.sy-chat-message--user{ justify-content: flex-end; }
.sy-chat-message--system{ justify-content: center; }

.sy-chat-avatar{
  width: 26px; height: 26px; border-radius: 50%; background: var(--sy-chat-primary); color: #fff;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; flex: 0 0 auto; margin-top: 2px;
}
.sy-chat-avatar.is-hidden{ visibility: hidden; }
.sy-chat-message--agent .sy-chat-avatar{ background: var(--sy-chat-secondary); color: var(--sy-chat-primary); }

.sy-chat-message-col{ display: flex; flex-direction: column; max-width: 86%; min-width: 0; }
.sy-chat-message--user .sy-chat-message-col{ max-width: 78%; align-items: flex-end; }

.sy-chat-agent-label{ font-size: 11px; font-weight: 700; color: var(--sy-chat-primary); margin: 0 0 3px 2px; }

.sy-chat-bubble{
  padding: 10px 12px; border-radius: 14px 14px 14px 4px; background: var(--sy-chat-surface);
  border: 1px solid var(--sy-chat-border); color: var(--sy-chat-text);
  font-size: max(var(--sy-chat-body-font), var(--sy-chat-font-size, 14px));
  font-family: var(--sy-chat-font-family, Inter, sans-serif);
  line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 2px 10px rgba(27,35,57,.04); max-width: 100%;
}

.sy-chat-message--user .sy-chat-bubble{
  border: 0; border-radius: 14px 14px 4px 14px; background: var(--sy-chat-user-bubble); color: #fff;
}
.sy-chat-message--agent .sy-chat-bubble{ border-color: color-mix(in srgb, var(--sy-chat-secondary) 45%, var(--sy-chat-border)); }
.sy-chat-message--system .sy-chat-bubble{
  background: transparent; border: 0; box-shadow: none; color: var(--sy-chat-muted); font-size: 12px;
  text-align: center; padding: 4px 10px;
}

.sy-chat-message--assistant .sy-chat-bubble a, .sy-chat-message--agent .sy-chat-bubble a{ color: var(--sy-chat-primary); text-decoration: underline; }
.sy-chat-message--assistant .sy-chat-bubble a:hover, .sy-chat-message--agent .sy-chat-bubble a:hover{ text-decoration: none; }
.sy-chat-message--user .sy-chat-bubble a{ color: #fff; text-decoration: underline; }

.sy-chat-bubble code{
  padding: 2px 4px; border-radius: 4px; background: rgba(0,0,0,.06);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; font-size: 12px;
}
.sy-chat-message--user .sy-chat-bubble code{ background: rgba(255,255,255,.18); }
.sy-chat-bubble ul, .sy-chat-bubble ol{ margin: 6px 0; padding-left: 18px; }
.sy-chat-bubble p{ margin: 0 0 6px; }
.sy-chat-bubble p:last-child{ margin-bottom: 0; }

.sy-chat-time{
  display: block; margin-top: 3px; color: var(--sy-chat-muted); font-size: 11px; line-height: 1.2; white-space: nowrap;
}
.sy-chat-message--user .sy-chat-time{ text-align: right; }
.sy-chat-message--system .sy-chat-time{ text-align: center; }

.sy-chat-typing{
  display: inline-flex; gap: 4px; padding: 11px 13px; border-radius: 14px 14px 14px 4px;
  background: var(--sy-chat-surface); border: 1px solid var(--sy-chat-border);
}
.sy-chat-typing i{ width: 5px; height: 5px; border-radius: 50%; background: var(--sy-chat-muted); animation: sy-chat-dot 1s infinite; font-style: normal; }
.sy-chat-typing i:nth-child(2){ animation-delay: .15s; }
.sy-chat-typing i:nth-child(3){ animation-delay: .3s; }
.sy-chat-typing-label{ font-size: 11.5px; color: var(--sy-chat-muted); margin: 4px 0 0 2px; }

.sy-chat-jump{ position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; pointer-events: none; }
.sy-chat-jump[hidden]{ display: none; }
.sy-chat-jump button{
  pointer-events: auto; display: flex; align-items: center; gap: 6px; border: 1px solid var(--sy-chat-border);
  background: var(--sy-chat-surface); color: var(--sy-chat-primary); border-radius: 999px; padding: 7px 13px;
  font-size: 12px; font-weight: 600; cursor: pointer; box-shadow: 0 8px 22px rgba(22,26,45,.14);
  opacity: 1; animation: sy-chat-in .2s ease;
}
.sy-chat-jump button svg{ width: 14px; height: 14px; }

/* ── Feedback (compact) ── */
.sy-chat-feedback{ margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.sy-chat-feedback-row{ display: flex; align-items: center; gap: 8px; }
.sy-chat-feedback-row span{ font-size: 11.5px; color: var(--sy-chat-muted); }
.sy-chat-feedback-icon{
  width: 26px; height: 26px; border: 1px solid var(--sy-chat-border); background: var(--sy-chat-surface);
  border-radius: 8px; display: grid; place-items: center; cursor: pointer; color: var(--sy-chat-muted);
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.sy-chat-feedback-icon svg{ width: 14px; height: 14px; }
.sy-chat-feedback-icon:hover{ border-color: var(--sy-chat-primary); color: var(--sy-chat-primary); }
.sy-chat-feedback-icon.is-active[data-value="up"]{ background: color-mix(in srgb, var(--sy-chat-success) 16%, #fff); border-color: var(--sy-chat-success); color: #176a37; }
.sy-chat-feedback-icon.is-active[data-value="down"]{ background: color-mix(in srgb, var(--sy-chat-error) 12%, #fff); border-color: var(--sy-chat-error); color: var(--sy-chat-error); }
.sy-chat-feedback-icon[disabled]{ opacity: .5; cursor: not-allowed; }

.sy-chat-feedback-negative{
  border: 1px solid var(--sy-chat-border); background: var(--sy-chat-surface); border-radius: 12px; padding: 10px 11px;
  opacity: 1; animation: sy-chat-in .18s ease;
}
.sy-chat-feedback-negative p{ margin: 0 0 8px; font-size: 12.5px; color: var(--sy-chat-text); }
.sy-chat-feedback-actions{ display: flex; flex-wrap: wrap; gap: 6px; }
.sy-chat-feedback-btn{
  border: 1px solid var(--sy-chat-border); background: var(--sy-chat-surface); color: var(--sy-chat-text);
  padding: 6px 10px; border-radius: 999px; font-size: 11.5px; cursor: pointer; font-weight: 600;
  transition: background .16s ease, border-color .16s ease;
}
.sy-chat-feedback-btn:hover{ background: var(--sy-chat-surface-soft); border-color: var(--sy-chat-primary); }

/* ── Quick actions ── */
.sy-chat-quick{ display: flex; gap: 7px; padding: 0 12px 8px; overflow-x: auto; scrollbar-width: none; flex: 0 0 auto; }
.sy-chat-quick:empty{ display: none; padding: 0; }
.sy-chat-quick button{
  flex: 0 0 auto; border: 1px solid var(--sy-chat-border); border-radius: 999px; padding: 7px 12px;
  background: var(--sy-chat-surface); color: var(--sy-chat-primary); font-size: 12px; font-weight: 600; cursor: pointer;
  transition: background .18s ease, border-color .18s ease, transform .18s ease; white-space: nowrap;
}
.sy-chat-quick button:hover, .sy-chat-quick button:focus-visible{
  transform: translateY(-1px); background: color-mix(in srgb, var(--sy-chat-primary) 8%, #fff); border-color: var(--sy-chat-primary);
}
.sy-chat-quick button:focus-visible{ outline: 2px solid var(--sy-chat-primary); outline-offset: 1px; }

/* ── Composer ── */
.sy-chat-composer{
  display: flex; gap: 8px; align-items: flex-end; padding: 10px 12px; border-top: 1px solid var(--sy-chat-border);
  background: var(--sy-chat-surface); flex: 0 0 auto;
}

.sy-chat-composer textarea{
  flex: 1; max-height: 120px; min-height: 48px; resize: none; border: 1px solid var(--sy-chat-border);
  border-radius: 14px; padding: 13px 14px; font: max(var(--sy-chat-body-font), var(--sy-chat-font-size, 14px))/1.4 var(--sy-chat-font-family, Inter, sans-serif);
  outline: none; background: var(--sy-chat-surface-soft); color: var(--sy-chat-text);
  transition: border-color .2s ease, box-shadow .2s ease;
}
.sy-chat-composer textarea:focus{
  border-color: var(--sy-chat-primary); background: var(--sy-chat-surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sy-chat-primary) 16%, transparent);
}
.sy-chat-composer textarea:disabled{ opacity: .6; }

.sy-chat-composer button{
  width: 44px; height: 44px; border: 0; border-radius: 14px; background: var(--sy-chat-primary); color: #fff;
  cursor: pointer; display: grid; place-items: center; flex: 0 0 auto;
  transition: transform .16s ease, filter .16s ease, background .16s ease;
}
.sy-chat-composer button svg{ width: 18px; height: 18px; }
.sy-chat-composer button span{ display: inline-flex; grid-area: 1 / 1; }
.sy-chat-composer button span[hidden]{ display: none; }
.sy-chat-composer button:hover{ transform: translateY(-1px); filter: brightness(1.05); }
.sy-chat-composer button:active{ transform: translateY(0) scale(.96); }
.sy-chat-composer button:disabled{ opacity: .5; cursor: not-allowed; transform: none; }
.sy-chat-composer button:focus-visible{ outline: 2px solid var(--sy-chat-primary); outline-offset: 2px; }
.sy-chat-composer button.is-streaming{ background: var(--sy-chat-error); }

.sy-chat-disclaimer{
  padding: 0 14px 10px; color: var(--sy-chat-muted); font-size: 10.5px; line-height: 1.4; flex: 0 0 auto; text-align: center;
}

.sy-chat-attachments{ display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 0 12px 6px; flex: 0 0 auto; }
.sy-chat-attachment-status{ font-size: 11px; color: var(--sy-chat-muted); }
.sy-chat-attachments-list{ display: flex; flex-wrap: wrap; gap: 6px; }
.sy-chat-attachment-pill{
  display: inline-flex; gap: 6px; align-items: center; border: 1px solid var(--sy-chat-border); border-radius: 999px;
  padding: 4px 8px; background: var(--sy-chat-surface-soft); color: var(--sy-chat-text); font-size: 11px;
}
.sy-chat-attachment-pill button{
  border: 0; border-radius: 999px; width: 16px; height: 16px; background: #ececf6; color: #5a5a79;
  font-size: 10px; line-height: 1; cursor: pointer;
}

.sy-chat-voice{ padding: 0 12px; display: flex; gap: 7px; align-items: center; margin-bottom: 4px; flex: 0 0 auto; }
.sy-chat-voice-btn{ border: 1px solid var(--sy-chat-border); background: var(--sy-chat-surface); color: var(--sy-chat-text); border-radius: 999px; padding: 5px 10px; font-size: 11px; }
.sy-chat-voice-btn.is-recording{ color: var(--sy-chat-error); border-color: var(--sy-chat-error); }

/* ── Toast (dismissible invitation) ── */
.sy-chat-toast{
  position: absolute; right: 0; bottom: calc(var(--sy-chat-button-size) + 14px); width: 258px; padding: 13px 16px 13px 15px;
  border: 1px solid var(--sy-chat-border); border-radius: 14px; background: var(--sy-chat-surface);
  box-shadow: 0 14px 36px var(--sy-chat-shadow); opacity: 0; transform: translateY(7px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.sy-chat-toast.is-visible{ opacity: 1; transform: none; pointer-events: auto; }
.sy-chat-toast strong, .sy-chat-toast span{ display: block; }
.sy-chat-toast strong{ color: var(--sy-chat-primary); font-size: 12.5px; }
.sy-chat-toast span{ margin-top: 4px; color: var(--sy-chat-muted); font-size: 12px; line-height: 1.42; }
.sy-chat-toast-close{ position: absolute; right: 6px; top: 6px; width: 22px; height: 22px; border: 0; background: none; color: #999; cursor: pointer; display: grid; place-items: center; border-radius: 6px; }
.sy-chat-toast-close:hover{ background: var(--sy-chat-surface-soft); }
.sy-chat-toast-close svg{ width: 13px; height: 13px; }

/* ── Overlays (confirm / privacy) — centered dialogs ── */
.sy-chat-overlay{
  position: absolute; inset: 0; z-index: 8; display: flex; align-items: center; justify-content: center;
  padding: 20px; background: rgba(20,20,34,.42); opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.sy-chat-overlay:not([hidden]){ opacity: 1; pointer-events: auto; }
.sy-chat-overlay[hidden]{ display: flex; }

.sy-chat-overlay-box{
  width: 100%; max-width: 290px; background: var(--sy-chat-surface); border-radius: 16px; padding: 18px;
  box-shadow: 0 20px 50px rgba(0,0,0,.28); transform: translateY(8px) scale(.98);
  transition: transform .18s cubic-bezier(0.34,1.56,0.64,1);
}
.sy-chat-overlay:not([hidden]) .sy-chat-overlay-box{ transform: none; }
.sy-chat-overlay-box p{ margin: 0 0 14px; color: var(--sy-chat-text); font-size: 13px; line-height: 1.5; }
.sy-chat-overlay-actions{ display: flex; gap: 8px; justify-content: flex-end; align-items: center; }

.sy-chat-privacy-box{ max-width: 310px; text-align: left; }
.sy-chat-privacy-icon{ width: 38px; height: 38px; border-radius: 10px; background: color-mix(in srgb, var(--sy-chat-primary) 12%, #fff); color: var(--sy-chat-primary); display: grid; place-items: center; margin-bottom: 10px; }
.sy-chat-privacy-icon svg{ width: 19px; height: 19px; }
.sy-chat-privacy-box .sy-chat-overlay-actions{ justify-content: space-between; }

.sy-chat-consent-check{ display: flex; align-items: flex-start; gap: 8px; font-size: 12px; color: var(--sy-chat-muted); line-height: 1.4; margin-bottom: 14px; cursor: pointer; }
.sy-chat-consent-check input{ margin-top: 2px; }

.sy-chat-link{ font-size: 12px; color: var(--sy-chat-primary); text-decoration: underline; }
.sy-chat-link:hover{ text-decoration: none; }

.sy-chat-btn-primary{
  border: 0; border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  background: var(--sy-chat-primary); color: #fff; transition: filter .16s ease, transform .16s ease;
}
.sy-chat-btn-primary:hover{ filter: brightness(1.06); }
.sy-chat-btn-primary:disabled{ opacity: .5; cursor: not-allowed; }
.sy-chat-btn-outline{
  border: 1px solid var(--sy-chat-border); border-radius: 10px; padding: 10px 16px; font-size: 13px; font-weight: 600;
  cursor: pointer; background: var(--sy-chat-surface); color: var(--sy-chat-text);
}
.sy-chat-btn-outline:hover{ background: var(--sy-chat-surface-soft); }
.sy-chat-btn-block{ width: 100%; }

/* ── Drawers (slide in from right, cover body+composer area) ── */
.sy-chat-drawer{
  position: absolute; inset: 0; z-index: 7; background: var(--sy-chat-surface); display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .22s cubic-bezier(0.16,1,0.3,1);
}
.sy-chat-drawer:not([hidden]){ transform: none; }
.sy-chat-drawer[hidden]{ display: flex; }

.sy-chat-drawer-head{ display: flex; align-items: center; gap: 6px; padding: 10px 14px; border-bottom: 1px solid var(--sy-chat-border); flex: 0 0 auto; }
.sy-chat-drawer-head .sy-chat-icon-btn{ color: var(--sy-chat-text); }
.sy-chat-drawer-head .sy-chat-icon-btn:hover{ background: var(--sy-chat-surface-soft); }
.sy-chat-drawer-head h3{ margin: 0; font-size: 14.5px; font-weight: 700; color: var(--sy-chat-text); }
.sy-chat-drawer-body{ flex: 1; overflow-y: auto; padding: 14px; }

.sy-chat-form-fields{ display: grid; gap: 12px; }
.sy-chat-field{ display: grid; gap: 5px; font-size: 12px; color: var(--sy-chat-muted); font-weight: 600; }
.sy-chat-field input, .sy-chat-field select, .sy-chat-field textarea{
  width: 100%; border: 1px solid var(--sy-chat-border); border-radius: 10px; padding: 10px 11px;
  font: 13px/1.4 inherit; background: var(--sy-chat-surface); color: var(--sy-chat-text);
}
.sy-chat-field textarea{ resize: vertical; min-height: 72px; }
.sy-chat-field input:focus, .sy-chat-field select:focus, .sy-chat-field textarea:focus{
  outline: none; border-color: var(--sy-chat-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sy-chat-primary) 14%, transparent);
}

.sy-chat-lead-success{ text-align: center; padding: 10px 4px; }
.sy-chat-lead-success-icon{ color: var(--sy-chat-success); margin: 4px 0 10px; }
.sy-chat-lead-success-icon svg{ width: 40px; height: 40px; }
.sy-chat-lead-success h4{ margin: 0 0 14px; font-size: 14.5px; color: var(--sy-chat-text); }
.sy-chat-lead-meta{ display: grid; gap: 8px; text-align: left; background: var(--sy-chat-surface-soft); border-radius: 10px; padding: 12px; margin-bottom: 14px; }
.sy-chat-lead-meta > div{ display: flex; justify-content: space-between; font-size: 12.5px; }
.sy-chat-lead-meta span{ color: var(--sy-chat-muted); }
.sy-chat-lead-meta strong{ color: var(--sy-chat-text); }
.sy-chat-lead-success p{ font-size: 12px; color: var(--sy-chat-muted); margin: 0 0 14px; }

.sy-chat-history-empty, .sy-chat-history-note{ color: var(--sy-chat-muted); font-size: 12.5px; text-align: center; padding: 24px 10px; line-height: 1.5; }
.sy-chat-history-item{
  display: flex; align-items: flex-start; gap: 10px; width: 100%; border: 1px solid var(--sy-chat-border); border-radius: 12px;
  padding: 11px 12px; margin-bottom: 8px; background: var(--sy-chat-surface); cursor: pointer; text-align: left;
}
.sy-chat-history-item:hover{ border-color: var(--sy-chat-primary); }
.sy-chat-history-item-body{ flex: 1; min-width: 0; }
.sy-chat-history-item-title{ font-size: 13px; font-weight: 700; color: var(--sy-chat-text); display: flex; align-items: center; gap: 6px; }
.sy-chat-history-item-preview{ font-size: 12px; color: var(--sy-chat-muted); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sy-chat-history-item-meta{ font-size: 10.5px; color: var(--sy-chat-muted); margin-top: 4px; }
.sy-chat-history-unread{ width: 8px; height: 8px; border-radius: 50%; background: var(--sy-chat-primary); flex: 0 0 auto; margin-top: 5px; }
.sy-chat-history-delete{ border: 0; background: none; color: var(--sy-chat-muted); cursor: pointer; padding: 4px; border-radius: 6px; flex: 0 0 auto; }
.sy-chat-history-delete:hover{ background: color-mix(in srgb, var(--sy-chat-error) 10%, transparent); color: var(--sy-chat-error); }
.sy-chat-history-delete svg{ width: 15px; height: 15px; }
.sy-chat-history-new{ width: 100%; margin-bottom: 10px; }

.sy-chat-lang-options{ display: grid; gap: 8px; }
.sy-chat-lang-option{
  display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--sy-chat-border);
  border-radius: 10px; padding: 11px 13px; cursor: pointer; font-size: 13px; color: var(--sy-chat-text); background: var(--sy-chat-surface);
}
.sy-chat-lang-option:hover{ border-color: var(--sy-chat-primary); }
.sy-chat-lang-option.is-active{ border-color: var(--sy-chat-primary); background: color-mix(in srgb, var(--sy-chat-primary) 6%, #fff); }
.sy-chat-lang-option svg{ width: 16px; height: 16px; color: var(--sy-chat-primary); visibility: hidden; }
.sy-chat-lang-option.is-active svg{ visibility: visible; }

.sy-chat-rating-body{ display: flex; flex-direction: column; align-items: center; text-align: center; padding-top: 24px; }
.sy-chat-rating-body p{ font-size: 13px; color: var(--sy-chat-text); margin: 0 0 16px; }
.sy-chat-star-picker{ display: flex; gap: 6px; margin-bottom: 20px; }
.sy-chat-star-btn{ border: 0; background: none; color: var(--sy-chat-border); cursor: pointer; padding: 2px; }
.sy-chat-star-btn svg{ width: 30px; height: 30px; fill: currentColor; transition: color .12s ease, transform .12s ease; }
.sy-chat-star-btn:hover, .sy-chat-star-btn:hover ~ .sy-chat-star-btn{ color: var(--sy-chat-border); }
.sy-chat-star-picker:hover .sy-chat-star-btn{ color: var(--sy-chat-border); }
.sy-chat-star-btn.is-filled{ color: var(--sy-chat-secondary); }
.sy-chat-star-btn.is-filled svg{ transform: scale(1.05); }

/* ── Error cards ── */
.sy-chat-error-card{
  border: 1px solid color-mix(in srgb, var(--sy-chat-error) 30%, var(--sy-chat-border)); background: color-mix(in srgb, var(--sy-chat-error) 5%, #fff);
  border-radius: 14px 14px 14px 4px; padding: 12px 13px; max-width: 100%;
}
.sy-chat-error-card-head{ display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.sy-chat-error-card-head svg{ width: 16px; height: 16px; color: var(--sy-chat-error); flex: 0 0 auto; }
.sy-chat-error-card-head strong{ font-size: 13px; color: var(--sy-chat-text); }
.sy-chat-error-card p{ margin: 0 0 10px; font-size: 12.5px; color: var(--sy-chat-muted); line-height: 1.45; }
.sy-chat-error-actions{ display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Product cards ── */
.sy-chat-products{ display: flex; flex-direction: column; gap: 10px; margin-top: 8px; max-width: 100%; }
.sy-chat-products.has-many{ flex-direction: row; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x mandatory; }
.sy-chat-products.has-many .sy-chat-product-card{ flex: 0 0 auto; width: 220px; scroll-snap-align: start; }

.sy-chat-product-card{
  display: block; border: 1px solid var(--sy-chat-border); border-radius: 12px; background: var(--sy-chat-surface);
  overflow: hidden; text-decoration: none; color: inherit; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}
.sy-chat-product-card:hover{ border-color: var(--sy-chat-primary); box-shadow: 0 8px 20px rgba(22,26,45,.1); transform: translateY(-1px); }
.sy-chat-product-card-media{ width: 100%; aspect-ratio: 4/3; background: var(--sy-chat-surface-soft); display: block; }
.sy-chat-product-card-media img{ width: 100%; height: 100%; object-fit: contain; }
.sy-chat-product-card-body{ padding: 10px 11px; }
.sy-chat-product-card-name{ font-size: 12.5px; font-weight: 700; color: var(--sy-chat-text); line-height: 1.35; margin: 0 0 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sy-chat-product-card-price{ display: flex; align-items: baseline; gap: 6px; margin-bottom: 4px; }
.sy-chat-product-card-price strong{ font-size: 13.5px; color: var(--sy-chat-primary); }
.sy-chat-product-card-price del{ font-size: 11px; color: var(--sy-chat-muted); }
.sy-chat-product-card-stock{ font-size: 10.5px; font-weight: 700; margin-bottom: 6px; }
.sy-chat-product-card-stock.in-stock{ color: var(--sy-chat-success); }
.sy-chat-product-card-stock.out-stock{ color: var(--sy-chat-error); }
.sy-chat-product-card-specs{ margin: 0 0 8px; padding: 0; list-style: none; display: grid; gap: 2px; }
.sy-chat-product-card-specs li{ font-size: 10.5px; color: var(--sy-chat-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sy-chat-product-card-actions{ display: flex; gap: 6px; }
.sy-chat-product-card-actions button, .sy-chat-product-card-actions a{
  flex: 1; text-align: center; border: 1px solid var(--sy-chat-border); border-radius: 8px; padding: 6px 8px;
  font-size: 11px; font-weight: 700; cursor: pointer; background: var(--sy-chat-surface); color: var(--sy-chat-text); text-decoration: none;
}
.sy-chat-product-card-actions .is-primary{ background: var(--sy-chat-primary); border-color: var(--sy-chat-primary); color: #fff; }
.sy-chat-product-card-actions .is-primary:hover{ filter: brightness(1.06); }

.sy-chat-compare-wrap{ overflow-x: auto; margin-top: 8px; }
.sy-chat-compare{ border-collapse: collapse; width: 100%; min-width: 320px; font-size: 11.5px; }
.sy-chat-compare th, .sy-chat-compare td{ border: 1px solid var(--sy-chat-border); padding: 7px 8px; text-align: left; vertical-align: top; }
.sy-chat-compare th{ background: var(--sy-chat-surface-soft); position: sticky; top: 0; }
.sy-chat-compare tr:first-child th:first-child, .sy-chat-compare tr:first-child td:first-child{ position: sticky; left: 0; background: var(--sy-chat-surface-soft); }
.sy-chat-compare td.diff{ background: color-mix(in srgb, var(--sy-chat-secondary) 20%, #fff); font-weight: 700; }
.sy-chat-compare-conclusion{ margin: 8px 0 0; font-size: 12px; color: var(--sy-chat-text); font-weight: 600; }

/* Minimize collapses to header only */
.sy-chatbot.is-minimized .sy-chat-body,
.sy-chatbot.is-minimized .sy-chat-quick,
.sy-chatbot.is-minimized .sy-chat-composer,
.sy-chatbot.is-minimized .sy-chat-disclaimer,
.sy-chatbot.is-minimized .sy-chat-attachments,
.sy-chatbot.is-minimized .sy-chat-voice,
.sy-chatbot.is-minimized .sy-chat-connection{ display: none; }
.sy-chatbot.is-minimized .sy-chat-window{ height: auto; }
.sy-chatbot.is-minimized #sy-chat-minimize{ background: rgba(255,255,255,.24); }

@keyframes sy-chat-in{ from{ opacity: 0; transform: translateY(4px);} to{ opacity: 1; transform: none;} }
@keyframes sy-chat-dot{ 0%,80%,100%{ opacity: .3; transform: translateY(0);} 40%{ opacity: 1; transform: translateY(-3px);} }
@keyframes sy-chat-pulse{ 0%{ opacity: .55; transform: scale(1);} 100%{ opacity: 0; transform: scale(1.35);} }
@keyframes sy-chat-online-ping{ 0%{ opacity: .55; transform: scale(1);} 100%{ opacity: 0; transform: scale(2.2);} }
@keyframes sy-chat-badge-in{ from{ opacity: 0; transform: scale(.4);} to{ opacity: 1; transform: scale(1);} }
@keyframes sy-chat-menu-in{ from{ opacity: 0; transform: translateY(-4px) scale(.98);} to{ opacity: 1; transform: none;} }
@keyframes sy-chat-shimmer{ 0%{ background-position: 100% 0;} 100%{ background-position: 0 0;} }
@keyframes sy-chat-notify{ 0%,100%{ transform: none;} 30%{ transform: translateY(-4px);} 55%{ transform: translateY(0);} }

/* ── Mobile: full screen ── */
@media (max-width: 600px){
  .sy-chatbot{ right: 14px; bottom: 14px; }
  .sy-chatbot--bottom-left{ left: 14px; right: auto; }
  .sy-chatbot--top-right{ right: 14px; top: 14px; bottom: auto; }
  .sy-chatbot--top-left{ left: 14px; top: 14px; bottom: auto; }

  .sy-chat-launcher{ width: var(--sy-chat-mobile-button-size); height: var(--sy-chat-mobile-button-size); }

  .sy-chat-window{
    position: fixed;
    left: 0; right: 0; top: 0; bottom: 0;
    width: 100%; height: 100dvh;
    border-radius: 0; border: 0;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .sy-chatbot--top-right .sy-chat-window, .sy-chatbot--top-left .sy-chat-window{ top: 0; }

  .sy-chat-toast{ right: 0; bottom: calc(var(--sy-chat-mobile-button-size) + 12px); max-width: calc(100vw - 70px); }

  .sy-chat-icon-btn, .sy-chat-composer button{ width: 44px; height: 44px; }

  .sy-chat-welcome-actions{ grid-template-columns: 1fr; }
  .sy-chat-message-col{ max-width: 90%; }
  .sy-chat-message--user .sy-chat-message-col{ max-width: 86%; }

  .sy-chat-products.has-many{ flex-direction: column; overflow-x: visible; }
  .sy-chat-products.has-many .sy-chat-product-card{ width: 100%; }

  .sy-chat-menu{ width: min(260px, calc(100vw - 28px)); }
}

@media (prefers-reduced-motion: reduce){
  .sy-chatbot, .sy-chatbot *, .sy-chatbot *::before, .sy-chatbot *::after{
    animation-duration: .01ms !important; animation-iteration-count: 1 !important;
    transition-duration: .01ms !important; scroll-behavior: auto !important;
  }
  .sy-chat-typing i{ animation: none !important; }
}
