/* ═══════════════════════════════════════════
   GITA — Design System & Styles
   Bhagavad Gita As It Is Chatbot
   ═══════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --bg-deep:        #080812;
  --bg-base:        #0D0D1F;
  --bg-surface:     #13132A;
  --bg-elevated:    #1A1A35;
  --bg-card:        #1F1F40;

  --saffron:        #FF9933;
  --saffron-dim:    #CC7A28;
  --saffron-glow:   rgba(255,153,51,0.15);
  --saffron-glow2:  rgba(255,153,51,0.06);

  --purple:         #7C3AED;
  --purple-light:   #A855F7;
  --purple-soft:    rgba(168,85,247,0.12);
  --lotus:          #E879F9;
  --lotus-soft:     rgba(232,121,249,0.1);

  --gold:           #F5C842;
  --gold-soft:      rgba(245,200,66,0.12);

  --text-primary:   #FFF8F0;
  --text-secondary: #C8B8A0;
  --text-muted:     #7A6A58;
  --text-ultra:     #4A3D30;

  --border:         rgba(255,153,51,0.12);
  --border-strong:  rgba(255,153,51,0.25);
  --glass:          rgba(255,255,255,0.03);
  --glass-hover:    rgba(255,255,255,0.06);

  --radius-sm:      8px;
  --radius-md:      14px;
  --radius-lg:      20px;
  --radius-xl:      28px;
  --radius-full:    999px;

  --shadow-sm:      0 2px 12px rgba(0,0,0,0.4);
  --shadow-md:      0 8px 32px rgba(0,0,0,0.5);
  --shadow-lg:      0 16px 64px rgba(0,0,0,0.6);
  --shadow-glow:    0 0 40px rgba(255,153,51,0.15);
  --shadow-purple:  0 0 40px rgba(168,85,247,0.15);

  --sidebar-w:      300px;
  --topbar-h:       60px;
  --input-h:        80px;

  --ease-out:       cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring:    cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100vh;
  overflow: hidden;
  line-height: 1.6;
}

/* ── Ambient Particles ── */
.particles {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.particle {
  position: absolute;
  border-radius: 50%;
  opacity: 0;
  animation: float-up linear infinite;
}

@keyframes float-up {
  0%   { opacity: 0; transform: translateY(0) scale(1); }
  10%  { opacity: 1; }
  90%  { opacity: 0.6; }
  100% { opacity: 0; transform: translateY(-100vh) scale(0.5); }
}

/* ── App Layout ── */
.app {
  display: flex;
  height: 100vh;
  position: relative;
  z-index: 1;
}

/* ══════════════════════════════
   SIDEBAR
══════════════════════════════ */

.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  height: 100vh;
  background: var(--bg-surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0;
  overflow-y: auto;
  transition: transform 0.35s var(--ease-out);
  position: relative;
  z-index: 10;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-surface);
  z-index: 2;
}

.logo-mark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lotus-icon {
  font-size: 28px;
  filter: drop-shadow(0 0 10px rgba(255,153,51,0.5));
  animation: lotus-pulse 3s ease-in-out infinite;
}

@keyframes lotus-pulse {
  0%, 100% { filter: drop-shadow(0 0 8px rgba(255,153,51,0.4)); transform: scale(1); }
  50%       { filter: drop-shadow(0 0 16px rgba(255,153,51,0.7)); transform: scale(1.05); }
}

.logo-text { display: flex; flex-direction: column; }

.logo-name {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--saffron), var(--gold), var(--lotus));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.logo-tagline {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 1px;
}

.sidebar-close {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: color 0.2s, background 0.2s;
}
.sidebar-close:hover { color: var(--text-primary); background: var(--glass-hover); }

/* Daily Verse Card */
.daily-verse-card {
  margin: 16px;
  padding: 16px;
  background: linear-gradient(135deg, rgba(255,153,51,0.08), rgba(168,85,247,0.08));
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
}

.daily-verse-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--saffron-glow), transparent);
  pointer-events: none;
}

.dv-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--saffron);
  font-weight: 600;
  margin-bottom: 6px;
}

.dv-id {
  font-family: 'Playfair Display', serif;
  font-size: 13px;
  color: var(--gold);
  margin-bottom: 8px;
  font-style: italic;
}

.dv-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.7;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dv-share {
  margin-top: 12px;
  padding: 6px 12px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.dv-share:hover { background: var(--saffron-glow); border-color: var(--saffron); color: var(--saffron); }

/* Chapter Browser */
.chapter-browser { padding: 16px 16px 8px; }

.section-label {
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 10px;
}

.chapter-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.chapter-item {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid transparent;
}

.chapter-item:hover {
  background: var(--glass-hover);
  border-color: var(--border);
  color: var(--saffron);
}

.chapter-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--saffron);
  background: var(--saffron-glow);
  border-radius: 4px;
  padding: 1px 6px;
  min-width: 28px;
  text-align: center;
}

.chapter-name {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.3;
  flex: 1;
}

.chapter-item:hover .chapter-name { color: var(--text-primary); }

/* Bookmarks */
.bookmarks-section { padding: 8px 16px 16px; }

.bm-count {
  background: var(--saffron-glow);
  color: var(--saffron);
  border-radius: var(--radius-full);
  padding: 0 6px;
  font-size: 10px;
  font-weight: 700;
}

.bookmark-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.bm-empty {
  font-size: 12px;
  color: var(--text-ultra);
  padding: 8px 12px;
  font-style: italic;
}

.bookmark-item {
  padding: 8px 12px;
  border-radius: var(--radius-md);
  background: var(--glass);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.bookmark-item:hover { background: var(--glass-hover); border-color: var(--border-strong); }

.bm-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  white-space: nowrap;
}

.bm-preview {
  font-size: 11px;
  color: var(--text-muted);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bm-remove {
  background: none;
  border: none;
  color: var(--text-ultra);
  cursor: pointer;
  font-size: 12px;
  padding: 2px;
  transition: color 0.2s;
  flex-shrink: 0;
}
.bm-remove:hover { color: #ef4444; }

/* Sidebar Footer */
.sidebar-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--border);
  font-size: 10px;
  color: var(--text-ultra);
  line-height: 1.6;
  text-align: center;
}
.sidebar-footer em { color: var(--text-muted); }

/* ══════════════════════════════
   MAIN AREA
══════════════════════════════ */

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  position: relative;
  background: var(--bg-base);
}

/* Background ornament */
.main::before {
  content: '';
  position: fixed;
  top: -200px;
  right: -200px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(168,85,247,0.06) 0%, transparent 70%);
  pointer-events: none;
}

.main::after {
  content: '';
  position: fixed;
  bottom: -200px;
  left: 200px;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255,153,51,0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* ── Topbar ── */
.topbar {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 5;
  background: rgba(13,13,31,0.8);
  backdrop-filter: blur(12px);
}

.menu-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: var(--radius-sm);
}
.menu-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: all 0.3s;
}
.menu-btn:hover span { background: var(--saffron); }

.topbar-brand {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tb-lotus { font-size: 20px; }

.tb-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--saffron), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.new-chat-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 16px;
  background: var(--glass);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-full);
  color: var(--saffron);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s;
}

.new-chat-btn:hover {
  background: var(--saffron-glow);
  box-shadow: var(--shadow-glow);
  transform: translateY(-1px);
}

.new-chat-btn span { font-size: 10px; }

/* ── Chat Area ── */
.chat-area {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  position: relative;
  z-index: 1;
}

.chat-area::-webkit-scrollbar { width: 4px; }
.chat-area::-webkit-scrollbar-track { background: transparent; }
.chat-area::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* ── Welcome Screen ── */
.welcome-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 20px;
  gap: 16px;
  animation: fade-in 0.8s var(--ease-out) both;
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.welcome-lotus {
  font-size: 72px;
  animation: welcome-bloom 1s var(--ease-spring) both;
  filter: drop-shadow(0 0 30px rgba(255,153,51,0.5));
}

@keyframes welcome-bloom {
  from { opacity: 0; transform: scale(0.5) rotate(-20deg); }
  to   { opacity: 1; transform: scale(1) rotate(0); }
}

.welcome-title {
  font-family: 'Playfair Display', serif;
  font-size: 52px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--saffron) 0%, var(--gold) 40%, var(--lotus) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: fade-in 0.8s 0.2s var(--ease-out) both;
  line-height: 1;
}

.welcome-sub {
  font-size: 18px;
  color: var(--text-secondary);
  font-style: italic;
  font-family: 'Playfair Display', serif;
  animation: fade-in 0.8s 0.3s var(--ease-out) both;
}

.welcome-desc {
  font-size: 14px;
  color: var(--text-muted);
  max-width: 480px;
  line-height: 1.7;
  animation: fade-in 0.8s 0.4s var(--ease-out) both;
}

.welcome-desc strong { color: var(--saffron); }
.welcome-desc em { color: var(--text-secondary); }

/* Suggestion Grid */
.suggestion-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
  width: 100%;
  max-width: 560px;
  animation: fade-in 0.8s 0.5s var(--ease-out) both;
}

.suggestion-chip {
  padding: 10px 16px;
  background: var(--glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  text-align: left;
  line-height: 1.4;
}

.suggestion-chip:hover {
  background: var(--saffron-glow);
  border-color: var(--saffron);
  color: var(--text-primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ── Chat Messages ── */
.message-group {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 760px;
  margin: 0 auto;
  width: 100%;
  animation: fade-in 0.5s var(--ease-out) both;
}

/* User Bubble */
.msg-user {
  align-self: flex-end;
  max-width: 80%;
  background: linear-gradient(135deg, rgba(255,153,51,0.15), rgba(168,85,247,0.10));
  border: 1px solid rgba(255,153,51,0.25);
  border-radius: var(--radius-xl) var(--radius-xl) var(--radius-sm) var(--radius-xl);
  padding: 14px 18px;
  font-size: 15px;
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
}

/* Gita Response Bubble */
.msg-gita {
  align-self: flex-start;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.gita-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.gita-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--saffron), var(--purple));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  box-shadow: 0 0 12px rgba(255,153,51,0.3);
}

.gita-name {
  font-family: 'Playfair Display', serif;
  font-size: 14px;
  font-weight: 600;
  background: linear-gradient(90deg, var(--saffron), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.gita-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Verse Cards Container */
.verse-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Verse Card */
.verse-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
  position: relative;
}

.verse-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--saffron), var(--purple-light), var(--lotus));
}

.verse-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-glow);
}

.verse-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px 10px;
}

.verse-ref {
  display: flex;
  align-items: center;
  gap: 10px;
}

.verse-badge {
  background: linear-gradient(135deg, var(--saffron), var(--saffron-dim));
  color: #000;
  font-weight: 700;
  font-size: 11px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.5px;
}

.verse-chapter-name {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.verse-actions {
  display: flex;
  gap: 6px;
}

.action-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12px;
  padding: 4px 8px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.action-btn:hover { background: var(--glass-hover); border-color: var(--border-strong); color: var(--text-primary); }
.action-btn.bookmarked { color: var(--gold); border-color: var(--gold-soft); background: var(--gold-soft); }

/* Sanskrit Block */
.verse-sanskrit {
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(255,153,51,0.04), rgba(168,85,247,0.04));
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.sanskrit-text {
  font-family: 'Noto Serif Devanagari', serif;
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.9;
  white-space: pre-line;
}

.transliteration-text {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.8;
  margin-top: 8px;
  font-style: italic;
  white-space: pre-line;
}

/* Translation Block */
.verse-translation {
  padding: 16px 18px;
}

.translation-label {
  font-size: 10px;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--saffron);
  font-weight: 600;
  margin-bottom: 8px;
}

.translation-text {
  font-size: 15px;
  color: var(--text-primary);
  line-height: 1.8;
  font-family: 'Playfair Display', serif;
  font-style: italic;
}

/* Purport Block (collapsible) */
.verse-purport {
  border-top: 1px solid var(--border);
}

.purport-toggle {
  width: 100%;
  padding: 12px 18px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 12px;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.2s;
}
.purport-toggle:hover { color: var(--saffron); }

.purport-arrow {
  transition: transform 0.3s var(--ease-out);
  font-size: 10px;
}
.purport-arrow.open { transform: rotate(180deg); }

.purport-content {
  padding: 0 18px 16px;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.9;
  display: none;
}
.purport-content.open { display: block; animation: fade-in 0.3s var(--ease-out); }

/* Relevance Score (faint) */
.relevance-bar {
  height: 2px;
  background: var(--border);
  margin: 0 18px 12px;
  border-radius: 2px;
  overflow: hidden;
}
.relevance-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--saffron), var(--lotus));
  border-radius: 2px;
  transition: width 1s var(--ease-out);
}

/* No Results */
.no-results {
  padding: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  line-height: 1.7;
}

.no-results p:first-child { font-size: 24px; margin-bottom: 8px; }

/* Typing indicator */
.typing-indicator {
  display: flex;
  gap: 5px;
  align-items: center;
  padding: 14px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  width: fit-content;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--saffron);
  animation: typing-bounce 1.2s ease-in-out infinite;
}
.typing-dot:nth-child(2) { animation-delay: 0.2s; background: var(--purple-light); }
.typing-dot:nth-child(3) { animation-delay: 0.4s; background: var(--lotus); }

@keyframes typing-bounce {
  0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
  30%            { transform: translateY(-8px); opacity: 1; }
}

/* ── Input Area ── */
.input-area {
  padding: 16px 20px 20px;
  border-top: 1px solid var(--border);
  background: rgba(13,13,31,0.9);
  backdrop-filter: blur(16px);
  position: relative;
  z-index: 5;
}

.input-wrapper {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 10px 10px 10px 18px;
  transition: border-color 0.25s, box-shadow 0.25s;
  position: relative;
}

.input-wrapper:focus-within {
  border-color: var(--saffron);
  box-shadow: 0 0 0 3px var(--saffron-glow), var(--shadow-md);
}

.question-input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  resize: none;
  line-height: 1.6;
  max-height: 140px;
  overflow-y: auto;
  scrollbar-width: none;
}
.question-input::-webkit-scrollbar { display: none; }
.question-input::placeholder { color: var(--text-muted); }

.send-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--saffron), var(--purple));
  border: none;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.25s var(--ease-out);
  opacity: 0.5;
}

.send-btn:not(:disabled) {
  opacity: 1;
}

.send-btn:not(:disabled):hover {
  transform: scale(1.1);
  box-shadow: 0 4px 20px rgba(255,153,51,0.4);
}

.send-btn:disabled { cursor: not-allowed; }

.input-hint {
  font-size: 11px;
  color: var(--text-ultra);
  text-align: center;
  margin-top: 8px;
}

/* ══════════════════════════════
   MODAL (Chapter Browser)
══════════════════════════════ */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.open { display: flex; animation: fade-in 0.2s ease; }

.modal {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  animation: modal-slide 0.3s var(--ease-out);
}

@keyframes modal-slide {
  from { transform: translateY(20px) scale(0.97); opacity: 0; }
  to   { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-family: 'Playfair Display', serif;
  font-size: 18px;
  background: linear-gradient(90deg, var(--saffron), var(--gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.modal-close {
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 6px 10px;
  transition: all 0.2s;
  font-family: 'Inter', sans-serif;
}
.modal-close:hover { color: var(--text-primary); border-color: var(--border-strong); }

.modal-body {
  overflow-y: auto;
  padding: 16px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

/* Verse row in modal */
.modal-verse-row {
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  background: var(--glass);
  cursor: pointer;
  transition: all 0.2s;
}

.modal-verse-row:hover {
  background: var(--saffron-glow2);
  border-color: var(--saffron);
}

.mvr-id {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
  margin-bottom: 4px;
}

.mvr-text {
  font-size: 13px;
  color: var(--text-secondary);
  font-style: italic;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Sidebar overlay (mobile) */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 9;
}

/* ══════════════════════════════
   SCROLLBAR
══════════════════════════════ */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ══════════════════════════════
   RESPONSIVE
══════════════════════════════ */
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    transform: translateX(-100%);
    z-index: 20;
  }

  .sidebar.open {
    transform: translateX(0);
    box-shadow: var(--shadow-lg);
  }

  .sidebar-close { display: block; }
  .menu-btn { display: flex; }

  .sidebar-overlay.open { display: block; }

  .suggestion-grid {
    grid-template-columns: 1fr;
  }

  .welcome-title { font-size: 36px; }
  .welcome-lotus { font-size: 52px; }
}

/* ── Utility animations ── */
@keyframes slide-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slide-up { animation: slide-up 0.4s var(--ease-out) both; }
