/* PSX Fusion Copilot — PSX GenAI Advisor brand palette
   Navy #0B1F33 · Green #10B981 · Gold #D4AF37 · Light #F6F8FB */

/* ── Teaser ─────────────────────────────────────────────────────────────── */
.copilot-teaser {
  padding: 56px 24px;
  background: linear-gradient(180deg, #F6F8FB 0%, #EEF2FF 100%);
  border-top: 1px solid #E2E8F0;
  border-bottom: 1px solid #E2E8F0;
}
.copilot-teaser-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.copilot-teaser-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #10B981;
  margin-bottom: 8px;
}
.copilot-teaser-title {
  font-size: clamp(22px, 3vw, 28px);
  font-weight: 800;
  color: #0B1F33;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
}
.copilot-teaser-sub {
  font-size: 14px;
  color: #64748B;
  line-height: 1.6;
  margin: 0;
  max-width: 560px;
}
.copilot-teaser-sub strong { color: #0F766E; font-weight: 600; }
.copilot-open-trigger {
  padding: 13px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #0B1F33, #1E3A5F);
  color: #F8FAFC;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(11, 31, 51, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}
.copilot-open-trigger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(11, 31, 51, 0.3);
}

/* ── Backdrop ───────────────────────────────────────────────────────────── */
.copilot-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 31, 51, 0.35);
  z-index: 9998;
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none;
  backdrop-filter: blur(2px);
}
body.copilot-drawer-open .copilot-backdrop {
  opacity: 1;
  pointer-events: auto;
}

/* ── Drawer — wider for readability ─────────────────────────────────────── */
.copilot-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(500px, 94vw);
  height: 100dvh;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  background: #F6F8FB;
  border-left: 1px solid #CBD5E1;
  box-shadow: -12px 0 40px rgba(11, 31, 51, 0.18);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  font-family: inherit;
}
body.copilot-drawer-open .copilot-drawer {
  transform: translateX(0);
}

/* ── Header — navy brand bar ─────────────────────────────────────────────── */
.copilot-drawer-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 18px;
  background: linear-gradient(135deg, #0B1F33 0%, #1E3A5F 100%);
  border-bottom: 2px solid #10B981;
}
.copilot-drawer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.copilot-drawer-logo {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: block;
  flex-shrink: 0;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.35);
}
.copilot-drawer-title-wrap { flex: 1; min-width: 0; }
.copilot-drawer-title {
  margin: 0 0 3px;
  font-size: 16px;
  font-weight: 700;
  color: #F8FAFC;
  letter-spacing: -0.01em;
}
.copilot-live {
  font-size: 11px;
  font-weight: 600;
  color: #6EE7B7;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.copilot-live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #10B981;
  animation: copilot-pulse 2s infinite;
}
@keyframes copilot-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(16,185,129,0.5); }
  50% { opacity: 0.7; box-shadow: 0 0 0 4px rgba(16,185,129,0); }
}
.copilot-close {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 10px;
  background: rgba(255,255,255,0.08);
  color: #CBD5E1;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.copilot-close:hover {
  background: rgba(255,255,255,0.15);
  color: #fff;
}

/* ── Suggestions ────────────────────────────────────────────────────────── */
.copilot-suggestions {
  flex-shrink: 0;
  padding: 12px 16px;
  background: #fff;
  border-bottom: 1px solid #E2E8F0;
}
.copilot-suggestions-label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  margin-bottom: 8px;
}
.copilot-suggestions-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.copilot-prompt {
  flex-shrink: 0;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid #E2E8F0;
  background: #F6F8FB;
  color: #334155;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.copilot-prompt:hover {
  border-color: #10B981;
  background: #ECFDF5;
  color: #047857;
}

/* ── Chat area ──────────────────────────────────────────────────────────── */
.copilot-drawer-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.copilot-messages {
  flex: 1;
  overflow-y: auto;
  padding: 18px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  scroll-behavior: smooth;
}
.copilot-msg { max-width: 100%; }
.copilot-msg-user { align-self: flex-end; max-width: 88%; }
.copilot-msg-assistant { align-self: flex-start; max-width: 95%; }
.copilot-msg-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.copilot-msg-user .copilot-msg-row { flex-direction: row-reverse; }
.copilot-msg-body {
  flex: 1;
  min-width: 0;
  padding: 12px 14px;
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.6;
}
.copilot-msg-user .copilot-msg-body {
  background: linear-gradient(135deg, #0B1F33, #1E3A5F);
  color: #F8FAFC;
  border-bottom-right-radius: 4px;
  box-shadow: 0 2px 8px rgba(11, 31, 51, 0.15);
}
.copilot-msg-assistant .copilot-msg-body {
  background: #fff;
  color: #1E293B;
  border: 1px solid #E2E8F0;
  border-bottom-left-radius: 4px;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.04);
}
.copilot-answer-text {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.65;
}
.copilot-answer-text:last-child { margin-bottom: 0; }
.copilot-avatar {
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.copilot-avatar-ai {
  background: transparent;
  border: none;
  padding: 0;
  object-fit: cover;
}
.copilot-avatar-user {
  background: #D4AF37;
  color: #0B1F33;
  font-size: 9px;
  font-weight: 800;
}
.copilot-notice {
  margin-bottom: 10px;
  padding: 9px 11px;
  border-radius: 10px;
  background: #FFFBEB;
  border-left: 3px solid #D4AF37;
  color: #78350F;
  font-size: 12px;
  line-height: 1.5;
}
.copilot-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
}
.copilot-badge {
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #F6F8FB;
  border: 1px solid #E2E8F0;
}
.copilot-badge-label {
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94A3B8;
}
.copilot-badge-value {
  font-size: 10px;
  font-weight: 700;
  color: #0B1F33;
}
.copilot-typing {
  flex-shrink: 0;
  padding: 0 16px 12px;
  font-size: 12px;
  color: #64748B;
  display: flex;
  align-items: center;
  gap: 8px;
}
.copilot-typing-dots { display: inline-flex; gap: 4px; }
.copilot-typing-dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10B981;
  animation: copilot-dot 1.2s infinite ease-in-out;
}
.copilot-typing-dots span:nth-child(2) { animation-delay: 0.15s; }
.copilot-typing-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes copilot-dot {
  0%, 80%, 100% { opacity: 0.35; transform: scale(0.85); }
  40% { opacity: 1; transform: scale(1); }
}

/* ── Composer — fixed Send button ─────────────────────────────────────────── */
.copilot-drawer-foot {
  flex-shrink: 0;
  padding: 14px 16px 18px;
  border-top: 1px solid #E2E8F0;
  background: #fff;
  box-shadow: 0 -6px 20px rgba(11, 31, 51, 0.06);
}
.copilot-composer-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.copilot-field-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94A3B8;
  white-space: nowrap;
}
.copilot-composer-top input {
  width: 88px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid #CBD5E1;
  background: #F6F8FB;
  color: #0B1F33;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}
.copilot-composer-main {
  display: flex;
  gap: 10px;
  align-items: flex-end;
}
.copilot-composer-main textarea {
  flex: 1;
  min-height: 48px;
  max-height: 120px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #CBD5E1;
  background: #F6F8FB;
  color: #0B1F33;
  font-size: 14px;
  line-height: 1.5;
  resize: none;
  font-family: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.copilot-composer-main textarea:focus {
  outline: none;
  border-color: #10B981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
  background: #fff;
}
.copilot-composer-main textarea::placeholder { color: #94A3B8; }
.copilot-send {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 64px;
  height: 48px;
  padding: 0 14px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #10B981, #059669);
  color: #fff;
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 3px 10px rgba(16, 185, 129, 0.35);
  transition: transform 0.15s, opacity 0.15s;
}
.copilot-send-label { font-size: 11px; font-weight: 700; }
.copilot-send:hover { transform: translateY(-1px); }
.copilot-send:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }
.copilot-hint {
  margin: 8px 0 0;
  font-size: 10px;
  color: #94A3B8;
  text-align: center;
}
.copilot-stack-mini {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 14px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid #F1F5F9;
  font-size: 10px;
  color: #94A3B8;
}
.copilot-stack-mini strong { color: #0B1F33; font-weight: 700; }

.copilot-open-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: #ECFDF5;
  color: #047857;
  border: 1px solid #A7F3D0;
}
.copilot-open-btn:hover { background: #D1FAE5; }

@media (max-width: 480px) {
  .copilot-drawer { width: 100vw; }
  .copilot-teaser-inner { flex-direction: column; align-items: flex-start; }
  .copilot-send { min-width: 56px; padding: 0 10px; }
  .copilot-send-label { display: none; }
}
