/* =====================================================
   JHON v4 — style.css
   Aesthetic: Neural Cinema · Deep Space · Holographic
   ===================================================== */

/* ── Reset & Base ────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:          #05050c;
  --bg-2:        #080814;
  --surface:     rgba(255,255,255,0.038);
  --surface-2:   rgba(255,255,255,0.065);
  --surface-3:   rgba(255,255,255,0.095);
  --border:      rgba(255,255,255,0.07);
  --border-2:    rgba(255,255,255,0.12);

  --primary:     #7c6aff;
  --primary-dim: rgba(124,106,255,0.18);
  --primary-glow:rgba(124,106,255,0.35);
  --cyan:        #00d4ff;
  --cyan-dim:    rgba(0,212,255,0.15);
  --gold:        #f0c040;

  --text:        #e2e2f0;
  --text-2:      #9898b8;
  --text-3:      #5e5e80;

  --radius-sm:   8px;
  --radius-md:   14px;
  --radius-lg:   20px;
  --radius-xl:   28px;

  --sidebar-w:   256px;

  --font-ui:     'Plus Jakarta Sans', sans-serif;
  --font-display:'Syne', sans-serif;
  --font-mono:   'JetBrains Mono', monospace;

  --ease-spring: cubic-bezier(0.34,1.56,0.64,1);
  --ease-smooth: cubic-bezier(0.4,0,0.2,1);
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

/* ── Scrollbar ───────────────────────────────────────── */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--primary-dim); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--primary); }

/* ── Particle Canvas ─────────────────────────────────── */
#particleCanvas {
  position: fixed; inset: 0;
  width: 100%; height: 100%;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity 1.2s ease;
}
#particleCanvas.visible { opacity: 1; }

/* ═══════════════════════════════════════════════════════
   SPLASH SCREEN
═══════════════════════════════════════════════════════ */
.splash {
  position: fixed; inset: 0;
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  transition: opacity 0.7s ease, visibility 0.7s ease;
}
.splash.hide { opacity: 0; visibility: hidden; pointer-events: none; }

.splash-bg {
  position: absolute; inset: 0;
  overflow: hidden;
}
.splash-aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  animation: splashPulse 3s ease-in-out infinite alternate;
}
.s-a1 { width: 600px; height: 600px; top: -200px; left: -200px; background: radial-gradient(circle, rgba(124,106,255,0.25) 0%, transparent 70%); animation-delay: 0s; }
.s-a2 { width: 500px; height: 500px; bottom: -150px; right: -150px; background: radial-gradient(circle, rgba(0,212,255,0.2) 0%, transparent 70%); animation-delay: -1s; }
.s-a3 { width: 400px; height: 400px; top: 50%; left: 50%; transform: translate(-50%,-50%); background: radial-gradient(circle, rgba(124,106,255,0.12) 0%, transparent 60%); animation-delay: -0.5s; }
.s-a4 { width: 300px; height: 300px; bottom: 10%; left: 20%; background: radial-gradient(circle, rgba(0,212,255,0.1) 0%, transparent 60%); animation-delay: -1.5s; }

@keyframes splashPulse {
  from { transform: scale(1) translate(0,0); opacity: 0.8; }
  to   { transform: scale(1.15) translate(10px, -10px); opacity: 1; }
}

.splash-content {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  align-items: center; gap: 24px;
  animation: fadeUp 0.6s ease both;
}

/* Splash orb */
.splash-orb {
  position: relative;
  width: 120px; height: 120px;
  display: flex; align-items: center; justify-content: center;
}
.splash-orb-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
}
.sr1 {
  border-color: rgba(124,106,255,0.4);
  animation: orbSpin 8s linear infinite;
  box-shadow: 0 0 20px rgba(124,106,255,0.2);
}
.sr2 {
  inset: -12px;
  border-color: rgba(0,212,255,0.25);
  animation: orbSpin 12s linear infinite reverse;
}
.sr3 {
  inset: -24px;
  border-color: rgba(124,106,255,0.12);
  animation: orbSpin 18s linear infinite;
}
@keyframes orbSpin { to { transform: rotate(360deg); } }

.splash-orb-core {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9c8aff, #5845cc);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 40px rgba(124,106,255,0.5), inset 0 1px 0 rgba(255,255,255,0.2);
  overflow: hidden;
  animation: coreBreath 2.5s ease-in-out infinite;
  position: relative; z-index: 1;
}
@keyframes coreBreath {
  0%,100% { box-shadow: 0 0 40px rgba(124,106,255,0.5), inset 0 1px 0 rgba(255,255,255,0.2); }
  50%      { box-shadow: 0 0 70px rgba(124,106,255,0.8), inset 0 1px 0 rgba(255,255,255,0.2); }
}

.splash-orb-glow {
  position: absolute; inset: -30px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(124,106,255,0.25) 0%, transparent 70%);
  animation: glowPulse 2.5s ease-in-out infinite;
}
@keyframes glowPulse { 0%,100% { opacity: 0.6; } 50% { opacity: 1; } }

.splash-name {
  font-family: var(--font-display);
  font-size: 52px; font-weight: 800;
  letter-spacing: 0.25em;
  background: linear-gradient(135deg, #fff 0%, var(--cyan) 50%, var(--primary) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  animation: fadeUp 0.7s 0.2s ease both;
}
.splash-tagline {
  color: var(--text-2);
  font-size: 14px; letter-spacing: 0.1em;
  text-transform: uppercase;
  animation: fadeUp 0.7s 0.35s ease both;
}
.splash-loader {
  width: 180px; height: 2px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  animation: fadeUp 0.7s 0.5s ease both;
}
.loader-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 4px;
  animation: loadBar 1.8s 0.3s ease-in-out forwards;
  width: 0;
}
@keyframes loadBar { to { width: 100%; } }

/* ═══════════════════════════════════════════════════════
   APP SHELL
═══════════════════════════════════════════════════════ */
.app {
  position: fixed; inset: 0;
  display: flex;
  opacity: 0;
  transition: opacity 0.8s ease;
  z-index: 1;
}
.app.visible { opacity: 1; }

/* Ambient aurora */
.ambient-layer {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  overflow: hidden;
}
.aurora {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
}
.aurora-1 {
  width: 700px; height: 700px;
  top: -250px; left: -200px;
  background: radial-gradient(circle, rgba(124,106,255,0.11) 0%, transparent 70%);
  animation: auroraDrift 18s ease-in-out infinite alternate;
}
.aurora-2 {
  width: 600px; height: 600px;
  bottom: -200px; right: -150px;
  background: radial-gradient(circle, rgba(0,212,255,0.09) 0%, transparent 70%);
  animation: auroraDrift 22s ease-in-out infinite alternate-reverse;
}
.aurora-3 {
  width: 450px; height: 450px;
  top: 40%; left: 35%;
  background: radial-gradient(circle, rgba(124,106,255,0.06) 0%, transparent 60%);
  animation: auroraDrift 28s ease-in-out infinite alternate;
}
@keyframes auroraDrift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(40px, 30px) scale(1.1); }
}

.grain-overlay {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-size: 256px 256px;
}

.scan-lines {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0;
  background: repeating-linear-gradient(0deg, transparent, transparent 2px, rgba(0,0,0,0.04) 2px, rgba(0,0,0,0.04) 4px);
  animation: scanMove 8s linear infinite;
  opacity: 0.4;
}
@keyframes scanMove { from { background-position: 0 0; } to { background-position: 0 48px; } }

/* ═══════════════════════════════════════════════════════
   SIDEBAR
═══════════════════════════════════════════════════════ */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: rgba(8,8,20,0.85);
  backdrop-filter: blur(20px) saturate(1.4);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: relative; z-index: 10;
  transition: transform 0.32s var(--ease-smooth);
}

/* Sidebar glow edge */
.sidebar::after {
  content: '';
  position: absolute; top: 0; right: -1px;
  width: 1px; height: 100%;
  background: linear-gradient(180deg, transparent 0%, var(--primary) 40%, var(--cyan) 70%, transparent 100%);
  opacity: 0.3;
}

/* Logo */
.sidebar-logo {
  display: flex; align-items: center; gap: 12px;
  padding: 22px 18px 18px;
  border-bottom: 1px solid var(--border);
}

.logo-orb {
  width: 36px; height: 36px;
  position: relative;
  display: flex; align-items: center; justify-content: center;
}
.logo-orb > span {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9c8aff, #4836b8);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  box-shadow: 0 0 16px rgba(124,106,255,0.45);
}
.orb-ring {
  position: absolute; inset: -3px;
  border-radius: 50%;
  border: 1px solid rgba(124,106,255,0.3);
  animation: orbSpin 10s linear infinite;
}

.logo-name {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #fff, var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.logo-tag {
  font-size: 10px; color: var(--text-3);
  letter-spacing: 0.1em; text-transform: uppercase;
  display: block;
}

/* New chat button */
.new-chat-btn {
  margin: 14px 14px 8px;
  padding: 10px 16px;
  background: var(--primary-dim);
  border: 1px solid rgba(124,106,255,0.3);
  border-radius: var(--radius-md);
  color: var(--primary);
  font-family: var(--font-ui);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.new-chat-btn::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(124,106,255,0.15), rgba(0,212,255,0.08));
  opacity: 0; transition: opacity 0.2s ease;
}
.new-chat-btn:hover { background: rgba(124,106,255,0.22); border-color: rgba(124,106,255,0.5); }
.new-chat-btn:hover::before { opacity: 1; }
.new-chat-btn:active { transform: scale(0.98); }

/* Section label */
.sidebar-section-label {
  padding: 8px 18px 4px;
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--text-3);
}

/* Conv list */
.conv-list {
  flex: 1;
  overflow-y: auto;
  padding: 4px 10px 8px;
}

.conv-item {
  display: flex; align-items: center; gap: 9px;
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  position: relative;
  transition: background 0.2s ease, border-color 0.2s ease;
  border: 1px solid transparent;
  margin-bottom: 2px;
  overflow: hidden;
}
.conv-item::before {
  content: '';
  position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 2px; height: 0;
  background: linear-gradient(180deg, var(--primary), var(--cyan));
  border-radius: 2px;
  transition: height 0.25s var(--ease-spring);
}
.conv-item:hover::before,
.conv-item.is-active::before { height: 70%; }
.conv-item:hover { background: var(--surface); border-color: var(--border); }
.conv-item.is-active {
  background: var(--primary-dim);
  border-color: rgba(124,106,255,0.25);
}

.conv-icon { color: var(--text-3); flex-shrink: 0; margin-left: 4px; }
.conv-item.is-active .conv-icon { color: var(--primary); }

.conv-info {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column; gap: 1px;
}
.conv-label {
  font-size: 12.5px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: color 0.2s;
}
.conv-item.is-active .conv-label { color: var(--text); }
.conv-item:hover .conv-label { color: var(--text); }
.conv-time {
  font-size: 10px; color: var(--text-3);
  font-family: var(--font-mono);
}

.conv-delete {
  opacity: 0; background: none; border: none;
  color: var(--text-3); cursor: pointer;
  padding: 3px; border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s, color 0.2s, background 0.2s;
  flex-shrink: 0;
}
.conv-item:hover .conv-delete { opacity: 1; }
.conv-delete:hover { color: #ff6b6b; background: rgba(255,107,107,0.12); }

/* Sidebar footer */
.sidebar-footer {
  padding: 12px 14px 16px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 8px;
}

.capabilities {
  display: flex; gap: 6px;
}
.cap-pill {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 10px; color: var(--text-3);
  font-family: var(--font-mono);
  transition: all 0.2s;
}
.cap-pill:hover { color: var(--cyan); border-color: var(--cyan-dim); background: var(--cyan-dim); }

.model-pill {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-mono);
  font-size: 11px; color: var(--text-2);
}
.model-pulse {
  width: 7px; height: 7px; border-radius: 50%;
  background: var(--cyan);
  box-shadow: 0 0 8px var(--cyan);
  animation: pulse 2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.5; transform: scale(0.75); } }

/* ═══════════════════════════════════════════════════════
   MAIN PANEL
═══════════════════════════════════════════════════════ */
.main {
  flex: 1;
  display: flex; flex-direction: column;
  position: relative; z-index: 1;
  min-width: 0;
  overflow: hidden;
}

/* Topbar */
.topbar {
  display: flex; align-items: center;
  padding: 0 20px;
  height: 56px;
  background: rgba(8,8,20,0.7);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative; z-index: 5;
}
.topbar::after {
  content: '';
  position: absolute; bottom: -1px; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--primary), var(--cyan), transparent);
  opacity: 0.4;
}

.sidebar-toggle {
  display: none;
  background: none; border: none; color: var(--text-2);
  cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.sidebar-toggle:hover { color: var(--text); background: var(--surface); }

.topbar-center {
  flex: 1;
  display: flex; align-items: center; gap: 8px;
  justify-content: center;
}
.topbar-title {
  font-family: var(--font-display);
  font-size: 18px; font-weight: 800;
  letter-spacing: 0.12em;
  background: linear-gradient(135deg, #fff, var(--primary));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
}
.topbar-version {
  font-family: var(--font-mono);
  font-size: 10px; color: var(--text-3);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 2px 7px; border-radius: 10px;
}

.topbar-status {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; color: var(--text-3);
  font-family: var(--font-mono);
}
.status-dot-live {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74,222,128,0.6);
  animation: pulse 2s ease-in-out infinite;
}

/* ── Messages Area ───────────────────────────────────── */
.messages-area {
  flex: 1;
  overflow-y: auto;
  padding: 28px 0 20px;
  display: flex; flex-direction: column;
  scroll-behavior: smooth;
}

/* Welcome */
.welcome {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  flex: 1; padding: 40px 20px;
  text-align: center;
  animation: fadeUp 0.6s ease both;
}

.welcome-orb {
  position: relative;
  width: 88px; height: 88px;
  margin-bottom: 24px;
}
.welcome-orb-ring {
  position: absolute; inset: 0;
  border-radius: 50%;
  border: 1px solid transparent;
}
.welcome-orb-ring.r1 {
  border-color: rgba(124,106,255,0.35);
  animation: orbSpin 10s linear infinite;
}
.welcome-orb-ring.r2 {
  inset: -10px;
  border-color: rgba(0,212,255,0.2);
  animation: orbSpin 16s linear infinite reverse;
}
.welcome-orb-core {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9c8aff, #4836b8);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 0 30px rgba(124,106,255,0.4);
  overflow: hidden;
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  z-index: 1;
}
.welcome-heading {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 700;
  background: linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.7) 100%);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  margin-bottom: 8px;
}
.welcome-sub {
  color: var(--text-3); font-size: 14px;
  margin-bottom: 32px;
}
.suggestions {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  max-width: 520px; width: 100%;
}
.suggestion {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-2);
  font-family: var(--font-ui);
  font-size: 13px;
  cursor: pointer; text-align: left;
  transition: all 0.2s ease;
  position: relative; overflow: hidden;
}
.suggestion::before {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(135deg, var(--primary-dim), var(--cyan-dim));
  opacity: 0; transition: opacity 0.25s;
}
.suggestion:hover {
  border-color: rgba(124,106,255,0.35);
  color: var(--text);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(124,106,255,0.12);
}
.suggestion:hover::before { opacity: 1; }
.suggestion-icon { font-size: 16px; flex-shrink: 0; position: relative; z-index: 1; }
.suggestion span:last-child { position: relative; z-index: 1; }

/* ── Message Rows ─────────────────────────────────────── */
.message-row {
  display: flex; padding: 6px 24px;
  max-width: 820px; width: 100%;
  margin: 0 auto;
  animation: fadeUp 0.35s ease both;
}

.user-row { justify-content: flex-end; flex-direction: column; align-items: flex-end; gap: 8px; }
.bot-row  { justify-content: flex-start; }

/* User bubble */
.bubble-user {
  max-width: 72%;
  padding: 12px 16px;
  background: linear-gradient(135deg, rgba(124,106,255,0.28), rgba(100,80,220,0.22));
  border: 1px solid rgba(124,106,255,0.3);
  border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg);
  color: var(--text);
  font-size: 14.5px; line-height: 1.6;
  word-break: break-word;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 20px rgba(124,106,255,0.15);
}

/* Bot wrapper */
.bot-wrapper {
  display: flex; align-items: flex-start; gap: 12px;
  max-width: 85%; width: 100%;
  position: relative;
}
.bot-wrapper:hover .copy-btn { opacity: 1; }

/* Bot avatar */
.bot-avatar {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #9c8aff, #4836b8);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 16px rgba(124,106,255,0.35);
  transition: box-shadow 0.3s ease;
}
.bot-avatar.thinking {
  animation: thinkPulse 1.4s ease-in-out infinite;
}
.bot-avatar.thinking::after {
  content: '';
  position: absolute; inset: -2px;
  border-radius: 50%;
  border: 2px solid transparent;
  border-top-color: var(--cyan);
  border-right-color: var(--primary);
  animation: thinkSpin 0.9s linear infinite;
}
@keyframes thinkPulse { 0%,100% { box-shadow: 0 0 16px rgba(124,106,255,0.35); } 50% { box-shadow: 0 0 28px rgba(0,212,255,0.5); } }
@keyframes thinkSpin  { to { transform: rotate(360deg); } }

/* Bot bubble */
.bubble-bot {
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg);
  color: var(--text);
  font-size: 14.5px; line-height: 1.7;
  word-break: break-word;
  backdrop-filter: blur(12px);
  box-shadow: 0 2px 16px rgba(0,0,0,0.2);
  flex: 1;
  transition: border-color 0.3s ease;
}
.bubble-bot:hover { border-color: var(--border-2); }

/* Markdown inside bubble */
.bubble-bot h1,.bubble-bot h2,.bubble-bot h3 {
  font-family: var(--font-display);
  margin: 16px 0 8px;
  color: var(--text);
}
.bubble-bot h1 { font-size: 20px; }
.bubble-bot h2 { font-size: 17px; }
.bubble-bot h3 { font-size: 15px; color: var(--primary); }
.bubble-bot p  { margin-bottom: 10px; }
.bubble-bot ul,.bubble-bot ol { margin: 8px 0 10px 20px; }
.bubble-bot li { margin-bottom: 4px; }
.bubble-bot strong { color: #fff; font-weight: 600; }
.bubble-bot em { color: var(--cyan); font-style: italic; }
.bubble-bot a  { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; }
.bubble-bot hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }
.bubble-bot blockquote {
  border-left: 3px solid var(--primary);
  margin: 10px 0; padding: 6px 14px;
  background: var(--primary-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-2);
  font-style: italic;
}
.bubble-bot table {
  width: 100%; border-collapse: collapse;
  margin: 12px 0; font-size: 13px;
}
.bubble-bot th {
  background: var(--primary-dim);
  border: 1px solid rgba(124,106,255,0.2);
  padding: 8px 12px; text-align: left;
  font-weight: 600; color: var(--primary);
}
.bubble-bot td {
  border: 1px solid var(--border);
  padding: 7px 12px;
}
.bubble-bot tr:hover td { background: var(--surface); }
.bubble-bot code {
  font-family: var(--font-mono);
  font-size: 13px;
  background: rgba(124,106,255,0.12);
  border: 1px solid rgba(124,106,255,0.2);
  padding: 1px 6px; border-radius: 5px;
  color: var(--cyan);
}
.bubble-bot pre {
  background: rgba(0,0,0,0.45);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  overflow-x: auto;
  margin: 10px 0;
  position: relative;
}
.bubble-bot pre::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, var(--primary), var(--cyan), transparent);
  opacity: 0.5;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.bubble-bot pre code {
  background: none; border: none; padding: 0;
  font-size: 13px; line-height: 1.7;
  color: #c8c8e8;
}

/* Copy button */
.copy-btn {
  position: absolute; top: 8px; right: -36px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-3); cursor: pointer;
  padding: 6px;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: all 0.2s ease;
}
.copy-btn:hover { color: var(--text); background: var(--surface-3); border-color: var(--border-2); }
.copy-btn.copied { color: #4ade80; border-color: rgba(74,222,128,0.3); }

/* Cursor blink */
.cursor-blink {
  display: inline-block;
  width: 2px; height: 16px;
  background: var(--primary);
  border-radius: 2px;
  margin-left: 2px;
  vertical-align: middle;
  animation: blink 0.75s step-end infinite;
}
@keyframes blink { 0%,100% { opacity: 1; } 50% { opacity: 0; } }

/* ── Attachment in messages ───────────────────────────── */
.msg-attachments {
  display: flex; flex-wrap: wrap; gap: 8px;
  justify-content: flex-end;
}
.msg-img {
  max-width: 240px; max-height: 200px;
  border-radius: var(--radius-md);
  border: 1px solid rgba(124,106,255,0.25);
  object-fit: cover;
  box-shadow: 0 4px 20px rgba(0,0,0,0.35);
  cursor: zoom-in;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.msg-img:hover { transform: scale(1.03); box-shadow: 0 8px 30px rgba(0,0,0,0.5); }
.msg-pdf-badge {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: rgba(0,212,255,0.08);
  border: 1px solid rgba(0,212,255,0.2);
  border-radius: var(--radius-md);
  color: var(--cyan); font-size: 13px;
  font-family: var(--font-mono);
  max-width: 240px;
}

/* ═══════════════════════════════════════════════════════
   INPUT BAR
═══════════════════════════════════════════════════════ */
.input-bar {
  padding: 12px 20px 16px;
  flex-shrink: 0;
  position: relative; z-index: 5;
  background: linear-gradient(0deg, rgba(5,5,12,0.95) 0%, transparent 100%);
}

/* File preview chips */
.file-preview-area {
  display: none;
  flex-wrap: wrap; gap: 8px;
  margin-bottom: 10px;
  padding: 2px 4px;
}
.file-chip {
  display: flex; align-items: center; gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-md);
  padding: 6px 10px 6px 6px;
  max-width: 200px;
  animation: fadeUp 0.25s ease;
  position: relative;
}
.chip-thumb {
  width: 36px; height: 36px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}
.chip-pdf-icon {
  width: 36px; height: 36px;
  border-radius: 8px;
  background: var(--cyan-dim);
  border: 1px solid rgba(0,212,255,0.2);
  display: flex; align-items: center; justify-content: center;
  color: var(--cyan); flex-shrink: 0;
}
.chip-info { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.chip-name {
  font-size: 11px; color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  max-width: 100px;
}
.chip-meta { font-size: 10px; color: var(--text-3); font-family: var(--font-mono); }
.chip-remove {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  font-size: 16px; line-height: 1;
  padding: 0 2px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.chip-remove:hover { color: #ff6b6b; }

/* Input wrapper */
.input-wrapper {
  display: flex; align-items: flex-end; gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: 10px 10px 10px 12px;
  backdrop-filter: blur(16px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.input-wrapper:focus-within {
  border-color: rgba(124,106,255,0.4);
  box-shadow: 0 0 0 3px rgba(124,106,255,0.1), 0 4px 24px rgba(0,0,0,0.3);
}

/* Attach button */
.attach-btn {
  background: none; border: none;
  color: var(--text-3); cursor: pointer;
  padding: 7px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}
.attach-btn:hover {
  color: var(--cyan);
  background: var(--cyan-dim);
}

textarea#userInput {
  flex: 1;
  background: none; border: none; outline: none;
  color: var(--text);
  font-family: var(--font-ui);
  font-size: 14.5px; line-height: 1.6;
  resize: none; min-height: 24px; max-height: 200px;
  overflow-y: auto;
}
textarea#userInput::placeholder { color: var(--text-3); }

.send-btn {
  width: 36px; height: 36px; flex-shrink: 0;
  border-radius: 10px; border: none;
  background: linear-gradient(135deg, var(--primary), #5845cc);
  color: #fff; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s var(--ease-spring);
  box-shadow: 0 0 16px rgba(124,106,255,0.35);
}
.send-btn:hover:not(:disabled) {
  transform: scale(1.08);
  box-shadow: 0 0 24px rgba(124,106,255,0.55);
}
.send-btn:active:not(:disabled) { transform: scale(0.95); }
.send-btn:disabled {
  background: var(--surface-2);
  box-shadow: none; cursor: not-allowed; opacity: 0.5;
}

.input-disclaimer {
  text-align: center;
  font-size: 11px; color: var(--text-3);
  margin-top: 8px;
  font-family: var(--font-mono);
}

/* ═══════════════════════════════════════════════════════
   DROP OVERLAY
═══════════════════════════════════════════════════════ */
.drop-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(5,5,12,0.88);
  backdrop-filter: blur(12px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease;
}
.drop-overlay.visible { opacity: 1; pointer-events: all; }

.drop-inner {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 48px 60px;
  border: 2px dashed rgba(124,106,255,0.5);
  border-radius: var(--radius-xl);
  background: rgba(124,106,255,0.06);
  text-align: center;
  animation: dropPulse 1.5s ease-in-out infinite;
}
@keyframes dropPulse {
  0%,100% { border-color: rgba(124,106,255,0.5); box-shadow: 0 0 30px rgba(124,106,255,0.1); }
  50%      { border-color: rgba(0,212,255,0.6);   box-shadow: 0 0 50px rgba(0,212,255,0.2); }
}
.drop-icon { color: var(--primary); opacity: 0.8; }
.drop-inner p { font-size: 20px; font-weight: 600; color: var(--text); }
.drop-inner span { font-size: 13px; color: var(--text-3); }

/* ═══════════════════════════════════════════════════════
   TOAST
═══════════════════════════════════════════════════════ */
.toast {
  position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%) translateY(12px);
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  color: var(--text);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 13px;
  backdrop-filter: blur(16px);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s var(--ease-spring);
  pointer-events: none;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.4);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ═══════════════════════════════════════════════════════
   ANIMATIONS
═══════════════════════════════════════════════════════ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Jhon photo/letter */
.jhon-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.jhon-letter {
  font-family: var(--font-display);
  font-size: 16px; font-weight: 800;
  color: #fff;
  position: absolute;
}
.jhon-photo + .jhon-letter { display: none; }
.jhon-photo[style*="display:none"] + .jhon-letter { display: block; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
═══════════════════════════════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    z-index: 100;
    transform: translateX(-100%);
  }
  .sidebar.is-open { transform: translateX(0); }

  .sidebar-toggle { display: flex; }

  .message-row { padding: 5px 14px; }
  .copy-btn { display: none; }

  .bubble-user { max-width: 85%; }
  .bot-wrapper  { max-width: 95%; }

  .suggestions { grid-template-columns: 1fr; }

  .topbar-status span { display: none; }

  .welcome { padding: 24px 16px; }
}

@media (max-width: 480px) {
  .splash-name { font-size: 38px; }
  .splash-loader { width: 140px; }
}
