/* Chat Widget styles */
.cw-launcher {
  position: fixed; bottom: 24px; right: 24px;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent);
  color: #052331;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 0 1px rgba(56,189,248,.5), 0 16px 40px rgba(56,189,248,.35);
  z-index: 1000;
  transition: transform .2s ease, background .2s ease;
}
.cw-launcher:hover { transform: scale(1.05); background: var(--accent-glow); }
.cw-launcher.cw-pulse::before {
  content: ''; position: absolute; inset: -4px; border-radius: 50%;
  border: 2px solid var(--accent);
  animation: cw-pulse 2s ease-out infinite;
}
@keyframes cw-pulse {
  0% { transform: scale(1); opacity: .6; }
  100% { transform: scale(1.4); opacity: 0; }
}

.cw-panel {
  position: fixed; bottom: 100px; right: 24px;
  width: 380px; height: 560px; max-height: calc(100vh - 120px);
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-lg);
  box-shadow: 0 24px 80px rgba(0,0,0,.6), 0 0 0 1px var(--border-hover);
  display: flex; flex-direction: column;
  z-index: 999;
  overflow: hidden;
  animation: cw-slide-up .25s ease-out;
}
.cw-panel.cw-inline {
  position: relative; right: auto; bottom: auto;
  width: 100%; height: 580px; max-height: none;
  animation: none;
  box-shadow: var(--glow-accent);
}
@keyframes cw-slide-up {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.cw-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(56,189,248,.08), transparent);
}
.cw-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--bg-raised);
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-hover);
  position: relative;
}
.cw-avatar::after {
  content: 'E'; font-family: var(--font-display); font-weight: 600; color: var(--accent); font-size: 15px;
}
.cw-dot {
  position: absolute; bottom: -2px; right: -2px;
  width: 12px; height: 12px; border-radius: 50%;
  background: var(--success); border: 2px solid var(--bg-surface);
}
.cw-dot-warm { background: var(--accent-warm); animation: cw-blink 2s ease-in-out infinite; }
@keyframes cw-blink { 50% { opacity: .5; } }

.cw-title { flex: 1; min-width: 0; }
.cw-name { font-weight: 500; font-size: 14px; color: var(--text-strong); }
.cw-sub { font-size: 12px; color: var(--text-muted); }
.cw-close { color: var(--text-muted); padding: 6px; border-radius: 6px; }
.cw-close:hover { background: var(--bg-raised); color: var(--text-strong); }

.cw-consent { padding: 18px; flex: 1; display: flex; flex-direction: column; gap: 14px; overflow-y: auto; }
.cw-consent-warn {
  font-size: 13px; line-height: 1.55;
  background: var(--accent-soft); color: var(--text-primary);
  padding: 12px 14px; border-radius: var(--r-md);
  border-left: 2px solid var(--accent);
}
.cw-consent-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; line-height: 1.5; color: var(--text-muted);
  cursor: pointer;
}
.cw-consent-row input { margin-top: 3px; accent-color: var(--accent); }
.cw-consent-btn {
  margin-top: 4px;
  height: 44px; border-radius: var(--r-md);
  background: var(--accent); color: #052331; font-weight: 500;
  transition: opacity .2s ease, background .2s ease;
}
.cw-consent-btn:disabled { opacity: .35; cursor: not-allowed; }
.cw-consent-btn:not(:disabled):hover { background: var(--accent-glow); }
.cw-consent-link { font-size: 12px; color: var(--text-muted); text-align: center; }
.cw-consent-link:hover { color: var(--accent); }

.cw-body {
  flex: 1; overflow-y: auto;
  padding: 16px; display: flex; flex-direction: column; gap: 10px;
  scroll-behavior: smooth;
}
.cw-bubble {
  max-width: 85%; padding: 10px 13px;
  border-radius: 12px; font-size: 14px; line-height: 1.5;
  white-space: pre-wrap; word-wrap: break-word;
}
.cw-ai { background: var(--bg-raised); color: var(--text-primary); border: 1px solid var(--border); align-self: flex-start; border-bottom-left-radius: 4px; }
.cw-user { background: var(--accent); color: #052331; align-self: flex-end; border-bottom-right-radius: 4px; }
.cw-from-enio { background: rgba(245,215,110,.10); border-color: rgba(245,215,110,.4); }
.cw-from-label { font-family: var(--font-mono); font-size: 11px; color: var(--accent-warm); text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 4px; }
.cw-err { border-color: var(--danger); }

.cw-typing { display: flex; gap: 4px; padding: 14px 13px; }
.cw-typing span { width: 6px; height: 6px; border-radius: 50%; background: var(--text-muted); animation: cw-typing 1.2s ease-in-out infinite; }
.cw-typing span:nth-child(2) { animation-delay: .15s; }
.cw-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes cw-typing { 0%,60%,100% { opacity: .3; } 30% { opacity: 1; } }

.cw-quick { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.cw-quick button {
  text-align: left; padding: 10px 13px; font-size: 13px;
  background: transparent; border: 1px solid var(--border-strong);
  border-radius: var(--r-md); color: var(--text-primary);
  transition: border-color .2s ease, background .2s ease;
}
.cw-quick button:hover { border-color: var(--border-hover); background: var(--accent-soft); }

.cw-handoff {
  margin: 0 16px 8px;
  padding: 10px 13px;
  background: var(--success-soft);
  border: 1px solid rgba(74,222,128,.4);
  border-radius: var(--r-md);
  font-size: 13px; color: var(--success);
  text-align: center;
}
.cw-handoff:hover { background: rgba(74,222,128,.18); }

.cw-meta {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 16px;
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}
.cw-progress { flex: 1; height: 3px; background: var(--bg-raised); border-radius: 2px; overflow: hidden; }
.cw-progress > div { height: 100%; background: var(--accent); transition: width .4s ease; }
.cw-sector { text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); }

.cw-input {
  display: flex; gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: var(--bg-deep);
}
.cw-input input {
  flex: 1; height: 40px; padding: 0 12px;
  background: var(--bg-raised); border: 1px solid var(--border);
  border-radius: var(--r-md); color: var(--text-primary);
  font-size: 14px; outline: none;
  transition: border-color .15s ease;
}
.cw-input input:focus { border-color: var(--border-hover); }
.cw-input button {
  width: 40px; height: 40px;
  background: var(--accent); color: #052331;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  transition: background .2s ease;
}
.cw-input button:hover:not(:disabled) { background: var(--accent-glow); }
.cw-input button:disabled { opacity: .4; cursor: not-allowed; }

.cw-foot {
  padding: 8px 14px 10px;
  font-family: var(--font-mono); font-size: 10px;
  color: var(--text-dim); text-align: center;
  background: var(--bg-deep);
}
.cw-foot a { color: var(--text-muted); text-decoration: underline; text-decoration-color: var(--border-strong); }

@media (max-width: 768px) {
  .cw-launcher { width: 56px; height: 56px; bottom: 16px; right: 16px; }
  .cw-panel { width: 100%; right: 0; bottom: 0; height: 100dvh; max-height: 100dvh; border-radius: 0; }
  .cw-panel.cw-inline { height: 600px; }
}

/* Cookie Banner */
.cookie-banner {
  position: fixed; bottom: 16px; left: 16px;
  max-width: 420px; z-index: 998;
  background: var(--bg-surface); border: 1px solid var(--border-strong);
  border-radius: var(--r-md); padding: 14px 16px;
  display: flex; flex-direction: column; gap: 10px;
  box-shadow: 0 16px 48px rgba(0,0,0,.5);
  animation: cw-slide-up .3s ease-out .4s backwards;
}
.cookie-banner p { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-muted); }
.cookie-banner-row { display: flex; gap: 8px; }
.cookie-banner button {
  flex: 1; height: 36px; padding: 0 14px;
  border-radius: var(--r-sm); font-size: 13px; font-weight: 500;
  transition: background .2s ease, border-color .2s ease;
}
.cookie-banner .ck-accept { background: var(--accent); color: #052331; }
.cookie-banner .ck-accept:hover { background: var(--accent-glow); }
.cookie-banner .ck-decline { background: transparent; border: 1px solid var(--border-strong); color: var(--text-muted); }
.cookie-banner .ck-decline:hover { border-color: var(--border-hover); color: var(--text-primary); }
@media (max-width: 480px) {
  .cookie-banner { left: 8px; right: 8px; bottom: 84px; max-width: none; }
}
