:root {
  --bg: #05070b;
  --panel: #0b0f14;
  --panel-alt: #111720;
  --text: #f2f4f8;
  --muted: #98a2b3;
  --border: #2a313b;
  --accent: #ff9f1a;
  --accent-soft: rgba(255, 159, 26, 0.14);
  --good: #2fd27f;
  --warn: #ffb347;
  --bad: #ff7b72;
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.42);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  color: var(--text);
  background: radial-gradient(circle at top, #17110b 0%, #0b0d11 30%, #05070b 100%);
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
.app-shell { min-height: 100vh; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(5, 7, 11, 0.92);
  border-bottom: 1px solid rgba(42, 49, 59, 0.9);
}
.topbar-inner {
  max-width: none;
  margin: 0;
  padding: 8px 6px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: center;
}
.brand h1 { margin: 0; font-size: 24px; letter-spacing: -0.02em; }
.nav-tabs { display: flex; flex-wrap: wrap; gap: 10px; }
.nav-tab {
  border: 1px solid var(--border);
  background: rgba(15, 27, 45, 0.96);
  color: var(--muted);
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 600;
  box-shadow: var(--shadow);
}
.nav-tab.active { background: var(--accent); color: #1a1205; border-color: var(--accent); }
.container { max-width: none; margin: 0; padding: 8px 6px 14px; }
.hero { display: grid; grid-template-columns: 1fr; gap: 10px; margin-bottom: 10px; }
.panel { background: var(--panel); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); }
.panel-pad { padding: 14px; }
.meta-list { display: grid; gap: 8px; }
.meta-row { display: flex; justify-content: space-between; gap: 12px; font-size: 11px; }
.meta-row span:first-child { color: var(--muted); }
.controls-row {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 10px;
  margin-bottom: 10px;
  align-items: stretch;
}
.controls-panel, .meta-panel {
  height: 100%;
  min-width: 0;
  overflow: hidden;
}
.field { display: grid; gap: 6px; min-width: 0; }
.field label { font-size: 11px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.field input, .field select, .field textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  background: #0f1620;
  border-radius: 12px;
  padding: 8px 10px;
  font: inherit;
  color: var(--text);
}
.controls-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(110px, 1fr));
  gap: 8px;
  align-items: start;
  min-width: 0;
}
.controls-grid-6 { grid-template-columns: repeat(6, minmax(110px, 1fr)); }
.compact-controls .field { position: relative; }
.filter-button {
  width: 100%;
  border: 1px solid var(--border);
  background: #0f1620;
  border-radius: 12px;
  padding: 8px 10px;
  color: var(--text);
  font: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
}
.filter-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  max-height: 220px;
  overflow: auto;
  background: #0f1620;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 8px;
  box-shadow: var(--shadow);
}
.menu-option {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 4px;
  color: var(--text);
  text-transform: none;
  letter-spacing: 0;
  font-weight: 500;
  text-align: left;
  width: 100%;
}
.menu-option-text {
  display: block;
  text-align: left;
  width: 100%;
}
.menu-option-all {
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  padding-bottom: 8px;
}
.tick { display: inline-flex; align-items: center; gap: 6px; color: var(--text); min-height: 36px; }
.pill-tick {
  border: 1px solid var(--border);
  background: #0f1620;
  border-radius: 12px;
  padding: 8px 10px;
}
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 8px; }
.badge-row, .chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.badge, .chip { display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; padding: 5px 8px; font-size: 11px; font-weight: 700; }
.badge { background: var(--accent-soft); color: var(--accent); }
.table-wrap { border: 1px solid var(--border); border-radius: 16px; overflow: auto; background: #090d12; }
.data-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}
.col-meta { width: 96px; }
.col-asset { width: 74px; min-width: 74px; max-width: 74px; }
.data-table th, .data-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle !important;
  text-align: center;
  font-size: 11px;
  line-height: 1.15;
}
.data-table td { white-space: nowrap; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #15110c;
  color: #f3b04d;
  text-align: center !important;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: normal;
}
.data-table tbody tr { height: 36px; }
.data-table tbody tr:hover td { background: #141922; }
.data-table tbody tr:hover td:first-child { background: #141922; }
.data-table td:first-child, .data-table th:first-child { position: sticky; left: 0; z-index: 1; background: inherit; }
.data-table th:first-child { z-index: 3; background: #15110c; }
.group-header {
  position: sticky;
  top: 0;
  z-index: 4;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  text-align: center !important;
  padding: 6px 8px !important;
  border-bottom: 1px solid var(--border);
}
.group-meta { background: #101317; color: #d2dae7; }
.group-fi { background: #10263f; color: #7cc4ff; }
.group-eq { background: #2a1808; color: #ffb347; }
.group-ra { background: #17311a; color: #8bf0aa; }
.group-div { background: #2c1230; color: #f0a3ff; }
.data-table thead tr:nth-child(2) th { top: 29px; }
.publisher-cell { min-width: 140px; font-weight: 700; text-align: center; white-space: nowrap; }
.numeric { text-align: center; font-variant-numeric: tabular-nums; }
.dim { color: var(--muted); }
.note-box { margin-top: 12px; background: #121820; border: 1px solid var(--border); border-radius: 12px; padding: 12px 14px; color: var(--muted); font-size: 11px; }
.row-excluded td { opacity: 0.35; }
.boxplot-row-wrap { overflow-x: auto; padding-bottom: 6px; }
.boxplot-stage { position: relative; min-width: 1340px; padding-top: 8px; }
.boxplot-guides { position: absolute; inset: 18px 0 28px 0; pointer-events: none; z-index: 0; }
.boxplot-guide { position: absolute; left: 0; right: 0; border-top: 1px dashed rgba(152, 162, 179, 0.22); }
.boxplot-guide-label { position: absolute; left: 0; transform: translateY(-50%); font-size: 9px; color: var(--muted); background: rgba(5, 7, 11, 0.85); padding: 0 4px; }
.boxplot-grid { display: grid; grid-template-columns: repeat(17, minmax(72px, 1fr)); gap: 6px; margin-top: 12px; min-width: 1340px; position: relative; z-index: 1; }
.boxplot-card { padding: 6px; border: 1px solid var(--border); border-radius: 10px; background: #0c1117; }
.boxplot-title { font-size: 9px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; text-align: center; }
.boxplot-empty { font-size: 10px; color: var(--muted); text-align: center; padding: 14px 0; }
.metric-table-wrap { margin-top: 10px; overflow-x: auto; }
.metric-table { width: 100%; min-width: 1340px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.metric-table th, .metric-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); font-size: 11px; text-align: center; vertical-align: middle; white-space: nowrap; }
.metric-table th { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; background: #101317; }
.metric-table .row-label { background: #101317; color: #d2dae7; font-weight: 700; }
.metric-table tbody tr { height: 42px; }
.source-links-inline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: nowrap;
  white-space: nowrap;
}
.source-link-sep {
  color: var(--muted);
}
.source-link-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.empty { padding: 20px; border: 1px dashed var(--border); border-radius: 14px; color: var(--muted); background: #0f1b2d; }
@media (max-width: 1180px) {
  .controls-row { grid-template-columns: 1fr; }
  .controls-grid, .controls-grid-6 { grid-template-columns: 1fr 1fr; }
}
