/* ============ RESET & BASE ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ TOKENS ============ */
:root {
  --bg: #FAFBFC;
  --surface: #FFFFFF;
  --surface-hover: #F1F5F9;
  --sidebar-bg: #0B1220;
  --sidebar-bg-gradient: linear-gradient(180deg, #0B1220 0%, #0F172A 100%);
  --sidebar-item-hover: rgba(255,255,255,0.05);
  --sidebar-item-active: rgba(6,182,212,0.12);
  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #94A3B8;
  --text-sidebar: #CBD5E1;
  --text-sidebar-muted: #64748B;
  --border: #E2E8F0;
  --border-subtle: #F1F5F9;
  --accent: #0891B2;
  --accent-glow: #06B6D4;
  --accent-soft: rgba(6,182,212,0.08);
  --warm: #F59E0B;
  --warm-soft: #FEF3C7;
  --success: #10B981;
  --success-soft: #D1FAE5;
  --danger: #EF4444;
  --danger-soft: #FEE2E2;
  --info: #3B82F6;
  --info-soft: #DBEAFE;
  --purple: #8B5CF6;
  --purple-soft: #EDE9FE;
  --code-bg: #0F172A;
  --code-text: #E2E8F0;

  --font-display: 'Poppins', 'Montserrat', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --font-bangla: 'Inter', 'Noto Sans Bengali', system-ui, sans-serif;
  --font-bangla-display: 'Hind Siliguri', system-ui, sans-serif;

  --sidebar-width: 300px;
  --content-max: 820px;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(15,23,42,0.04);
  --shadow: 0 4px 12px rgba(15,23,42,0.06);
  --shadow-lg: 0 20px 40px rgba(15,23,42,0.1);
}

/* ============ LAYOUT ============ */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg-gradient);
  color: var(--text-sidebar);
  height: 100vh;
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-header {
  padding: 22px 24px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  overflow: hidden;
}
.sidebar-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(6,182,212,0.15) 0%, transparent 40%),
    radial-gradient(circle at 15% 85%, rgba(139,92,246,0.08) 0%, transparent 50%);
  pointer-events: none;
}

.logo { display: flex; align-items: center; gap: 10px; position: relative; z-index: 1; text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: 8px;
  background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%);
  display: grid; place-items: center;
  box-shadow: 0 0 20px rgba(6,182,212,0.4);
  flex-shrink: 0;
}
.logo-mark svg { width: 20px; height: 20px; color: #fff; }
.logo-text { display: flex; flex-direction: column; line-height: 1.1; }
.logo-title { font-family: var(--font-display); font-weight: 700; font-size: 15px; letter-spacing: -0.01em; color: #fff; }
.logo-sub { font-size: 11px; color: var(--text-sidebar-muted); letter-spacing: 0.02em; margin-top: 2px; }

.search { padding: 14px 20px; position: relative; }
.search input {
  width: 100%;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.08);
  color: var(--text-sidebar);
  padding: 9px 12px 9px 34px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 13px;
  outline: none;
  transition: all 0.2s;
}
.search input::placeholder { color: var(--text-sidebar-muted); }
.search input:focus {
  background: rgba(255,255,255,0.06);
  border-color: rgba(6,182,212,0.4);
  box-shadow: 0 0 0 3px rgba(6,182,212,0.1);
}
.search-icon { position: absolute; left: 32px; top: 50%; transform: translateY(-50%); color: var(--text-sidebar-muted); pointer-events: none; }

.nav { flex: 1; overflow-y: auto; padding: 8px 12px 24px; }
.nav::-webkit-scrollbar { width: 4px; }
.nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }
.nav::-webkit-scrollbar-track { background: transparent; }

.nav-chapter { margin-bottom: 4px; }
.nav-chapter-header {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; cursor: pointer; border-radius: 6px;
  color: var(--text-sidebar-muted);
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  transition: color 0.15s; user-select: none;
}
.nav-chapter-header:hover { color: var(--text-sidebar); }
.nav-chapter-num { font-family: var(--font-mono); font-size: 10px; color: var(--accent-glow); opacity: 0.7; }
.nav-chapter-chevron { margin-left: auto; transition: transform 0.2s; opacity: 0.5; }
.nav-chapter.collapsed .nav-chapter-chevron { transform: rotate(-90deg); }
.nav-chapter.collapsed .nav-topics { display: none; }

.nav-topics { padding: 2px 0 8px; }
.nav-item {
  display: block;
  padding: 7px 12px 7px 32px;
  color: var(--text-sidebar);
  text-decoration: none;
  font-size: 13.5px;
  border-radius: 6px;
  transition: all 0.15s;
  position: relative;
  margin: 1px 0;
}
.nav-item:hover { background: var(--sidebar-item-hover); color: #fff; }
.nav-item.active { background: var(--sidebar-item-active); color: var(--accent-glow); font-weight: 500; }
.nav-item.active::before {
  content: '';
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent-glow);
  box-shadow: 0 0 10px var(--accent-glow);
}
.nav-item.visited::after {
  content: '✓';
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  color: var(--success);
  font-size: 10px;
  opacity: 0.7;
}

.sidebar-footer {
  padding: 14px 20px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: flex; align-items: center; gap: 12px;
  font-size: 11px; color: var(--text-sidebar-muted);
}
.progress-ring { position: relative; width: 32px; height: 32px; flex-shrink: 0; }
.progress-ring svg { transform: rotate(-90deg); }
.progress-ring circle { fill: none; stroke-width: 3; }
.progress-bg { stroke: rgba(255,255,255,0.08); }
.progress-fg {
  stroke: var(--accent-glow);
  stroke-dasharray: 87.96;
  stroke-dashoffset: 87.96;
  transition: stroke-dashoffset 0.5s ease;
  filter: drop-shadow(0 0 4px rgba(6,182,212,0.6));
}
.progress-text {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-family: var(--font-mono); font-size: 9px; font-weight: 600; color: var(--accent-glow);
}

/* ---------- MAIN CONTENT ---------- */
.main { flex: 1; min-width: 0; padding: 60px 60px 120px; }
.content { max-width: var(--content-max); margin: 0 auto; }

.breadcrumb {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; color: var(--text-muted);
  margin-bottom: 24px; font-family: var(--font-mono); letter-spacing: 0.02em;
}
.breadcrumb a { color: var(--text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { opacity: 0.5; }
.breadcrumb-current { color: var(--accent); }

.topic-header {
  margin-bottom: 40px; padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}
.topic-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); background: var(--accent-soft);
  padding: 5px 12px; border-radius: 999px;
  margin-bottom: 16px; font-weight: 500; letter-spacing: 0.02em;
}
h1.topic-title {
  font-family: var(--font-display); font-size: 44px; font-weight: 700;
  line-height: 1.1; letter-spacing: -0.02em; color: var(--text-primary);
  margin-bottom: 16px;
}
.topic-lead { font-size: 18px; color: var(--text-secondary); line-height: 1.6; max-width: 720px; }

.content h2 {
  font-family: var(--font-display); font-size: 28px; font-weight: 700;
  letter-spacing: -0.015em; color: var(--text-primary);
  margin: 48px 0 16px; padding-top: 8px; scroll-margin-top: 20px;
}
.content h3 {
  font-family: var(--font-display); font-size: 20px; font-weight: 600;
  letter-spacing: -0.01em; color: var(--text-primary);
  margin: 32px 0 12px;
}
.content h4 {
  font-family: var(--font-body); font-size: 16px; font-weight: 600;
  color: var(--text-primary); margin: 24px 0 10px;
}

.content p { margin: 0 0 16px; color: var(--text-secondary); font-size: 16px; line-height: 1.75; }
.content p strong { color: var(--text-primary); font-weight: 600; }
.content ul, .content ol { margin: 0 0 20px; padding-left: 24px; color: var(--text-secondary); }
.content li { margin-bottom: 8px; line-height: 1.7; }
.content li strong { color: var(--text-primary); }

.content a { color: var(--accent); text-decoration: none; border-bottom: 1px solid transparent; transition: border-color 0.15s; }
.content a:hover { border-bottom-color: var(--accent); }

.content code {
  font-family: var(--font-mono); font-size: 0.88em;
  background: rgba(6,182,212,0.08); color: var(--accent);
  padding: 2px 6px; border-radius: 4px; font-weight: 500;
}
.content pre {
  background: var(--code-bg); color: var(--code-text);
  padding: 18px 22px; border-radius: var(--radius);
  overflow-x: auto; margin: 20px 0;
  font-family: var(--font-mono); font-size: 13.5px; line-height: 1.65;
  box-shadow: var(--shadow);
}
.content pre code { background: transparent; color: inherit; padding: 0; font-size: inherit; }

.callout {
  display: flex; gap: 14px; padding: 18px 20px;
  border-radius: var(--radius); margin: 20px 0;
  border-left: 3px solid; background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.callout-icon { flex-shrink: 0; width: 24px; height: 24px; display: grid; place-items: center; margin-top: 1px; }
.callout-body { flex: 1; min-width: 0; }
.callout-title { font-weight: 600; font-size: 14px; margin-bottom: 6px; letter-spacing: 0.01em; text-transform: uppercase; font-family: var(--font-body); }
.callout p { margin: 0; font-size: 15px; }
.callout p + p { margin-top: 8px; }
.callout ul { margin: 8px 0 0; font-size: 15px; }

.callout.tip { border-left-color: var(--warm); background: var(--warm-soft); }
.callout.tip .callout-title { color: #B45309; }
.callout.tip .callout-icon { color: var(--warm); }
.callout.note { border-left-color: var(--info); background: var(--info-soft); }
.callout.note .callout-title { color: #1E40AF; }
.callout.note .callout-icon { color: var(--info); }
.callout.warning { border-left-color: var(--danger); background: var(--danger-soft); }
.callout.warning .callout-title { color: #991B1B; }
.callout.warning .callout-icon { color: var(--danger); }
.callout.success { border-left-color: var(--success); background: var(--success-soft); }
.callout.success .callout-title { color: #065F46; }
.callout.success .callout-icon { color: var(--success); }
.callout.analogy { border-left-color: var(--purple); background: var(--purple-soft); }
.callout.analogy .callout-title { color: #5B21B6; }
.callout.analogy .callout-icon { color: var(--purple); }

.content table {
  width: 100%; border-collapse: collapse; margin: 20px 0;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
  font-size: 14.5px; box-shadow: var(--shadow-sm);
}
.content th {
  background: #F8FAFC; color: var(--text-primary); font-weight: 600;
  text-align: left; padding: 12px 16px; font-size: 13px;
  text-transform: uppercase; letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
}
.content td { padding: 12px 16px; border-bottom: 1px solid var(--border-subtle); color: var(--text-secondary); }
.content tr:last-child td { border-bottom: none; }
.content tr:hover td { background: #F8FAFC; }
.content td code { font-size: 12.5px; }
.table-wrap { overflow-x: auto; margin: 20px 0; }
.table-wrap table { margin: 0; }

.diagram {
  margin: 32px 0; padding: 32px 24px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden;
}
.diagram::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent) 0%, var(--accent-glow) 50%, var(--purple) 100%);
}
.diagram-title {
  font-family: var(--font-display); font-size: 13px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-muted); margin-bottom: 20px; text-align: center;
}
.diagram svg { display: block; margin: 0 auto; max-width: 100%; height: auto; }
.diagram-caption { text-align: center; font-size: 13px; color: var(--text-muted); margin-top: 16px; font-style: italic; }

.term {
  background: linear-gradient(120deg, var(--accent-soft) 0%, var(--accent-soft) 100%);
  padding: 1px 6px; border-radius: 4px; color: var(--accent); font-weight: 500;
}

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px; margin: 24px 0;
}
.concept-card {
  padding: 20px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-sm); transition: all 0.2s;
}
.concept-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: var(--accent-glow); }
.concept-card-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--accent-soft); display: grid; place-items: center;
  color: var(--accent); margin-bottom: 12px;
}
.concept-card h4 { margin: 0 0 6px; font-size: 15px; }
.concept-card p { margin: 0; font-size: 13.5px; color: var(--text-secondary); line-height: 1.5; }

.pagination {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
  margin-top: 64px; padding-top: 32px; border-top: 1px solid var(--border);
}
.page-nav {
  padding: 18px 20px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--surface);
  transition: all 0.2s; text-decoration: none; color: inherit; display: block;
}
.page-nav:hover { border-color: var(--accent-glow); transform: translateY(-2px); box-shadow: var(--shadow); }
.page-nav.next { text-align: right; }
.page-nav-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 4px; }
.page-nav-title { font-family: var(--font-display); font-weight: 600; color: var(--text-primary); font-size: 15px; }

.hero { padding: 32px 0 8px; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 12px;
  color: var(--accent); background: var(--accent-soft);
  padding: 5px 12px; border-radius: 999px;
  margin-bottom: 24px; font-weight: 500;
}
.hero-title {
  font-family: var(--font-display); font-size: 56px; font-weight: 700;
  line-height: 1.05; letter-spacing: -0.03em; color: var(--text-primary);
  margin-bottom: 20px;
}
.hero-title .accent {
  background: linear-gradient(135deg, var(--accent) 0%, var(--purple) 100%);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero-lead { font-size: 19px; color: var(--text-secondary); line-height: 1.65; max-width: 680px; margin-bottom: 32px; }
.hero-stats {
  display: flex; gap: 40px; padding: 24px 0;
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  margin-bottom: 40px; flex-wrap: wrap;
}
.stat-num { font-family: var(--font-display); font-size: 32px; font-weight: 700; color: var(--accent); letter-spacing: -0.02em; line-height: 1; }
.stat-label { font-size: 12.5px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; margin-top: 6px; font-family: var(--font-mono); }

.path-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px; margin: 32px 0;
}
.path-card {
  padding: 24px; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  transition: all 0.2s; position: relative; overflow: hidden;
  text-align: left; font-family: inherit; color: inherit;
  width: 100%; text-decoration: none; display: block;
}
.path-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--accent-glow); }
.path-card-num { font-family: var(--font-mono); font-size: 12px; color: var(--accent); font-weight: 600; margin-bottom: 10px; display: block; }
.path-card h3 { font-family: var(--font-display); font-size: 18px; font-weight: 600; margin: 0 0 8px; color: var(--text-primary); }
.path-card p { font-size: 14px; color: var(--text-secondary); margin: 0; line-height: 1.5; }
.path-card-topics { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-subtle); font-size: 12.5px; color: var(--text-muted); }

@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 100; transform: translateX(-100%); transition: transform 0.3s; }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 60px 24px 100px; }
  .hero-title { font-size: 40px; }
  h1.topic-title { font-size: 32px; }
  .mobile-menu-btn { display: flex !important; }
}
.mobile-menu-btn {
  display: none; position: fixed; top: 16px; left: 16px; z-index: 200;
  background: var(--sidebar-bg); color: #fff; border: none;
  padding: 8px; border-radius: 8px; cursor: pointer; box-shadow: var(--shadow);
}

@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.content > * { animation: fadeIn 0.4s ease-out; }

/* SVG diagram helpers */
.node-box { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.node-text { font-family: var(--font-body); font-size: 13px; font-weight: 500; fill: var(--text-primary); }
.node-label { font-family: var(--font-mono); font-size: 10px; fill: var(--text-muted); }
.connector { stroke: var(--accent); stroke-width: 2; fill: none; }
.dashed { stroke-dasharray: 4 4; }

@media (max-width: 480px) {
  .pagination { grid-template-columns: 1fr; }
  .page-nav.next { text-align: left; }
}

@media print {
  .sidebar, .mobile-menu-btn, .pagination { display: none; }
  .main { padding: 20px; }
}

/* ============ BANGLA LANGUAGE ============ */
html[lang="bn"] body,
html[lang="bn"] .content p,
html[lang="bn"] .content li,
html[lang="bn"] .topic-lead,
html[lang="bn"] .hero-lead,
html[lang="bn"] .callout p,
html[lang="bn"] .callout-title,
html[lang="bn"] .nav-item,
html[lang="bn"] .concept-card p,
html[lang="bn"] .path-card p,
html[lang="bn"] td,
html[lang="bn"] th {
  font-family: var(--font-bangla);
}
html[lang="bn"] h1.topic-title,
html[lang="bn"] .hero-title,
html[lang="bn"] .content h2,
html[lang="bn"] .content h3,
html[lang="bn"] .content h4,
html[lang="bn"] .concept-card h4,
html[lang="bn"] .path-card h3,
html[lang="bn"] .page-nav-title {
  font-family: var(--font-bangla-display);
  letter-spacing: 0;
}
/* Bangla runs a little denser — give it more line height */
html[lang="bn"] .content p,
html[lang="bn"] .content li,
html[lang="bn"] .topic-lead,
html[lang="bn"] .hero-lead { line-height: 1.7; }
/* Keep code, mono, and eyebrows in Latin fonts even in Bangla mode */
html[lang="bn"] code,
html[lang="bn"] pre,
html[lang="bn"] .breadcrumb,
html[lang="bn"] .topic-eyebrow,
html[lang="bn"] .nav-chapter-num,
html[lang="bn"] .stat-num,
html[lang="bn"] .stat-label { font-family: var(--font-mono); }
html[lang="bn"] .term { font-family: var(--font-bangla); }

/* ============ LANGUAGE TOGGLE ============ */
.lang-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 999px;
  padding: 3px;
  position: relative;
  z-index: 1;
}
.lang-toggle button {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text-sidebar-muted);
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.18s;
  letter-spacing: 0.02em;
}
.lang-toggle button.active {
  background: linear-gradient(135deg, #06B6D4 0%, #0891B2 100%);
  color: #fff;
  box-shadow: 0 0 12px rgba(6,182,212,0.35);
}
.lang-toggle button:not(.active):hover { color: var(--text-sidebar); }
.lang-toggle button[data-lang="bn"] { font-family: var(--font-bangla); }

.sidebar-langbar {
  padding: 0 20px 14px;
  position: relative;
}

/* ============ SEARCH RESULTS PANEL ============ */
/* Appended to <body> (not the sidebar) so it can overflow past the
   sidebar's fixed 300px width — the sidebar itself clips overflow.
   Styled as an extension of the dark sidebar it grows out of, not a
   generic light dropdown, so it reads as part of the product. */
.search-panel {
  position: fixed;
  z-index: 500;
  background: var(--sidebar-bg-gradient);
  border: 1px solid rgba(6,182,212,0.22);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 60px rgba(2,8,20,0.55), 0 0 0 1px rgba(255,255,255,0.04) inset;
  max-width: calc(100vw - 24px);
  max-height: min(70vh, 560px);
  overflow-y: auto;
  overflow-x: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.98);
  transform-origin: top left;
  transition: opacity 0.18s ease, transform 0.22s cubic-bezier(0.2,0.9,0.3,1.3);
}
.search-panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.search-panel::-webkit-scrollbar { width: 6px; }
.search-panel::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
.search-panel::-webkit-scrollbar-track { background: transparent; }

.sr-summary {
  padding: 11px 16px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-sidebar-muted);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  background: rgba(0,0,0,0.15);
}
.sr-summary strong { color: var(--accent-glow); font-weight: 600; }

.sr-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 16px;
  text-decoration: none;
  color: inherit;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  position: relative;
  transition: background 0.15s;
  opacity: 0;
  animation: srFadeIn 0.35s ease forwards;
  animation-delay: calc(var(--i, 0) * 35ms);
}
.search-panel .sr-item:last-of-type { border-bottom: none; }
@keyframes srFadeIn { from { opacity: 0; transform: translateX(-4px); } to { opacity: 1; transform: translateX(0); } }

.sr-item::before {
  content: '';
  position: absolute;
  left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--accent-glow);
  box-shadow: 0 0 8px var(--accent-glow);
  opacity: 0;
  transition: opacity 0.15s;
}
.sr-item:hover, .sr-item.active { background: rgba(255,255,255,0.05); }
.sr-item:hover::before, .sr-item.active::before { opacity: 1; }

.sr-icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--sidebar-item-active);
  color: var(--accent-glow);
  margin-top: 1px;
  transition: transform 0.15s;
}
.sr-item:hover .sr-icon, .sr-item.active .sr-icon { transform: scale(1.08); }
.sr-icon svg { width: 14px; height: 14px; }

.sr-body { min-width: 0; flex: 1; }
.sr-page {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
}
.sr-page-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-chip {
  flex-shrink: 0;
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  color: var(--accent-glow);
  background: rgba(6,182,212,0.12);
  border: 1px solid rgba(6,182,212,0.25);
  padding: 1px 6px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}
.sr-heading {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent-glow);
  opacity: 0.85;
  margin-bottom: 5px;
}
.sr-snippet {
  font-size: 12.5px;
  color: var(--text-sidebar);
  opacity: 0.8;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.sr-item mark {
  background: rgba(6,182,212,0.3);
  color: #fff;
  padding: 0 2px;
  border-radius: 3px;
  font-weight: 600;
}
.sr-empty {
  padding: 26px 16px;
  font-size: 13px;
  color: var(--text-sidebar-muted);
  text-align: center;
}
.sr-hint {
  padding: 9px 16px;
  font-size: 10.5px;
  color: var(--text-sidebar-muted);
  font-family: var(--font-mono);
  background: rgba(0,0,0,0.15);
  border-top: 1px solid rgba(255,255,255,0.07);
  letter-spacing: 0.02em;
}
html[lang="bn"] .sr-page,
html[lang="bn"] .sr-heading,
html[lang="bn"] .sr-snippet,
html[lang="bn"] .sr-summary { font-family: var(--font-bangla); }

/* In-page jump target from a search result — lives on light .content, so
   this stays a separate, light-theme treatment from the panel's marks. */
mark.search-hit {
  background: rgba(6,182,212,0.35);
  color: inherit;
  box-shadow: 0 0 0 4px rgba(6,182,212,0.18);
  border-radius: 3px;
  transition: background 1.4s ease, box-shadow 1.4s ease;
}
mark.search-hit.search-hit-settled {
  background: rgba(6,182,212,0.16);
  box-shadow: none;
}
