/* ==========================================================================
   TAVR Research WebApp - Responsive, Mobile-First Modern Stylesheet
   ========================================================================== */

:root {
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Light Theme */
  --bg-primary: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-hover: #f1f5f9;
  --bg-surface-secondary: #f8fafc;
  --border-subtle: #e2e8f0;
  --border-strong: #cbd5e1;

  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;

  --primary: #0284c7;
  --primary-hover: #0369a1;
  --primary-subtle: #e0f2fe;
  --primary-text: #0369a1;

  --accent-teal: #0d9488;
  --accent-teal-bg: #ccfbf1;
  --accent-purple: #7c3aed;
  --accent-purple-bg: #ede9fe;
  --accent-amber: #d97706;
  --accent-amber-bg: #fef3c7;
  --accent-rose: #e11d48;
  --accent-rose-bg: #ffe4e6;

  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.07), 0 2px 4px -2px rgb(0 0 0 / 0.05);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.08), 0 4px 6px -4px rgb(0 0 0 / 0.04);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.06);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;

  --header-height: 60px;
}

[data-theme="dark"] {
  --bg-primary: #0b1120;
  --bg-surface: #111827;
  --bg-surface-hover: #1f2937;
  --bg-surface-secondary: #1a2234;
  --border-subtle: #1f293d;
  --border-strong: #374151;

  --text-main: #f9fafb;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --primary: #38bdf8;
  --primary-hover: #0284c7;
  --primary-subtle: rgba(56, 189, 248, 0.12);
  --primary-text: #38bdf8;

  --accent-teal: #2dd4bf;
  --accent-teal-bg: rgba(45, 212, 191, 0.14);
  --accent-purple: #c084fc;
  --accent-purple-bg: rgba(192, 132, 252, 0.14);
  --accent-amber: #fbbf24;
  --accent-amber-bg: rgba(251, 191, 36, 0.14);
  --accent-rose: #fb7185;
  --accent-rose-bg: rgba(251, 113, 133, 0.14);

  --shadow-sm: 0 1px 3px 0 rgb(0 0 0 / 0.3);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5);
  --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.6);
}

/* ==========================================================================
   Global Reset & Box Sizing
   ========================================================================== */

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

html, body {
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

html {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-primary);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg-primary);
  color: var(--text-main);
  transition: background-color 0.2s ease, color 0.2s ease;
}

body.modal-open {
  overflow: hidden;
}

/* ==========================================================================
   App Header (Mobile Responsive)
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background-color: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-subtle);
  width: 100%;
}

[data-theme="dark"] .app-header {
  background-color: rgba(17, 24, 39, 0.9);
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.6rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  min-height: var(--header-height);
  width: 100%;
}

.logo-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--text-main);
  cursor: pointer;
  flex-shrink: 0;
}

.logo-icon-wrapper {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  box-shadow: 0 3px 8px rgba(2, 132, 199, 0.3);
  flex-shrink: 0;
}

.logo-icon-wrapper svg {
  width: 20px;
  height: 20px;
}

.logo-text-group {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.65rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Header Action Controls */
.header-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-shrink: 0;
}

.icon-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  position: relative;
  flex-shrink: 0;
}

.icon-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--border-strong);
}

.icon-btn svg {
  width: 17px;
  height: 17px;
}

.badge-counter {
  position: absolute;
  top: -3px;
  right: -3px;
  background-color: var(--primary);
  color: #ffffff;
  font-size: 0.65rem;
  font-weight: 700;
  min-width: 17px;
  height: 17px;
  line-height: 17px;
  padding: 0 4px;
  border-radius: 9999px;
  text-align: center;
}

.btn-primary-action {
  background: linear-gradient(135deg, var(--primary) 0%, #0369a1 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-full);
  padding: 0.45rem 0.9rem;
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(2, 132, 199, 0.25);
  white-space: nowrap;
}

.btn-primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(2, 132, 199, 0.35);
}

.btn-primary-action svg {
  width: 15px;
  height: 15px;
}

@media (max-width: 480px) {
  .header-container {
    padding: 0.5rem 0.75rem;
  }
  .brand-subtitle {
    display: none;
  }
  .brand-title {
    font-size: 0.95rem;
  }
  .icon-btn {
    width: 34px;
    height: 34px;
  }
  .btn-primary-action {
    padding: 0.4rem 0.75rem;
    font-size: 0.775rem;
  }
}

/* ==========================================================================
   Hero & Search Section
   ========================================================================== */

.hero-section {
  padding: 1.5rem 1rem 1rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

.hero-content {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 1.25rem;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.725rem;
  font-weight: 600;
  background-color: var(--primary-subtle);
  color: var(--primary-text);
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  margin-bottom: 0.65rem;
}

.hero-badge svg {
  width: 13px;
  height: 13px;
}

.hero-title {
  font-size: clamp(1.4rem, 4.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.25;
  margin-bottom: 0.45rem;
  word-break: break-word;
}

.hero-title span {
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: clamp(0.85rem, 2.2vw, 0.95rem);
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Search Box (Full Width & Responsive) */
.search-wrapper {
  position: relative;
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
}

.search-input-group {
  position: relative;
  display: flex;
  align-items: center;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-subtle);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
  padding: 0.35rem 0.6rem 0.35rem 1rem;
  width: 100%;
  transition: all 0.25s ease;
}

.search-input-group:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-subtle);
}

.search-icon {
  color: var(--text-muted);
  width: 18px;
  height: 18px;
  margin-right: 0.5rem;
  flex-shrink: 0;
}

.search-input {
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  color: var(--text-main);
  outline: none;
  font-family: inherit;
}

.search-clear-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.35rem;
  display: none;
  border-radius: 9999px;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.search-clear-btn.active {
  display: flex;
}

/* ==========================================================================
   Filter Chips & Controls Bar
   ========================================================================== */

.filter-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  width: 100%;
}

.category-scroll-container {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  padding: 0.4rem 0 0.65rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  width: 100%;
}

.category-scroll-container::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.filter-chip:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.filter-chip.active {
  background-color: var(--primary);
  color: #ffffff;
  border-color: var(--primary);
  font-weight: 600;
}

.controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.65rem 0;
  margin-top: 0.25rem;
  border-bottom: 1px solid var(--border-subtle);
  gap: 0.5rem;
  flex-wrap: wrap;
  width: 100%;
}

.results-count {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
}

.results-count strong {
  color: var(--text-main);
}

.sort-and-view {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-label {
  font-size: 0.775rem;
  color: var(--text-muted);
  font-weight: 500;
}

.sort-select {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
}

@media (max-width: 480px) {
  .hero-section, .filter-section {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
  .controls-bar {
    flex-direction: column;
    align-items: flex-start;
  }
  .sort-and-view {
    width: 100%;
    justify-content: space-between;
  }
  .sort-select {
    flex: 1;
    max-width: 200px;
  }
}

/* ==========================================================================
   Article Grid & Responsive Cards
   ========================================================================== */

.main-content {
  flex: 1;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
  width: 100%;
}

@media (max-width: 480px) {
  .main-content {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

.articles-grid {
  display: grid;
  grid-template-columns: 100%;
  gap: 1.25rem;
  width: 100%;
}

@media (min-width: 640px) {
  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .articles-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.article-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: var(--shadow-sm);
  position: relative;
  cursor: pointer;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.article-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-md);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
  gap: 0.5rem;
}

.badge-tag {
  font-size: 0.675rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: var(--radius-full);
  display: inline-flex;
  align-items: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.badge-trials {
  background-color: var(--primary-subtle);
  color: var(--primary-text);
}

.badge-outcomes {
  background-color: var(--accent-teal-bg);
  color: var(--accent-teal);
}

.badge-market {
  background-color: var(--accent-purple-bg);
  color: var(--accent-purple);
}

.badge-device {
  background-color: var(--accent-amber-bg);
  color: var(--accent-amber);
}

.badge-safety {
  background-color: var(--accent-rose-bg);
  color: var(--accent-rose);
}

.card-bookmark-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0.3rem;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s ease;
  flex-shrink: 0;
}

.card-bookmark-btn:hover {
  color: var(--accent-rose);
}

.card-bookmark-btn.active {
  color: var(--accent-rose);
}

.card-bookmark-btn.active svg {
  fill: currentColor;
}

.card-title {
  font-size: 1.025rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--text-main);
  margin-bottom: 0.5rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.65rem;
  flex-wrap: wrap;
}

.meta-item {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.meta-item svg {
  width: 13px;
  height: 13px;
}

.card-abstract {
  font-size: 0.825rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.85rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
  overflow-wrap: break-word;
  flex: 1;
}

.card-authors {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 0.85rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 0.65rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: auto;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.citation-badge {
  font-size: 0.725rem;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  background-color: var(--bg-surface-secondary);
  padding: 0.2rem 0.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
}

.read-btn {
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================================================
   Dedicated Full-Page Rendered Article View (No Popup)
   ========================================================================== */

.article-page-view {
  min-height: calc(100vh - var(--header-height));
  background-color: var(--bg-primary);
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow-x: hidden;
}

.article-nav-bar {
  position: sticky;
  top: var(--header-height);
  z-index: 30;
  background-color: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-subtle);
  padding: 0.5rem 0;
  width: 100%;
}

[data-theme="dark"] .article-nav-bar {
  background-color: rgba(17, 24, 39, 0.92);
}

.article-nav-container {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  width: 100%;
}

.back-btn {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-main);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  box-shadow: var(--shadow-sm);
  white-space: nowrap;
}

.back-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

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

.tool-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.65rem;
  font-size: 0.775rem;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.tool-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
}

.tool-btn.active {
  color: var(--accent-rose);
  border-color: var(--accent-rose);
}

.article-content-wrapper {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
  padding: 1.5rem 1rem 4rem;
}

@media (max-width: 480px) {
  .article-nav-container, .article-content-wrapper {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }
}

/* Article Header */
.full-article-header {
  margin-bottom: 1.75rem;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 1.5rem;
  width: 100%;
}

.full-article-title {
  font-size: clamp(1.35rem, 5vw, 2.2rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text-main);
  letter-spacing: -0.025em;
  margin: 0.65rem 0 0.85rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.full-article-authors {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.85rem;
  word-break: break-word;
  overflow-wrap: break-word;
}

.full-article-meta-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

/* Real Links & Citations Toolbar (Mobile Wrapped) */
.real-links-bar {
  display: flex;
  gap: 0.5rem;
  margin: 1.25rem 0;
  flex-wrap: wrap;
  width: 100%;
}

.real-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.775rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  white-space: nowrap;
}

.real-link-pubmed {
  background-color: #205493;
  color: #ffffff;
}

.real-link-pubmed:hover {
  background-color: #112e51;
  color: #ffffff;
}

.real-link-journal {
  background-color: var(--bg-surface);
  border-color: var(--border-strong);
  color: var(--text-main);
}

.real-link-journal:hover {
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--bg-surface-hover);
}

.real-link-gdoc {
  background: linear-gradient(135deg, #0284c7 0%, #0d9488 100%);
  color: #ffffff;
}

@media (max-width: 600px) {
  .real-links-bar {
    flex-direction: column;
    gap: 0.45rem;
  }
  .real-link-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }
}

/* Clinical Metric Cards (Responsive Grid) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 1.25rem 0 1.75rem;
  width: 100%;
}

@media (min-width: 640px) {
  .metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .metrics-grid {
    grid-template-columns: 100%;
  }
}

.metric-card {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.85rem 0.65rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
  min-width: 0;
  overflow: hidden;
}

.metric-card-val {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  line-height: 1.1;
  margin-bottom: 0.2rem;
  word-break: break-word;
}

.metric-card-label {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-card-sub {
  font-size: 0.675rem;
  color: var(--text-secondary);
  margin-top: 0.2rem;
}

/* Structured Abstract Box */
.structured-abstract-card {
  background-color: var(--bg-surface);
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
  margin-bottom: 1.75rem;
  width: 100%;
  overflow-wrap: break-word;
}

.abstract-section-heading {
  font-size: 0.8rem;
  font-weight: 800;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 0.75rem;
  margin-bottom: 0.2rem;
}

.abstract-section-heading:first-child {
  margin-top: 0;
}

.abstract-section-text {
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-secondary);
}

/* Full Clinical Prose Body */
.article-prose {
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--text-main);
  width: 100%;
  word-break: break-word;
  overflow-wrap: break-word;
}

.article-prose h2 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.35rem;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.article-prose p {
  margin-bottom: 1.15rem;
  color: var(--text-secondary);
}

.article-prose ul {
  margin: 0.65rem 0 1.25rem 1.25rem;
  color: var(--text-secondary);
}

.article-prose li {
  margin-bottom: 0.45rem;
  line-height: 1.6;
}

.clinical-highlight-callout {
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.08) 0%, rgba(13, 148, 136, 0.08) 100%);
  border: 1px solid var(--border-subtle);
  border-left: 4px solid var(--accent-teal);
  border-radius: var(--radius-sm);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
  width: 100%;
}

[data-theme="dark"] .clinical-highlight-callout {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.1) 0%, rgba(45, 212, 191, 0.1) 100%);
}

.clinical-highlight-callout h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.clinical-highlight-callout p {
  font-size: 0.85rem;
  line-height: 1.55;
  margin-bottom: 0;
}

/* Embedded Research Document Frame */
.gdoc-fullpage-container {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin: 1.5rem 0;
  width: 100%;
}

.gdoc-iframe-full {
  width: 100%;
  height: 80vh;
  min-height: 520px;
  border: none;
  background-color: #ffffff;
  display: block;
}

@media (max-width: 480px) {
  .gdoc-iframe-full {
    height: 65vh;
    min-height: 400px;
  }
}

/* References Section */
.references-container {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-strong);
  width: 100%;
}

.references-list {
  padding-left: 1.25rem;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.references-list li {
  margin-bottom: 0.65rem;
  line-height: 1.55;
  word-break: break-word;
}

.references-list a {
  color: var(--primary);
  text-decoration: underline;
  word-break: break-all;
}

/* ==========================================================================
   Add Article Modal Form
   ========================================================================== */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.modal-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.modal-sheet {
  background-color: var(--bg-surface);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
}

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

.modal-close-btn {
  background: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.form-group {
  margin-bottom: 0.85rem;
}

.form-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.55rem 0.75rem;
  background-color: var(--bg-surface-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.85rem;
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  background-color: var(--bg-surface);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.75rem;
}

@media (min-width: 480px) {
  .form-row {
    grid-template-columns: 1fr 1fr;
  }
}

.modal-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.65rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  background-color: var(--bg-surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  max-width: 480px;
  margin: 1.5rem auto;
}

.empty-icon {
  width: 44px;
  height: 44px;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.empty-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.empty-text {
  font-size: 0.825rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background-color: #0f172a;
  color: #ffffff;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-full);
  font-size: 0.8rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  box-shadow: var(--shadow-xl);
  z-index: 100;
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease;
  pointer-events: none;
}

[data-theme="dark"] .toast {
  background-color: #ffffff;
  color: #0f172a;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* App Footer */
.app-footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 1.5rem 1rem;
  margin-top: auto;
  font-size: 0.8rem;
  color: var(--text-muted);
  width: 100%;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  text-align: center;
}

@media (min-width: 640px) {
  .footer-container {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

.footer-links {
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
}
/* =========================================================
   TAVR Research — Article Tables
   Responsive, theme-aware clinical data presentation
   ========================================================= */

.article-prose .article-table-wrap {
  width: 100%;
  max-width: 100%;
  margin: 1.5rem 0 2rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--bg-surface);
  box-shadow: var(--shadow-sm);
}

.article-prose .article-data-table {
  width: 100%;
  min-width: 520px;
  border-collapse: separate;
  border-spacing: 0;
  color: var(--text-main);
  font-size: 0.9rem;
  line-height: 1.6;
}

.article-prose .article-data-table th,
.article-prose .article-data-table td {
  padding: 0.85rem 1rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border-subtle);
  overflow-wrap: anywhere;
}

.article-prose .article-data-table thead th {
  background: var(--bg-surface-secondary);
  color: var(--text-main);
  font-weight: 750;
  border-bottom: 2px solid var(--border-strong);
}

.article-prose .article-data-table tbody tr:nth-child(even) {
  background: var(--bg-surface-secondary);
}

.article-prose .article-data-table tbody tr:hover {
  background: var(--bg-surface-hover);
}

.article-prose .article-data-table tbody tr:last-child td {
  border-bottom: 0;
}

.article-prose .article-data-table th:first-child,
.article-prose .article-data-table td:first-child {
  font-weight: 600;
}

.article-prose .article-data-table a {
  color: var(--primary-text);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

@media (max-width: 600px) {
  .article-prose .article-table-wrap {
    margin: 1.1rem 0 1.5rem;
    border-radius: var(--radius-sm);
  }

  .article-prose .article-data-table {
    min-width: 480px;
    font-size: 0.82rem;
  }

  .article-prose .article-data-table th,
  .article-prose .article-data-table td {
    padding: 0.7rem 0.75rem;
  }
}
.article-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border-color, #e2e8f0);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.article-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.92rem;
  line-height: 1.65;
}

.article-table thead {
  background: var(--bg-surface-secondary, #f1f5f9);
}

.article-table th {
  padding: 15px 18px;
  text-align: left;
  font-weight: 750;
  color: var(--text-main, #0f172a);
  border-bottom: 2px solid var(--border-color, #cbd5e1);
}

.article-table td {
  padding: 14px 18px;
  vertical-align: top;
  border-bottom: 1px solid var(--border-color, #e2e8f0);
  color: var(--text-main, #334155);
}

.article-table tbody tr:nth-child(even) {
  background: var(--bg-surface-secondary, #f8fafc);
}

.article-table tbody tr:last-child td {
  border-bottom: none;
}
/* Clinical article tables */
.article-table-wrapper {
  width: 100%;
  overflow-x: auto;
  margin: 1.5rem 0 2rem;
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
}

.article-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
  font-size: 0.9rem;
  line-height: 1.65;
}

.article-table thead {
  background: var(--bg-surface-secondary);
}

.article-table th {
  padding: 14px 16px;
  text-align: left;
  font-weight: 750;
  color: var(--text-main);
  border-bottom: 2px solid var(--border-strong);
}

.article-table td {
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  color: var(--text-main);
  border-bottom: 1px solid var(--border-subtle);
}

.article-table tbody tr:nth-child(even) {
  background: var(--bg-surface-secondary);
}

.article-table tbody tr:last-child td {
  border-bottom: none;
}