/* AlgoTailor brand skin for the visitor chat (loads after chat-studio.css). Owner inbox styles are untouched. */
.chat-launcher,
#chat-dialog {
  --chat-bg: #090D12;
  --chat-surface: #111821;
  --chat-raised: #16202B;
  --chat-line: #1F2935;
  --chat-ink: #F1F4F7;
  --chat-muted: #A3AFBC;
  --chat-blue: #22D39A;
  --chat-blue-soft: #7BE8C4;
  --chat-green: #22D39A;
  --chat-amber: #FFB547;
}

/* Launcher: the primary teal action, same as the site's buttons */
.chat-launcher {
  border: 1px solid #22D39A;
  background: #22D39A;
  color: #090D12;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(3, 6, 10, .55);
}
.chat-launcher > svg { color: #090D12; }
.chat-launcher-label { font-weight: 600; }
.chat-launcher:hover { background: #4BE3B1; box-shadow: 0 12px 32px rgba(3, 6, 10, .7); }
.chat-launcher:focus-visible { outline: 3px solid #F1F4F7; outline-offset: 4px; }
/* New reply arrived while the chat window was closed (set by app.js, label also changes) */
.chat-launcher[data-unread="true"]::after {
  content: "";
  position: absolute;
  top: -5px;
  right: -5px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #FFB547;
  border: 2px solid #090D12;
}

/* Panel */
#chat-dialog { background: var(--chat-bg); border: 1px solid var(--chat-line); border-radius: 18px; box-shadow: 0 28px 90px rgba(3, 6, 10, .8); }
#chat-dialog::backdrop { background: rgba(3, 6, 10, .78); backdrop-filter: blur(4px); }
#chat-dialog .chat-panel-header { position: relative; background: var(--chat-surface); border-color: var(--chat-line); }
#chat-dialog .chat-panel-brand { padding-right: 52px; }
#chat-dialog .chat-panel-mark { background: var(--chat-bg); border: 1px solid var(--chat-line); color: #F1F4F7; }
#chat-dialog .chat-panel-mark svg { width: 24px; height: 24px; }

/* Close button sits in the header's top-right corner, not in the text flow */
#chat-dialog .dialog-close { position: absolute; top: 16px; right: 14px; color: var(--chat-muted); }
#chat-dialog .dialog-close:hover { color: #F1F4F7; background: var(--chat-raised); border-color: var(--chat-line); }

#chat-dialog .chat-privacy-label { color: #22D39A; font: 700 .6875rem/1.5 var(--mono, monospace); letter-spacing: .06em; text-transform: uppercase; }
#chat-dialog .chat-welcome-icon { background: var(--chat-surface); border-color: var(--chat-line); color: #22D39A; }
#chat-dialog .chat-platforms span { background: var(--chat-surface); color: #C9D2DC; border-color: var(--chat-line); font-family: var(--mono, monospace); }

/* Primary actions: teal with dark ink text for contrast */
#chat-dialog .chat-prepare-brief,
#chat-dialog .button:not(.chat-prepare-brief) { color: #090D12; background: #22D39A; border: 1px solid #22D39A; font-weight: 600; }
#chat-dialog .chat-prepare-brief:hover,
#chat-dialog .button:hover { background: #4BE3B1; }

/* Fields */
#chat-dialog label { color: #C9D2DC; }
#chat-dialog input,
#chat-dialog textarea { background: #0C1218; border-color: #2A3644; color: var(--chat-ink); }
#chat-dialog input:focus,
#chat-dialog textarea:focus { border-color: #22D39A; }
#chat-dialog input::placeholder,
#chat-dialog textarea::placeholder,
#chat-dialog .optional-label { color: #8794A3; }
#chat-dialog .chat-privacy-note { color: #8F9BA8 !important; }
#chat-dialog [data-open-privacy] { color: #7BE8C4; font-size: .8125rem; }
#chat-dialog [data-open-privacy]:hover { color: #F1F4F7; }
#chat-dialog #chat-start-form details { background: var(--chat-surface); border-color: var(--chat-line); }
#chat-dialog #chat-start-form details > summary { color: #C9D2DC; }
#chat-dialog #chat-start-form details > summary::marker { color: #22D39A; }

/* Conversation */
#chat-dialog .visitor-messages { scrollbar-color: #2A3644 var(--chat-bg); }
#chat-dialog .chat-panel-body { scrollbar-color: #2A3644 var(--chat-bg); }
#chat-dialog .visitor-message > p { background: var(--chat-surface); border-color: var(--chat-line); }
#chat-dialog .visitor-message.visitor > p { color: #E9FBF4; background: #0F3B2E; border-color: #1C6B52; }
#chat-dialog .visitor-message > small { color: #8794A3; }
#chat-dialog #visitor-connection { color: #A3AFBC; }
#chat-dialog .chat-panel-footer { background: var(--chat-surface); border-color: var(--chat-line); color: #8794A3; font-family: var(--mono, monospace); }
#chat-dialog :focus-visible { outline: 3px solid #22D39A; outline-offset: 3px; }

@media (max-width: 600px) {
  #chat-dialog .dialog-close { top: 12px; right: 10px; }
}
@media (forced-colors: active) {
  .chat-launcher { border: 1px solid ButtonText; }
  .chat-launcher[data-unread="true"]::after { background: Highlight; border-color: ButtonText; }
}
