/* ═══════════════════════════════════════════════════════════════
   Neuronal Miniexon Atlas — Stylesheet
   ═══════════════════════════════════════════════════════════════ */

/* ── Variables ─────────────────────────────────────────────────── */
:root {
  --navy:       #0d1b2a;
  --navy-mid:   #1b2d42;
  --navy-light: #243b55;
  --accent:     #3a86ff;
  --accent2:    #06d6a0;
  --accent3:    #ffb703;
  --neuron:     #e63946;
  --text:       #e8edf2;
  --text-muted: #8fa3b8;
  --border:     rgba(255,255,255,0.08);
  --card-bg:    rgba(27,45,66,0.85);
  --card-hover: rgba(36,59,85,0.95);
  --radius:     12px;
  --radius-sm:  7px;
  --shadow:     0 4px 24px rgba(0,0,0,0.35);
  --shadow-lg:  0 8px 40px rgba(0,0,0,0.5);
  --font-mono:  'JetBrains Mono', 'Fira Mono', 'Courier New', monospace;
}

/* ── Reset & Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--navy);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  font-size: 16px;
}

a { color: var(--accent); text-decoration: none; transition: color .2s; }
a:hover { color: #74b3ff; text-decoration: underline; }

/* ── Scrollbar ──────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--navy); }
::-webkit-scrollbar-thumb { background: var(--navy-light); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ══════════════════════════════════════════════════════════════════
   NAVBAR
   ══════════════════════════════════════════════════════════════════ */
.navbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(13,27,42,0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  height: 62px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 16px rgba(0,0,0,0.4);
}

.navbar-brand {
  display: flex; align-items: center; gap: 12px;
  text-decoration: none;
}
.navbar-brand:hover { text-decoration: none; }

.navbar-logo { height: 38px; width: auto; }

.navbar-title {
  font-size: 1.15rem; font-weight: 700; letter-spacing: .02em;
  color: var(--text);
  line-height: 1.2;
}
.navbar-title span { color: var(--accent); }
.navbar-subtitle {
  font-size: 0.68rem; color: var(--text-muted); letter-spacing: .06em;
  text-transform: uppercase;
}

.navbar-search {
  display: flex; align-items: center; gap: 8px;
  position: relative;
}
.navbar-search input {
  background: var(--navy-light);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  padding: 6px 16px 6px 38px;
  font-size: 0.92rem;
  width: 220px;
  outline: none;
  transition: border-color .2s, width .3s;
}
.navbar-search input:focus {
  border-color: var(--accent);
  width: 280px;
}
.navbar-search .search-icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--text-muted); pointer-events: none;
}
.navbar-links { display: flex; gap: 1.5rem; align-items: center; }
.navbar-links a {
  color: var(--text-muted); font-size: 0.92rem; font-weight: 500;
  transition: color .2s;
}
.navbar-links a:hover { color: var(--text); text-decoration: none; }

/* ══════════════════════════════════════════════════════════════════
   HERO (index page)
   ══════════════════════════════════════════════════════════════════ */
.hero {
  position: relative; overflow: visible;
  padding: 3.5rem 2rem 2.5rem;
  text-align: center;
  background: linear-gradient(135deg, #0d1b2a 0%, #1a2f4a 50%, #0d2137 100%);
  min-width: 0;
}
.hero::before {
  content: '';
  position: absolute; inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%233a86ff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}

/* ── Hero brand row: [graphic] | [name] ── */
.hero-brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-bottom: 1.2rem;
  /* let the row be as wide as needed, centred */
}
.hero-brand-graphic {
  /* SVG viewBox is 185×90 (≈2.056:1). Logo is larger than the text. */
  height: clamp(80px, 13vw, 160px);
  width: auto;
  flex-shrink: 0;
  filter: drop-shadow(0 0 20px rgba(58,134,255,0.45));
}
.hero-brand-divider {
  width: 2px;
  height: clamp(50px, 9vw, 110px);
  background: rgba(255,255,255,0.18);
  margin: 0 clamp(14px, 2.5vw, 36px);
  flex-shrink: 0;
  border-radius: 1px;
}
.hero-brand-name {
  font-family: 'Inter', system-ui, sans-serif;
  /* font-size drives the height — keep in sync with graphic height above */
  font-size: clamp(2rem, 5.5vw, 5rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #e2e8f0;
  line-height: 1;
  white-space: nowrap;
}
.hero-brand-accent {
  background: linear-gradient(90deg, #fcd34d, #fb923c);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
  filter: drop-shadow(0 0 14px rgba(251,146,60,0.5));
}

/* ── Hero subtitle (row 2) ── */
.hero-subtitle {
  font-size: clamp(1rem, 2.5vw, 1.6rem);
  font-weight: 600;
  color: #cbd5e1;
  letter-spacing: 0.01em;
  margin-bottom: 0.6rem;
}
.hero-subtitle .tagline-highlight {
  color: #fbbf24;
  font-weight: 700;
}

/* ── Tagline (row 3) ── */
.hero p.tagline {
  font-size: clamp(0.9rem, 1.6vw, 1.05rem);
  color: var(--text-muted);
  max-width: 620px;
  margin: 0 auto 2.2rem;
}
.hero p.tagline .tagline-highlight {
  color: inherit;
  font-weight: inherit;
  white-space: nowrap;
}

/* Stats bar */
.stats-bar {
  display: flex; justify-content: center; gap: 3rem;
  margin-bottom: 2.5rem;
}
.stat-item { text-align: center; }
.stat-num {
  font-size: 2rem; font-weight: 800; color: var(--accent);
  display: block; line-height: 1;
}
.stat-label { font-size: 0.78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .08em; }

/* Search box (hero) */
.hero-search-wrap {
  max-width: 560px; margin: 0 auto;
  position: relative;
}
.hero-search-wrap input {
  width: 100%;
  background: rgba(255,255,255,0.07);
  border: 1.5px solid rgba(58,134,255,0.35);
  border-radius: 30px;
  color: var(--text);
  padding: 14px 56px 14px 24px;
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, background .2s;
}
.hero-search-wrap input:focus {
  border-color: var(--accent);
  background: rgba(255,255,255,0.1);
}
.hero-search-wrap input::placeholder { color: var(--text-muted); }
.hero-search-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: var(--accent); border: none; border-radius: 24px;
  color: #fff; padding: 8px 20px; font-size: 0.9rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.hero-search-btn:hover { background: #2563eb; }

/* Autocomplete dropdown */
.autocomplete-list {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0;
  background: var(--navy-mid);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-height: 280px; overflow-y: auto;
  z-index: 200;
  box-shadow: var(--shadow-lg);
  display: none;
}
.autocomplete-list.open { display: block; }
.autocomplete-item {
  padding: 9px 18px; cursor: pointer;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.95rem;
  transition: background .15s;
}
.autocomplete-item:hover, .autocomplete-item.active {
  background: var(--navy-light);
}
.autocomplete-item .evt-badge {
  font-size: 0.72rem; color: var(--text-muted);
  font-family: var(--font-mono);
}

/* ══════════════════════════════════════════════════════════════════
   GENE TABLE (index)
   ══════════════════════════════════════════════════════════════════ */
.section { padding: 2.5rem 2rem; max-width: 1300px; margin: 0 auto; }
.section-title {
  font-size: 1.1rem; font-weight: 700; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .1em;
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: 10px;
}
.section-title::after {
  content: ''; flex: 1; height: 1px; background: var(--border);
}

.gene-table-wrap {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.gene-table-filter {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
}
.gene-table-filter input {
  background: var(--navy-light); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); padding: 6px 12px;
  font-size: 0.85rem; outline: none; width: 220px;
}
.gene-table-filter input:focus { border-color: var(--accent); }

table.gene-table {
  width: 100%; border-collapse: collapse; font-size: 0.93rem;
}
table.gene-table thead th {
  background: var(--navy-light);
  padding: 10px 14px; text-align: left;
  font-weight: 600; color: var(--text-muted);
  text-transform: uppercase; font-size: 0.75rem; letter-spacing: .07em;
  border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
table.gene-table thead th:hover { color: var(--text); }
table.gene-table tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s;
}
table.gene-table tbody tr:hover { background: var(--card-hover); }
table.gene-table tbody td { padding: 9px 14px; }
table.gene-table tbody td:first-child { font-weight: 700; color: var(--accent); }
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 10px;
  font-size: 0.72rem; font-weight: 600; font-family: var(--font-mono);
}
.badge-event { background: rgba(58,134,255,0.15); color: #74b3ff; }
.badge-length { background: rgba(6,214,160,0.15); color: #06d6a0; }
.badge-disorder { background: rgba(230,57,70,0.15); color: #ff6b6b; }
.badge-ok { background: rgba(6,214,160,0.15); color: #06d6a0; }

/* ══════════════════════════════════════════════════════════════════
   GENE PAGE LAYOUT
   ══════════════════════════════════════════════════════════════════ */
.gene-page { max-width: 1400px; margin: 0 auto; padding: 1.5rem 2rem 4rem; }

/* Breadcrumb */
.breadcrumb {
  font-size: 0.82rem; color: var(--text-muted);
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: 6px;
}
.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb .sep { opacity: .4; }

/* Gene header */
.gene-header {
  display: flex; align-items: flex-start; gap: 1.5rem;
  margin-bottom: 2rem;
  padding: 1.5rem 2rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative; overflow: hidden;
}
.gene-header::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--accent2));
}
.gene-icon {
  width: 56px; height: 56px; border-radius: 14px;
  background: linear-gradient(135deg, rgba(58,134,255,0.2), rgba(6,214,160,0.2));
  border: 1px solid rgba(58,134,255,0.3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  font-size: 1.6rem;
}
.gene-header-info { flex: 1; }
.gene-name {
  font-size: 2rem; font-weight: 800; color: var(--text);
  letter-spacing: -.02em; line-height: 1;
  margin-bottom: .3rem;
}
.gene-event-id {
  font-family: var(--font-mono); font-size: 0.82rem;
  color: var(--text-muted); margin-bottom: .6rem;
}
.gene-links { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: .8rem; }
.ext-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 12px; border-radius: 16px; font-size: 0.8rem; font-weight: 600;
  border: 1px solid; transition: all .2s; text-decoration: none;
}
.ext-link:hover { text-decoration: none; transform: translateY(-1px); }
.ext-link-vastdb { color: #74b3ff; border-color: rgba(58,134,255,0.4); background: rgba(58,134,255,0.08); }
.ext-link-vastdb:hover { background: rgba(58,134,255,0.18); }
.ext-link-genecards { color: #ffd166; border-color: rgba(255,209,102,0.4); background: rgba(255,209,102,0.08); }
.ext-link-genecards:hover { background: rgba(255,209,102,0.18); }
.ext-link-uniprot { color: #06d6a0; border-color: rgba(6,214,160,0.4); background: rgba(6,214,160,0.08); }
.ext-link-uniprot:hover { background: rgba(6,214,160,0.18); }
.gene-summary {
  font-size: 0.93rem; color: var(--text-muted); line-height: 1.65;
  max-width: 700px;
}
.gene-summary.loading { font-style: italic; opacity: .6; }

/* Other events alert */
.other-events-bar {
  background: rgba(255,183,3,0.1); border: 1px solid rgba(255,183,3,0.3);
  border-radius: var(--radius-sm); padding: 8px 14px;
  font-size: 0.83rem; color: var(--accent3);
  margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: 8px;
}

/* ── Panel cards ────────────────────────────────────────────────── */
.panel {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
  overflow: hidden;
}
.panel-header {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px;
  background: rgba(255,255,255,0.02);
}
.panel-num {
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  font-size: 0.78rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.panel-title { font-size: 1.05rem; font-weight: 700; }
.panel-body { padding: 1.5rem; }

/* ── Info grid ──────────────────────────────────────────────────── */
.info-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem; margin-bottom: 1.5rem;
}
.info-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.info-card-label {
  font-size: 0.72rem; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .07em;
  margin-bottom: 4px;
}
.info-card-value {
  font-size: 1.05rem; font-weight: 700; color: var(--text);
  font-family: var(--font-mono);
}
.info-card-value.highlight { color: var(--accent2); }

/* Biophysics table */
.biophys-table {
  width: 100%; border-collapse: collapse; font-size: 0.92rem;
  margin-bottom: 1.5rem;
}
.biophys-table th {
  background: var(--navy-light); padding: 8px 12px;
  text-align: left; font-weight: 600; color: var(--text-muted);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}
.biophys-table td {
  padding: 8px 12px; border-bottom: 1px solid var(--border);
  font-family: var(--font-mono);
}
.biophys-table tr:last-child td { border-bottom: none; }
.biophys-table .col-miniexon { color: var(--accent3); font-weight: 600; }
.biophys-table .col-protein  { color: var(--text-muted); }

/* AA sequence display */
.aa-seq-wrap {
  background: rgba(0,0,0,0.25);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  line-height: 1.8;
  word-break: break-all;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 1.5rem;
}
.aa-seq-wrap .miniexon-aa { color: var(--accent3); font-weight: 700; background: rgba(255,183,3,0.15); border-radius: 2px; }
.aa-seq-wrap .disorder-aa { color: #ff6b8a; background: rgba(230,57,70,0.12); border-radius: 2px; }

/* ── Plot containers ────────────────────────────────────────────── */
.plot-container {
  width: 100%; border-radius: var(--radius-sm);
  overflow: visible;
  position: relative;
}
#psi-plot { height: 420px; }
#fuzdrop-plot { height: 380px; }
#disorder-track { height: 90px; margin-top: 4px; }

/* ── Image gallery ──────────────────────────────────────────────── */
.iso-columns {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem;
}
.iso-col-title {
  font-size: 0.85rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; margin-bottom: .8rem;
  display: flex; align-items: center; gap: 6px;
}
.iso-col-title .dot {
  width: 10px; height: 10px; border-radius: 50%;
}
.dot-long  { background: var(--accent); }
.dot-short { background: var(--accent2); }

/* ── Image toolbar ──────────────────────────────────────────────── */
.img-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 1.2rem;
}
.img-toolbar-group {
  display: flex; align-items: center; gap: 7px;
  flex: 1; min-width: 180px;
}
.toolbar-label {
  font-size: 0.75rem; color: var(--text-muted);
  white-space: nowrap; min-width: 60px;
}
.img-slider {
  flex: 1; height: 4px; cursor: pointer;
  accent-color: var(--accent);
  background: var(--navy-light);
  border-radius: 2px;
}
.slider-val {
  font-size: 0.72rem; font-family: var(--font-mono);
  color: var(--accent2); min-width: 38px; text-align: right;
}
.toolbar-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 14px; font-size: 0.78rem; font-weight: 600;
  border: 1px solid rgba(58,134,255,0.4);
  background: rgba(58,134,255,0.1); color: #74b3ff;
  cursor: pointer; transition: background .2s;
  white-space: nowrap;
}
.toolbar-btn:hover { background: rgba(58,134,255,0.22); }
.toolbar-btn-reset {
  border-color: rgba(255,255,255,0.15);
  background: rgba(255,255,255,0.05); color: var(--text-muted);
}
.toolbar-btn-reset:hover { background: rgba(255,255,255,0.12); color: var(--text); }

/* ── Image grid ─────────────────────────────────────────────────── */
.img-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
}
.img-thumb {
  aspect-ratio: 1; border-radius: var(--radius-sm);
  overflow: hidden; cursor: pointer;
  border: 2px solid transparent;
  transition: border-color .2s, transform .2s;
  background: var(--navy-light);
  position: relative;
}
.img-thumb:hover { border-color: var(--accent); transform: scale(1.03); }
.img-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: filter .25s ease;
}

.no-images {
  text-align: center; padding: 3rem 1rem;
  color: var(--text-muted); font-size: 0.9rem;
}
.no-images svg { opacity: .3; margin-bottom: .8rem; }

/* ── Lightbox ───────────────────────────────────────────────────── */
.lightbox {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.92);
  align-items: center; justify-content: center;
}
.lightbox.open { display: flex; }
.lightbox-inner {
  position: relative; max-width: 90vw; max-height: 90vh;
  display: flex; flex-direction: column; align-items: center;
}
.lightbox-inner > img {
  max-width: min(88vw, 900px); max-height: 72vh;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  transition: filter .2s ease;
}
.lightbox-close {
  position: absolute; top: -14px; right: -14px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--neuron); border: none; color: #fff;
  font-size: 1.1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
}
.lightbox-nav {
  position: absolute; top: calc(36vh);
  background: rgba(255,255,255,0.1); border: none; color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  font-size: 1.1rem; display: flex; align-items: center; justify-content: center;
  transition: background .2s; z-index: 10;
}
.lightbox-nav:hover { background: rgba(255,255,255,0.25); }
.lightbox-prev { left: -52px; }
.lightbox-next { right: -52px; }
.lightbox-caption {
  text-align: center; margin-top: 8px;
  font-size: 0.82rem; color: var(--text-muted);
}

/* Lightbox viewport (zoom/pan container) */
.lb-viewport {
  width: min(88vw, 900px);
  height: 62vh;
  overflow: hidden;
  position: relative;
  border-radius: var(--radius-sm);
  background: #000;
  cursor: default;
  user-select: none;
}
.lb-viewport img {
  position: absolute;
  top: 0; left: 0;
  max-width: none; max-height: none;
  width: auto; height: auto;
  transform-origin: 0 0;
  transition: filter .2s ease;
  will-change: transform;
}
.lb-caption-row {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; margin-top: 6px; padding: 0 2px;
}
.lb-zoom-label {
  font-size: 0.72rem; font-family: var(--font-mono);
  color: var(--accent2); min-width: 44px; text-align: right;
}
.lb-zoom-btn {
  width: 26px; height: 26px; border-radius: 6px;
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 1rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lb-zoom-btn:hover { background: rgba(255,255,255,0.2); }

/* Lightbox brightness controls */
.lb-controls {
  width: 100%; margin-top: 10px;
  background: rgba(13,27,42,0.9);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.lb-ctrl-row {
  display: flex; align-items: center; gap: 8px;
}
.lb-ctrl-label {
  font-size: 0.72rem; color: var(--text-muted);
  min-width: 62px; white-space: nowrap;
}
.lb-slider {
  flex: 1; height: 4px; cursor: pointer;
  accent-color: var(--accent3);
}
.lb-val {
  font-size: 0.72rem; font-family: var(--font-mono);
  color: var(--accent3); min-width: 38px; text-align: right;
}

/* ── Search results / select event ─────────────────────────────── */
.results-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem; margin-top: 1.5rem;
}
.result-card {
  background: var(--card-bg); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 1.2rem 1.4rem;
  transition: border-color .2s, transform .2s, box-shadow .2s;
  cursor: pointer; text-decoration: none; display: block; color: var(--text);
}
.result-card:hover {
  border-color: var(--accent); transform: translateY(-2px);
  box-shadow: var(--shadow-lg); text-decoration: none; color: var(--text);
}
.result-card-gene { font-size: 1.3rem; font-weight: 800; color: var(--accent); }
.result-card-event { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.result-card-coord { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* ── Footer ─────────────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 2rem;
  text-align: center;
  font-size: 0.78rem; color: var(--text-muted);
  background: rgba(0,0,0,0.2);
}
footer a { color: var(--text-muted); }
footer a:hover { color: var(--text); }

/* ── Spinner ─────────────────────────────────────────────────────── */
.spinner {
  width: 28px; height: 28px; border-radius: 50%;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .iso-columns { grid-template-columns: 1fr; }
  .gene-header { flex-direction: column; }
  .hero h1 { font-size: 1.8rem; }
  .stats-bar { gap: 1.5rem; }
  .navbar-search { display: none; }
}
@media (max-width: 600px) {
  .info-grid { grid-template-columns: 1fr 1fr; }
  .panel-body { padding: 1rem; }
  .gene-page { padding: 1rem; }
}

/* ── Download buttons ───────────────────────────────────────────── */
.dl-btn {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 12px; font-size: 0.72rem; font-weight: 600;
  border: 1px solid rgba(6,214,160,0.35);
  background: rgba(6,214,160,0.08); color: #06d6a0;
  cursor: pointer; transition: background .2s; text-decoration: none;
  white-space: nowrap;
}
.dl-btn:hover { background: rgba(6,214,160,0.2); text-decoration: none; color: #06d6a0; }

/* ── Protein structure panel ────────────────────────────────────── */
.structure-panel {
  flex-direction: column;
  width: 420px; min-width: 320px; flex-shrink: 0;
  background: rgba(13,27,42,0.95);
  border: 1px solid rgba(255,183,3,0.35);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.structure-panel-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255,183,3,0.08);
  border-bottom: 1px solid rgba(255,183,3,0.2);
  font-size: .8rem; color: var(--text-muted);
}
.structure-viewer-wrap {
  width: 100%; height: 380px;
  position: relative;
  background: #0a1628;
  display: flex; align-items: center; justify-content: center;
}
#structure-legend { display: none; }  /* shown via JS once loaded */

/* ── Tooltip override for Plotly ─────────────────────────────────── */
.js-plotly-plot .plotly .modebar { background: transparent !important; }
.js-plotly-plot .plotly .modebar-btn path { fill: var(--text-muted) !important; }
