﻿/* ==========================================================================
   KOL Intelligence Dashboard — app.css
   Medical/Pharma SPA Design System
   ========================================================================== */

/* ==========================================================================
   1. CSS VARIABLES & RESET
   ========================================================================== */

:root {
  /* Primary — Indigo */
  --teal-50:  #eef0ff;
  --teal-100: #e0e7ff;
  --teal-200: #c7d2fe;
  --teal-300: #a5b4fc;
  --teal-400: #818cf8;
  --teal-500: #6366f1;
  --teal-600: #4338ca;
  --teal-700: #3730a3;
  --teal-800: #312e81;
  --teal-900: #1e1b4b;

  /* Slate scale */
  --slate-50:  #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* White */
  --white: #ffffff;

  /* Typography */
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-base: 13px;
  --line-height-base: 1.5;

  /* Shadows */
  --shadow-sm:  0 1px 3px 0 rgba(0,0,0,0.07), 0 1px 2px -1px rgba(0,0,0,0.05);
  --shadow-md:  0 4px 6px -1px rgba(0,0,0,0.08), 0 2px 4px -2px rgba(0,0,0,0.05);
  --shadow-lg:  0 10px 15px -3px rgba(0,0,0,0.08), 0 4px 6px -4px rgba(0,0,0,0.05);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: var(--font-size-base);
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  background-color: var(--slate-50);
  color: var(--slate-800);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: inherit;
}

button {
  font-family: inherit;
  font-size: inherit;
}

/* ==========================================================================
   2. LEFT NAV SIDEBAR
   ========================================================================== */

.app-shell {
  display: flex;
  min-height: 100vh;
}

/* ── Left nav ── */
.left-nav {
  width: 220px;
  min-width: 220px;
  background-color: var(--slate-900);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 1100;
  scrollbar-width: none;
}

.left-nav::-webkit-scrollbar { display: none; }

/* Brand */
.ln-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--slate-800);
  flex-shrink: 0;
}

.ln-logo-mark {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 900;
  color: var(--white);
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.ln-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.ln-brand-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--white);
  letter-spacing: -0.3px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ln-brand-sub {
  font-size: 10px;
  color: var(--slate-500);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Nav section */
.ln-section {
  padding: 16px 0 8px;
  border-bottom: 1px solid var(--slate-800);
  flex-shrink: 0;
}

.ln-section:last-of-type {
  border-bottom: none;
}

.ln-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--slate-600);
  padding: 0 16px 8px;
}

/* Nav items */
.ln-nav {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.ln-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-400);
  text-decoration: none;
  border-radius: 0;
  cursor: pointer;
  transition: background-color 0.12s, color 0.12s;
  border-left: 2px solid transparent;
  position: relative;
}

.ln-nav-item:hover:not(.ln-nav-disabled) {
  background-color: var(--slate-800);
  color: var(--slate-200);
}

.ln-nav-item.active {
  background-color: rgba(13, 148, 136, 0.12);
  color: var(--teal-400);
  border-left-color: var(--teal-500);
}

.ln-nav-disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.ln-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.ln-coming-soon {
  margin-left: auto;
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  background-color: var(--slate-800);
  color: var(--slate-500);
  border-radius: 3px;
  padding: 1px 5px;
}

/* Sidebar quick stats */
.ln-stats {
  display: flex;
  flex-direction: column;
  gap: 0;
  padding: 0 0 4px;
}

.ln-stat-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 16px;
  font-size: 11px;
}

.ln-stat-label {
  color: var(--slate-500);
}

.ln-stat-val {
  font-weight: 700;
  color: var(--teal-400);
}

/* Footer */
.ln-footer {
  margin-top: auto;
  padding: 16px;
  border-top: 1px solid var(--slate-800);
  flex-shrink: 0;
}

.ln-footer-text {
  font-size: 10px;
  color: var(--slate-500);
  line-height: 1.5;
  margin-bottom: 3px;
}

.ln-footer-note {
  font-size: 10px;
  color: var(--slate-700);
}

/* ==========================================================================
   3. APP BODY + TOP BAR + MAIN LAYOUT
   ========================================================================== */

.app-body {
  margin-left: 220px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100vh;
}

/* Top bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 500;
  height: 48px;
  background-color: var(--white);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 12px;
}

.tb-search {
  flex: 1;
  max-width: 420px;
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0 12px;
  height: 34px;
  transition: border-color 0.15s, background-color 0.15s;
}

.tb-search:focus-within {
  border-color: var(--teal-400);
  background-color: var(--white);
}

.tb-search-icon {
  width: 14px;
  height: 14px;
  color: var(--slate-400);
  flex-shrink: 0;
}

.tb-search input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  font-size: 13px;
  font-family: var(--font-sans);
  color: var(--slate-800);
  height: 100%;
}

.tb-search input::placeholder {
  color: var(--slate-400);
}

.tb-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.tb-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--teal-700);
  background-color: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: 20px;
  padding: 3px 12px;
}

main {
  flex: 1;
  padding: 24px 28px;
  background-color: var(--slate-50);
}

.directory-page,
.profile-page {
  width: 100%;
}

/* ==========================================================================
   4. LOADING & ERROR STATES
   ========================================================================== */

.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  gap: 14px;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--slate-200);
  border-top-color: var(--teal-600);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.loading-spinner p {
  font-size: 13px;
  color: var(--slate-500);
}

.error-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  text-align: center;
  gap: 10px;
}

.error-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
}

.error-state h3 {
  font-size: 16px;
  font-weight: 700;
  color: var(--slate-800);
}

.error-state p {
  font-size: 13px;
  color: var(--slate-500);
  max-width: 360px;
  line-height: 1.6;
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
}

.empty-state-card {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 36px 40px;
  text-align: center;
  max-width: 420px;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  box-shadow: var(--shadow-sm);
}

.empty-icon {
  font-size: 32px;
  line-height: 1;
  margin-bottom: 4px;
}

.empty-state-card h3 {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-800);
}

.empty-state-card p {
  font-size: 12px;
  color: var(--slate-500);
  line-height: 1.6;
}

/* ==========================================================================
   5. DIRECTORY PAGE
   ========================================================================== */

.dir-header {
  margin-bottom: 20px;
}

.page-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.2;
  margin-bottom: 4px;
}

.page-subtitle {
  font-size: 13px;
  color: var(--slate-500);
  line-height: 1.5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 24px;
  display: flex;
  flex-direction: column;
}

.stat-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-500);
  margin-bottom: 10px;
}

.stat-number {
  font-size: 38px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1;
  letter-spacing: -1px;
  margin-bottom: 8px;
}

.stat-sub {
  font-size: 12px;
  color: var(--slate-400);
}

.stat-icon { display: none; }

/* ── Directory hero header ───────────────────────────────────────────────── */
.dir-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.dir-breadcrumb {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.9px;
  text-transform: uppercase;
  color: var(--teal-600);
  margin-bottom: 8px;
}

.dir-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.2;
  margin-bottom: 4px;
}

.dir-subtitle {
  font-size: 13px;
  color: var(--slate-500);
}

.dir-hero-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.dir-btn-outline {
  height: 36px;
  padding: 0 16px;
  border: 1px solid var(--slate-300);
  border-radius: 8px;
  background: var(--white);
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-700);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.dir-btn-outline:hover { border-color: var(--slate-400); color: var(--slate-900); }

.dir-btn-solid {
  height: 36px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: var(--slate-900);
  font-size: 13px;
  font-weight: 600;
  color: var(--white);
  cursor: pointer;
  transition: background 0.15s;
}
.dir-btn-solid:hover { background: var(--slate-700); }

/* ── Table panel (wraps filter bar + table + pagination) ─────────────────── */
.table-panel {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  overflow: hidden;
}

/* ── Directory filter bar ────────────────────────────────────────────────── */
.dir-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-100);
  gap: 8px;
  flex-wrap: wrap;
}

.dir-fb-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dir-fb-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.dir-search-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  padding: 0 10px;
  height: 32px;
  background: var(--white);
  gap: 6px;
  min-width: 220px;
}
.dir-search-wrap:focus-within { border-color: var(--teal-400); }

.dir-search-icon {
  width: 14px;
  height: 14px;
  color: var(--slate-400);
  flex-shrink: 0;
}

.dir-search-input {
  border: none;
  outline: none;
  font-size: 13px;
  color: var(--slate-700);
  width: 100%;
  background: transparent;
  font-family: inherit;
}
.dir-search-input::placeholder { color: var(--slate-400); }

.dir-qf-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-600);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: border-color 0.12s, color 0.12s, background 0.12s;
}
.dir-qf-btn:hover { border-color: var(--slate-300); color: var(--slate-800); }
.dir-qf-btn.dir-qf-active { border-color: var(--teal-500); color: var(--teal-700); background: var(--teal-50); }

.dir-kol-count-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--slate-700);
  background: var(--slate-100);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.dir-meta-btn {
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-600);
  cursor: pointer;
  white-space: nowrap;
  font-family: inherit;
  transition: border-color 0.12s, color 0.12s;
}
.dir-meta-btn:hover { border-color: var(--slate-300); color: var(--slate-800); }
.dir-sort-btn { font-weight: 600; color: var(--slate-700); }

.dir-clear-btn {
  height: 32px;
  padding: 0 10px;
  border: 1px solid #fecaca;
  border-radius: 8px;
  background: #fef2f2;
  font-size: 12px;
  font-weight: 600;
  color: #dc2626;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s;
}
.dir-clear-btn:hover { background: #fee2e2; }

/* ── Column group row ────────────────────────────────────────────────────── */
.col-group-row { background: var(--slate-50); }

.col-group {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--slate-400);
  padding: 7px 12px;
  border-bottom: 1px solid var(--slate-100);
  text-align: left;
}

.col-group-identity { border-right: 2px solid var(--teal-100); }

/* ==========================================================================
   6. TABLE COMPONENTS
   ========================================================================== */

.table-wrap {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  overflow: hidden;
}

.table-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--slate-100);
}

.table-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--slate-800);
}

.table-hint {
  font-size: 11px;
  color: var(--slate-400);
}

.table-section-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--slate-500);
  margin-bottom: 12px;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table thead {
  background-color: var(--slate-50);
  border-bottom: 1px solid var(--slate-200);
}

.data-table thead tr {
  border-bottom: 1px solid var(--slate-200);
}

.data-table th {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--slate-500);
  padding: 9px 14px;
  text-align: left;
  white-space: nowrap;
}

.data-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: middle;
}

.data-table tbody tr {
  transition: background-color 0.1s;
}

.data-table tbody tr:hover {
  background-color: var(--teal-50);
}

.data-table tbody tr:last-child td {
  border-bottom: none;
}

/* ==========================================================================
   7. DIRECTORY KOL CELLS
   ========================================================================== */

.dir-table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.dir-table {
  min-width: 2000px;
}

/* sticky name column */
.col-sticky {
  position: sticky;
  left: 0;
  background: var(--white);
  z-index: 2;
  box-shadow: 2px 0 6px -2px rgba(0,0,0,0.08);
}
.kol-row:hover .col-sticky {
  background: var(--teal-50);
}
.dir-table thead .col-sticky {
  background: var(--slate-50);
  z-index: 3;
}

.col-name      { min-width: 200px; }
.col-id        { min-width: 110px; white-space: nowrap; }
.col-score-h   { min-width: 90px;  white-space: nowrap; }
.col-tier-h    { min-width: 100px; white-space: nowrap; }
.col-ind       { min-width: 120px; }
.col-spec      { min-width: 160px; }
.col-conf      { min-width: 160px; }
.col-confcount { min-width: 90px;  white-space: nowrap; }
.col-abs       { min-width: 150px; }
.col-lit       { min-width: 180px; }
.col-litcount  { min-width: 80px;  white-space: nowrap; }
.col-lit-src   { min-width: 160px; }
.col-affil     { min-width: 200px; }

.dir-src-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.dir-src-chip  {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10px; font-weight: 600; border-radius: 4px; padding: 2px 6px;
  background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200);
}
.src-count { font-weight: 400; color: var(--slate-400); }
.src-pubmed           { background:#ecfdf5; color:#065f46; border-color:#a7f3d0; }
.src-aacr             { background:#fef3c7; color:#92400e; border-color:#fcd34d; }
.src-asco---jco       { background:#eff6ff; color:#1e40af; border-color:#bfdbfe; }
.src-jtho             { background:#fdf4ff; color:#6b21a8; border-color:#e9d5ff; }
.src-annals-of-oncology{ background:#fff1f2; color:#9f1239; border-color:#fecdd3; }
.src-preprint--biorxiv-medrxiv { background:#fefce8; color:#713f12; border-color:#fef08a; }
.src-doi              { background:#f0f9ff; color:#075985; border-color:#bae6fd; }

.popup-src-badge {
  display: inline-block; font-size: 10px; font-weight: 600;
  background: var(--slate-100); color: var(--slate-500);
  border: 1px solid var(--slate-200); border-radius: 4px; padding: 1px 5px;
  margin-right: 4px; vertical-align: middle;
}
.col-city      { min-width: 110px; }
.col-state     { min-width: 140px; }
.col-country   { min-width: 90px;  }
.col-contact   { min-width: 200px; }

.td-center { text-align: center; }

/* ── Column header with filter icon ── */
.col-header-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  white-space: nowrap;
}
.col-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--slate-500);
}
.col-filter-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  border-radius: 3px;
  display: flex;
  align-items: center;
  color: var(--slate-300);
  transition: color 0.15s, background 0.15s;
  flex-shrink: 0;
}
.col-filter-btn:hover {
  color: var(--teal-500);
  background: var(--teal-50);
}
.col-filter-btn.has-filter {
  color: var(--teal-500);
}
.cf-icon {
  width: 12px;
  height: 12px;
}
.cf-icon.active {
  color: var(--teal-500);
}

/* ── Excel-style filter dropdown ── */
.cfd {
  display: none;
  position: fixed;
  z-index: 9998;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.13), 0 2px 6px rgba(0,0,0,0.07);
  overflow: hidden;
  font-size: 12px;
}
.cfd-title {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--slate-500);
  padding: 10px 12px 6px;
  border-bottom: 1px solid var(--slate-100);
}
.cfd-search-wrap {
  padding: 8px 10px;
  border-bottom: 1px solid var(--slate-100);
}
.cfd-search {
  width: 100%;
  font-size: 12px;
  color: var(--slate-700);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 5px;
  padding: 5px 8px;
  outline: none;
  box-sizing: border-box;
}
.cfd-search:focus {
  border-color: var(--teal-400);
  background: var(--white);
}
.cfd-options-wrap {
  max-height: 200px;
  overflow-y: auto;
  padding: 4px 0;
}
.cfd-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  cursor: pointer;
  color: var(--slate-700);
  transition: background 0.1s;
}
.cfd-option:hover {
  background: var(--teal-50);
}
.cfd-option input[type=checkbox] {
  accent-color: var(--teal-500);
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  cursor: pointer;
}
.cfd-select-all {
  font-weight: 600;
  color: var(--slate-800);
}
.cfd-divider {
  height: 1px;
  background: var(--slate-100);
  margin: 2px 0;
}
.cfd-options-list {
  display: flex;
  flex-direction: column;
}
.cfd-range-block {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cfd-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cfd-range-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-500);
  width: 28px;
  flex-shrink: 0;
}
.cfd-range-input {
  flex: 1;
  font-size: 12px;
  color: var(--slate-700);
  background: var(--slate-50);
  border: 1px solid var(--slate-200);
  border-radius: 5px;
  padding: 5px 8px;
  outline: none;
  box-sizing: border-box;
  min-width: 0;
}
.cfd-range-input:focus {
  border-color: var(--teal-400);
  background: var(--white);
}
.cfd-footer {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--slate-100);
  background: var(--slate-50);
}
.cfd-clear-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--slate-500);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 5px;
  padding: 4px 12px;
  cursor: pointer;
  transition: border-color 0.12s;
}
.cfd-clear-btn:hover { border-color: var(--slate-400); }
.cfd-apply-btn {
  font-size: 11px;
  font-weight: 600;
  color: var(--white);
  background: var(--teal-600);
  border: none;
  border-radius: 5px;
  padding: 4px 14px;
  cursor: pointer;
  transition: background 0.12s;
}
.cfd-apply-btn:hover { background: var(--teal-700); }

/* ── Table header bar right side ── */
.tbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.clear-filters-btn {
  font-size: 11px;
  font-weight: 600;
  color: #dc2626;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 5px;
  padding: 4px 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: background 0.12s;
}
.clear-filters-btn:hover { background: #fee2e2; }

.kol-row {
  cursor: pointer;
}

.kol-name-cell {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.kol-avatar {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--teal-600), var(--teal-700));
  color: var(--white);
  font-weight: 700;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: -0.5px;
  margin-top: 1px;
}

.kol-name-block {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.kol-fullname {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-700);
  line-height: 1.3;
}

.dir-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dir-kol-code {
  font-size: 10px;
  font-weight: 600;
  color: var(--slate-500);
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 4px;
  padding: 1px 5px;
  letter-spacing: 0.3px;
}

.dir-degree {
  font-size: 10px;
  font-weight: 500;
  color: var(--teal-600);
  background: var(--teal-50);
  border: 1px solid var(--teal-100);
  border-radius: 4px;
  padding: 1px 5px;
}

.dir-specialty {
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  line-height: 1.3;
  margin-bottom: 4px;
}

.dir-indication {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 6px;
  letter-spacing: 0.2px;
}
.ind-nsclc  { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.ind-oc     { background: #fdf4ff; color: #7e22ce; border: 1px solid #e9d5ff; }
.ind-other  { background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200); }

.dir-location {
  font-size: 12px;
  color: var(--slate-600);
  line-height: 1.4;
}

.dir-inst-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  line-height: 1.3;
  margin-bottom: 5px;
}

.dir-net-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.dir-net-chip {
  font-size: 10px;
  font-weight: 500;
  color: var(--slate-500);
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 4px;
  padding: 1px 5px;
}

.dir-conf-name {
  font-size: 12px;
  color: var(--slate-700);
  font-weight: 500;
  line-height: 1.3;
  margin-bottom: 5px;
}

.dir-count-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.dir-count-chip {
  font-size: 10px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 6px;
}
.chip-conf { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.chip-abs  { background: #eff6ff; color: #1e40af; border: 1px solid #bfdbfe; }
.chip-pub  { background: #fdf4ff; color: #6b21a8; border: 1px solid #e9d5ff; }

.dir-lit-title {
  font-size: 11px;
  color: var(--slate-600);
  line-height: 1.4;
  margin-bottom: 5px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dir-extra {
  font-size: 11px;
  color: var(--slate-400);
}

.dir-contact-cell {
  vertical-align: middle;
}

.dir-contact-link {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--teal-600);
  text-decoration: none;
  word-break: break-all;
  line-height: 1.3;
}
.dir-contact-link svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
  color: var(--teal-500);
}
.dir-contact-link:hover {
  color: var(--teal-700);
  text-decoration: underline;
}

.dir-phone {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--slate-500);
  margin-top: 4px;
}
.dir-phone svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

.dir-na {
  font-size: 12px;
  color: var(--slate-300);
}

.dir-degree-inline {
  font-size: 10px;
  color: var(--teal-600);
  margin-top: 2px;
}

.dir-cell-text {
  font-size: 12px;
  color: var(--slate-700);
  line-height: 1.4;
}

/* Lit source: names only by default, counts appear on hover via pseudo-element */
.dir-src-names {
  position: relative;
  cursor: default;
}
.dir-src-names:hover {
  color: transparent; /* hide the plain names text */
}
.dir-src-names::after {
  content: attr(data-counts);
  position: absolute;
  inset: 0;
  color: var(--slate-700);
  font-size: 12px;
  line-height: 1.4;
  white-space: normal;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
}
.dir-src-names:hover::after {
  opacity: 1;
}

.dir-cell-small {
  font-size: 11px;
  color: var(--slate-500);
  line-height: 1.4;
}

.dir-lit-cell {
  font-size: 11px;
  color: var(--slate-600);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.dir-count-num {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  border-radius: 6px;
  padding: 3px 10px;
}

.dir-web-link {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: var(--slate-500);
  text-decoration: none;
  margin-top: 3px;
}
.dir-web-link svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.dir-web-link:hover {
  color: var(--teal-600);
  text-decoration: underline;
}

/* ── Popup trigger ── */
.dir-popup-trigger {
  display: inline-block;
  margin-top: 3px;
  font-size: 10px;
  font-weight: 700;
  color: var(--teal-600);
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: 4px;
  padding: 1px 6px;
  cursor: pointer;
  user-select: none;
  transition: background 0.12s, color 0.12s;
}
.dir-popup-trigger:hover {
  background: var(--teal-600);
  color: var(--white);
  border-color: var(--teal-600);
}

/* ── Floating popup ── */
.dir-popup {
  display: none;
  position: fixed;
  z-index: 9999;
  min-width: 280px;
  max-width: 480px;
  max-height: 55vh;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.08);
  padding: 14px 16px;
  pointer-events: auto;
}
.popup-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--slate-500);
  margin-bottom: 10px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--slate-100);
}
.popup-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.popup-list li {
  font-size: 12px;
  color: var(--slate-700);
  line-height: 1.5;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-50);
}
.popup-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.popup-list strong {
  color: var(--slate-900);
  font-weight: 600;
}
.popup-list em {
  color: var(--slate-400);
  font-style: normal;
  font-size: 11px;
}
.popup-type {
  background: var(--slate-100);
  border-radius: 3px;
  padding: 1px 4px;
  font-size: 10px;
  color: var(--slate-500);
}
.popup-more-note {
  margin-top: 10px;
  font-size: 11px;
  color: var(--slate-400);
  text-align: center;
  font-style: italic;
}
.popup-empty {
  font-size: 12px;
  color: var(--slate-400);
}
.popup-subtitle {
  display: block;
  font-size: 11px;
  color: var(--slate-500);
  margin-top: 2px;
  line-height: 1.4;
}
.popup-year {
  font-size: 11px;
  color: var(--slate-400);
}
.popup-pmid-link {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  color: var(--teal-600);
  background: var(--teal-50);
  border: 1px solid var(--teal-200);
  border-radius: 4px;
  padding: 1px 5px;
  text-decoration: none;
  margin-top: 2px;
}
.popup-pmid-link:hover {
  background: var(--teal-600);
  color: var(--white);
}
.popup-pmid {
  font-size: 10px;
  color: var(--slate-400);
}

/* legacy — kept for profile page compat */
.kol-institution { font-size: 11px; color: var(--slate-500); line-height: 1.3; }
.row-indication  { font-size: 10px; font-weight: 500; color: var(--teal-600); }
.networks-cell   { font-size: 12px; color: var(--slate-600); }
.nowrap-cell     { white-space: nowrap; }
.lit-preview-text{ font-size: 11px; color: var(--slate-600); line-height: 1.4; }
.extra-count     { font-size: 11px; color: var(--slate-400); }
.opinion-count   { font-size: 11px; color: var(--slate-500); }

/* ==========================================================================
   8. SCORE & TIER BADGES + PAGINATION
   ========================================================================== */

.score-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.4;
}

.score-teal {
  background-color: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
}

.score-blue {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.score-gray {
  background-color: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

.tier-badge {
  display: inline-block;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 9px;
  line-height: 1.4;
}

.tier-gold {
  background-color: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
}

.tier-blue {
  background-color: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.tier-slate {
  background-color: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

.score-cell {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-top: 1px solid var(--slate-100);
}

.pg-showing {
  font-size: 12px;
  color: var(--slate-500);
  white-space: nowrap;
}

.pg-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pg-size {
  font-size: 12px;
  color: var(--slate-400);
  white-space: nowrap;
}

.page-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border: 1px solid var(--slate-200);
  border-radius: 5px;
  background-color: var(--white);
  color: var(--slate-600);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.page-btn:hover:not(:disabled) {
  border-color: var(--teal-500);
  color: var(--teal-700);
  background-color: var(--teal-50);
}

.page-btn.active {
  border-color: var(--teal-600);
  background-color: var(--teal-600);
  color: var(--white);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.page-num-btn {
  height: 28px;
  min-width: 28px;
  padding: 0 8px;
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  background: var(--white);
  font-size: 12px;
  font-weight: 500;
  color: var(--slate-700);
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}
.page-num-btn.active {
  border-color: var(--teal-600);
  background-color: var(--teal-600);
  color: var(--white);
}
.page-num-btn:hover:not(.active) {
  border-color: var(--teal-400);
  color: var(--teal-700);
  background-color: var(--teal-50);
}

.page-info {
  font-size: 12px;
  color: var(--slate-400);
  padding: 0 4px;
}

/* ==========================================================================
   9. BACK BUTTON
   ========================================================================== */

.back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--teal-600);
  text-decoration: none;
  margin-bottom: 14px;
  font-weight: 500;
  transition: color 0.15s;
}

.back-btn:hover {
  color: var(--teal-700);
  text-decoration: underline;
}

/* ==========================================================================
   10. PROFILE CARD – 4-COLUMN FOLIO LAYOUT
   ========================================================================== */

.profile-card {
  display: flex;
  flex-direction: column;
  width: 100%;
  background-color: var(--white);
  border: 1px solid #DDE2F0;
  border-radius: 8px 8px 0 0;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.pc-columns {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.pc-identity {
  flex: 0 0 220px;
  padding: 24px 20px;
  border-right: 1px solid var(--slate-100);
}

.pc-affiliations {
  flex: 2;
  min-width: 0;
  padding: 24px 20px;
  border-right: 1px solid var(--slate-100);
}

.pc-contacts {
  flex: 1.5;
  min-width: 0;
  padding: 24px 20px;
  border-right: 1px solid var(--slate-100);
}

.pc-score {
  flex: 0 0 200px;
  padding: 24px 20px;
  background-color: #F8F9FD;
}

.pc-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid #E8ECF6;
  background-color: #F8F9FD;
}

.pc-kpi {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 14px 12px;
  text-align: center;
  border-right: 1px solid var(--slate-100);
  cursor: default;
}

.pc-kpi:last-child {
  border-right: none;
}

.pc-kpi-num {
  font-size: 22px;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1;
  letter-spacing: -0.5px;
}

.pc-kpi-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.7px;
  color: var(--slate-400);
  margin-top: 3px;
}

.pc-section-label {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--slate-400);
  margin-bottom: 10px;
  display: block;
}

.pc-avatar-wrap { margin-bottom: 10px; }

.profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 10px;
  background: #EEF0FF;
  color: #4338CA;
  font-size: 22px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.profile-name {
  font-size: 17px;
  font-weight: 800;
  color: var(--slate-900);
  line-height: 1.2;
  margin: 6px 0 3px;
}

.profile-subdesc {
  font-size: 11px;
  color: var(--slate-500);
  line-height: 1.4;
  margin-bottom: 2px;
}

.profile-aka {
  font-size: 11px;
  color: var(--slate-400);
  font-style: italic;
  margin-bottom: 2px;
}

.profile-location {
  font-size: 11px;
  color: var(--slate-500);
  margin-top: 2px;
}

.pc-institution {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.3;
  margin-bottom: 2px;
  overflow-wrap: break-word;
}

.pc-inst-role {
  font-size: 11.5px;
  color: var(--slate-500);
  margin-bottom: 8px;
}

.pc-networks-block { margin-top: 6px; }

.pc-network-row {
  font-size: 11.5px;
  color: var(--slate-600);
  line-height: 1.6;
}

.pc-network-role { color: var(--slate-400); }

.pc-extra-inst {
  font-size: 11.5px;
  color: var(--slate-600);
  margin-bottom: 2px;
}

.pc-tags-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.pc-tag {
  background-color: #EEF0FF;
  color: #3730A3;
  border: 1px solid #EEF0FF;
  font-size: 11px;
  border-radius: 20px;
  padding: 2px 9px;
  line-height: 1.4;
}

.pc-contact-row {
  font-size: 12px;
  color: var(--slate-600);
  margin-bottom: 8px;
  line-height: 1.4;
  overflow-wrap: break-word;
  word-break: break-word;
}

.contact-link {
  color: var(--teal-600);
  text-decoration: none;
  transition: color 0.15s;
}

.contact-link:hover {
  text-decoration: underline;
  color: var(--teal-700);
}

.pc-contact-text { color: var(--slate-700); }
.pc-no-contact { font-size: 11px; color: var(--slate-400); font-style: italic; }

.pc-score-display {
  display: flex;
  align-items: baseline;
  gap: 2px;
  margin-bottom: 8px;
}

.pc-score-big {
  font-size: 40px;
  font-weight: 900;
  color: var(--slate-900);
  line-height: 1;
}

.pc-score-denom {
  font-size: 14px;
  color: var(--slate-400);
  font-weight: 500;
}

.pc-score-bar-wrap {
  height: 5px;
  background: var(--slate-200);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 6px;
}

.pc-score-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #4338CA, #7C3AED);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.pc-score-sub {
  font-size: 10.5px;
  color: var(--slate-400);
  font-weight: 500;
}

/* ==========================================================================
   11. PROFILE STATS BAR
   ========================================================================== */

.profile-stats-bar {
  display: none;
}

/* ==========================================================================
   12. TAB NAV
   ========================================================================== */

.tab-nav {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--slate-200);
  background-color: var(--white);
  border-radius: 8px 8px 0 0;
  padding: 0 4px;
  margin-bottom: 0;
}

.tab-btn {
  padding: 12px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--slate-500);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.15s, border-color 0.15s;
}

.tab-btn:hover {
  color: var(--slate-700);
}

.tab-btn.active {
  color: var(--teal-700);
  border-bottom-color: var(--teal-600);
  font-weight: 600;
}

/* ==========================================================================
   13. CONFERENCE TAB
   ========================================================================== */

.conferences-tab {
  /* container */
}

.conf-summary-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--slate-500);
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.csb-item {
  color: var(--slate-600);
}

.csb-item strong {
  color: var(--slate-900);
  font-weight: 700;
}

.csb-sep {
  color: var(--slate-300);
}

.conf-featured-card {
  background-color: var(--white);
  border: 1px solid var(--teal-200);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-sm);
}

.featured-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.featured-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--teal-600);
}

.conf-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-900);
  margin-bottom: 6px;
  line-height: 1.2;
}

.conf-meta-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 6px 0;
}

.conf-year-badge {
  background-color: var(--teal-600);
  color: var(--white);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  line-height: 1.4;
}

.conf-location {
  font-size: 12px;
  color: var(--slate-500);
}

.conf-role-badge {
  background-color: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  border-radius: 20px;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 9px;
  line-height: 1.4;
}

.conf-format-badge {
  background-color: var(--slate-100);
  color: var(--slate-600);
  font-size: 11px;
  border-radius: 4px;
  padding: 2px 8px;
  line-height: 1.4;
}

.conf-abstract-count {
  font-size: 12px;
  color: var(--slate-500);
  font-style: italic;
  margin-top: 6px;
}

.featured-abstracts-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.featured-abstract-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  background-color: var(--slate-50);
  border-radius: 6px;
  padding: 8px 10px;
  line-height: 1.4;
}

.abstract-code-badge {
  background-color: var(--teal-600);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  flex-shrink: 0;
  padding: 1px 7px;
  line-height: 1.6;
  white-space: nowrap;
}

.abstract-type-tag {
  background-color: var(--slate-200);
  color: var(--slate-600);
  font-size: 10px;
  border-radius: 4px;
  flex-shrink: 0;
  padding: 1px 6px;
  line-height: 1.6;
  white-space: nowrap;
}

.abstract-title-text {
  color: var(--slate-700);
}

.conf-table-wrap {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 8px;
  overflow-x: auto;
}

.conf-full-name {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-800);
  line-height: 1.3;
}

.conf-short-name {
  display: block;
  font-size: 11px;
  color: var(--slate-400);
  font-weight: 400;
  margin-top: 2px;
}

.conf-year-cell {
  white-space: nowrap;
  font-weight: 700;
  color: var(--slate-700);
}

.conf-location-cell {
  font-size: 12px;
  color: var(--slate-500);
}

.role-chip {
  background-color: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
  display: inline-block;
  line-height: 1.4;
}

.abs-count-badge {
  background-color: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 9px;
  display: inline-block;
  line-height: 1.4;
}

/* ==========================================================================
   14. LITERATURE TAB
   ========================================================================== */

.literature-tab {
  /* container */
}

.scholarly-footprint {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
}

.footprint-stat {
  text-align: center;
  border-right: 1px solid var(--slate-100);
  padding: 0 8px;
}

.footprint-stat:last-child {
  border-right: none;
}

.footprint-icon {
  font-size: 16px;
  line-height: 1;
  margin-bottom: 4px;
}

.footprint-number {
  font-size: 24px;
  font-weight: 700;
  color: var(--teal-600);
  line-height: 1;
}

.footprint-label {
  font-size: 10px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--slate-400);
  margin-top: 3px;
}

.lit-item {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-left: 3px solid transparent;
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 10px;
  transition: border-left-color 0.15s;
}

.lit-item:hover {
  border-left-color: var(--teal-400);
}

.lit-title-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 4px;
}

.lit-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--teal-700);
  line-height: 1.4;
  flex: 1;
}

.latest-badge {
  background-color: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  font-size: 10px;
  font-weight: 700;
  border-radius: 20px;
  padding: 2px 8px;
  flex-shrink: 0;
  line-height: 1.4;
}

.lit-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 11px;
  color: var(--slate-500);
  margin-top: 3px;
}

.lit-journal {
  color: var(--slate-600);
  font-weight: 500;
}

.lit-sep {
  color: var(--slate-300);
}

.lit-year {
  color: var(--slate-700);
  font-weight: 700;
}

.pub-type-badge {
  display: inline-block;
  font-size: 10px;
  border-radius: 4px;
  padding: 1px 6px;
  line-height: 1.6;
  font-weight: 500;
}

.pubtype-review {
  background-color: #f5f3ff;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.pubtype-meta {
  background-color: #fdf2f8;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.pubtype-trial {
  background-color: #eff6ff;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.pubtype-editorial {
  background-color: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

.pubtype-case {
  background-color: #fffbeb;
  color: #b45309;
  border: 1px solid #fde68a;
}

.pubtype-letter {
  background-color: var(--slate-50);
  color: var(--slate-500);
  border: 1px solid var(--slate-200);
}

.pubtype-default {
  background-color: var(--slate-100);
  color: var(--slate-500);
  border: 1px solid var(--slate-200);
}

.citation-badge {
  background-color: var(--slate-100);
  color: var(--slate-700);
  font-size: 11px;
  font-weight: 700;
  border-radius: 4px;
  padding: 1px 7px;
  display: inline-block;
  line-height: 1.6;
}

.ext-link {
  color: var(--teal-600);
  text-decoration: none;
  font-size: 11px;
  transition: color 0.15s;
}

.ext-link:hover {
  text-decoration: underline;
  color: var(--teal-700);
}

.pub-abstract {
  font-size: 12px;
  color: var(--slate-600);
  line-height: 1.6;
  margin-top: 6px;
}

.abs-short,
.abs-full {
  display: inline;
}

.show-more-btn {
  background: none;
  border: none;
  color: var(--teal-600);
  font-size: 11px;
  cursor: pointer;
  padding: 0;
  font-weight: 500;
  transition: color 0.15s;
}

.show-more-btn:hover {
  text-decoration: underline;
  color: var(--teal-700);
}

.focus-item {
  margin-bottom: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--slate-100);
}

.focus-item:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.focus-area-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.focus-area {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-700);
}

.focus-count {
  font-size: 11px;
  color: var(--teal-600);
  font-weight: 600;
  flex-shrink: 0;
}

/* ==========================================================================
   15. KOL OPINIONS TAB
   ========================================================================== */

.opinions-tab {
  /* container */
}

/* ── Opinions layout ────────────────────────────────────────────────────────
   Cards col drives row height. Analytics col stretches to match via grid.
   analytics-scroll uses position:absolute inset:0 — fills the col without
   contributing to its height, so pagination sits outside + below both cols. */

.op-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  align-items: stretch;
  gap: 24px;
}
.op-cards-col {
  min-width: 0;
}
.op-analytics-col {
  position: relative;
  min-height: 0;
  min-width: 0;
}
.op-analytics-scroll {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding-bottom: 16px;
  scrollbar-width: thin;
  scrollbar-color: var(--slate-200) transparent;
}
.op-analytics-scroll::-webkit-scrollbar { width: 4px; }
.op-analytics-scroll::-webkit-scrollbar-track { background: transparent; }
.op-analytics-scroll::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 2px; }

/* ── Sidebar: Activity by year bar chart ── */
/* ── Sidebar: Activity by year — horizontal bars ── */
.op-yr-chart { display: flex; flex-direction: column; gap: 6px; padding: 2px 0; }
.op-yr-row { display: grid; grid-template-columns: 36px 1fr 28px; align-items: center; gap: 8px; }
.op-yr-label { font-size: 11px; color: var(--slate-500); text-align: right; white-space: nowrap; }
.op-yr-bar-wrap { height: 10px; background: var(--slate-100); border-radius: 5px; overflow: hidden; }
.op-yr-bar { height: 10px; background: linear-gradient(90deg, #4338CA, #7C3AED); border-radius: 5px; transition: opacity .15s; }
.op-yr-row:hover .op-yr-bar { opacity: .75; }
.op-yr-cnt { font-size: 11px; color: var(--slate-500); font-weight: 600; text-align: right; }

/* ── Sidebar: Media breakdown — horizontal bars ── */
.op-fmt-bars-list { display: flex; flex-direction: column; gap: 8px; }
.op-fmt-bar-row { display: grid; grid-template-columns: 1fr 80px 28px 32px; align-items: center; gap: 7px; }
.op-fmt-bar-label { font-size: 11px; color: var(--slate-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-fmt-bar-track { height: 8px; background: var(--slate-100); border-radius: 4px; overflow: hidden; }
.op-fmt-bar-fill { height: 8px; border-radius: 4px; transition: opacity .15s; }
.op-fmt-bar-row:hover .op-fmt-bar-fill { opacity: .8; }
.op-fmt-bar-cnt { font-size: 11px; color: var(--slate-500); font-weight: 600; text-align: right; }
.op-fmt-bar-pct { font-size: 11px; color: var(--slate-400); text-align: right; }

/* ── Sidebar: Top topics bars ── */
.op-topics-list { display: flex; flex-direction: column; gap: 7px; }
.op-topic-row { display: grid; grid-template-columns: 1fr 50px auto; align-items: center; gap: 6px; position: relative; cursor: default; }
.op-topic-label { font-size: 11px; color: var(--slate-700); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.op-topic-bar-wrap { height: 5px; background: var(--slate-100); border-radius: 3px; overflow: hidden; }
.op-topic-bar { height: 5px; background: linear-gradient(90deg, #4338CA, #7C3AED); border-radius: 3px; }
.op-topic-cnt { font-size: 11px; color: var(--slate-500); font-weight: 600; text-align: right; }
.op-topic-row[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute; right: 0; top: -28px;
  background: #0F1B3D; color: #fff;
  font-size: 11px; padding: 4px 8px; border-radius: 5px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity .15s; z-index: 10;
}
.op-topic-row[data-tooltip]:hover::after { opacity: 1; }

/* ── Filter bar ────────────────────── */

#op-filter-bar-wrap {
  margin-bottom: 14px;
}

.op-filter-row-1 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.op-filter-row-2 {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  flex-wrap: wrap;
}

.op-filters-left {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

/* Legacy: keep .op-filter-bar for any existing references */
.op-filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 11px;
  color: var(--slate-500);
  font-weight: 500;
}

.op-filter-btn {
  border: 1px solid var(--slate-200);
  border-radius: 6px;
  background-color: var(--white);
  color: var(--slate-600);
  font-size: 12px;
  cursor: pointer;
  padding: 5px 12px;
  font-family: var(--font-sans);
  transition: border-color 0.15s, color 0.15s, background-color 0.15s;
}

.op-filter-btn:hover {
  border-color: var(--teal-500);
  color: var(--teal-600);
}

.op-filter-btn.active {
  background-color: var(--teal-600);
  color: var(--white);
  border-color: var(--teal-600);
}

/* ── Opinion card ─────────────────── */

.opinions-grid {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 16px;
}
.opinions-col {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.opinion-card {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s;
}

.opinion-card:hover {
  border-color: var(--teal-300);
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

/* ── New card inner layout ── */
.opinion-card { padding: 0; gap: 0; }
.op-identity-row { display: flex; align-items: center; gap: 8px; padding: 14px 16px 0; }
.op-identity-spacer { flex: 1; }
.op-source-link { font-size: 12px; color: var(--accent); text-decoration: none; }
.op-source-link:hover { text-decoration: underline; }
.op-source-name { font-size: 12px; color: var(--muted); }
.opinion-card .opinion-title { padding: 8px 16px 0; font-size: 14px; font-weight: 600; -webkit-line-clamp: 2; }

.op-section { margin: 10px 16px 0; }
.op-section-label { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.op-section-label svg { color: var(--accent); flex-shrink: 0; }

/* ③ Quote block — nested under positions as attributed evidence */
.op-attributed-quote { margin-top: 10px; border-top: 1px dashed var(--line); padding-top: 10px; }
.op-attr-label { display: flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-ink); margin-bottom: 6px; }
.op-attr-label svg { color: var(--accent); flex-shrink: 0; }
.op-quote { margin: 0; padding: 10px 12px; background: #F8F9FD; border-left: 3px solid var(--accent); border-radius: 0 6px 6px 0; font-size: 12.5px; color: var(--ink); line-height: 1.7; font-style: italic; }

/* ④ KOL positions */
.op-positions-section { }
.op-positions-list { display: flex; flex-direction: column; gap: 8px; }
.op-position-item { background: #F8F9FD; border: 1px solid var(--line); border-radius: 6px; padding: 9px 12px; }
.op-position-header { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.op-position-topic { font-size: 12px; font-weight: 600; color: var(--ink); flex: 1; }
.op-stance-pill { font-size: 10px; padding: 1px 7px; white-space: nowrap; }
.op-position-text { font-size: 12px; color: var(--muted); line-height: 1.6; }

/* ⑥ Footer metrics */
.op-footer-row { display: flex; align-items: center; gap: 0; flex-wrap: wrap; padding: 8px 16px 12px; margin-top: 10px; border-top: 1px solid var(--line-soft); }
.op-metric { font-size: 11px; color: var(--muted); }
.op-metric-dot { font-size: 11px; color: var(--line); margin: 0 6px; }

/* Showing label */
.op-showing {
  font-size: 11px;
  color: var(--slate-400);
  white-space: nowrap;
}

.op-pagination-bar {
  display: flex;
  justify-content: center;
  margin: 20px 0 28px;
}
.op-pagination-bar .pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 0;
  border-top: none;
  width: auto;
}
.op-pagination-bar .page-btn {
  height: 34px;
  min-width: 34px;
  padding: 0 12px;
  font-size: 13px;
}
.op-pagination-bar #op-prev,
.op-pagination-bar #op-next { padding: 0 14px; }

/* Top bar: format badge + date */
.op-card-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-top: 14px;
  padding-bottom: 0;
}

.media-format-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 5px;
  padding: 3px 9px;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.4;
  background-color: var(--slate-100);
  color: var(--slate-600);
}

/* Format-specific badge colours */
.fmt-badge-video   { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.fmt-badge-podcast { background: #f5f3ff; color: #6d28d9; border: 1px solid #ddd6fe; }
.fmt-badge-article { background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe; }
.fmt-badge-interview{ background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }
.fmt-badge-webinar { background: #fff7ed; color: #c2410c; border: 1px solid #fed7aa; }
.fmt-badge-web         { background: #f0fdfa; color: var(--teal-700); border: 1px solid var(--teal-200); }
.fmt-badge-publication { background: #f0fdf4; color: #15803d;           border: 1px solid #bbf7d0; }
.fmt-badge-conference  { background: #fefce8; color: #854d0e;           border: 1px solid #fde68a; }

.opinion-date {
  font-size: 11px;
  color: var(--slate-400);
  white-space: nowrap;
}

/* Title */
.opinion-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1.35;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  cursor: default;
}

/* Topic/stance chips */
.opinion-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.stance-chip {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 2px 8px;
  line-height: 1.5;
}

.sc-teal    { background: var(--teal-50);  color: var(--teal-700);  border: 1px solid var(--teal-200); }
.sc-blue    { background: #eff6ff;          color: #1d4ed8;          border: 1px solid #bfdbfe; }
.sc-orange  { background: #fffbeb;          color: #92400e;          border: 1px solid #fde68a; }
.sc-purple  { background: #f5f3ff;          color: #6d28d9;          border: 1px solid #ddd6fe; }
.sc-green   { background: #f0fdf4;          color: #15803d;          border: 1px solid #bbf7d0; }
.sc-red     { background: #fef2f2;          color: #dc2626;          border: 1px solid #fecaca; }
.sc-default { background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200); }

/* Analysis section — synthesized KOL position per topic */
.opinion-analysis-section {
  background-color: #f0fdfa;
  border: 1px solid var(--teal-100);
  border-radius: 8px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.analysis-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--teal-600);
  text-transform: uppercase;
  margin-bottom: 2px;
}

.topic-position-block {
  padding-top: 8px;
  border-top: 1px solid var(--teal-100);
}

.topic-position-block:first-of-type {
  padding-top: 0;
  border-top: none;
}

.pos-topic-label {
  font-size: 10px;
  font-weight: 700;
  color: var(--teal-700);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 5px;
}

.pos-stance {
  font-weight: 600;
  color: var(--teal-600);
  text-transform: none;
  letter-spacing: 0;
}

.pos-text {
  font-size: 12px;
  color: var(--slate-700);
  line-height: 1.65;
}

/* Excerpt block with left border */
.opinion-excerpt-block {
  background-color: var(--slate-50);
  border-left: 3px solid var(--teal-300);
  border-radius: 0 6px 6px 0;
  padding: 10px 12px;
}

.excerpt-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: var(--slate-400);
  text-transform: uppercase;
  margin-bottom: 6px;
}

.exc-short,
.exc-full {
  display: inline;
}

.opinion-excerpt {
  font-size: 12px;
  color: var(--slate-700);
  line-height: 1.7;
  font-style: italic;
  display: -webkit-box;
  -webkit-line-clamp: 5;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Drugs section */
.opinion-drugs-block {
  /* container */
}

.drugs-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  color: var(--slate-400);
  text-transform: uppercase;
  margin-bottom: 5px;
}

.opinion-drug-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.drug-pill {
  background-color: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  padding: 1px 7px;
  display: inline-block;
  line-height: 1.6;
}
.drug-brand-label {
  font-weight: 400;
  opacity: 0.72;
  margin-left: 3px;
}

/* Source traceability row */
.opinion-source-trace {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-top: 8px;
  border-top: 1px solid var(--slate-100);
}

.source-name-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--teal-600);
  text-decoration: none;
  transition: color 0.15s;
}

.source-name-link:hover {
  text-decoration: underline;
  color: var(--teal-700);
}

.source-name-text {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-700);
}

.source-trace-detail {
  font-size: 11px;
  color: var(--slate-400);
  line-height: 1.4;
}

/* Metrics row */
.opinion-metrics-row {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--slate-100);
  padding-top: 10px;
  margin-top: 2px;
}

.metric-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 12px;
  border-right: 1px solid var(--slate-100);
}

.metric-item:last-child {
  border-right: none;
  padding-right: 0;
  padding-left: 12px;
}

.metric-item + .metric-item {
  padding-left: 12px;
}

.metric-num {
  font-size: 18px;
  font-weight: 700;
  color: var(--slate-900);
  line-height: 1;
}

.metric-lbl {
  font-size: 10px;
  color: var(--slate-400);
  line-height: 1.3;
}

/* ── Opinion hover tooltip ────────── */
.op-hover-tip {
  position: fixed;
  z-index: 9999;
  background: var(--slate-900);
  color: #f1f5f9;
  font-size: 12px;
  line-height: 1.65;
  padding: 10px 14px;
  border-radius: 8px;
  max-width: 380px;
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.28);
  pointer-events: none;
  display: none;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── Sidebar: opinion coverage ────── */

.cov-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}

.cov-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--slate-100);
  font-size: 12px;
}

.cov-row:last-child {
  border-bottom: none;
}

.cov-label {
  color: var(--slate-600);
}

.cov-val {
  font-weight: 700;
  color: var(--slate-900);
}

.fmt-breakdown-list {
  border-top: 1px solid var(--slate-100);
  padding-top: 8px;
  display: flex;
  flex-direction: column;
}

.fmt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
  padding: 5px 0;
  border-bottom: 1px solid var(--slate-100);
  color: var(--slate-600);
}

.fmt-row:last-child {
  border-bottom: none;
}

.fmt-name {
  color: var(--slate-600);
}

.fmt-count {
  font-weight: 700;
  color: var(--slate-900);
}

/* Drug mention index — right-aligned */
.drug-idx-list {
  display: flex;
  flex-direction: column;
}

.drug-idx-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid var(--slate-100);
  font-size: 12px;
}

.drug-idx-row:last-child {
  border-bottom: none;
}

.drug-idx-name {
  color: var(--slate-700);
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  flex: 1;
}

.drug-idx-count {
  font-size: 11px;
  font-weight: 700;
  color: var(--teal-700);
  white-space: nowrap;
  flex-shrink: 0;
}

.drug-idx-more {
  font-size: 11px;
  color: var(--slate-400);
  padding: 6px 0 2px;
  text-align: center;
}

/* Drug stance list — replaces cramped table in narrow sidebar */
.stance-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.stance-item {
  padding: 8px 0;
  border-bottom: 1px solid var(--slate-100);
}

.stance-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.stance-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.stance-item-top .drug-pill {
  max-width: 160px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.stance-item-context {
  font-size: 11px;
  color: var(--slate-500);
  line-height: 1.55;
  margin: 0;
}

/* Sidebar note text + source-linked badge */
.sidebar-note {
  font-size: 11px;
  color: var(--slate-500);
  line-height: 1.6;
  margin-bottom: 6px;
}

.source-linked-badge {
  display: inline-block;
  background-color: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  font-size: 11px;
  font-weight: 700;
  border-radius: 20px;
  padding: 3px 12px;
  margin-top: 4px;
}

/* Legacy aliases */
.topic-chip {
  background-color: var(--slate-100);
  color: var(--slate-700);
  font-size: 11px;
  border-radius: 4px;
  padding: 1px 7px;
  display: inline-block;
  line-height: 1.6;
}

/* Preserve old drug-index-* classes for any other usage */
.drug-index-bar-row { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; font-size: 12px; }
.drug-index-name    { flex: 1; color: var(--teal-700); font-weight: 600; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.drug-index-bar-wrap { width: 60px; height: 6px; background-color: var(--slate-100); border-radius: 3px; overflow: hidden; flex-shrink: 0; }
.drug-index-bar-fill { height: 100%; background-color: var(--teal-500); border-radius: 3px; }
.drug-index-count   { font-size: 11px; color: var(--slate-500); width: 24px; text-align: right; flex-shrink: 0; }
.format-row         { display: flex; align-items: center; justify-content: space-between; font-size: 12px; padding: 4px 0; border-bottom: 1px solid var(--slate-100); }
.format-row:last-child { border-bottom: none; }
.format-name        { color: var(--slate-600); }
.format-count       { color: var(--slate-900); font-weight: 700; }

.drug-stance-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.drug-stance-table th {
  text-align: left;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  color: var(--slate-500);
  border-bottom: 1px solid var(--slate-200);
}

.drug-stance-table td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--slate-100);
  vertical-align: top;
}

.drug-stance-table tr:last-child td {
  border-bottom: none;
}

.stance-context {
  font-size: 11px;
  color: var(--slate-600);
  max-width: 200px;
  line-height: 1.4;
}

.stance-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  border-radius: 20px;
  padding: 1px 8px;
  line-height: 1.5;
}

.stance-positive {
  background-color: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.stance-negative {
  background-color: #fef2f2;
  color: #dc2626;
  border: 1px solid #fecaca;
}

.stance-mixed {
  background-color: #fffbeb;
  color: #d97706;
  border: 1px solid #fde68a;
}

.stance-neutral {
  background-color: var(--slate-100);
  color: var(--slate-600);
  border: 1px solid var(--slate-200);
}

.table-responsive {
  overflow-x: auto;
}

/* ==========================================================================
   16. INTELLIGENCE / OVERVIEW TAB
   ========================================================================== */

.overview-tab {
  display: flex;
  flex-direction: row;
  gap: 14px;
}

.intel-card {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
}

.intel-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.intel-card-header h3 {
  font-size: 14px;
  font-weight: 700;
  color: var(--slate-800);
  margin: 0;
}

.intel-icon {
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}

.intel-summary {
  font-size: 13px;
  color: var(--slate-600);
  line-height: 1.7;
}

.topic-row {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--slate-100);
}

.topic-row:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.topic-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.topic-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--slate-800);
}

.topic-conf-badge {
  font-size: 10px;
  font-weight: 600;
  border-radius: 20px;
  padding: 2px 8px;
  line-height: 1.4;
}

.conf-high {
  background-color: #dcfce7;
  color: #15803d;
}

.conf-medium {
  background-color: #fef9c3;
  color: #854d0e;
}

.conf-low {
  background-color: #fee2e2;
  color: #991b1b;
}

.confidence-bar {
  height: 4px;
  background-color: var(--slate-100);
  border-radius: 2px;
  margin-bottom: 6px;
  overflow: hidden;
}

.confidence-fill {
  height: 100%;
  background-color: var(--teal-500);
  border-radius: 2px;
}

.topic-position {
  font-size: 12px;
  color: var(--slate-600);
  line-height: 1.6;
  margin-top: 4px;
}

.topic-quotes {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
}

.topic-quotes li {
  font-size: 12px;
  color: var(--slate-600);
  font-style: italic;
  margin-bottom: 3px;
  padding-left: 10px;
  border-left: 2px solid var(--teal-200);
  line-height: 1.5;
}

.needs-list,
.trial-list {
  padding-left: 18px;
  font-size: 13px;
  color: var(--slate-600);
  line-height: 1.8;
}

/* ==========================================================================
   17. SIDEBAR
   ========================================================================== */

.two-col-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  overflow-x: hidden;
}

.main-col {
  flex: 1 1 0;
  min-width: 0;
  overflow-x: hidden;
}

.sidebar-col {
  flex: 0 0 260px;
  width: 260px;
  position: sticky;
  top: 60px;
  max-height: calc(100vh - 70px);
  overflow-y: auto;
  overflow-x: hidden;
  scrollbar-width: thin;
  scrollbar-color: var(--slate-200) transparent;
  padding-bottom: 16px;
}

.sidebar-col::-webkit-scrollbar { width: 4px; }
.sidebar-col::-webkit-scrollbar-track { background: transparent; }
.sidebar-col::-webkit-scrollbar-thumb { background: var(--slate-200); border-radius: 2px; }

.sidebar-card {
  background-color: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.sidebar-card-title,
.sidebar-card h4 {
  font-size: 12px;
  font-weight: 700;
  color: var(--slate-800);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--slate-100);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.bar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 5px;
}

.bar-year {
  font-size: 11px;
  color: var(--slate-500);
  width: 36px;
  flex-shrink: 0;
}

.bar-track {
  flex: 1;
  height: 8px;
  background-color: var(--slate-100);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background-color: var(--teal-500);
  border-radius: 3px;
  transition: width 0.5s ease-out;
}

.bar-count {
  font-size: 11px;
  color: var(--slate-500);
  width: 22px;
  text-align: right;
}

.theme-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.theme-chip {
  background-color: var(--teal-50);
  color: var(--teal-700);
  border: 1px solid var(--teal-200);
  font-size: 11px;
  border-radius: 20px;
  padding: 3px 10px;
  margin: 0;
  line-height: 1.4;
}

/* ==========================================================================
   18. MISC UTILITIES
   ========================================================================== */

.text-muted {
  color: var(--slate-400);
}

.nowrap {
  white-space: nowrap;
}

.truncate {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* ==========================================================================
   19. RESPONSIVE BREAKPOINTS
   ========================================================================== */

@media (max-width: 1200px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .two-col-layout {
    flex-direction: column;
  }
  .two-col-layout .sidebar-col {
    position: static;
    width: 100%;
    max-height: none;
  }
  .op-content-grid {
    grid-template-columns: 1fr;
  }
  .op-analytics-col {
    position: static;
    min-height: unset;
  }
  .op-analytics-scroll {
    position: static;
    overflow-y: visible;
  }
}

@media (max-width: 900px) {
  main {
    padding: 16px;
  }
  .pc-columns {
    flex-wrap: wrap;
  }
  .pc-identity {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--slate-100);
  }
  .pc-affiliations {
    flex: 1.5;
    border-right: 1px solid var(--slate-100);
  }
  .pc-contacts {
    flex: 1;
  }
  .pc-score {
    width: 100%;
    border-top: 1px solid var(--slate-100);
  }
  .scholarly-footprint {
    grid-template-columns: repeat(3, 1fr);
  }
  .coverage-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .opinions-grid { flex-direction: column; }
  .opinions-col { width: 100%; }
}

@media (max-width: 640px) {
  .pc-columns {
    flex-direction: column;
  }
  .pc-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
  .pc-kpi:nth-child(2) {
    border-right: none;
  }
  .pc-kpi:nth-child(3) {
    border-top: 1px solid var(--slate-100);
  }
  .pc-identity, .pc-affiliations, .pc-contacts, .pc-score {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--slate-100);
  }
  .pc-score {
    width: 100%;
  }
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .scholarly-footprint {
    grid-template-columns: repeat(2, 1fr);
  }
  .coverage-stats {
    grid-template-columns: repeat(2, 1fr);
  }
  .page-title {
    font-size: 18px;
  }
  .profile-name {
    font-size: 16px;
  }
}


/* ==========================================================================
   20. SPIN ANIMATION
   ========================================================================== */

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   21. REDESIGN OVERRIDES
   ========================================================================== */

:root {
  --ink: #0F1B3D;
  --muted: #5A6483;
  --line: #DDE2F0;
  --line-soft: #E8ECF6;
  --bg: #F4F6FB;
  --accent: #4338CA;
  --accent-ink: #3730A3;
  --accent-soft: #EEF0FF;
  --row-hover: #F0F2FF;
  --font-sans: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

body, main { background: var(--bg); color: var(--ink); }

/* shell */
.left-nav { display: none; }
.app-body { margin-left: 0; }
.top-bar { height: 56px; padding: 0 32px; justify-content: space-between; border-bottom-color: var(--line); }
.tb-breadcrumb { color: var(--muted); font-size: 13px; display: flex; align-items: center; }
.tb-breadcrumb a { color: var(--muted); text-decoration: none; }
.tb-breadcrumb a:hover { color: var(--ink); }
.tb-breadcrumb .sep { margin: 0 8px; }
.tb-breadcrumb b { color: var(--ink); font-weight: 500; }
.tb-badge { color: var(--ink); background: #fff; border: 1px solid #C9D5D3; border-radius: 5px; font-weight: 500; }
.tb-snap { font-size: 12px; color: var(--muted); }
main { padding: 28px 32px 40px; }
.tb-logout-btn { font-size: 12px; font-weight: 500; color: var(--muted); background: none; border: 1px solid var(--slate-200); border-radius: 6px; padding: 4px 10px; cursor: pointer; font-family: inherit; margin-left: 8px; }
.tb-logout-btn:hover { color: var(--ink); border-color: var(--slate-300); background: var(--slate-50); }

/* hero + buttons */
.dir-breadcrumb { color: var(--accent); font-weight: 600; letter-spacing: .08em; }
.dir-title { font-size: 30px; font-weight: 600; }
.dir-subtitle { color: var(--muted); }
.dir-btn-outline, .dir-btn-solid, .dir-qf-btn, .dir-meta-btn { border-radius: 6px; height: 36px; }
.dir-btn-solid { background: var(--accent); border-color: var(--accent); }
.dir-btn-solid:hover { background: var(--accent-ink); }

/* stat cards */
.stat-card { border-radius: 8px; padding: 18px 20px; border-color: var(--line); }
.stat-label, .stat-sub { color: var(--muted); }
.stat-number { font-size: 32px; font-weight: 600; letter-spacing: 0; margin-bottom: 4px; }

/* table panel + headers */
.table-panel { border-radius: 8px; border-color: var(--line); }
.col-filter-btn { display: none; }
.col-group { font-size: 11px; font-weight: 600; letter-spacing: .06em; color: var(--muted);
  background: #F7FAF9; border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.col-group:first-child { border-left: 0; }
.col-group-identity { border-right: none; }
.data-table th { font-size: 12px; font-weight: 500; text-transform: none; letter-spacing: 0; color: var(--muted);
  padding: 10px 14px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 14px; vertical-align: top; line-height: 1.4; border-bottom: 1px solid var(--line-soft); }
.data-table tbody tr:hover, .kol-row:hover .col-sticky { background: var(--row-hover); }
.col-sticky { box-shadow: none; }
.dir-table thead .col-sticky { background: #fff; }
.dir-table { min-width: 1900px; }

/* cells */
.kol-fullname { font-size: 14px; font-weight: 600; color: var(--accent); text-decoration: none; display: block; }
.kol-fullname:hover { text-decoration: underline; }
.dir-degree-inline { font-size: 12px; color: var(--muted); }
.dir-kol-code { background: none; border: 0; padding: 0; font-size: 13px; color: var(--ink); letter-spacing: 0; }
.dir-score { font-size: 14px; font-weight: 600; }
.dir-score span { color: var(--muted); font-weight: 400; }
.tier-badge { border-radius: 5px; font-size: 12px; font-weight: 600; padding: 2px 10px; border: 0; }
.tier-t1 { background: #FFE9A8; color: #6B4200; }
.tier-grey { background: #E8ECF6; color: #2B3558; }
.dir-indication { background: none; border: 1px solid #CBD2E6; color: #2B3558; border-radius: 5px;
  font-size: 12px; font-weight: 400; padding: 2px 8px; }
.dir-count-num { background: none; border: 0; font-weight: 600; font-size: 13px; color: var(--ink); }
.dir-lit-cell { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  max-width: 230px; color: var(--accent); }
.dir-popup-trigger { color: var(--accent); font-size: 12px; }
.dir-contact-link { color: var(--accent); font-size: 13px; text-decoration: none; }
.dir-contact-link:hover { text-decoration: underline; }
.dir-web-link { color: var(--accent); font-size: 13px; text-decoration: none; }
.dir-web-link:hover { text-decoration: underline; }
.dir-cell-text, .dir-cell-small { font-size: 13px; color: var(--ink); }

/* pagination */
.page-btn { border-radius: 6px; border-color: #C9D5D3; }
.page-btn.active, .page-num-btn.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.page-btn:hover:not(:disabled):not(.active), .page-num-btn:hover:not(.active) {
  border-color: var(--accent); color: var(--accent); background: var(--accent-soft);
}
.pg-gap { padding: 0 4px; color: var(--muted); font-size: 13px; }


/* ========== 22. PROFILE PAGE REDESIGN ========== */
.profile-topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.prof-back-btn { font-size: 13px; color: var(--muted); text-decoration: none; }
.prof-back-btn:hover { color: var(--ink); }
.prof-topbar-actions { display: flex; gap: 10px; }
.prof-btn-outline { height: 34px; padding: 0 16px; border-radius: 6px; border: 1px solid #C9D5D3; background: #fff; color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; }
.prof-btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.prof-btn-solid { height: 34px; padding: 0 16px; border-radius: 6px; border: none; background: var(--accent); color: #fff; font-size: 13px; font-weight: 500; cursor: pointer; }
.prof-btn-solid:hover { background: var(--accent-ink); }
.pc-identity { display: flex; flex-direction: column; }
.pc-avatar-wrap { margin-bottom: 4px; }
.pc-contact-text { font-size: 13px; color: var(--ink); }
.tab-count { display: inline-flex; align-items: center; justify-content: center; min-width: 22px; height: 18px; padding: 0 5px; background: var(--line); border-radius: 9px; font-size: 11px; font-weight: 600; color: var(--muted); margin-left: 4px; vertical-align: middle; }
.tab-btn.active .tab-count { background: rgba(255,255,255,0.25); color: #fff; }
.overview-tab { display: flex; flex-direction: row; gap: 24px; align-items: flex-start; margin-top: 20px; }
.overview-main { flex: 1 1 0; min-width: 0; }
.overview-sidebar { flex: 0 0 400px; width: 400px; }
.intel-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; margin-bottom: 16px; }
.intel-card-title { font-size: 14px; font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.intel-summary { font-size: 14px; color: var(--ink); line-height: 1.6; }
.topic-row { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.topic-row:last-child { border-bottom: none; }
.topic-name { font-size: 14px; font-weight: 600; }
.topic-position { font-size: 13px; color: var(--ink); line-height: 1.5; margin-top: 8px; }
.topic-quotes { font-size: 13px; color: var(--muted); line-height: 1.5; margin-top: 6px; padding-left: 16px; }
.topic-quotes li { margin-bottom: 4px; font-style: italic; }
.evidence-sources { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; padding-top: 8px; border-top: 1px dashed var(--line); }
.evidence-label { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; white-space: nowrap; }
.evidence-pill { display: inline-block; font-size: 11px; color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent); border-radius: 4px; padding: 2px 8px; line-height: 1.5; cursor: pointer; font-family: inherit; text-align: left; transition: background 0.15s; }
.evidence-pill:hover { background: var(--accent); color: #fff; }
@keyframes op-highlight-flash { 0%,100% { box-shadow: none; } 20%,80% { box-shadow: 0 0 0 3px var(--accent); background: var(--accent-soft); } }
.op-card-highlight { animation: op-highlight-flash 2.5s ease; }
.key-trials-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.key-trial-pill { display: inline-block; padding: 4px 10px; border-radius: 5px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 500; }
.needs-list { padding-left: 18px; font-size: 13px; color: var(--ink); line-height: 1.7; }

/* Sidebar mini charts */
.smc-chart { display: flex; flex-direction: column; gap: 13px; }
.smc-row { display: flex; align-items: center; gap: 10px; }
.smc-label { font-size: 13px; color: var(--muted); width: 100px; flex-shrink: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.smc-track { flex: 1; height: 9px; background: var(--line); border-radius: 5px; overflow: hidden; }
.smc-fill { height: 100%; border-radius: 5px; transition: width 0.5s ease; }
.smc-val { font-size: 13px; font-weight: 600; color: var(--ink); width: 40px; text-align: right; flex-shrink: 0; }

/* ========== 23. SHARED TAB SECTION STYLES ========== */
.tab-section-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 16px; padding-top: 20px; }
.tab-section-title { font-size: 20px; font-weight: 600; color: var(--ink); margin-bottom: 4px; }
.tab-section-sub { font-size: 13px; color: var(--muted); }
.tab-export-btn { flex-shrink: 0; height: 34px; padding: 0 14px; border-radius: 6px; border: 1px solid #C9D5D3; background: #fff; color: var(--ink); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap; }
.tab-export-btn:hover { border-color: var(--accent); color: var(--accent); }
.tab-filter-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.tab-filter-left { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.tab-filter-right { display: flex; align-items: center; gap: 10px; }
.tab-filter-btn { height: 30px; padding: 0 12px; border-radius: 6px; border: 1px solid #C9D5D3; background: #fff; color: var(--ink); font-size: 12px; cursor: pointer; transition: border-color 0.15s, background 0.15s, color 0.15s; }
.tab-filter-btn.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.tab-filter-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.tab-filter-chip { height: 30px; padding: 0 12px; border-radius: 6px; border: none; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 500; cursor: pointer; }
.tab-sort-label { font-size: 13px; color: var(--muted); }

/* Conference filter bar */
.conf-filter-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; }
.conf-filter-row { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; flex: 1; }
.conf-filter-group { display: flex; flex-direction: column; gap: 4px; }
.conf-filter-group-toggle { }
.conf-filter-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.conf-filter-select { height: 34px; padding: 0 28px 0 10px; border-radius: 6px; border: 1px solid #C9D5D3; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6483' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 8px center; appearance: none; font-size: 13px; color: var(--ink); cursor: pointer; min-width: 140px; outline: none; transition: border-color 0.15s; }
.conf-filter-select:focus { border-color: var(--accent); }
.conf-filter-select:hover { border-color: var(--accent); }
.conf-filter-meta { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.conf-results-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.conf-results-num { font-weight: 600; color: var(--ink); }
.conf-filter-reset { background: none; border: none; font-size: 12px; color: var(--accent); cursor: pointer; padding: 0; text-decoration: underline; }
.conf-filter-reset:hover { color: var(--accent-ink); }
.conf-filter-toggle-btn { height: 34px; padding: 0 12px; border-radius: 6px; border: 1px dashed #C9D5D3; background: #fff; color: var(--muted); font-size: 13px; cursor: pointer; display: flex; align-items: center; gap: 7px; transition: all 0.15s; white-space: nowrap; }
.conf-filter-toggle-btn.active { border-style: solid; border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.conf-filter-toggle-btn:hover:not(.active) { border-color: var(--accent); color: var(--accent); }
.conf-filter-toggle-badge { background: var(--line); color: var(--muted); border-radius: 10px; padding: 1px 6px; font-size: 11px; font-weight: 600; }
.conf-filter-toggle-btn.active .conf-filter-toggle-badge { background: var(--accent); color: #fff; }
.ybc-chart { display: flex; align-items: flex-end; gap: 4px; padding-bottom: 4px; height: 160px; }
.ybc-col { display: flex; flex-direction: column; align-items: center; flex: 1; min-width: 0; height: 100%; }
.ybc-bar-wrap { width: 100%; height: 100%; min-height: 90px; display: flex; flex-direction: column; justify-content: flex-end; }
.ybc-bar { width: 100%; background: var(--accent); border-radius: 3px 3px 0 0; min-height: 2px; }
.ybc-label { font-size: 9px; color: var(--muted); margin-top: 5px; writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; line-height: 1; }
.ybc-count { font-size: 10px; color: var(--muted); text-align: center; }
.glance-list { display: flex; flex-direction: column; gap: 0; }
.glance-row { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.glance-row:last-child { border-bottom: none; }
.glance-label { font-size: 13px; color: var(--muted); }
.glance-val { font-size: 14px; font-weight: 600; color: var(--ink); }

/* ========== 24. CONFERENCES TAB ========== */
.conf-two-col { display: flex; gap: 24px; align-items: flex-start; }
.conf-main-col { flex: 1 1 0; min-width: 0; }
.conf-sidebar-col { flex: 0 0 260px; width: 260px; }
.conf-featured-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 20px 24px; margin-bottom: 20px; }
.conf-featured-head { margin-bottom: 16px; }
.conf-featured-label-row { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.conf-year-big { font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1; }
.conf-latest-badge { font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); }
.conf-name { font-size: 18px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.conf-meta-row { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; margin-bottom: 10px; }
.conf-role-row { display: flex; align-items: center; gap: 10px; }
.conf-abs-count-text { font-size: 13px; color: var(--muted); }
.conf-abs-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 16px; }
.conf-abs-card { background: var(--bg); border: 1px solid var(--line-soft); border-radius: 6px; padding: 12px; }
.conf-abs-card-top { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.abs-code-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px; background: #fff; border: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.abs-code-link { border-color: var(--accent); color: var(--accent); }
.abs-code-link:hover { background: var(--accent-soft); }
.abs-type-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); }
.abs-pres-date { font-size: 11px; color: var(--muted); margin-left: auto; white-space: nowrap; align-self: center; }
.conf-abs-card-title { font-size: 12px; font-weight: 600; color: var(--teal-700); line-height: 1.4; margin: 0; }
.conf-abs-card-link { display: block; font-size: 12px; font-weight: 600; color: var(--teal-700); line-height: 1.4; margin: 0; text-decoration: none; }
.conf-abs-card-link:hover { text-decoration: underline; }
.conf-abs-role { font-size: 11px; color: var(--muted); margin-top: 6px; }
.conf-table-wrap { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.conf-table { width: 100%; }
.conf-year-cell { font-size: 13px; font-weight: 600; color: var(--ink); }
.conf-location-cell { font-size: 12px; color: var(--muted); margin-top: 2px; }
.conf-abs-cell { text-align: center; }
.abs-count-badge { display: inline-block; min-width: 24px; height: 24px; line-height: 24px; text-align: center; border-radius: 12px; background: var(--accent-soft); color: var(--accent-ink); font-size: 12px; font-weight: 600; padding: 0 6px; }
.themes-text-list { display: flex; flex-direction: column; gap: 0; }
.theme-text-item { font-size: 13px; color: var(--ink); padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.theme-text-item:last-child { border-bottom: none; }

/* Donut charts — column layout: SVG centered, full-width legend below */
.donut-col-wrap { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.donut-svg-center { flex: none; }
.donut-svg-wrap { flex: none; }
.donut-wrap { display: flex; align-items: center; gap: 14px; }
.donut-legend { width: 100%; display: flex; flex-direction: column; gap: 6px; }
.donut-legend-row { display: flex; align-items: center; gap: 7px; }
.donut-dot { flex: none; width: 9px; height: 9px; border-radius: 50%; }
.donut-legend-label { flex: 1; font-size: 12px; color: var(--ink); }
.donut-legend-val { font-size: 12px; font-weight: 600; color: var(--ink); min-width: 20px; text-align: right; }
.donut-legend-pct { font-size: 11px; color: var(--muted); min-width: 32px; text-align: right; }
.donut-seg { cursor: pointer; transition: opacity 0.15s, filter 0.15s; }
.donut-seg:hover { opacity: 0.82; filter: brightness(1.18); }

/* Topic / drug bar chart */
.topic-bars { display: flex; flex-direction: column; gap: 9px; }
.topic-bar-row { display: flex; align-items: center; gap: 8px; position: relative; cursor: default; }
.topic-bar-row[data-tooltip]::after { content: attr(data-tooltip); position: absolute; left: 0; top: calc(100% + 4px); background: #0F1B3D; color: #fff; font-size: 11px; line-height: 1.4; padding: 5px 9px; border-radius: 5px; white-space: nowrap; pointer-events: none; opacity: 0; z-index: 200; box-shadow: 0 4px 12px rgba(0,0,0,0.18); transition: opacity 0.15s; }
.topic-bar-row[data-tooltip]:hover::after { opacity: 1; }
.topic-bar-label { flex: 0 0 120px; font-size: 12px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topic-bar-track { flex: 1; height: 7px; background: var(--line); border-radius: 4px; overflow: hidden; }
.topic-bar-fill { height: 100%; background: linear-gradient(90deg, #4338CA, #7C3AED); border-radius: 4px; transition: width 0.4s ease; }
.topic-bar-count { flex: none; font-size: 12px; font-weight: 600; color: var(--muted); min-width: 22px; text-align: right; }

/* Conference presence overview card */
.conf-overview-card { border-left: 3px solid var(--accent) !important; }
.conf-overview-text { font-size: 13px; color: var(--muted); line-height: 1.6; margin: 0; }
.conf-overview-text strong { color: var(--ink); font-weight: 600; }

/* Recurring conference chips */
.conf-repeat-note { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.conf-repeat-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.conf-repeat-chip { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent-ink); font-size: 11px; font-weight: 600; }

/* ========== 25. LITERATURE TAB ========== */
.lit-two-col { display: flex; gap: 20px; align-items: stretch; }
.lit-main-col { flex: 0 0 54%; min-width: 0; }
.lit-sidebar-col { flex: 1 1 0; min-width: 280px; display: flex; flex-direction: column; }
.lit-sidebar-col .sidebar-card { flex: 1; display: flex; flex-direction: column; }
.lit-sidebar-col .rf-list { flex: 1; }
.lit-sidebar-col .ybc-chart { flex: 1; min-height: 120px; align-items: flex-end; }
.lit-search-wrap { position: relative; }
.lit-search-input { height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid #C9D5D3; background: #fff; font-size: 13px; color: var(--ink); width: 240px; outline: none; }
.lit-search-input:focus { border-color: var(--accent); }
.lit-col-header { display: flex; justify-content: space-between; padding: 0 0 8px 0; border-bottom: 1px solid var(--line); }
.lit-col-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lit-col-label-right { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); }
.lit-pub-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 4px 20px 16px; }
.lit-item { padding: 14px 0; border-bottom: 1px solid var(--line-soft); }
.lit-item:last-child { border-bottom: none; }
.lit-item-top-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.lit-item-tags { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.lit-year-tag { font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 4px; background: var(--line); color: var(--muted); }
.lit-title-link { font-size: 14px; font-weight: 500; color: var(--accent); text-decoration: none; line-height: 1.4; display: block; }
.lit-title-link:hover { text-decoration: underline; }
.lit-title-plain { font-size: 14px; font-weight: 500; color: var(--ink); line-height: 1.4; display: block; }
.lit-meta-row { margin-top: 4px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.lit-journal { font-size: 12px; color: var(--muted); }
.lit-citation-inline { font-size: 12px; color: var(--muted); }
.lit-pagination-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line-soft); flex-wrap: wrap; gap: 8px; }
.lit-showing { font-size: 13px; color: var(--muted); }
.footprint-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.footprint-cell { padding: 12px 8px; border-bottom: 1px solid var(--line-soft); }
.footprint-cell:nth-child(odd) { border-right: 1px solid var(--line-soft); }
.footprint-number { font-size: 20px; font-weight: 700; color: var(--ink); }
.footprint-label { font-size: 11px; color: var(--muted); margin-top: 2px; }
.rf-list { display: flex; flex-direction: column; gap: 10px; }
.rf-item-top { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.rf-topic { font-size: 13px; color: var(--ink); }
.rf-count { font-size: 12px; color: var(--muted); flex-shrink: 0; }
.rf-bar-track { height: 3px; background: var(--line); border-radius: 2px; }
.rf-bar-fill { height: 100%; background: var(--accent); border-radius: 2px; }

/* ========== 26. OPINIONS TAB UPDATE ========== */
.op-filters-right { display: flex; align-items: center; }
.op-showing-row { margin-bottom: 8px; }
.op-showing { font-size: 13px; color: var(--muted); }

/* bar chart tooltip */
.ybc-col { position: relative; cursor: default; }
.ybc-col[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #1E2B2A;
  color: #fff;
  padding: 5px 9px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  z-index: 20;
}
.ybc-col[data-tooltip]:hover::before {
  content: '';
  position: absolute;
  bottom: calc(100% + 1px);
  left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: #1E2B2A;
  pointer-events: none;
  z-index: 20;
}
.ybc-col:hover .ybc-bar { background: var(--accent-ink); }

/* ── Literature card enhancements ─────────────────────────────────────────── */
.lit-type-tag {
  display: inline-block;
  background: #EAF4F2;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.02em;
}
.lit-authors {
  font-size: 12px;
  color: var(--muted);
  margin: 3px 0 4px;
  font-style: italic;
}
.lit-role-chip {
  display: inline-block;
  background: #F3F4F6;
  color: #374151;
  font-size: 11px;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}

/* ── Literature: KOL insights section ─────────────────────────────────────── */
.lit-ins-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 8px;
  padding: 3px 9px;
  border: 1px solid var(--slate-200);
  border-radius: 12px;
  background: #F8FAFF;
  color: #4F46E5;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: background 0.15s, border-color 0.15s;
}
.lit-ins-toggle:hover,
.lit-ins-toggle--open { background: #EEF2FF; border-color: #C7D2FE; }
.lit-ins-chevron { font-size: 10px; margin-left: 2px; }
.lit-ins-body { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.lit-ins-card {
  background: #F8FAFF;
  border: 1px solid #E0E7FF;
  border-left: 3px solid #6366F1;
  border-radius: 6px;
  padding: 8px 12px;
}
.lit-ins-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.lit-ins-fmt {
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em;
  color: #6366F1; background: #EEF2FF; padding: 1px 6px; border-radius: 3px;
}
.lit-ins-topics { font-size: 11px; color: var(--slate-600); font-weight: 500; }
.lit-ins-year   { font-size: 11px; color: var(--slate-400); margin-left: auto; }
.lit-ins-excerpt { font-size: 12px; color: var(--slate-700); line-height: 1.5; margin: 0 0 5px; font-style: italic; }
.lit-ins-drugs  { display: flex; gap: 5px; flex-wrap: wrap; }
.lit-ins-drug   { font-size: 10px; font-weight: 600; background: var(--teal-50); color: var(--teal-700); border: 1px solid var(--teal-200); border-radius: 3px; padding: 1px 6px; }

/* ── Abstract AI Summary ─────────────────────────────────────────────────── */
.lit-ai-summary {
  margin-top: 10px;
  padding: 10px 12px;
  background: #F0FDF4;
  border: 1px solid #BBF7D0;
  border-left: 3px solid #16A34A;
  border-radius: 6px;
}
.lit-ai-label {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #15803D;
  text-transform: uppercase;
  margin-bottom: 5px;
}
.lit-ai-text {
  font-size: 12px;
  color: #1E293B;
  line-height: 1.55;
  margin: 0 0 6px;
}
.lit-ai-findings {
  margin: 0 0 6px;
  padding-left: 16px;
  font-size: 11px;
  color: #334155;
  line-height: 1.5;
}
.lit-ai-findings li { margin-bottom: 2px; }
.lit-ai-drugs { display: flex; gap: 5px; flex-wrap: wrap; }

/* ── Literature filter dropdown ────────────────────────────────────────────── */
.literature-tab { position: relative; }
.lit-dropdown {
  position: absolute;
  z-index: 100;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.10);
  min-width: 180px;
  max-height: 260px;
  overflow-y: auto;
  padding: 4px 0;
}
.lit-dd-item {
  padding: 8px 14px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
}
.lit-dd-item:hover { background: #F3FAF9; }
.lit-dd-item.active { color: var(--accent); font-weight: 600; background: #EAF4F2; }
.tab-filter-btn.has-filter {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.lit-clear-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color 0.15s;
}
.lit-clear-btn:hover { color: var(--ink); }

/* ── Literature source badge ───────────────────────────────────────────────── */
.lit-source-badge {
  display: inline-flex;
  align-items: center;
  background: #EEF2FF;
  color: #4F46E5;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}
.lit-source-badge--right {
  margin-left: auto;
}

/* ── Literature card inline year & meta dot ────────────────────────────────── */
.lit-year-inline {
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}
.lit-meta-dot {
  color: var(--line);
  margin: 0 5px;
  font-size: 12px;
}

/* Literature sidebar — multi-card layout: each card sizes to its content */
.lit-sidebar-col .sidebar-card  { flex: 0 0 auto; }
.lit-sidebar-col .rf-list       { flex: none; }
.lit-sidebar-col .ybc-chart     { flex: none; min-height: 0; height: 110px; }
.lit-sidebar-col .ybc-bar-wrap  { min-height: 0; }
.lit-sidebar-col .ybc-label     { font-size: 8px; }

/* ── Tooltip icon (.tip-icon) ─────────────────────────────────────────────── */
.tip-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--muted);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  font-style: italic;
  cursor: help;
  position: relative;
  margin-left: 5px;
  vertical-align: middle;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}

.global-tip {
  position: fixed;
  z-index: 10000;
  background: #1E2B2A;
  color: #fff;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.45;
  padding: 7px 11px;
  border-radius: 6px;
  max-width: 220px;
  pointer-events: none;
  display: none;
  box-shadow: 0 3px 10px rgba(0,0,0,0.2);
  white-space: normal;
}

.stance-extra { display: none; }
.stance-extra.stance-extra-visible { display: block; }
.stance-more-btn {
  display: inline-block;
  background: none;
  border: none;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0 2px;
  font-family: inherit;
}
.stance-more-btn:hover { text-decoration: underline; }
