/* ============================================
   Giants — Public landing styles
   ============================================ */

body.public { background: var(--color-bg); color: var(--color-text); }

.public-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(10,10,26,0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
}
.public-nav__wrap {
  max-width: 1200px; margin: 0 auto;
  padding: 16px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.public-nav__brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 20px;
}
.public-nav__logo {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white; font-weight: 900;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px;
}
.public-nav__links { display: flex; align-items: center; gap: 24px; }
.public-nav__link { font-weight: 500; color: var(--color-text-secondary); transition: color 150ms; }
.public-nav__link:hover { color: var(--color-text); }

.public-main { min-height: 70vh; }

/* Hero */
.hero { padding: 100px 24px 80px; overflow: hidden; position: relative; }
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(circle at 30% 40%, rgba(108,92,231,0.2), transparent 50%),
              radial-gradient(circle at 80% 60%, rgba(0,212,255,0.15), transparent 50%);
  z-index: 0; pointer-events: none;
}
.hero__wrap { max-width: 900px; margin: 0 auto; text-align: center; position: relative; z-index: 1; }
.hero__eyebrow {
  display: inline-block;
  padding: 8px 16px;
  background: rgba(108,92,231,0.15);
  border: 1px solid rgba(108,92,231,0.3);
  border-radius: var(--radius-full);
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--color-primary-light);
  margin-bottom: 24px;
}
.hero__title {
  font-size: clamp(36px, 6vw, 68px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 24px;
}
.hero__accent {
  background: linear-gradient(90deg, var(--color-accent), var(--color-primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero__sub {
  font-size: 20px; line-height: 1.5;
  color: var(--color-text-secondary);
  max-width: 680px; margin: 0 auto 36px;
}
.hero__cta {
  display: flex; gap: 16px; justify-content: center; flex-wrap: wrap;
  margin-bottom: 32px;
}
.hero__trust {
  font-size: 13px; color: var(--color-text-muted);
}

/* Sections */
.features, .how-it-works, .plans-teaser, .cta-final {
  padding: 80px 24px;
}
.features__wrap { max-width: 1200px; margin: 0 auto; }
.section-title {
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  text-align: center;
  margin-bottom: 12px;
  letter-spacing: -0.01em;
}
.section-sub {
  text-align: center; font-size: 17px;
  color: var(--color-text-secondary);
  max-width: 640px; margin: 0 auto 48px;
}

.features__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-top: 48px;
}
.feature-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: all var(--transition-normal);
}
.feature-card:hover {
  border-color: var(--color-primary);
  transform: translateY(-4px);
  box-shadow: var(--shadow-glow);
}
.feature-card__icon { font-size: 32px; margin-bottom: 16px; }
.feature-card h3 { font-size: 19px; font-weight: 700; margin-bottom: 10px; }
.feature-card p { color: var(--color-text-secondary); line-height: 1.6; }

/* How it works */
.how-it-works { background: var(--color-bg-card); }
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin-top: 48px;
}
.step { text-align: center; padding: 24px 16px; }
.step__num {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  font-size: 22px; font-weight: 800;
  border-radius: var(--radius-full);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px;
  box-shadow: var(--shadow-glow);
}
.step h3 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.step p { color: var(--color-text-secondary); font-size: 15px; line-height: 1.5; }

/* Plans teaser + dedicated /precos */
.plan-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}
.plan-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 32px 28px;
  text-align: center;
  position: relative;
  transition: all var(--transition-normal);
}
.plan-card--featured {
  border-color: var(--color-primary);
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}
.plan-card__badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  color: white; padding: 4px 14px;
  border-radius: var(--radius-full);
  font-size: 12px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase;
}
.plan-card__name {
  font-size: 14px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}
.plan-card__price { margin-bottom: 10px; }
.plan-card__currency { font-size: 18px; vertical-align: super; color: var(--color-text-muted); }
.plan-card__amount { font-size: 48px; font-weight: 800; color: var(--color-text); }
.plan-card__period { font-size: 15px; color: var(--color-text-muted); }
.plan-card__fee {
  font-size: 13px; color: var(--color-text-secondary);
  margin-bottom: 22px;
}
.plan-card__desc {
  font-size: 14px; color: var(--color-text-secondary);
  line-height: 1.5; margin-bottom: 20px;
  min-height: 44px;
}
.plan-card__features {
  list-style: none; padding: 0;
  text-align: left; margin-bottom: 28px;
}
.plan-card__features li {
  padding: 8px 0; font-size: 14px;
  color: var(--color-text-secondary);
  border-bottom: 1px solid var(--color-border);
}
.plan-card__features li:last-child { border-bottom: none; }
.plan-card__features li::before {
  content: '\2713';
  color: var(--color-green);
  margin-right: 10px;
  font-weight: 700;
}

.btn--lg { padding: 14px 28px; font-size: 16px; font-weight: 700; }
.btn--md { padding: 10px 22px; font-size: 14px; font-weight: 600; }

/* CTA final */
.cta-final {
  background: linear-gradient(135deg, rgba(108,92,231,0.15), rgba(0,212,255,0.1));
  text-align: center;
}
.cta-final h2 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  margin-bottom: 14px;
}
.cta-final p {
  font-size: 18px;
  color: var(--color-text-secondary);
  max-width: 560px; margin: 0 auto 32px;
}

/* Footer */
.public-footer {
  background: var(--color-bg-card);
  border-top: 1px solid var(--color-border);
  padding: 48px 24px 20px;
}
.public-footer__wrap {
  max-width: 1200px; margin: 0 auto;
  display: grid; grid-template-columns: 2fr 1fr;
  gap: 32px;
}
.public-footer__wrap p { color: var(--color-text-muted); font-size: 14px; margin-top: 6px; }
.public-footer__wrap a {
  display: block;
  color: var(--color-text-secondary);
  font-size: 14px;
  padding: 4px 0;
  transition: color 150ms;
}
.public-footer__wrap a:hover { color: var(--color-text); }
.public-footer__legal {
  max-width: 1200px; margin: 32px auto 0;
  padding-top: 20px;
  border-top: 1px solid var(--color-border);
  text-align: center;
  font-size: 13px; color: var(--color-text-muted);
}

/* FAQ */
.pricing-faq { max-width: 780px; margin: 0 auto; }
.faq {
  display: flex; flex-direction: column; gap: 16px;
  margin-top: 40px;
}
.faq__item {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}
.faq__item h4 { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.faq__item p { color: var(--color-text-secondary); line-height: 1.6; }

/* ============================================================
   SALES WIDGET — chat overlay flutuante na landing
   ============================================================ */
.sales-widget { position: relative; z-index: 950; }

.sales-widget__launcher {
  position: fixed; bottom: 24px; right: 24px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; font-size: 14px; font-weight: 700;
  box-shadow: 0 12px 32px rgba(108,92,231,0.45);
  cursor: pointer;
  transition: transform 200ms cubic-bezier(.2,.7,.3,1.4), box-shadow 200ms ease;
  z-index: 951;
  animation: salesLauncherPulse 3s ease-in-out infinite;
}
.sales-widget__launcher:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 16px 40px rgba(108,92,231,0.6); }
.sales-widget__launcher--hidden { transform: scale(0); pointer-events: none; opacity: 0; }
.sales-widget__launcher-icon { font-size: 18px; }
.sales-widget__launcher-text { letter-spacing: 0.01em; }

@keyframes salesLauncherPulse {
  0%, 100% { box-shadow: 0 12px 32px rgba(108,92,231,0.45), 0 0 0 0 rgba(108,92,231,0.4); }
  50%      { box-shadow: 0 12px 32px rgba(108,92,231,0.45), 0 0 0 16px rgba(108,92,231,0); }
}

.sales-widget__chat {
  position: fixed; bottom: 24px; right: 24px;
  width: 380px; max-width: calc(100vw - 32px);
  height: 560px; max-height: calc(100vh - 48px);
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(0,0,0,0.55), 0 0 0 1px rgba(108,92,231,0.2);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 952;
  animation: salesChatIn 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
@keyframes salesChatIn {
  0%   { opacity: 0; transform: translateY(20px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.sales-widget__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--color-border);
  background: linear-gradient(180deg, var(--color-bg-elevated), var(--color-bg-card));
}
.sales-widget__head-brand { display: flex; align-items: center; gap: 10px; }
.sales-widget__avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; color: #fff;
}
.sales-widget__name { font-size: 14px; font-weight: 800; }
.sales-widget__sub {
  font-size: 11px; color: var(--color-text-muted);
  display: flex; align-items: center; gap: 6px; margin-top: 2px;
}
.sales-widget__dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-success); box-shadow: 0 0 6px var(--color-success);
}
.sales-widget__close {
  width: 30px; height: 30px; border-radius: 6px;
  font-size: 22px; color: var(--color-text-muted);
  display: flex; align-items: center; justify-content: center;
  transition: background 150ms ease, color 150ms ease;
}
.sales-widget__close:hover { background: var(--color-bg-hover); color: var(--color-text); }

.sales-widget__messages {
  flex: 1; overflow-y: auto; padding: 16px;
  display: flex; flex-direction: column; gap: 10px;
  background: var(--color-bg);
}
.sales-widget__loading {
  display: flex; align-items: center; justify-content: center;
  padding: 40px 0; flex: 1;
}

.sales-widget__msg {
  display: flex; max-width: 85%;
  animation: salesMsgIn 200ms ease-out;
}
@keyframes salesMsgIn {
  0%   { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}
.sales-widget__msg--user { align-self: flex-end; justify-content: flex-end; }
.sales-widget__msg--bot  { align-self: flex-start; }
.sales-widget__bubble {
  padding: 10px 14px; border-radius: 14px;
  font-size: 13.5px; line-height: 1.5;
  word-wrap: break-word; white-space: pre-wrap;
}
.sales-widget__msg--user .sales-widget__bubble {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: #fff; border-bottom-right-radius: 4px;
}
.sales-widget__msg--bot .sales-widget__bubble {
  background: var(--color-bg-elevated); color: var(--color-text);
  border: 1px solid var(--color-border); border-bottom-left-radius: 4px;
}
.sales-widget__msg--error .sales-widget__bubble {
  border-color: rgba(255,107,107,0.5); color: var(--color-danger);
}

.sales-widget__composer {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px; border-top: 1px solid var(--color-border);
  background: var(--color-bg-card);
}
.sales-widget__input {
  flex: 1; padding: 10px 14px;
  background: var(--color-bg-elevated); color: var(--color-text);
  border: 1px solid var(--color-border); border-radius: var(--radius-full);
  font-size: 13px; font-family: inherit; outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.sales-widget__input:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(108,92,231,0.18);
}
.sales-widget__input::placeholder { color: var(--color-text-muted); }
.sales-widget__send {
  flex-shrink: 0; width: 36px; height: 36px; border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: #fff; display: flex; align-items: center; justify-content: center;
  transition: transform 150ms ease, box-shadow 150ms ease;
}
.sales-widget__send:hover { transform: scale(1.05); }

.sales-widget__legal {
  font-size: 10px; color: var(--color-text-muted); text-align: center;
  padding: 6px 12px 10px;
}
.sales-widget__legal a { color: var(--color-primary-light); }

/* Re-import dos elementos comuns (typing dots) — public.css é incluído na landing */
.copilot-typing {
  display: inline-flex; gap: 4px; align-items: center;
}
.copilot-typing span {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--color-primary-light);
  animation: copilotTypingDot 1.2s infinite ease-in-out both;
}
.copilot-typing span:nth-child(2) { animation-delay: 0.15s; }
.copilot-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes copilotTypingDot {
  0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
  40%           { transform: scale(1);   opacity: 1; }
}

@media (max-width: 480px) {
  .sales-widget__chat {
    width: 100vw; height: 100dvh; max-height: 100dvh;
    bottom: 0; right: 0; border-radius: 0;
  }
  .sales-widget__launcher { bottom: 16px; right: 16px; padding: 12px 16px; }
}

/* ============ Lead modal (high-touch model) ============ */
.lead-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.lead-modal[hidden] { display: none; }
.lead-modal__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(8px); }
.lead-modal__panel { position: relative; background: #12122A; border: 1px solid #2A2A50; border-radius: 16px; padding: 32px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,0.5); animation: lead-modal-in 280ms cubic-bezier(0.32, 0.72, 0, 1); }
@keyframes lead-modal-in { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
.lead-modal__close { position: absolute; top: 14px; right: 14px; width: 32px; height: 32px; border-radius: 50%; background: rgba(255,255,255,0.1); border: none; color: #fff; font-size: 20px; cursor: pointer; }
.lead-modal__close:hover { background: rgba(255,255,255,0.2); }
.lead-modal__head { margin-bottom: 20px; }
.lead-modal__head h2 { font-size: 24px; margin-bottom: 8px; }
.lead-modal__head p { color: #9090b8; font-size: 14px; line-height: 1.5; }
.lead-modal__form { display: flex; flex-direction: column; gap: 14px; }
.lead-modal__field { display: flex; flex-direction: column; gap: 6px; }
.lead-modal__field span { font-size: 13px; color: #9090b8; }
.lead-modal__field small { color: #6a6a8a; font-weight: 400; font-size: 11px; }
.lead-modal__field input,
.lead-modal__field select,
.lead-modal__field textarea {
  background: #1A1A3E; border: 1px solid #2A2A50; color: #fff;
  padding: 11px 14px; border-radius: 10px; font: inherit; font-size: 15px;
  transition: 200ms; outline: none;
}
.lead-modal__field input:focus,
.lead-modal__field select:focus,
.lead-modal__field textarea:focus { border-color: #7B61FF; box-shadow: 0 0 0 3px rgba(123,97,255,0.18); }
.lead-modal__submit { margin-top: 6px; }
.lead-modal__success { text-align: center; padding: 20px 0; }
.lead-modal__check { width: 64px; height: 64px; border-radius: 50%; background: rgba(0,255,136,0.15); display: grid; place-items: center; font-size: 32px; color: #00FF88; margin: 0 auto 16px; }
.lead-modal__success h3 { font-size: 22px; margin-bottom: 10px; }
.lead-modal__success p { color: #9090b8; line-height: 1.5; margin-bottom: 20px; }
.lead-modal__success a { color: #7B61FF; }

.public-footer__link { background: none; border: none; color: inherit; cursor: pointer; padding: 0; font: inherit; text-decoration: none; }
.public-footer__link:hover { color: #7B61FF; }

/* Admin form (used in /admin/accounts/new) */
.admin-form { max-width: 720px; display: flex; flex-direction: column; gap: 24px; margin-top: 24px; }
.admin-form__group { border: 1px solid var(--color-border, #2A2A50); border-radius: 12px; padding: 20px; background: var(--color-bg-card, #12122A); display: flex; flex-direction: column; gap: 14px; }
.admin-form__group legend { padding: 0 8px; color: var(--color-text-secondary, #9090b8); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em; }
.admin-form__group label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.admin-form__group small { color: var(--color-text-secondary, #6a6a8a); font-size: 12px; }
.admin-form__group input,
.admin-form__group select,
.admin-form__group textarea { background: var(--color-bg-elevated, #1A1A3E); border: 1px solid var(--color-border, #2A2A50); color: var(--color-text, #fff); padding: 10px 12px; border-radius: 8px; font: inherit; font-size: 14px; outline: none; }
.admin-form__group input:focus,
.admin-form__group select:focus,
.admin-form__group textarea:focus { border-color: #7B61FF; box-shadow: 0 0 0 3px rgba(123,97,255,0.18); }
.admin-form__actions { display: flex; gap: 12px; }

.admin-page__head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.admin-page__title { font-size: 28px; }
.admin-page__sub { color: var(--color-text-secondary, #9090b8); margin-bottom: 12px; max-width: 600px; }

/* ============================================================
   Sales Widget v2 — chat overlay landing (.sw__*)
   ============================================================ */
.sw { position: fixed; bottom: 24px; right: 24px; z-index: 950; font-family: inherit; }

/* FAB */
.sw__fab {
  position: relative;
  display: inline-flex; align-items: center; gap: 10px;
  background: linear-gradient(135deg, #7B61FF, #00D4FF);
  color: #0A0A1A;
  padding: 14px 22px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.01em;
  cursor: pointer;
  box-shadow: 0 16px 36px rgba(108,92,231,0.5), 0 4px 12px rgba(0,0,0,0.25);
  transition: transform 220ms cubic-bezier(0.32, 0.72, 0, 1), box-shadow 220ms;
  isolation: isolate;
}
.sw__fab:hover { transform: translateY(-2px) scale(1.03); box-shadow: 0 22px 48px rgba(108,92,231,0.65); }
.sw__fab:active { transform: translateY(0) scale(0.99); }
.sw__fab--hidden { transform: scale(0); pointer-events: none; opacity: 0; }
.sw__fab-icon { display: inline-flex; align-items: center; }
.sw__fab-label { white-space: nowrap; }
.sw__fab-pulse {
  position: absolute; inset: -3px; border-radius: 999px;
  border: 2px solid rgba(123,97,255,0.55);
  animation: sw-fab-pulse 2.4s ease-out infinite;
  z-index: -1;
  pointer-events: none;
}
@keyframes sw-fab-pulse {
  0% { transform: scale(0.95); opacity: 0.9; }
  70% { transform: scale(1.18); opacity: 0; }
  100% { transform: scale(1.18); opacity: 0; }
}

/* Painel */
.sw__panel {
  position: absolute; bottom: 78px; right: 0;
  width: min(400px, calc(100vw - 32px));
  height: min(620px, calc(100vh - 120px));
  background: #0E0E22;
  border: 1px solid rgba(123,97,255,0.18);
  border-radius: 18px;
  box-shadow: 0 28px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(255,255,255,0.02);
  display: flex; flex-direction: column;
  overflow: hidden;
  animation: sw-panel-in 320ms cubic-bezier(0.32, 0.72, 0, 1);
}
.sw__panel[hidden] { display: none; }
@keyframes sw-panel-in {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}

/* Header */
.sw__head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px;
  background: linear-gradient(135deg, rgba(123,97,255,0.18), rgba(0,212,255,0.08));
  border-bottom: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.sw__head-brand { display: flex; align-items: center; gap: 12px; }
.sw__avatar {
  position: relative;
  width: 38px; height: 38px; border-radius: 50%;
  background: linear-gradient(135deg, #7B61FF, #00D4FF);
  display: grid; place-items: center;
  color: #0A0A1A; font-weight: 800; font-size: 16px;
  box-shadow: 0 4px 14px rgba(123,97,255,0.4);
}
.sw__avatar-status {
  position: absolute; right: -1px; bottom: -1px;
  width: 11px; height: 11px; border-radius: 50%;
  background: #00FF88; border: 2px solid #0E0E22;
  animation: sw-status-pulse 2s ease-in-out infinite;
}
@keyframes sw-status-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,255,136,0.6); }
  50%      { box-shadow: 0 0 0 5px rgba(0,255,136,0); }
}
.sw__name { font-weight: 700; font-size: 15px; color: #fff; line-height: 1.2; }
.sw__status { font-size: 12px; color: #b0b0d0; display: flex; align-items: center; gap: 6px; margin-top: 2px; }
.sw__status-dot { width: 6px; height: 6px; border-radius: 50%; background: #00FF88; }
.sw__close {
  background: rgba(255,255,255,0.06);
  border: none; color: #fff;
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  transition: 200ms;
}
.sw__close:hover { background: rgba(255,255,255,0.14); }

/* Thread */
.sw__thread {
  flex: 1; overflow-y: auto; padding: 18px;
  display: flex; flex-direction: column; gap: 12px;
  scroll-behavior: smooth;
}
.sw__thread::-webkit-scrollbar { width: 5px; }
.sw__thread::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 99px; }

/* Welcome */
.sw__welcome {
  display: flex; flex-direction: column; gap: 14px;
  padding: 6px 4px;
  animation: sw-welcome-in 380ms cubic-bezier(0.32, 0.72, 0, 1);
  transition: opacity 280ms, transform 280ms;
}
.sw__welcome--gone { opacity: 0; transform: translateY(-12px); pointer-events: none; }
@keyframes sw-welcome-in {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: none; }
}
.sw__welcome-avatar {
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, #7B61FF, #00D4FF);
  color: #0A0A1A; font-weight: 800; font-size: 24px;
  display: grid; place-items: center;
  box-shadow: 0 8px 24px rgba(123,97,255,0.5);
  margin: 4px 0 4px;
}
.sw__welcome-text { font-size: 14px; color: #d8d8ee; line-height: 1.55; }
.sw__welcome-greet { font-size: 16px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.sw__welcome-text p { margin: 0; }
.sw__suggestions { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.sw__chip {
  background: rgba(123,97,255,0.08);
  border: 1px solid rgba(123,97,255,0.22);
  color: #d8d8ee;
  padding: 11px 14px;
  border-radius: 12px;
  font: inherit; font-size: 13px;
  text-align: left;
  cursor: pointer;
  transition: 200ms;
}
.sw__chip:hover {
  background: rgba(123,97,255,0.16);
  border-color: rgba(123,97,255,0.45);
  transform: translateX(2px);
}

/* Messages */
.sw__msg {
  display: flex; gap: 8px; max-width: 90%;
  animation: sw-msg-in 280ms cubic-bezier(0.32, 0.72, 0, 1);
}
@keyframes sw-msg-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: none; }
}
.sw__msg--user { margin-left: auto; flex-direction: row-reverse; }
.sw__msg--user .sw__bubble {
  background: linear-gradient(135deg, #7B61FF, #5A4BD1);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.sw__msg--user.sw__msg--pending .sw__bubble { opacity: 0.75; }
.sw__msg--user.sw__msg--error .sw__bubble {
  background: linear-gradient(135deg, #FF6B6B, #c53d3d);
}
.sw__msg--bot .sw__bubble {
  background: rgba(255,255,255,0.06);
  color: #f0f0fa;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255,255,255,0.04);
}
.sw__msg--bot.sw__msg--error .sw__bubble {
  background: rgba(255,107,107,0.12);
  border-color: rgba(255,107,107,0.3);
  color: #ffd0d0;
}
.sw__msg-avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, #7B61FF, #00D4FF);
  color: #0A0A1A; font-weight: 700; font-size: 12px;
  display: grid; place-items: center; flex-shrink: 0;
  margin-top: 2px;
}
.sw__bubble {
  padding: 10px 14px;
  border-radius: 14px;
  line-height: 1.5; font-size: 14px;
  word-break: break-word;
  white-space: pre-wrap;
}
.sw__bubble--typing {
  display: inline-flex; gap: 4px; padding: 14px 16px;
  align-items: center;
}
.sw__typing-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: rgba(255,255,255,0.45);
  animation: sw-typing 1.2s ease-in-out infinite;
}
.sw__typing-dot:nth-child(2) { animation-delay: 0.18s; }
.sw__typing-dot:nth-child(3) { animation-delay: 0.36s; }
@keyframes sw-typing {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.45; }
  30%           { transform: translateY(-4px); opacity: 1; }
}

/* Composer */
.sw__composer {
  display: flex; gap: 8px; padding: 12px 14px;
  background: rgba(255,255,255,0.02);
  border-top: 1px solid rgba(255,255,255,0.05);
  flex-shrink: 0;
}
.sw__input {
  flex: 1;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  padding: 10px 14px;
  border-radius: 999px;
  font: inherit; font-size: 14px;
  outline: none;
  transition: 200ms;
}
.sw__input:focus {
  background: rgba(255,255,255,0.08);
  border-color: rgba(123,97,255,0.5);
  box-shadow: 0 0 0 3px rgba(123,97,255,0.18);
}
.sw__input:disabled { opacity: 0.55; cursor: not-allowed; }
.sw__send {
  width: 38px; height: 38px; border-radius: 50%;
  border: none; cursor: pointer;
  background: linear-gradient(135deg, #7B61FF, #00D4FF);
  color: #0A0A1A;
  display: grid; place-items: center;
  transition: 200ms;
  flex-shrink: 0;
}
.sw__send:hover:not(:disabled) { transform: scale(1.06); box-shadow: 0 6px 20px rgba(123,97,255,0.4); }
.sw__send:disabled { opacity: 0.5; cursor: not-allowed; }

/* Legal */
.sw__legal {
  padding: 8px 14px;
  font-size: 11px; color: #6a6a8a;
  display: flex; gap: 8px; align-items: center; justify-content: center;
  border-top: 1px solid rgba(255,255,255,0.04);
  flex-shrink: 0;
}
.sw__legal a { color: inherit; text-decoration: none; }
.sw__legal a:hover { color: #b0b0d0; }
.sw__legal-sep { opacity: 0.5; }

/* Mobile */
@media (max-width: 540px) {
  .sw { bottom: 16px; right: 16px; }
  .sw__fab { padding: 12px 18px; font-size: 13px; }
  .sw__panel {
    bottom: 72px; right: -8px;
    width: calc(100vw - 16px);
    max-width: 100vw;
  }
}

/* prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
  .sw__fab-pulse, .sw__avatar-status, .sw__typing-dot, .sw__msg, .sw__welcome, .sw__panel {
    animation: none !important;
  }
}
