/* =============================================
   VOTEWISE — CLEAN DARK UI v2
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-0:          #07090F;
  --bg-1:          #0C1017;
  --bg-2:          #111620;
  --bg-3:          #171D2A;
  --bg-4:          #1D2535;
  --bg-hover:      #232C3E;

  --saffron:       #FF9933;
  --saffron-dim:   rgba(255,153,51,0.15);
  --green:         #138808;
  --green-dim:     rgba(19,136,8,0.15);
  --white-flag:    #FEFEFE;

  --text-1:        #E8ECF4;
  --text-2:        #99A3B8;
  --text-3:        #5E6A82;
  --text-4:        #3A4258;
  --border:        rgba(255,255,255,0.06);
  --border-h:      rgba(255,255,255,0.10);
  --border-accent: rgba(255,153,51,0.20);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;

  --ease: 0.2s cubic-bezier(0.4,0,0.2,1);
  --sidebar-w: 270px;
  --header-h: 56px;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, sans-serif;
  background: var(--bg-0);
  color: var(--text-1);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   SPLASH / LOADING SCREEN
   ============================================================ */
.splash-screen {
  position: fixed; inset: 0; z-index: 2000;
  background: #000;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.6s ease;
  overflow: hidden;
}
.splash-screen.active { opacity: 1; pointer-events: all; }
.splash-screen.fade-out { opacity: 0; pointer-events: none; }

/* -- Fullscreen Waving Flag Video Background -- */
.splash-video-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}

/* -- Dark overlay — heavier for premium contrast -- */
.splash-video-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.55) 0%,
    rgba(0, 0, 0, 0.40) 50%,
    rgba(0, 0, 0, 0.65) 100%
  );
  z-index: 1;
}

/* -- Netflix-style Flag Intro -- */
.flag-intro-container.light-mode {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  overflow: hidden;
  background: #F8F9FA;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.flag-intro-container.light-mode.animate {
  opacity: 1;
}

/* Wavy Background */
.wavy-flag-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}
.wave {
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
}
.flag-intro-container.animate .wave {
  animation: wave-sweep 1.5s cubic-bezier(0.25, 1, 0.5, 1) forwards;
}
.flag-intro-container.animate .saffron-wave-1 { animation-delay: 0.1s; }
.flag-intro-container.animate .saffron-wave-2 { animation-delay: 0.3s; }
.flag-intro-container.animate .green-wave-1 { animation-delay: 0.2s; }
.flag-intro-container.animate .green-wave-2 { animation-delay: 0.4s; }

/* Quote on the left */
.image-quote {
  position: relative;
  z-index: 2;
  margin-left: 8vw;
  max-width: 400px;
  opacity: 0;
  transform: translateY(20px);
}
.flag-intro-container.animate .image-quote {
  animation: fade-up 1s cubic-bezier(0.25, 1, 0.5, 1) forwards;
  animation-delay: 1s;
}
.image-quote .quote-mark {
  position: absolute;
  top: -30px;
  left: -20px;
  font-size: 5rem;
  font-family: 'Cinzel', serif;
  color: var(--saffron-dim);
  line-height: 1;
}
.image-quote p {
  font-family: 'Cinzel', serif;
  font-size: clamp(1.5rem, 3vw, 2.5rem);
  color: #333;
  font-style: italic;
  margin: 0 0 10px 0;
  line-height: 1.4;
}
.image-quote cite {
  font-size: 1rem;
  color: var(--saffron);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Big Chakra on the right */
.image-chakra {
  position: relative;
  z-index: 1;
  width: 30vw;
  height: 30vw;
  max-width: 400px;
  max-height: 400px;
  margin-right: 5vw;
  background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="45" stroke="%23000080" stroke-width="3" fill="none"/><circle cx="50" cy="50" r="35" stroke="%23000080" stroke-width="0.5" fill="none"/><circle cx="50" cy="50" r="10" fill="%23000080"/><g stroke="%23000080" stroke-width="1.5"><line x1="50" y1="5" x2="50" y2="95"/><line x1="5" y1="50" x2="95" y2="50"/><line x1="18.18" y1="18.18" x2="81.82" y2="81.82"/><line x1="18.18" y1="81.82" x2="81.82" y2="18.18"/><line x1="26.3" y1="9.4" x2="73.7" y2="90.6"/><line x1="9.4" y1="26.3" x2="90.6" y2="73.7"/><line x1="90.6" y1="26.3" x2="9.4" y2="73.7"/><line x1="73.7" y1="9.4" x2="26.3" y2="90.6"/><line x1="32.6" y1="3.4" x2="67.4" y2="96.6"/><line x1="3.4" y1="32.6" x2="96.6" y2="67.4"/><line x1="96.6" y1="32.6" x2="3.4" y2="67.4"/><line x1="67.4" y1="3.4" x2="32.6" y2="96.6"/></g></svg>') no-repeat center center;
  background-size: contain;
  opacity: 0;
  transform: rotate(-180deg) scale(0.5);
  filter: drop-shadow(0 10px 20px rgba(0,0,128,0.1));
}
.flag-intro-container.animate .image-chakra {
  animation: big-chakra-spin 1.5s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  animation-delay: 0.5s;
}

/* Transitions */
.flag-intro-container.fade-out {
  opacity: 0 !important;
  transition: opacity 0.8s ease;
}

@keyframes wave-sweep {
  0% { transform: scaleX(0); opacity: 0; }
  100% { transform: scaleX(1); opacity: 1; }
}

@keyframes fade-up {
  0% { transform: translateY(20px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}

@keyframes big-chakra-spin {
  0% { transform: rotate(-270deg) scale(0.5); opacity: 0; filter: drop-shadow(0 0 0 rgba(0,0,128,0)); }
  100% { transform: rotate(0) scale(1); opacity: 1; filter: drop-shadow(0 15px 30px rgba(0,0,128,0.15)); }
}

/* ============================================================
   ONBOARDING — WHO ARE YOU?
   ============================================================ */
.onboarding-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: #000;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.4s ease;
  overflow: hidden;
}
.onboarding-overlay.active { opacity: 1; pointer-events: all; }
.onboarding-overlay.fade-out { opacity: 0; pointer-events: none; }

/* -- Video background -- */
.onboarding-video-bg {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  z-index: 0;
}
.onboarding-video-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.72) 0%,
    rgba(0, 0, 0, 0.50) 50%,
    rgba(0, 0, 0, 0.68) 100%
  );
  z-index: 1;
}

/* -- Card layout: side-by-side -- */
.onboarding-card {
  position: relative; z-index: 2;
  max-width: 820px; width: 100%;
  display: flex;
  align-items: center;
  gap: 60px;
}

/* -- Left: Big heading -- */
.onboarding-question {
  flex-shrink: 0;
  text-align: left;
}
.onboarding-question h2 {
  font-family: 'Cinzel', 'Times New Roman', serif;
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 4rem);
  color: #FFFFFF;
  letter-spacing: 3px;
  line-height: 1.15;
  text-transform: uppercase;
}
.onboarding-question p {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.45);
  margin-top: 14px;
  letter-spacing: 0.5px;
  font-weight: 400;
}

.onboarding-quote {
  margin-top: 40px;
  position: relative;
  padding-left: 20px;
  border-left: 3px solid var(--saffron);
}
.onboarding-quote .quote-mark {
  position: absolute;
  top: -15px;
  left: 8px;
  font-size: 3.5rem;
  font-family: 'Cinzel', serif;
  color: rgba(255, 255, 255, 0.08);
  line-height: 1;
}
.onboarding-quote p {
  font-family: 'Cinzel', serif;
  font-size: 1.2rem;
  color: rgba(255, 255, 255, 0.9);
  font-style: italic;
  margin: 0 0 10px 0;
  line-height: 1.5;
  letter-spacing: 1px;
}
.onboarding-quote cite {
  font-size: 0.75rem;
  color: var(--saffron);
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  display: block;
}

/* -- Right: Persona buttons -- */
.persona-buttons {
  flex: 1;
  display: flex; flex-direction: column; gap: 12px;
}

/* --- Individual persona button --- */
.persona-btn {
  display: grid;
  grid-template-columns: 36px 1fr;
  grid-template-rows: auto auto;
  grid-template-areas: "num label" "num desc";
  align-items: center; column-gap: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid transparent;
  border-radius: var(--radius-md);
  padding: 18px 22px;
  text-align: left; cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.persona-num {
  grid-area: num;
  font-family: 'Cinzel', serif;
  font-size: 1.1rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.18);
  text-align: center;
  letter-spacing: 1px;
  transition: color 0.3s ease;
}
.persona-label { grid-area: label; font-size: 0.92rem; font-weight: 600; color: rgba(255,255,255,0.88); transition: color 0.3s ease; }
.persona-desc  { grid-area: desc; font-size: 0.76rem; color: rgba(255,255,255,0.35); margin-top: 2px; transition: color 0.3s ease; }

/* -- Hover: Saffron (first option) -- */
.persona-saffron:hover {
  background: rgba(255, 153, 51, 0.12);
  border-color: rgba(255, 153, 51, 0.25);
  border-left-color: var(--saffron);
}
.persona-saffron:hover .persona-label { color: var(--saffron); }
.persona-saffron:hover .persona-desc  { color: rgba(255, 153, 51, 0.6); }
.persona-saffron:hover .persona-num   { color: var(--saffron); }

/* -- Hover: White + Blue text (middle option) -- */
.persona-white:hover {
  background: rgba(255, 255, 255, 0.10);
  border-color: rgba(255, 255, 255, 0.22);
  border-left-color: var(--white-flag);
}
.persona-white:hover .persona-label { color: #1A3A8F; }
.persona-white:hover .persona-desc  { color: rgba(26, 58, 143, 0.7); }
.persona-white:hover .persona-num   { color: #1A3A8F; }

/* -- Hover: Green (last option) -- */
.persona-green:hover {
  background: rgba(19, 136, 8, 0.12);
  border-color: rgba(19, 136, 8, 0.25);
  border-left-color: var(--green);
}
.persona-green:hover .persona-label { color: #2ECC40; }
.persona-green:hover .persona-desc  { color: rgba(46, 204, 64, 0.6); }
.persona-green:hover .persona-num   { color: #2ECC40; }

/* ============================================================
   APP SHELL
   ============================================================ */
.app { display: flex; flex-direction: column; height: 100vh; background: var(--bg-0); }
.hidden { display: none !important; }

/* ── HEADER ── */
.app-header {
  height: var(--header-h);
  background: var(--bg-1);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px;
  position: relative; z-index: 10; flex-shrink: 0;
}
.header-left { display: flex; align-items: center; gap: 14px; }
.header-logo { display: flex; align-items: center; gap: 8px; }
.logo-text {
  font-size: 1.15rem; font-weight: 800; letter-spacing: -0.5px;
  color: var(--text-1);
}
.header-tagline {
  font-size: 0.72rem; color: var(--text-4);
  border-left: 1px solid var(--border-h); padding-left: 14px;
  letter-spacing: 0.4px;
}
.header-center {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; align-items: center;
}
.powered-by {
  font-size: 0.75rem; color: var(--text-3); letter-spacing: 0.5px;
}
.powered-by strong {
  color: #FFA611; font-weight: 600;
}
.header-right { display: flex; align-items: center; gap: 14px; }

/* ── SMART MODE BUTTON ── */
.smart-mode-btn {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem; font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}
.smart-mode-btn:hover {
  background: rgba(255, 215, 0, 0.1); /* Gold tint */
  border-color: rgba(255, 215, 0, 0.4);
  color: #FFD700;
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}
.smart-mode-btn::after {
  content: '✨';
  position: absolute;
  right: -20px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  opacity: 0;
  transition: all 0.3s ease;
}
.smart-mode-btn:hover::after {
  right: 6px;
  opacity: 1;
}
.smart-mode-btn:hover {
  padding-right: 28px;
}
.smart-mode-btn.active {
  background: rgba(255, 215, 0, 0.15);
  border-color: #FFD700;
  color: #FFD700;
  padding-right: 28px;
}
.smart-mode-btn.active::after {
  right: 6px; opacity: 1;
}
/* Persona badge — plain text, no pill */
.persona-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.8rem; color: var(--text-2);
  font-weight: 500;
}

/* Share button — flat, minimal */
.share-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-pill); padding: 6px 14px;
  font-size: 0.78rem; font-weight: 600; cursor: pointer;
  font-family: 'Inter', sans-serif;
  transition: all var(--ease);
}
.share-btn:hover {
  background: var(--bg-4);
  color: var(--text-1);
  border-color: var(--border-h);
}

/* ============================================================
   APP BODY
   ============================================================ */
.app-body { display: flex; flex: 1; overflow: hidden; }

/* ── SIDEBAR ── */
.timeline-sidebar {
  width: var(--sidebar-w); flex-shrink: 0;
  background: var(--bg-1);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  overflow-y: auto; padding: 0;
  gap: 0;
}
.timeline-sidebar::-webkit-scrollbar { width: 3px; }
.timeline-sidebar::-webkit-scrollbar-thumb { background: var(--text-4); border-radius: 3px; }

.sidebar-section {
  padding: 16px 14px;
  border-bottom: 1px solid var(--border);
}
.sidebar-section:last-child { border-bottom: none; margin-top: auto; }

.sidebar-section-title {
  font-size: 0.68rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 1.2px;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 6px;
}

/* Live dot indicator */
.live-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: #FF4444;
  animation: live-pulse 1.5s ease-in-out infinite;
}
@keyframes live-pulse {
  0%,100% { opacity: 1; }
  50%     { opacity: 0.3; }
}

/* ── TIMELINE ── */
.timeline { display: flex; flex-direction: column; }

.timeline-phase {
  display: flex; align-items: center; gap: 12px;
  cursor: pointer;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  transition: background var(--ease);
  border: 1px solid transparent;
}
.timeline-phase:hover { background: var(--bg-hover); }
.timeline-phase.active {
  background: var(--saffron-dim);
  border-color: var(--border-accent);
}

.phase-marker {
  display: flex; flex-direction: column; align-items: center;
  width: 32px; flex-shrink: 0; position: relative;
}
.phase-line {
  width: 1.5px; height: 10px; background: var(--text-4);
}
.timeline-phase:first-child .phase-line.top { visibility: hidden; }
.timeline-phase:last-child  .phase-line.bottom { visibility: hidden; }
.timeline-phase.active .phase-line { background: var(--saffron); opacity: 0.4; }

.phase-dot {
  font-size: 1rem; width: 28px; height: 28px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  background: var(--bg-3);
  border: 1px solid var(--border);
  transition: all var(--ease);
}
.timeline-phase.active .phase-dot {
  background: var(--saffron-dim);
  border-color: var(--border-accent);
}

.phase-content { display: flex; flex-direction: column; }
.phase-label { font-size: 0.84rem; font-weight: 600; color: var(--text-1); transition: color var(--ease); }
.phase-sub   { font-size: 0.7rem; color: var(--text-4); margin-top: 1px; }
.timeline-phase.active .phase-label { color: var(--saffron); }
.timeline-phase.active .phase-sub   { color: var(--text-3); }

/* ── LIVE DATA CARDS ── */
.live-data-cards {
  display: flex; flex-direction: column; gap: 8px;
}
.live-card {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  cursor: default;
}
.live-card-title {
  font-size: 0.7rem; font-weight: 700; color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.5px;
  margin-bottom: 4px;
}
.live-card-value {
  font-size: 0.88rem; font-weight: 600; color: var(--text-1);
  line-height: 1.4;
}
.live-card-source {
  font-size: 0.65rem; color: var(--text-4); margin-top: 4px;
}
.live-card-source a {
  color: var(--saffron); text-decoration: none; opacity: 0.7;
}
.live-card-source a:hover { opacity: 1; }

/* Loading placeholder */
.loading-placeholder {
  height: 52px; position: relative; overflow: hidden;
}
.shimmer {
  position: absolute; inset: 0;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.03) 50%, transparent 100%);
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0%   { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ── FACT SECTION ── */
.fact-section { padding-bottom: 14px !important; }

.fact-body {
  display: flex; align-items: center; gap: 8px;
}

.fact-arrow {
  flex-shrink: 0; width: 22px; height: 36px;
  border: none; background: transparent;
  cursor: pointer; padding: 0;
  display: flex; flex-direction: column;
  gap: 1px; border-radius: 4px;
  overflow: hidden;
  opacity: 0.5; transition: opacity var(--ease), transform var(--ease);
}
.fact-arrow:hover { opacity: 1; transform: scale(1.15); }

.arrow-bar {
  flex: 1; width: 100%;
  display: block;
}
.arrow-bar.saffron { background: var(--saffron); }
.arrow-bar.white   { background: var(--white-flag); }
.arrow-bar.green   { background: var(--green); }

/* Arrow shapes using clip-path */
.fact-arrow-left { clip-path: polygon(100% 0%, 100% 100%, 0% 50%); }
.fact-arrow-right { clip-path: polygon(0% 0%, 100% 50%, 0% 100%); }

.fact-text {
  flex: 1;
  font-size: 0.8rem; color: var(--text-2); line-height: 1.55;
  min-height: 44px;
  transition: opacity 0.3s ease;
}
.fact-text.fading { opacity: 0; }

.fact-dots { display: flex; gap: 4px; margin-top: 10px; justify-content: center; }
.fact-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--text-4); transition: all var(--ease);
}
.fact-dot.active { background: var(--saffron); }

/* ============================================================
   CHAT AREA
   ============================================================ */
.chat-area {
  flex: 1; display: flex; flex-direction: column;
  background: var(--bg-0); overflow: hidden;
}

.chat-messages {
  flex: 1; overflow-y: auto; padding: 28px 28px 12px;
  display: flex; flex-direction: column; gap: 16px;
  scroll-behavior: smooth;
  background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 600" preserveAspectRatio="xMaxYMid slice"><path d="M300,0 C600,0 700,200 1000,150 L1000,0 Z" fill="rgba(255,153,51,0.06)"/><path d="M500,0 C700,100 800,250 1000,200 L1000,0 Z" fill="rgba(255,153,51,0.03)"/><path d="M400,600 C600,450 800,600 1000,450 L1000,600 Z" fill="rgba(19,136,8,0.06)"/><path d="M600,600 C750,500 900,600 1000,500 L1000,600 Z" fill="rgba(19,136,8,0.03)"/><g transform="translate(850, 300)" opacity="0.05"><circle cx="0" cy="0" r="90" stroke="%23ffffff" stroke-width="6" fill="none"/><circle cx="0" cy="0" r="70" stroke="%23ffffff" stroke-width="1.5" fill="none"/><circle cx="0" cy="0" r="15" fill="%23ffffff"/><path d="M0,-90 L0,90 M-90,0 L90,0 M-63.6,-63.6 L63.6,63.6 M-63.6,63.6 L63.6,-63.6" stroke="%23ffffff" stroke-width="3"/><path d="M-34.4,-83.1 L34.4,83.1 M-34.4,83.1 L34.4,-83.1 M-83.1,-34.4 L83.1,34.4 M-83.1,34.4 L83.1,-34.4" stroke="%23ffffff" stroke-width="3"/><path d="M-17.6,-88.3 L17.6,88.3 M-17.6,88.3 L17.6,-88.3 M-88.3,-17.6 L88.3,17.6 M-88.3,17.6 L88.3,-17.6" stroke="%23ffffff" stroke-width="3"/><path d="M-49.8,-75 L49.8,75 M-49.8,75 L49.8,-75 M-75,-49.8 L75,49.8 M-75,49.8 L75,-49.8" stroke="%23ffffff" stroke-width="3"/></g></svg>');
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
  background-attachment: local;
}
.chat-messages::-webkit-scrollbar { width: 4px; }
.chat-messages::-webkit-scrollbar-track { background: transparent; }
.chat-messages::-webkit-scrollbar-thumb { background: var(--text-4); border-radius: 4px; }

/* ── MESSAGES ── */
.message {
  display: flex; gap: 10px; max-width: 72%;
  animation: msg-in 0.3s cubic-bezier(0.16,1,0.3,1) both;
}
@keyframes msg-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.message.user { flex-direction: row-reverse; align-self: flex-end; }
.message.bot  { align-self: flex-start; }

.message-avatar {
  width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem; align-self: flex-end;
}
.message.bot .message-avatar {
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--saffron);
}
.message.user .message-avatar {
  background: var(--saffron);
  color: var(--bg-0);
}

.message-bubble {
  padding: 14px 18px; border-radius: var(--radius-lg);
  font-size: 0.87rem; line-height: 1.7;
}
.message.bot .message-bubble {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
  color: var(--text-2);
}
.message.bot .message-bubble strong { color: var(--text-1); }
.message.user .message-bubble {
  background: var(--saffron);
  color: var(--bg-0); font-weight: 500;
  border-bottom-right-radius: 4px;
}

.message-bubble p { margin-bottom: 8px; }
.message-bubble p:last-child { margin-bottom: 0; }
.message-bubble ul { padding-left: 18px; margin: 6px 0; }
.message-bubble li { margin-bottom: 4px; }

/* Follow-up */
.inline-followup {
  margin-top: 12px; padding-top: 12px;
  border-top: 1px solid var(--border);
}
.inline-followup span {
  font-size: 0.7rem; color: var(--text-4); display: block; margin-bottom: 6px;
  font-weight: 600; text-transform: uppercase; letter-spacing: 0.6px;
}
.followup-chip {
  display: inline-flex;
  background: var(--bg-3);
  border: 1px solid var(--border);
  color: var(--text-2); border-radius: var(--radius-pill);
  padding: 7px 14px; font-size: 0.8rem; font-weight: 500;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all var(--ease);
}
.followup-chip:hover {
  background: var(--saffron);
  color: var(--bg-0);
  border-color: var(--saffron);
}

/* Typing indicator */
.typing-indicator .message-bubble {
  display: flex; gap: 6px; align-items: center; padding: 14px 20px;
}
.typing-dot {
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--text-4);
  animation: dot-bounce 1.3s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.15s; }
.typing-dot:nth-child(3) { animation-delay: 0.3s; }
@keyframes dot-bounce {
  0%,80%,100% { transform: translateY(0); }
  40%          { transform: translateY(-6px); background: var(--text-2); }
}

/* ── SUGGESTION CHIPS ── */
.suggestion-chips {
  padding: 8px 28px 4px;
  display: flex; gap: 8px; flex-wrap: wrap;
}
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  color: var(--text-2);
  border-radius: var(--radius-pill); padding: 7px 14px;
  font-size: 0.8rem; font-weight: 500;
  cursor: pointer; font-family: 'Inter', sans-serif;
  transition: all var(--ease); white-space: nowrap;
}
.chip:hover {
  border-color: var(--border-h);
  color: var(--text-1);
  background: var(--bg-3);
}

/* ── INPUT BAR ── */
.chat-input-bar {
  padding: 10px 24px 14px;
  background: var(--bg-1);
  border-top: 1px solid var(--border);
}
.input-wrapper {
  display: flex; gap: 8px; align-items: center;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px 4px 4px 18px;
  transition: border-color var(--ease);
}
.input-wrapper:focus-within {
  border-color: var(--border-h);
}
#chat-input {
  flex: 1; border: none; background: transparent;
  font-family: 'Inter', sans-serif; font-size: 0.87rem;
  color: var(--text-1); outline: none;
}
#chat-input::placeholder { color: var(--text-4); }

.send-btn {
  width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
  background: var(--saffron);
  border: none; color: var(--bg-0); cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: opacity var(--ease);
}
.send-btn:hover { opacity: 0.85; }
.send-btn:active { opacity: 0.7; }
.send-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.input-disclaimer {
  text-align: center; font-size: 0.67rem; color: var(--text-4);
  margin-top: 8px;
}

/* ── TOAST ── */
.toast {
  position: fixed; bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: var(--bg-3);
  border: 1px solid var(--border-h);
  color: var(--text-1);
  padding: 10px 20px; border-radius: var(--radius-pill);
  font-size: 0.82rem; font-weight: 500;
  opacity: 0; pointer-events: none;
  transition: all 0.3s ease; z-index: 9999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── MODALS ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 2000;
  background: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.3s ease;
}
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal-content {
  background: var(--bg-1);
  border: 1px solid var(--border-h);
  border-radius: var(--radius-lg);
  padding: 32px;
  width: 100%; max-width: 420px;
  transform: translateY(20px);
  transition: transform 0.3s ease;
}
.modal-overlay.active .modal-content { transform: translateY(0); }
.modal-content h3 { font-size: 1.2rem; color: var(--text-1); margin-bottom: 12px; }
.modal-content p { font-size: 0.9rem; color: var(--text-3); margin-bottom: 24px; line-height: 1.5; }

.api-guide {
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 24px;
  text-align: left;
}
.api-guide h4 {
  font-size: 0.85rem; color: var(--text-1); margin-bottom: 10px; font-weight: 600;
}
.api-guide ol {
  padding-left: 20px; font-size: 0.82rem; color: var(--text-2); line-height: 1.6; margin: 0;
}
.api-guide a { color: var(--saffron); text-decoration: none; font-weight: 500; }
.api-guide strong { color: var(--text-1); font-weight: 600; }

.modal-input-group { margin-bottom: 24px; text-align: left; }
.modal-input-group label { display: block; font-size: 0.85rem; color: var(--text-2); margin-bottom: 8px; font-weight: 500; }
.modal-input-group input {
  width: 100%; padding: 12px;
  background: var(--bg-0);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-1); font-size: 0.95rem;
}
.modal-input-group input:focus { outline: none; border-color: var(--saffron); }
.modal-help { font-size: 0.75rem !important; margin-top: 8px !important; margin-bottom: 0 !important; }
.modal-help a { color: var(--saffron); text-decoration: none; }
.modal-actions { display: flex; justify-content: flex-end; gap: 12px; }
.modal-btn {
  padding: 10px 18px; border-radius: var(--radius-sm);
  font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.2s ease;
}
.modal-btn.secondary { background: transparent; border: 1px solid var(--border); color: var(--text-2); }
.modal-btn.secondary:hover { background: var(--bg-2); color: var(--text-1); }
.modal-btn.primary { background: var(--saffron); border: none; color: #000; }
.modal-btn.primary:hover { opacity: 0.9; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  :root { --sidebar-w: 0px; }
  .timeline-sidebar { display: none; }
  .chat-messages { padding: 16px; }
  .suggestion-chips { padding: 8px 16px 4px; }
  .chat-input-bar { padding: 8px 12px 12px; }
  .header-tagline { display: none; }
  .header-center { display: none; }
  .message { max-width: 90%; }

  .onboarding-card { flex-direction: column; gap: 28px; }
  .onboarding-question { text-align: center; }
  .onboarding-question h2 { font-size: clamp(1.8rem, 8vw, 2.8rem); }
}
@media (max-width: 480px) {
  .persona-btn { grid-template-columns: 38px 1fr; }
  .logo-text { font-size: 1rem; }
}
