.secure-ai-chat {
  --chat-accent: #175cd3;
  --chat-border: #d0d5dd;
  --chat-surface: #fff;
  --chat-muted: #667085;
  background: var(--chat-surface);
  border: 1px solid var(--chat-border);
  border-radius: 14px;
  box-shadow: 0 8px 28px rgba(16, 24, 40, .08);
  color: #101828;
  margin: 1rem auto;
  max-width: 720px;
  overflow: hidden;
}

.secure-ai-chat__dock {
  bottom: 20px;
  position: fixed;
  right: 20px;
  z-index: 99999;
}

.secure-ai-chat__launcher {
  background: var(--chat-accent, #175cd3);
  border: 0;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(16, 24, 40, .2);
  color: #fff;
  cursor: pointer;
  float: right;
  font-weight: 700;
  padding: .85rem 1.2rem;
}

.secure-ai-chat--floating {
  clear: both;
  margin: 0 0 .75rem;
  max-height: calc(100vh - 100px);
  width: min(420px, calc(100vw - 32px));
}

.secure-ai-chat--floating[hidden] { display: none; }

.secure-ai-chat__header {
  align-items: center;
  border-bottom: 1px solid var(--chat-border);
  display: flex;
  justify-content: space-between;
  padding: 1rem 1.25rem;
}

.secure-ai-chat__header > div { display: flex; flex-direction: column; }
.secure-ai-chat__status { color: var(--chat-muted); font-size: .78rem; }
.secure-ai-chat .secure-ai-chat__end {
  background: #fff !important;
  border: 1px solid #98a2b3 !important;
  border-radius: 7px;
  color: #344054 !important;
  cursor: pointer;
  font-weight: 600;
  padding: .35rem .6rem;
}
.secure-ai-chat .secure-ai-chat__end:hover {
  background: #f2f4f7 !important;
  border-color: #667085 !important;
  color: #101828 !important;
}
.secure-ai-chat .secure-ai-chat__end:focus-visible {
  background: #fff !important;
  color: #101828 !important;
  outline: 3px solid rgba(23, 92, 211, .35);
  outline-offset: 2px;
}

.secure-ai-chat__privacy,
.secure-ai-chat__notice,
.secure-ai-chat__counter { color: var(--chat-muted); font-size: .78rem; }

.secure-ai-chat__messages {
  display: flex;
  flex-direction: column;
  gap: .75rem;
  max-height: 460px;
  min-height: 260px;
  overflow-y: auto;
  padding: 1.25rem;
}

.secure-ai-chat__message {
  background: #f2f4f7;
  border-radius: 12px;
  max-width: 84%;
  padding: .75rem 1rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.secure-ai-chat__message--user { align-self: flex-end; background: var(--chat-accent); color: #fff; }
.secure-ai-chat__message--assistant { align-self: flex-start; }
.secure-ai-chat__message--support { align-self: flex-start; background: #ecfdf3; border: 1px solid #abefc6; color: #067647; }
.secure-ai-chat__message--error { background: #fef3f2; color: #b42318; }
.secure-ai-chat__form { border-top: 1px solid var(--chat-border); padding: 1rem 1.25rem .5rem; }
.secure-ai-chat__form textarea { box-sizing: border-box; resize: vertical; width: 100%; }
.secure-ai-chat__actions { align-items: center; display: flex; justify-content: space-between; margin-top: .5rem; }
.secure-ai-chat__actions button { background: var(--chat-accent); border: 0; border-radius: 8px; color: #fff; cursor: pointer; padding: .65rem 1.1rem; }
.secure-ai-chat__actions button:disabled { cursor: wait; opacity: .55; }
.secure-ai-chat__notice { margin: 0; padding: .25rem 1.25rem 1rem; }

@media (max-width: 520px) {
  .secure-ai-chat__dock { bottom: 12px; right: 12px; }
  .secure-ai-chat--floating { max-height: calc(100vh - 82px); width: calc(100vw - 24px); }
  .secure-ai-chat__header { align-items: flex-start; flex-direction: column; gap: .2rem; }
  .secure-ai-chat__message { max-width: 92%; }
}
