/* ==========================================================================
   Modern Academic Website Theme — Debadeepta Dey
   Zero-dependency, responsive, dark/light-mode stylesheet
   ========================================================================== */

:root {
  --bg-primary: #ffffff;
  --bg-secondary: #f8fafc;
  --bg-elevated: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-nav: rgba(255, 255, 255, 0.85);
  --text-primary: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: #eff6ff;
  --accent-border: #bfdbfe;
  --badge-bg: #f1f5f9;
  --badge-text: #334155;
  --venue-bg: #eef2ff;
  --venue-text: #3730a3;
  --venue-border: #c7d2fe;
  --shadow-sm: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.07), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -6px rgba(15, 23, 42, 0.12), 0 4px 10px -2px rgba(15, 23, 42, 0.06);
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Newsreader', Georgia, Cambria, "Times New Roman", Times, serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --container-max: 1080px;
  --nav-height: 64px;
}

[data-theme="dark"] {
  --bg-primary: #0b0f19;
  --bg-secondary: #111827;
  --bg-elevated: #161f33;
  --bg-subtle: #1e293b;
  --bg-nav: rgba(11, 15, 25, 0.85);
  --text-primary: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --border-color: #1e293b;
  --border-hover: #334155;
  --accent: #60a5fa;
  --accent-hover: #93c5fd;
  --accent-subtle: rgba(59, 130, 246, 0.12);
  --accent-border: rgba(96, 165, 250, 0.3);
  --badge-bg: #1e293b;
  --badge-text: #cbd5e1;
  --venue-bg: rgba(99, 102, 241, 0.15);
  --venue-text: #a5b4fc;
  --venue-border: rgba(129, 140, 248, 0.3);
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 12px 28px -6px rgba(0, 0, 0, 0.5);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 20px);
  font-size: 16px;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.2s ease, color 0.2s ease;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.15s ease;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
}

img {
  max-width: 100%;
  height: auto;
}

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ==========================================================================
   Sticky Header & Navigation
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-height);
  background: var(--bg-nav);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.site-brand {
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  text-decoration: none;
  white-space: nowrap;
}

.site-brand:hover {
  color: var(--accent);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-links a {
  display: inline-block;
  padding: 0.45rem 0.8rem;
  font-size: 0.925rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: color 0.15s ease, background-color 0.15s ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background-color: var(--accent-subtle);
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 36px;
  padding: 0 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.icon-btn:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
  background: var(--bg-subtle);
}

.icon-btn kbd {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.mobile-menu-toggle {
  display: none;
}

@media (max-width: 768px) {
  .mobile-menu-toggle {
    display: inline-flex;
  }
  .icon-btn kbd {
    display: none;
  }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    background: var(--bg-elevated);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1.5rem;
    box-shadow: var(--shadow-md);
  }
  .nav-links.open {
    display: flex;
  }
  .nav-links a {
    padding: 0.65rem 0.75rem;
  }
}

/* ==========================================================================
   Homepage Sections
   ========================================================================== */

.home-section {
  padding: 4rem 0;
  border-bottom: 1px solid var(--border-color);
}

.home-section:nth-of-type(even) {
  background-color: var(--bg-secondary);
}

.home-section:last-of-type {
  border-bottom: none;
}

.section-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3rem;
  align-items: start;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.5rem 0;
  color: var(--text-primary);
}

.section-header p {
  margin: 0;
  font-size: 0.925rem;
  color: var(--text-muted);
}

@media (max-width: 860px) {
  .home-section {
    padding: 3rem 0;
  }
  .section-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   Hero / About Section
   ========================================================================== */

.about-section {
  padding: 4.5rem 0 4rem;
}

.about-grid {
  display: grid;
  grid-template-columns: 290px 1fr;
  gap: 3.5rem;
  align-items: start;
}

.profile-card {
  text-align: center;
  position: sticky;
  top: calc(var(--nav-height) + 2rem);
}

.avatar-wrapper {
  width: 200px;
  height: 200px;
  margin: 0 auto 1.25rem;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--border-color);
  box-shadow: var(--shadow-md);
}

.avatar-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-name {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 0.35rem;
  color: var(--text-primary);
}

.profile-role {
  font-size: 0.98rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin: 0 0 0.25rem;
}

.profile-org {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 1.25rem;
}

.social-links {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  font-size: 1.1rem;
  text-decoration: none;
  transition: all 0.15s ease;
}

.social-links a:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
  transform: translateY(-2px);
  text-decoration: none;
}

.bio-heading {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 0 0 1rem;
  color: var(--text-primary);
}

.bio-content {
  font-size: 1.02rem;
  color: var(--text-secondary);
  line-height: 1.72;
}

.bio-content p {
  margin: 0 0 1rem;
}

.bio-content ul {
  margin: 0.5rem 0 1.25rem;
  padding-left: 1.35rem;
}

.bio-content li {
  margin-bottom: 0.55rem;
}

.bio-content li p {
  margin: 0;
}

.bio-content a {
  font-weight: 500;
}

.about-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 2rem;
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--border-color);
}

.about-meta-col h3 {
  font-size: 1.05rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin: 0 0 0.9rem;
}

.interests-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  list-style: none;
  padding: 0;
  margin: 0;
}

.interests-list li {
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--accent-subtle);
  color: var(--accent);
  border: 1px solid var(--accent-border);
}

.edu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.edu-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.edu-icon {
  color: var(--accent);
  margin-top: 0.2rem;
  font-size: 1rem;
}

.edu-course {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 0;
}

.edu-inst {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin: 0.1rem 0 0;
}

@media (max-width: 860px) {
  .about-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .profile-card {
    position: static;
  }
  .about-meta-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   Experience Timeline
   ========================================================================== */

.timeline {
  position: relative;
  padding-left: 1.75rem;
  border-left: 2px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.timeline-item {
  position: relative;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.35rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.timeline-item:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.timeline-dot {
  position: absolute;
  left: calc(-1.75rem - 7px);
  top: 1.4rem;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 2.5px solid var(--text-muted);
}

.timeline-item.current .timeline-dot {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-subtle);
}

.timeline-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.timeline-role {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.timeline-company {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.15rem 0 0;
}

.timeline-meta {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ==========================================================================
   News Feed
   ========================================================================== */

.news-container {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
  max-height: 440px;
  overflow-y: auto;
  box-shadow: var(--shadow-sm);
  transition: max-height 0.3s ease;
}

.news-container.expanded {
  max-height: none;
}

.news-container ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-container li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border-color);
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.news-container li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.news-container li:first-child {
  padding-top: 0;
}

.news-date-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  background: var(--badge-bg);
  color: var(--text-primary);
  margin-right: 0.5rem;
}

.news-toggle-wrapper {
  margin-top: 0.75rem;
  text-align: right;
}

/* ==========================================================================
   Interns / People Grid
   ========================================================================== */

.interns-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 0.9rem;
}

.intern-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 0.95rem 1.15rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
}

a.intern-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
}

.intern-name {
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
}

a.intern-card:hover .intern-name {
  color: var(--accent);
}

.intern-ext-icon {
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.65;
  transition: opacity 0.15s ease, transform 0.15s ease;
}

a.intern-card:hover .intern-ext-icon {
  opacity: 1;
  color: var(--accent);
  transform: translate(1px, -1px);
}

.intern-role {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin: 0;
}

/* ==========================================================================
   Publications (Featured & All)
   ========================================================================== */

.featured-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.pub-card-featured {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pub-card-featured:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-md);
}

.pub-banner-link {
  display: block;
  background: #ffffff;
  border-bottom: 1px solid var(--border-color);
  max-height: 280px;
  overflow: hidden;
  text-align: center;
}

.pub-banner-link img {
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  padding: 0.75rem;
  transition: transform 0.25s ease;
}

.pub-card-featured:hover .pub-banner-link img {
  transform: scale(1.015);
}

.pub-card-body {
  padding: 1.35rem 1.5rem;
}

.pub-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.55rem;
}

.venue-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--venue-bg);
  color: var(--venue-text);
  border: 1px solid var(--venue-border);
}

.pub-date {
  font-size: 0.82rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
}

.pub-title {
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.4;
  margin: 0 0 0.45rem;
}

.pub-title a {
  color: var(--text-primary);
  text-decoration: none;
}

.pub-title a:hover {
  color: var(--accent);
}

.pub-authors {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin: 0 0 0.75rem;
  line-height: 1.5;
}

.pub-author-self {
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: underline;
  text-decoration-color: var(--accent);
  text-underline-offset: 3px;
}

.pub-abstract-preview {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-abstract-preview.expanded {
  display: block;
  -webkit-line-clamp: unset;
}

.pub-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.btn-pub {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.32rem 0.72rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s ease;
}

.btn-pub:hover {
  border-color: var(--accent);
  background: var(--accent-subtle);
  color: var(--accent);
  text-decoration: none;
}

.btn-pub-primary {
  background: var(--accent-subtle);
  color: var(--accent);
  border-color: var(--accent-border);
}

.btn-pub-primary:hover {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

/* Filter Bar for All Publications */
.pub-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
  background: var(--bg-elevated);
  padding: 0.85rem 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.pub-search-input-wrap {
  position: relative;
  flex: 1 1 240px;
}

.pub-search-input-wrap i {
  position: absolute;
  left: 0.8rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.85rem;
}

.pub-search-input {
  width: 100%;
  padding: 0.48rem 0.75rem 0.48rem 2.2rem;
  font-size: 0.9rem;
  font-family: var(--font-sans);
  color: var(--text-primary);
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  outline: none;
  transition: border-color 0.15s ease;
}

.pub-search-input:focus {
  border-color: var(--accent);
}

.pub-year-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.year-pill {
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 600;
  font-family: var(--font-sans);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
}

.year-pill:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.year-pill.active {
  background: var(--accent);
  color: #ffffff;
  border-color: var(--accent);
}

.pub-compact-list {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.pub-item-compact {
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.05rem 1.25rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.pub-item-compact:hover {
  border-color: var(--border-hover);
  box-shadow: var(--shadow-sm);
}

.pub-item-compact .pub-title {
  font-size: 1.02rem;
  margin-bottom: 0.3rem;
}

.pub-item-compact .pub-authors {
  font-size: 0.88rem;
  margin-bottom: 0.55rem;
}

.pub-abstract-collapse {
  display: none;
  margin: 0.65rem 0;
  padding: 0.75rem 0.95rem;
  background: var(--bg-subtle);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.pub-abstract-collapse.open {
  display: block;
}

/* ==========================================================================
   Contact Section & Footer
   ========================================================================== */

.contact-cards {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.contact-card {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1.25rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-weight: 500;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
  transition: all 0.15s ease;
}

.contact-card:hover {
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  text-decoration: none;
}

.contact-card i {
  font-size: 1.2rem;
  color: var(--accent);
}

.site-footer {
  padding: 2.5rem 0;
  border-top: 1px solid var(--border-color);
  color: var(--text-muted);
  font-size: 0.875rem;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* ==========================================================================
   Single Page / Publication Detail View
   ========================================================================== */

.single-article {
  max-width: 820px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.back-link:hover {
  color: var(--accent);
  text-decoration: none;
}

.single-title {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.025em;
  margin: 0.5rem 0 1rem;
}

.single-featured-img {
  margin: 1.75rem 0;
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  text-align: center;
}

.single-section-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 2rem 0 0.6rem;
}

.bibtex-block {
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ==========================================================================
   Modals (BibTeX Citation & Instant Search)
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
}

.modal-backdrop.open {
  display: flex;
}

.modal-dialog {
  width: 100%;
  max-width: 680px;
  background: var(--bg-elevated);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: modalFadeIn 0.15s ease-out;
}

@keyframes modalFadeIn {
  from { opacity: 0; transform: translateY(8px) scale(0.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.modal-body {
  padding: 1.25rem;
  max-height: 65vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  padding: 0.85rem 1.25rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-secondary);
}

.search-results-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.search-result-item {
  display: block;
  padding: 0.75rem 0.9rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  text-decoration: none;
  transition: border-color 0.15s ease;
}

.search-result-item:hover {
  border-color: var(--accent);
  text-decoration: none;
}

.search-result-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-primary);
  margin: 0 0 0.2rem;
}

.search-result-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin: 0;
}
