/* ==========================================================================
   SHREEMAD BHAGAVAD GITA v8 — REDESIGN: IMMERSIVE MOBILE-FIRST
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@600;700;800;900&family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&family=Rozha+One&family=Yatra+One&display=swap');

/* ─── DESIGN TOKENS ─── */
:root {
  --h: 55px;            /* Header height */
  --bn: 60px;           /* Bottom nav height */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 20px;
  --r-xl: 28px;

  /* Palette – Light (Divya Surya) */
  --bg:       #fffdf7;
  --bg2:      #fef8ec;
  --surface:  rgba(255,255,255,0.95);
  --surface2: rgba(255,255,255,0.7);
  --border:   rgba(217,119,6,0.22);
  --text1:    #1a1006;
  --text2:    #604218;
  --text3:    #8c6a38;
  --skt:      #6b2d0e;
  --accent:   #ea580c;
  --accent2:  #f97316;
  --gold:     #d97706;
  --gold-hi:  #f59e0b;
  --gold-g:   linear-gradient(135deg,#d97706 0%,#f59e0b 50%,#b45309 100%);
  --gold-glo: rgba(245,158,11,0.3);
  --teal:     #0891b2;
  --teal-g:   linear-gradient(135deg,#06b6d4 0%,#0284c7 100%);
  --purple:   #7c3aed;
  --purple-g: linear-gradient(135deg,#7c3aed 0%,#a855f7 100%);
  --sh-sm:    0 2px 8px rgba(180,83,9,0.07);
  --sh-md:    0 6px 24px rgba(180,83,9,0.10);
  --sh-lg:    0 14px 40px rgba(180,83,9,0.15);
  --font-sa:  'Rozha One','Yatra One',serif;
  --font-hd:  'Cinzel','Outfit',serif;
  --font-bd:  'Inter',system-ui,sans-serif;
}

[data-theme="dark"] {
  --bg:       #06040f;
  --bg2:      #0d0a1e;
  --surface:  rgba(16,12,36,0.92);
  --surface2: rgba(22,17,50,0.8);
  --border:   rgba(124,58,237,0.25);
  --text1:    #f1eeff;
  --text2:    #c4b5fd;
  --text3:    #8b7fb8;
  --skt:      #fbbf24;
  --accent:   #a78bfa;
  --accent2:  #c4b5fd;
  --gold:     #f59e0b;
  --gold-hi:  #fbbf24;
  --gold-g:   linear-gradient(135deg,#fef08a 0%,#f59e0b 50%,#d97706 100%);
  --gold-glo: rgba(245,158,11,0.4);
  --teal:     #22d3ee;
  --teal-g:   linear-gradient(135deg,#00f2fe 0%,#4facfe 100%);
  --purple:   #7c3aed;
  --purple-g: linear-gradient(135deg,#6d28d9 0%,#a855f7 100%);
  --sh-sm:    0 2px 8px rgba(0,0,0,0.5);
  --sh-md:    0 6px 24px rgba(0,0,0,0.6);
  --sh-lg:    0 14px 40px rgba(0,0,0,0.75);
}

/* ─── RESET ─── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0;-webkit-tap-highlight-color:transparent;}
a{text-decoration:none;color:inherit;}
button{cursor:pointer;font-family:var(--font-bd);}

/* ─── BODY ─── */
body {
  font-family: var(--font-bd);
  background: var(--bg);
  color: var(--text1);
  min-height: 100vh;
  min-height: 100dvh;
  overflow: hidden;   /* No body scroll — inner areas scroll */
  line-height: 1.5;
  transition: background 0.3s, color 0.3s;
  padding-top: env(safe-area-inset-top);
}

/* ─── AMBIENT BACKGROUND ─── */
.ambient-bg {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 0; overflow: hidden;
}
.orb {
  position: absolute; border-radius: 50%;
  filter: blur(80px); opacity: 0.22;
  animation: drift 18s ease-in-out infinite alternate;
}
.orb-1 {
  top: -8%; left: 10%; width: 380px; height: 380px;
  background: radial-gradient(circle,#7c3aed,transparent 70%);
  animation-delay: 0s;
}
.orb-2 {
  bottom: 15%; right: -8%; width: 420px; height: 420px;
  background: radial-gradient(circle,#ea580c,transparent 70%);
  animation-delay: -6s;
}
.orb-3 {
  top: 38%; left: -12%; width: 300px; height: 300px;
  background: radial-gradient(circle,#0891b2,transparent 70%);
  animation-delay: -12s;
}
@keyframes drift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(20px,15px) scale(1.05); }
  100% { transform: translate(-10px,25px) scale(0.97); }
}

/* ─── APP SHELL ─── */
.app-shell {
  position: relative; z-index: 1;
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
  max-width: 600px; margin: 0 auto;
  overflow: hidden;
}

/* ─── HEADER ─── */
.app-header {
  position: relative; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top,0px) + 8px) 14px 8px;
  background: var(--surface);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--sh-sm);
  flex-shrink: 0;
  min-height: calc(var(--h) + env(safe-area-inset-top,0px));
}

.brand-link {
  display: flex; align-items: center; gap: 9px;
  color: var(--text1); text-decoration: none;
}
.brand-logo {
  width: 34px; height: 34px;
  background: var(--gold-g);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sa); font-size: 18px; color: #fff;
  box-shadow: 0 2px 10px var(--gold-glo);
  flex-shrink: 0;
}
.brand-info { display: flex; flex-direction: column; line-height: 1; }
.brand-title {
  font-family: var(--font-hd); font-size: 0.86rem; font-weight: 800;
  background: var(--gold-g); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: 0.5px;
}
.brand-sub { font-size: 0.6rem; color: var(--text3); margin-top: 1px; }

.header-actions { display: flex; align-items: center; gap: 5px; }

.lang-wrap { position: relative; display: flex; align-items: center; }
.lang-select {
  appearance: none;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text1); font-family: var(--font-bd); font-size: 0.72rem; font-weight: 600;
  padding: 4px 22px 4px 7px; border-radius: var(--r-md);
  cursor: pointer; outline: none; max-width: 120px;
  white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
}
.lang-chevron {
  position: absolute; right: 6px; pointer-events: none;
  color: var(--text3); width: 11px; height: 11px;
}

.hdr-btn {
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text1); display: flex; align-items: center; justify-content: center;
  transition: all 0.2s; flex-shrink: 0;
}
.hdr-btn:hover { background: var(--surface); }
.hdr-btn svg { width: 13px; height: 13px; }
.om-btn { font-family: var(--font-sa); font-size: 15px; color: var(--accent); font-weight: bold; }
.om-btn.playing {
  background: var(--accent); color: #fff; border-color: var(--accent2);
  animation: pulseOm 2s ease-in-out infinite alternate;
}
@keyframes pulseOm {
  0%   { box-shadow: 0 0 4px var(--gold-glo); }
  100% { box-shadow: 0 0 14px rgba(234,88,12,0.7); transform: scale(1.08); }
}

/* ─── MAIN CONTENT ─── */
.app-main {
  flex: 1; overflow: hidden; position: relative;
  display: flex; flex-direction: column;
}

/* ─── APP VIEWS ─── */
.app-view {
  display: none;
  position: absolute; inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  animation: viewFadeIn 0.22s cubic-bezier(0.16,1,0.3,1);
  padding: 10px 12px calc(var(--bn) + 10px);
}
.app-view.active { display: flex; flex-direction: column; }
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ─── CHAPTER NAV BAR ─── */
.chapter-nav-bar {
  margin-bottom: 10px; flex-shrink: 0;
}
.chapter-nav-btn {
  display: flex; align-items: center; gap: 7px;
  width: 100%;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-md);
  padding: 8px 12px;
  color: var(--text1); font-weight: 700; font-size: 0.82rem;
  text-align: left; overflow: hidden;
  box-shadow: var(--sh-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.chapter-nav-btn:hover { border-color: var(--accent); box-shadow: var(--sh-md); }
.nav-compass-ico { width: 14px; height: 14px; color: var(--gold); flex-shrink: 0; }
.chapter-nav-btn > span:nth-child(2) {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.verse-badge {
  background: var(--gold-g); color: #fff;
  font-size: 0.68rem; font-weight: 800;
  padding: 2px 8px; border-radius: 20px; flex-shrink: 0;
}
.nav-chevron-ico { width: 13px; height: 13px; color: var(--text3); flex-shrink: 0; }

/* ─── SHLOKA STAGE ─── */
.shloka-stage {
  flex: 1; display: flex; flex-direction: column;
  touch-action: pan-y;
}

/* ─── SHLOKA CARD ─── */
.shloka-card {
  position: relative; overflow: hidden;
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px;
  box-shadow: var(--sh-md);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  transition: transform 0.16s cubic-bezier(0.2,0.9,0.3,1), opacity 0.16s;
  flex-shrink: 0;
}

/* Card animations */
.shloka-card.slide-left     { animation: slideOutLeft  0.15s forwards; }
.shloka-card.slide-right    { animation: slideOutRight 0.15s forwards; }
.shloka-card.slide-in-right { animation: slideInRight  0.18s cubic-bezier(0.16,1,0.3,1); }
.shloka-card.slide-in-left  { animation: slideInLeft   0.18s cubic-bezier(0.16,1,0.3,1); }
@keyframes slideOutLeft  { to { transform: translateX(-40px); opacity: 0; } }
@keyframes slideOutRight { to { transform: translateX(40px);  opacity: 0; } }
@keyframes slideInRight  { from { transform: translateX(40px);  opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes slideInLeft   { from { transform: translateX(-40px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.card-watermark {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 200px; height: 200px; opacity: 0.04;
  pointer-events: none; color: var(--gold);
}

/* Card Meta Row: Speaker + Actions */
.card-meta-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.speaker-tag {
  display: inline-flex; align-items: center; gap: 4px;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--accent); padding: 3px 10px;
  border-radius: 20px; font-weight: 700; font-size: 0.72rem;
  font-family: var(--font-sa); white-space: nowrap; max-width: 65%;
  overflow: hidden; text-overflow: ellipsis;
}
.speaker-ico { width: 11px; height: 11px; flex-shrink: 0; }
.card-actions { display: flex; align-items: center; gap: 6px; }
.card-action-btn {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text2); display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.card-action-btn:hover { background: var(--surface); color: var(--accent); }
.card-action-btn svg { width: 13px; height: 13px; }
.card-action-btn.bookmarked { background: rgba(245,158,11,0.18); color: var(--gold); border-color: var(--gold); }

/* Sanskrit Block */
.sanskrit-block {
  text-align: center;
  background: var(--bg2); border: 1.5px solid var(--border);
  border-radius: var(--r-md); padding: 16px 12px 10px;
  margin-bottom: 10px;
}
.sanskrit-text {
  font-family: var(--font-sa),'Noto Serif Devanagari',serif;
  font-size: 1.28rem; font-weight: 700; line-height: 1.85;
  color: var(--skt); letter-spacing: 0.5px;
  white-space: pre-line; user-select: text; margin-bottom: 8px;
}
.verse-tags-row {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; padding-top: 8px; border-top: 1px dashed var(--border);
  flex-wrap: wrap;
}
.meter-tag {
  font-size: 0.72rem; font-weight: 600; color: var(--text3);
  background: var(--surface); border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 8px;
}
.swipe-hint {
  font-size: 0.7rem; font-weight: 600; color: var(--gold);
  display: inline-flex; align-items: center; gap: 4px;
}
.swipe-hint svg { width: 11px; height: 11px; }

/* Transliteration */
.translit-block {
  margin-bottom: 8px;
  padding: 7px 10px;
  background: var(--bg2); border-radius: var(--r-sm);
  border-left: 3px solid var(--teal);
  font-style: italic; color: var(--text2);
  font-size: 0.78rem; line-height: 1.45; white-space: pre-line;
}

/* Translation */
.translation-block { margin-bottom: 2px; }
.translation-label {
  display: flex; align-items: center; gap: 5px;
  font-size: 0.72rem; font-weight: 700; color: var(--gold);
  text-transform: uppercase; letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.translation-label svg { width: 11px; height: 11px; }
.translation-text {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 9px 11px;
  font-size: 0.88rem; line-height: 1.55; color: var(--text1); font-weight: 500;
  user-select: text;
}

/* Card Footer Navigation */
.card-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin-top: 10px; padding-top: 8px;
  border-top: 1px dashed var(--border);
}
.nav-btn {
  display: flex; align-items: center; gap: 4px;
  background: var(--bg2); border: 1px solid var(--border);
  color: var(--text1); padding: 6px 13px;
  border-radius: var(--r-sm); font-weight: 600; font-size: 0.78rem;
  transition: all 0.2s;
}
.nav-btn:hover { background: var(--gold-g); color: #fff; border-color: transparent; }
.nav-btn svg { width: 13px; height: 13px; }
.recite-btn {
  display: flex; align-items: center; gap: 5px;
  background: var(--teal-g); color: #fff;
  border: none; padding: 6px 14px;
  border-radius: var(--r-sm); font-weight: 700; font-size: 0.78rem;
  transition: opacity 0.2s; flex: 1; justify-content: center;
}
.recite-btn:hover { opacity: 0.88; }
.recite-btn.playing { background: linear-gradient(135deg,#ef4444,#dc2626); }
.recite-btn svg { width: 13px; height: 13px; }

/* ─── DETAIL ACCORDIONS ─── */
.details-strip { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.detail-accordion {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); overflow: hidden;
}
.detail-acc-btn {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  padding: 8px 10px; background: transparent; border: none;
  color: var(--text1); font-weight: 600; font-size: 0.76rem;
}
.detail-acc-btn > span { display: flex; align-items: center; gap: 5px; }
.detail-acc-btn > span svg { width: 12px; height: 12px; color: var(--gold); }
.acc-chevron { width: 12px; height: 12px; color: var(--text3); transition: transform 0.2s; }
.detail-accordion.open .acc-chevron { transform: rotate(180deg); }
.detail-acc-body {
  display: none; padding: 8px 11px;
  border-top: 1px solid var(--border);
  font-size: 0.78rem; line-height: 1.5; color: var(--text2);
  background: var(--bg2);
}
.detail-accordion.open .detail-acc-body { display: block; }

/* ─── VIEW HEADER (Chapters / Guidance / Bookmarks) ─── */
.view-header { margin-bottom: 12px; flex-shrink: 0; }
.view-title {
  font-family: var(--font-hd); font-size: 1.2rem; font-weight: 800;
  background: var(--gold-g); -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  line-height: 1.2;
}
.view-subtitle { font-size: 0.74rem; color: var(--text3); margin-top: 2px; display: block; }

/* ─── CHAPTERS GRID ─── */
.chapters-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
}
.chapter-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px;
  cursor: pointer; display: flex; flex-direction: column; gap: 5px;
  box-shadow: var(--sh-sm); transition: all 0.2s;
}
.chapter-card:hover { box-shadow: var(--sh-md); border-color: var(--accent); transform: translateY(-1px); }
.chapter-card-top {
  display: flex; align-items: center; justify-content: space-between;
}
.chapter-number-pill {
  background: var(--gold-g); color: #fff;
  font-weight: 800; font-size: 0.68rem;
  padding: 2px 7px; border-radius: 10px;
}
.chapter-verse-pill { font-size: 0.68rem; color: var(--text3); font-weight: 600; }
.chapter-title-sanskrit { font-family: var(--font-sa); font-size: 0.95rem; color: var(--skt); font-weight: 700; }
.chapter-title-eng { font-family: var(--font-hd); font-size: 0.76rem; font-weight: 700; color: var(--text1); }
.chapter-desc { font-size: 0.72rem; color: var(--text2); line-height: 1.4; }

/* ─── GUIDANCE GRID ─── */
.guidance-grid { display: flex; flex-direction: column; gap: 8px; }
.guidance-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 12px;
  cursor: pointer; display: flex; flex-direction: column; gap: 6px;
  box-shadow: var(--sh-sm); transition: all 0.2s;
}
.guidance-card:hover { box-shadow: var(--sh-md); border-color: var(--accent); }
.guidance-header { display: flex; align-items: center; gap: 8px; }
.guidance-icon-box { width: 32px; height: 32px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0; }
.guidance-header-text h3 { font-size: 0.86rem; font-weight: 700; }
.guidance-problem { font-size: 0.75rem; color: var(--text2); background: var(--bg2); padding: 6px 9px; border-radius: var(--r-sm); border-left: 2.5px solid var(--accent); }
.guidance-solution { font-size: 0.76rem; font-weight: 500; color: var(--text1); }
.guidance-shlokas-list { display: flex; flex-direction: column; gap: 3px; }
.guidance-shloka-link { display: flex; align-items: center; justify-content: space-between; background: var(--bg2); border: 1px solid var(--border); padding: 5px 9px; border-radius: var(--r-sm); font-size: 0.73rem; font-weight: 600; cursor: pointer; color: var(--text1); }
.guidance-shloka-link:hover { background: rgba(234,88,12,0.1); color: var(--accent); }

/* ─── BOOKMARKS ─── */
.bookmarks-list { display: flex; flex-direction: column; gap: 8px; }
.empty-state-box {
  text-align: center; padding: 40px 20px;
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--r-lg); color: var(--text3);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
}
.empty-state-box svg { width: 32px; height: 32px; color: var(--gold); }

/* ─── BOTTOM NAVIGATION ─── */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 600px;
  display: flex; align-items: stretch;
  background: var(--surface);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 0 6px calc(env(safe-area-inset-bottom,0px) + 4px);
  z-index: 150; box-shadow: 0 -4px 20px rgba(0,0,0,0.12);
  min-height: var(--bn);
}
.bnav-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px; background: transparent; border: none;
  color: var(--text3); font-size: 0.62rem; font-weight: 600;
  padding: 6px 4px; border-radius: var(--r-sm);
  transition: color 0.2s;
  cursor: pointer;
}
.bnav-btn * { pointer-events: none; }
.bnav-icon svg { width: 18px; height: 18px; }
.bnav-btn.active { color: var(--accent); }
.bnav-btn.active .bnav-icon svg { filter: drop-shadow(0 0 4px var(--accent)); }
.bnav-label { white-space: nowrap; font-size: 0.6rem; }

/* ─── MODAL OVERLAY ─── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(10px);
  z-index: 200; display: none;
  align-items: flex-end; justify-content: center;
  padding: 0;
}
.modal-overlay.open { display: flex; }

/* ─── MATRIX MODAL (bottom sheet style) ─── */
.matrix-modal {
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  width: 100%; max-width: 600px;
  max-height: 80vh;
  display: flex; flex-direction: column;
  box-shadow: var(--sh-lg);
  overflow: hidden;
  animation: sheetUp 0.25s cubic-bezier(0.16,1,0.3,1);
}
@keyframes sheetUp {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
.matrix-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
  flex-shrink: 0;
}
.matrix-title {
  display: flex; align-items: center; gap: 7px;
  font-family: var(--font-hd); font-size: 0.95rem; font-weight: 700; color: var(--gold);
}
.matrix-title svg { width: 16px; height: 16px; }
.modal-close {
  background: transparent; border: none; color: var(--text3);
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
}
.modal-close:hover { background: var(--bg2); color: var(--text1); }
.modal-close svg { width: 16px; height: 16px; }

.matrix-body {
  padding: 12px; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
.matrix-section { display: flex; flex-direction: column; gap: 6px; }
.matrix-section-label {
  font-size: 0.72rem; font-weight: 700;
  color: var(--text3); text-transform: uppercase; letter-spacing: 0.5px;
}
.chapters-chip-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; }
.chapter-chip {
  padding: 6px 3px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text1); font-weight: 700; font-size: 0.8rem;
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.chapter-chip:hover { border-color: var(--accent); color: var(--accent); }
.chapter-chip.selected { background: var(--accent); color: #fff; border-color: var(--accent2); }

.verse-chips-grid {
  display: grid; grid-template-columns: repeat(8,1fr);
  gap: 4px; max-height: 150px; overflow-y: auto; padding: 2px;
}
.verse-chip {
  padding: 5px 2px; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--bg2);
  color: var(--text1); font-size: 0.72rem; font-weight: 600;
  cursor: pointer; text-align: center; transition: all 0.15s;
}
.verse-chip:hover { border-color: var(--gold); color: var(--gold); }
.verse-chip.selected { background: var(--gold-g); color: #fff; border-color: transparent; }

/* ─── PADACHHEDA WORD GRID ─── */
.padachheda-grid {
  display: grid; grid-template-columns: repeat(2,1fr);
  gap: 5px;
}
.padachheda-item {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 6px 8px;
}
.pada-word { font-family: var(--font-sa); font-size: 0.82rem; color: var(--skt); font-weight: 700; }
.pada-meaning { font-size: 0.7rem; color: var(--text2); }

/* ─── DESKTOP NAV (hidden on mobile, available on wider screens) ─── */
@media (min-width: 600px) {
  body { overflow: unset; }
  .app-shell {
    height: auto; min-height: 100vh;
    border-left: 1px solid var(--border);
    border-right: 1px solid var(--border);
  }
  .app-main { overflow: visible; }
  .app-view {
    position: static; display: none; overflow: visible;
  }
  .app-view.active { display: flex; }
  .bottom-nav { position: fixed; }

  .chapters-grid { grid-template-columns: repeat(3,1fr); }
  .verse-chips-grid { grid-template-columns: repeat(10,1fr); }
}

/* ─── SMOOTH SCROLL INSIDE VIEWS ─── */
.app-view::-webkit-scrollbar { width: 3px; }
.app-view::-webkit-scrollbar-track { background: transparent; }
.app-view::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

/* ─── ADDITIONAL POLISH ─── */

/* Ensure shloka card doesn't overflow on small screens */
@media (max-width: 390px) {
  .sanskrit-text { font-size: 1.15rem; line-height: 1.75; }
  .translation-text { font-size: 0.82rem; }
  .translit-block { font-size: 0.74rem; }
}

/* Prevent the bottom nav from overlapping content */
@media (max-width: 599px) {
  .app-view { 
    padding-bottom: calc(var(--bn) + env(safe-area-inset-bottom, 0px) + 12px); 
  }
}

/* Sanskrit font rendering enhancement */
.sanskrit-text {
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Swipe hint should not overflow */
.swipe-hint {
  flex-shrink: 0;
  white-space: nowrap;
}
.verse-tags-row {
  overflow: hidden;
}

/* Bottom nav active indicator bar */
.bnav-btn.active::before {
  content: '';
  position: absolute;
  top: -1px; left: 20%; right: 20%; height: 2px;
  background: var(--accent);
  border-radius: 0 0 2px 2px;
}
.bnav-btn { position: relative; }

/* Chapter card active state for touch */
.chapter-card:active, .guidance-card:active { 
  transform: scale(0.98); opacity: 0.9; 
}

/* Smooth detail accordion animation */
.detail-acc-body {
  transition: none;
  overflow: hidden;
}
.detail-accordion.open .detail-acc-body {
  animation: accordionOpen 0.18s ease-out;
}
@keyframes accordionOpen {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
