/* Self-contained styles for the floating support widget and public thread
   page. Own variable namespace so it can load on any v1 page safely. */
:root {
  --chat-primary: #4f46e5; --chat-primary-2: #7c3aed;
  --chat-grad: linear-gradient(135deg, #4f46e5, #7c3aed);
  --chat-surface: #fff; --chat-surface-2: #f8fafc; --chat-border: #e2e8f0;
  --chat-text: #0f172a; --chat-muted: #64748b; --chat-danger: #f43f5e;
  --chat-warning: #f59e0b; --chat-shadow: 0 10px 30px -12px rgba(79,70,229,.4);
}
.dark {
  --chat-surface: #0b1020; --chat-surface-2: #111827; --chat-border: #1e293b;
  --chat-text: #e2e8f0; --chat-muted: #94a3b8;
}
.chat-widget { position: fixed; inset-inline-end: 1.25rem; bottom: 1.25rem; z-index: 60;
  font-family: "Inter", system-ui, sans-serif; color: var(--chat-text); }
.chat-fab { width: 3.6rem; height: 3.6rem; border-radius: 999px; border: 0; cursor: pointer;
  background: var(--chat-grad); color: #fff; display: grid; place-items: center; box-shadow: var(--chat-shadow); }
.chat-panel { position: absolute; inset-inline-end: 0; bottom: 4.4rem; width: min(24rem, calc(100vw - 2.5rem));
  background: var(--chat-surface); border: 1px solid var(--chat-border); border-radius: 1.25rem;
  box-shadow: var(--chat-shadow); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1.1rem;
  background: var(--chat-grad); color: #fff; }
.chat-head h2 { font-size: 1rem; margin: 0; }
.chat-icon-btn { background: transparent; border: 0; color: inherit; cursor: pointer; font-size: 1.05rem; }
.chat-messages { max-height: 16rem; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .6rem; }
.chat-msg { max-width: 85%; padding: .65rem .9rem; border-radius: .9rem; font-size: .9rem; list-style: none; }
.chat-msg--guest, .chat-msg--user { background: var(--chat-surface-2); border: 1px solid var(--chat-border); align-self: flex-start; }
[dir="rtl"] .chat-msg--guest, [dir="rtl"] .chat-msg--user { align-self: flex-end; }
.chat-msg--admin { background: rgba(99,102,241,.12); align-self: flex-end; }
[dir="rtl"] .chat-msg--admin { align-self: flex-start; }
.chat-msg--note { background: rgba(245,158,11,.14); border: 1px dashed var(--chat-warning); }
.chat-form { padding: 1rem; display: grid; gap: .6rem; border-top: 1px solid var(--chat-border); }
.chat-fields { display: grid; gap: .5rem; }
.chat-input { width: 100%; padding: .6rem .75rem; border: 1px solid var(--chat-border);
  border-radius: .55rem; background: var(--chat-surface); color: var(--chat-text); font: inherit; }
.chat-error { color: var(--chat-danger); font-size: .85rem; margin: 0; }
.chat-submit { background: var(--chat-grad); color: #fff; border: 0; padding: .65rem;
  border-radius: .55rem; font-weight: 700; cursor: pointer; }
#chat-thread { list-style: none; margin: 0; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
