:root {
  --navy:        #1a3a5c;
  --teal:        #1a8a9a;
  --teal-mid:    #1e7a8a;
  --teal-pale:   #e5f5f7;
  --blue-sel:    #cce5ff;
  --hi-multi:    #d4edda;
  --hi-rna:      #fff3cd;
  --hi-methyl:   #e8d5f5;
  --hi-mirna:    #fce4ec;
}

* { box-sizing: border-box; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #fff;
  color: #222;
  font-size: 0.9rem;
  margin: 0;
}

/* ── Header ── */
header {
  background: var(--navy);
  color: #fff;
  padding: 0.9rem 1.5rem;
  border-bottom: 3px solid var(--teal);
}
header h1 { font-size: 1.35rem; font-weight: 700; margin: 0; letter-spacing: -0.01em; }
header p  { font-size: 0.82rem; opacity: 0.75; margin: 0.2rem 0 0; }

/* ── Page nav ── */
.page-nav {
  background: #fff;
  border-bottom: 2px solid #dee2e6;
  padding: 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}
.page-nav a {
  color: #555;
  font-weight: 500;
  font-size: 0.88rem;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: color 0.15s;
  white-space: nowrap;
}
.page-nav a:hover  { color: var(--teal); }
.page-nav a.active {
  color: var(--teal);
  border-bottom-color: var(--teal);
  font-weight: 600;
}

/* ── Page wrapper ── */
.page-body {
  max-width: 1600px;
  margin: 0 auto;
  padding: 1.2rem 1rem 2rem;
}

/* ── Filter bar ── */
.filter-bar {
  background: #f7fafc;
  border: 1px solid #d8e4ec;
  border-radius: 7px;
  padding: 0.8rem 1rem;
  margin-bottom: 1rem;
}
.filter-bar label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 3px;
  display: block;
}

/* ── Tabulator overrides ── */
.tabulator {
  border: 1px solid #d0dde8 !important;
  border-radius: 6px;
  overflow: hidden;
  font-size: 0.82rem;
  width: fit-content !important;
  max-width: 100%;
  margin: 0 auto;
}
.tabulator-outer { overflow-x: auto; }
.tabulator .tabulator-header,
.tabulator .tabulator-col,
.tabulator .tabulator-col.tabulator-sortable:hover {
  background: var(--navy) !important;
  border-bottom: 2px solid var(--teal) !important;
}
.tabulator .tabulator-col-title,
.tabulator .tabulator-col-sorter { color: #fff !important; }
.tabulator .tabulator-col { border-right-color: rgba(255,255,255,0.15) !important; }
.tabulator-row.tabulator-row-even { background: #f8fbfc; }
.tabulator-row:hover { background: var(--teal-pale) !important; cursor: pointer; }
.tabulator-row.best-multi  { background: var(--hi-multi)  !important; }
.tabulator-row.best-rna    { background: var(--hi-rna)    !important; }
.tabulator-row.best-methyl { background: var(--hi-methyl) !important; }
.tabulator-row.best-mirna  { background: var(--hi-mirna)  !important; }
.tabulator-row.sel-row     { background: var(--blue-sel)  !important; }
.tabulator .tabulator-footer { background: #f7fafc; border-top: 1px solid #d0dde8; }
.tabulator .tabulator-page.active { background: var(--teal); color: #fff; border-color: var(--teal); }

/* ── Chart section ── */
.chart-section { display: none; margin-top: 1.5rem; }
.chart-section.visible { display: block; }
.section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--navy);
  border-left: 3px solid var(--teal);
  padding-left: 0.65rem;
  margin-bottom: 0.75rem;
}
.chart-wrap { position: relative; height: 280px; }
.cm-wrap    { position: relative; }

/* ── CM toggle buttons ── */
.cm-btn-group .btn {
  font-size: 0.75rem;
  padding: 0.25rem 0.6rem;
  color: var(--teal);
  border-color: var(--teal);
}
.cm-btn-group .btn.active,
.cm-btn-group .btn:hover {
  background: var(--teal);
  color: #fff;
  border-color: var(--teal);
}

/* ── Placeholder ── */
.placeholder-tab {
  text-align: center;
  padding: 5rem 2rem;
  color: #7a8fa6;
}
.placeholder-tab .ph-icon { font-size: 2.8rem; margin-bottom: 0.8rem; }
.placeholder-tab h4 { color: #3a5070; font-size: 1.1rem; margin-bottom: 0.5rem; }
.placeholder-tab p  { font-size: 0.88rem; max-width: 440px; margin: 0 auto; }
.placeholder-tab code {
  background: #eef3f7;
  padding: 0.1em 0.4em;
  border-radius: 3px;
  color: var(--navy);
}

/* ── Loading ── */
.loading-center { text-align: center; padding: 5rem 1rem; }

/* ── Site footer ── */
footer.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
  font-size: 0.78rem;
  text-align: center;
  padding: 1rem 1.5rem;
  margin-top: 3rem;
}
footer.site-footer strong { color: rgba(255,255,255,0.92); }
footer.site-footer a { color: rgba(255,255,255,0.65); text-decoration: none; }
footer.site-footer a:hover { color: #fff; }

/* ── Legend pill ── */
.legend-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 0.75rem; margin-right: 0.75rem;
}
.legend-pill .swatch {
  width: 12px; height: 12px; border-radius: 3px; flex-shrink: 0;
}
