:root {
  --bg-0: #000000;
  --bg-1: #050505;
  --bg-2: #090909;
  --bg-3: #0f0f0f;
  --text-0: #ffffff;
  --text-1: #f3f3f3;
  --text-2: #b8b8b8;
  --border: rgba(255, 255, 255, 0.16);
  --accent: #22c55e;
  --accent-2: #16a34a;
  --accent-soft: rgba(34, 197, 94, 0.16);
  --danger: #fb7185;
  --warn: #fbbf24;
  --ok: #4ade80;
  --nav-h: 78px;
  --radius: 12px;
  --mono: "IBM Plex Mono", monospace;
  --sans: "Work Sans", -apple-system, system-ui, sans-serif;
  --serif: "Crimson Pro", serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  font-family: var(--sans);
  color: var(--text-0);
  background: var(--bg-0);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
}

.bg-grid {
  position: fixed;
  inset: 0;
  z-index: -2;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
}

.bg-orb {
  position: fixed;
  top: -120px;
  right: -120px;
  width: 500px;
  height: 500px;
  z-index: -1;
  background: radial-gradient(circle, rgba(34, 197, 94, 0.2) 0%, rgba(34, 197, 94, 0) 68%);
  filter: blur(24px);
}

.container {
  width: min(1480px, calc(100% - 3.5rem));
  margin-inline: auto;
}

/* extra-wide sections (Dune-like) */
.container.is-wide {
  width: min(1680px, calc(100% - 3.5rem));
}


.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  backdrop-filter: blur(10px) saturate(160%);
  background: rgba(0, 0, 0, 0.88);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 2rem));
  margin-inline: auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text-0);
  text-decoration: none;
  font-family: var(--serif);
  font-size: 1.55rem;
}

.brand-mark {
  width: 30px;
  height: 30px;
}

.nav {
  display: flex;
  gap: 1.25rem;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--text-1);
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.2rem 0;
  border-bottom: 1px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav a.active,
.nav a:hover {
  color: var(--text-0);
  border-color: var(--accent);
}

.nav-cta {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.85rem !important;
  color: var(--text-0) !important;
}

.nav-cta:hover,
.nav-cta.active {
  background: var(--accent-soft);
  border-color: rgba(34, 197, 94, 0.45);
}

.menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: transparent;
  padding: 8px;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  height: 2px;
  background: var(--text-0);
  margin: 5px 0;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--border);
  padding: 0.5rem 1rem 1rem;
  background: rgba(0, 0, 0, 0.98);
}

.mobile-nav a {
  display: block;
  color: var(--text-1);
  text-decoration: none;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

body.mobile-open .mobile-nav {
  display: block;
}

main {
  padding-bottom: 3rem;
}

.page {
  display: none;
  padding: 2rem 0 3rem;
  min-height: calc(100vh - var(--nav-h));
}

.page.active {
  display: block;
}

.page[data-page="use-cases"] {
  padding-top: 0.8rem;
}

.usecases-head {
  margin-top: 0.15rem;
  margin-bottom: 0.35rem;
}

.usecases-head h2 {
  margin: 0;
  font-size: clamp(1.6rem, 2.6vw, 2.15rem);
}

.usecases-head p {
  margin: 0.3rem 0 0;
  color: var(--text-1);
  font-size: 1rem;
}

.eyebrow {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  border: 1px solid rgba(34, 197, 94, 0.28);
  border-radius: 999px;
  padding: 0.35rem 0.7rem;
}

.hero-shell {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 1.2rem;
  align-items: stretch;
  margin-top: 1.5rem;
}

.hero-copy,
.hero-panel,
.card,
.metric-card,
.kpi-card,
.pricing-card,
.premium-card,
.code-card {
  background: linear-gradient(180deg, var(--bg-2), var(--bg-1));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.hero-copy {
  padding: 2.2rem;
}

.hero-copy h1 {
  margin: 1rem 0 0.8rem;
  font-family: var(--serif);
  font-size: clamp(2rem, 4.8vw, 3.65rem);
  line-height: 1.05;
}

.hero-copy p {
  color: var(--text-1);
  max-width: 64ch;
  margin: 0;
}

.hero-panel {
  padding: 1.25rem;
}

.hero-panel h2 {
  margin: 0;
  font-size: 1.1rem;
}

.hero-panel p {
  margin: 0.35rem 0 0.9rem;
  color: var(--text-1);
  font-size: 0.92rem;
}

.search-input-wrap {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.6rem;
}

input,
select,
textarea {
  width: 100%;
  background: var(--bg-3);
  color: var(--text-0);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.64rem 0.72rem;
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(34, 197, 94, 0.48);
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.18);
}

.search-results {
  margin-top: 0.75rem;
  max-height: 300px;
  overflow: auto;
  display: grid;
  gap: 0.45rem;
}

.search-result {
  background: #040404;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  width: 100%;
  text-align: left;
  color: var(--text-0);
}

.search-result:hover {
  border-color: rgba(34, 197, 94, 0.4);
}

.search-result .type {
  font-family: var(--mono);
  color: var(--accent);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.search-result .title {
  margin-top: 0.18rem;
  font-weight: 600;
}

.search-result .meta {
  margin-top: 0.16rem;
  color: var(--text-2);
  font-size: 0.82rem;
}

.quota-line {
  margin-top: 0.85rem;
  color: var(--text-2);
  font-size: 0.83rem;
  font-family: var(--mono);
}

.quota-line.pro-limit {
  color: var(--accent);
}

.cta-row {
  margin-top: 1.2rem;
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.btn {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.62rem 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  color: var(--text-0);
  background: transparent;
  transition: transform 0.14s ease, border-color 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #04110a;
}

.btn-primary:hover {
  background: #2dd46b;
}

.btn-secondary:hover {
  border-color: rgba(34, 197, 94, 0.5);
  background: rgba(34, 197, 94, 0.08);
}

.btn-small {
  padding: 0.5rem 0.8rem;
  font-size: 0.85rem;
}

.metrics-row {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.metric-card {
  padding: 1rem;
}

.metric-label,
.kpi-label {
  color: var(--text-2);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--mono);
}

.metric-value,
.kpi-value {
  font-size: 1.7rem;
  font-weight: 700;
  margin-top: 0.25rem;
}

.credibility {
  margin-top: 1rem;
  padding: 1rem;
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.08), rgba(34, 197, 94, 0.03));
  border: 1px solid rgba(34, 197, 94, 0.25);
  border-radius: var(--radius);
}

.cred-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.cred-head h3 {
  margin: 0;
}

.cred-head span {
  color: var(--text-2);
  font-size: 0.88rem;
}

.code-grid {
  margin-top: 0.9rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.code-card {
  padding: 0.9rem;
}

.code-title {
  font-size: 0.88rem;
  color: var(--text-1);
  margin-bottom: 0.5rem;
}

.code-card pre {
  margin: 0;
  overflow: auto;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 0.7rem;
}

.code-card code {
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-1);
}

.link-btn {
  margin-top: 0.5rem;
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  font-family: var(--mono);
  font-size: 0.79rem;
}

.premium-lock {
  margin: 0;
  padding: 0;
}

.section-head {
  margin-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 1rem;
}

.section-head h2 {
  margin: 0.5rem 0 0;
  font-size: clamp(1.55rem, 3vw, 2.25rem);
}

.section-head p {
  margin: 0.45rem 0 0;
  color: var(--text-1);
}

.head-actions {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.card {
  padding: 1rem;
}

.stack-gap {
  display: grid;
  gap: 0.8rem;
}

.filters-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.filters-grid label span,
.api-form label span {
  display: block;
  font-size: 0.82rem;
  color: var(--text-2);
  margin-bottom: 0.35rem;
}

.filter-buttons {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.saved-searches {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  padding: 0.7rem;
  background: #060606;
}

.saved-head {
  display: flex;
  justify-content: space-between;
  color: var(--text-1);
  font-size: 0.88rem;
}

.saved-list {
  margin-top: 0.5rem;
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.saved-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  border: 1px solid var(--border);
  background: var(--bg-3);
  color: var(--text-1);
  border-radius: 999px;
  padding: 0.25rem 0.55rem;
  font-size: 0.78rem;
}

.saved-chip button {
  border: 0;
  background: transparent;
  color: var(--accent);
  font-family: var(--mono);
  cursor: pointer;
  font-size: 0.75rem;
}

.table-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.8rem;
  color: var(--text-1);
  font-size: 0.98rem;
  margin-top: 0.35rem;
}

.mi-table-meta-right {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.icon-hint {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: #050505;
  color: var(--text-1);
  font-family: var(--mono);
  font-size: 0.73rem;
  letter-spacing: 0.02em;
  padding: 0.3rem 0.58rem;
  cursor: help;
}

.derived-pill {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  border: 1px solid rgba(34, 197, 94, 0.35);
  color: var(--accent);
}

.table-shell {
  width: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  background: #030303;
}

.table-shell.table-scroll {
  max-height: 520px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
  table-layout: fixed;
}

th,
td {
  padding: 0.9rem 1rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.11);
  text-align: left;
  font-size: 1.02rem;
  line-height: 1.35;
}


th {
  position: sticky;
  top: 0;
  background: #000000;
  color: #e7e7e7;
  font-family: var(--mono);
  font-size: 0.86rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  z-index: 1;
}

th[data-sort-type] {
  cursor: pointer;
  user-select: none;
}

th[data-sort-type]::after {
  content: "  ^v";
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.72rem;
}

th.sort-asc::after {
  content: "  ^";
  color: var(--accent);
}

th.sort-desc::after {
  content: "  v";
  color: var(--accent);
}

td {
  color: var(--text-1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}


table tbody tr {
  transition: background 160ms ease, transform 160ms ease;
}

table tbody tr:nth-child(odd) {
  background: #020202;
}

table tbody tr:hover {
  background: rgba(34, 197, 94, 0.14);
}
td strong {
  color: var(--text-0);
}

td.nowrap,
th.nowrap {
  white-space: nowrap;
}

.gated-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.9rem;
  border: 1px solid rgba(34, 197, 94, 0.36);
  border-radius: 10px;
  background: #070707;
  padding: 0.85rem 1rem;
}

.gated-panel strong {
  display: block;
  font-size: 0.95rem;
  color: #ffffff;
}

.gated-panel span {
  color: var(--text-2);
  font-size: 0.88rem;
}

.empty-state-note {
  color: var(--text-2);
  font-size: 0.92rem;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: 10px;
  padding: 0.65rem 0.8rem;
}

.mi-selftest-ok {
  color: #86efac;
  border-color: rgba(74, 222, 128, 0.44);
}

.mi-selftest-warn {
  color: #fde68a;
  border-color: rgba(251, 191, 36, 0.42);
}

.mi-selftest-bad {
  color: #fda4af;
  border-color: rgba(244, 63, 94, 0.46);
}

.empty {
  text-align: center;
  color: var(--text-2);
  padding: 1.1rem;
}

.kpi-grid {
  margin-top: 1.1rem;
  margin-bottom: 0.85rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.table-tools {
  display: grid;
  grid-template-columns: 1fr minmax(220px, 360px) auto;
  gap: 0.7rem;
  align-items: center;
  color: var(--text-1);
}

.table-tools span {
  font-size: 0.98rem;
}

.table-tools.two-col {
  grid-template-columns: 1fr minmax(240px, 380px);
}

.usecases-sticky-wrap {
  position: sticky;
  top: calc(var(--nav-h) + 0.2rem);
  z-index: 30;
  margin-top: 0.15rem;
}

.usecases-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  gap: 0.6rem;
  background: rgba(3, 3, 3, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 24px;
  padding: 0.5rem;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.usecase-panel {
  display: none;
  margin-top: 0.95rem;
}

.usecase-panel.active {
  display: grid;
  gap: 1rem;
}

.molecule-top-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, 0.9fr);
  gap: 1rem;
}

.molecule-top-grid > .card {
  min-height: 460px;
  height: 100%;
}

.molecule-top-list-card {
  display: flex;
  flex-direction: column;
  min-height: 460px;
  max-height: 460px;
}

.molecule-list-shell table {
  min-width: 420px;
}

.table-shell.table-scroll.molecule-top-table-shell {
  flex: 1;
  max-height: 286px;
}

.molecule-bottom-grid {
  display: block;
}

.molecule-evidence-card {
  width: 100%;
}

.molecule-evidence-shell {
  max-height: 560px;
}

.molecule-top-row {
  cursor: pointer;
}

.molecule-top-row.active td {
  background: rgba(34, 197, 94, 0.18);
}

.molecule-chart-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.kpi-card {
  padding: 0.95rem;
}

.kpi-sub {
  color: var(--text-2);
  font-size: 0.78rem;
}

.kpi-sub + .kpi-sub {
  margin-top: 0.12rem;
}

.premium-row {
  margin-top: 1rem;
}

.premium-card {
  padding: 1rem;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.premium-card h3 {
  margin: 0;
}

.premium-card p {
  margin: 0.45rem 0 0.8rem;
  color: var(--text-1);
}

.network-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.7rem;
}

.network-scroll {
  max-height: 360px;
  overflow: auto;
  padding-right: 0.2rem;
}

.network-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: #ffffff;
}

.network-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
  padding: 0.75rem;
  background: #050505;
}

.network-item .pair {
  font-weight: 600;
}

.network-item .meta {
  color: var(--text-2);
  margin-top: 0.3rem;
  font-size: 0.82rem;
}

.sticky-tabs {
  position: sticky;
  top: calc(var(--nav-h) + 0.4rem);
  z-index: 10;
  display: inline-flex;
  gap: 0.4rem;
  background: #030303;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.3rem;
}

.tab {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 0.72rem 1.1rem;
  cursor: pointer;
  color: #f2f2f2;
  background: #050505;
  font-weight: 700;
  font-size: 0.97rem;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease, transform 0.18s ease;
}

.tab:hover {
  border-color: rgba(34, 197, 94, 0.46);
  transform: translateY(-1px);
}

.tab.active {
  background: linear-gradient(180deg, rgba(34, 197, 94, 0.32), rgba(34, 197, 94, 0.2));
  border-color: rgba(34, 197, 94, 0.7);
  color: #ffffff;
  box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.22) inset;
}

.tab-panel {
  display: none;
}

.tab-panel.active {
  display: block;
}

.alert-list {
  display: grid;
  gap: 0.6rem;
}

.alert-item {
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-left: 3px solid var(--accent);
  border-radius: 10px;
  background: #050505;
  padding: 0.75rem;
}

.alert-item.critical {
  border-left-color: var(--danger);
}

.alert-item.warning {
  border-left-color: var(--warn);
}

.alert-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.alert-level {
  font-family: var(--mono);
  font-size: 0.72rem;
  text-transform: uppercase;
}

.chart-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.live-chart-grid {
  align-items: stretch;
}

.chart-card {
  min-height: 300px;
  max-height: 340px;
  display: flex;
  flex-direction: column;
  padding: 0.9rem;
}

.chart-card h3 {
  margin: 0;
  font-size: 1.22rem;
}

.chart-sub {
  margin: 0.25rem 0 0.5rem;
  color: #d5d5d5;
  font-size: 0.92rem;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: 240px !important;
  min-height: 240px;
  max-height: 240px;
  flex: 0 0 auto;
}

.usecase-panel[data-usecase-panel="molecule"] {
  gap: 1.25rem;
  margin-top: 1.1rem;
}

.usecase-panel[data-usecase-panel="molecule"] .kpi-grid {
  margin-top: 0.35rem;
  margin-bottom: 0.35rem;
  gap: 0.9rem;
}

.usecase-panel[data-usecase-panel="molecule"] .kpi-card {
  padding: 1.15rem;
}

.usecase-panel[data-usecase-panel="molecule"] .kpi-label {
  font-size: 0.9rem;
}

.usecase-panel[data-usecase-panel="molecule"] .kpi-value {
  font-size: 2rem;
}

.usecase-panel[data-usecase-panel="molecule"] .kpi-sub {
  font-size: 0.85rem;
}

.usecase-panel[data-usecase-panel="molecule"] .chart-card {
  min-height: 460px;
  max-height: 460px;
  padding: 1.05rem;
}

.usecase-panel[data-usecase-panel="molecule"] .chart-card h3 {
  font-size: 1.45rem;
}

.usecase-panel[data-usecase-panel="molecule"] .chart-sub {
  font-size: 1rem;
}

.usecase-panel[data-usecase-panel="molecule"] .chart-card canvas {
  height: 332px !important;
  min-height: 332px;
  max-height: 332px;
}

.usecase-panel[data-usecase-panel="molecule"] .table-tools span,
.usecase-panel[data-usecase-panel="molecule"] .table-meta span {
  font-size: 1.05rem;
  font-weight: 600;
}

.usecase-panel[data-usecase-panel="molecule"] th {
  font-size: 0.93rem;
}

.usecase-panel[data-usecase-panel="molecule"] td {
  font-size: 0.95rem;
  padding: 0.68rem 0.82rem;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] {
  min-width: 1500px;
  table-layout: auto;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] th,
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td.wrap-cell {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.28;
  word-break: break-word;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td.id-cell {
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(3),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(5),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(9) {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.3;
  word-break: break-word;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] th:nth-child(3),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(3) {
  min-width: 250px;
  max-width: 320px;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] th:nth-child(5),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(5) {
  min-width: 220px;
  max-width: 290px;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] th:nth-child(2),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(2) {
  min-width: 175px;
  max-width: 280px;
  white-space: nowrap;
  text-overflow: clip;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] th:nth-child(4),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(4),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] th:nth-child(6),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(6),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] th:nth-child(7),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(7),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] th:nth-child(8),
.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-evidence"] td:nth-child(8) {
  white-space: nowrap;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-top"] th {
  font-size: 0.84rem;
}

.usecase-panel[data-usecase-panel="molecule"] table[data-sort-table="molecule-top"] td {
  font-size: 0.86rem;
  padding: 0.55rem 0.72rem;
  line-height: 1.2;
}

.api-lock-note {
  color: var(--text-2);
  font-size: 0.88rem;
  border-top: 1px dashed rgba(255, 255, 255, 0.2);
  padding-top: 0.55rem;
}

.pricing-grid {
  margin-top: 1rem;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.pricing-card {
  padding: 1rem;
}

.pricing-card h3 {
  margin: 0;
}

.pricing-card .price {
  margin-top: 0.4rem;
  color: var(--accent);
  font-weight: 700;
}

.pricing-card ul {
  margin: 0.7rem 0 0;
  padding-left: 1rem;
  color: var(--text-1);
  display: grid;
  gap: 0.38rem;
}

.pricing-card.featured {
  border-color: rgba(34, 197, 94, 0.5);
  box-shadow: inset 0 0 0 1px rgba(34, 197, 94, 0.16);
}

.api-form {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.7rem;
}

.api-form button {
  grid-column: 1 / -1;
}

.form-status {
  min-height: 1.2rem;
  color: var(--text-1);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  z-index: 80;
}

.modal.show {
  display: flex;
}

.modal-card {
  width: min(520px, 100%);
  background: #080808;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  position: relative;
}

.modal-close {
  position: absolute;
  top: 0.6rem;
  right: 0.6rem;
  border: 0;
  background: transparent;
  color: var(--text-1);
  font-size: 1.1rem;
  cursor: pointer;
}

.modal-card h3 {
  margin: 0;
}

.modal-card p {
  margin: 0.5rem 0 0;
  color: var(--text-1);
}

.modal-actions {
  margin-top: 0.9rem;
  display: flex;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0;
  background: rgba(0, 0, 0, 0.95);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.footer p {
  margin: 0.2rem 0 0;
  color: var(--text-2);
}

.footer-mono {
  font-family: var(--mono);
  color: var(--text-2);
  font-size: 0.8rem;
}

.status-pill {
  display: inline-block;
  border-radius: 999px;
  padding: 0.2rem 0.5rem;
  font-size: 0.78rem;
  border: 1px solid var(--border);
  white-space: nowrap;
}

.status-pill.good {
  color: var(--ok);
  border-color: rgba(74, 222, 128, 0.45);
}

.status-pill.warn {
  color: var(--warn);
  border-color: rgba(251, 191, 36, 0.42);
}

.status-pill.bad {
  color: var(--danger);
  border-color: rgba(251, 113, 133, 0.45);
}

.json-pre {
  display: block;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--text-1);
}

tr[data-mi-idx] {
  cursor: pointer;
}

table[data-sort-table="mi"] {
  min-width: 1460px;
  table-layout: fixed;
}

table[data-sort-table="mi"] th {
  font-size: 0.76rem;
}

table[data-sort-table="mi"] td {
  font-size: 0.8rem;
  padding: 0.44rem 0.54rem;
  line-height: 1.28;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  vertical-align: top;
}

table[data-sort-table="mi"] td.mi-cell-nowrap,
table[data-sort-table="mi"] th.mi-cell-nowrap {
  white-space: nowrap;
}

table[data-sort-table="mi"] td.mi-cell-wrap {
  word-break: break-word;
}

table[data-sort-table="mi"] td.mi-cell-generated {
  min-width: 180px;
}

table[data-sort-table="mi"] td.mi-cell-nct {
  min-width: 125px;
}

table[data-sort-table="mi"] td.mi-cell-intervention {
  min-width: 270px;
}

table[data-sort-table="mi"] td.mi-cell-reason {
  min-width: 260px;
}

table[data-sort-table="mi"] td.mi-cell-target {
  min-width: 210px;
}

table[data-sort-table="mi"] td.mi-cell-evidence {
  min-width: 150px;
}

.mi-nct-link {
  border: 0;
  background: transparent;
  color: var(--text-0);
  font: inherit;
  font-family: var(--mono);
  font-size: 0.84rem;
  padding: 0;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.mi-tag-pill {
  display: inline-block;
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: 0.16rem 0.48rem;
  font-size: 0.76rem;
  font-family: var(--mono);
  white-space: nowrap;
}

.mi-evidence-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  padding: 0.14rem 0.48rem;
  font-size: 0.74rem;
  font-family: var(--mono);
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.06);
}

.mi-evidence-chip.low {
  color: #d4d4d4;
  border-color: rgba(212, 212, 212, 0.26);
}

.mi-evidence-chip.med {
  color: #d9f99d;
  border-color: rgba(190, 242, 100, 0.42);
}

.mi-evidence-chip.high {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.52);
}

.mi-tag-small {
  color: #8af6b2;
  border-color: rgba(34, 197, 94, 0.56);
  background: rgba(34, 197, 94, 0.16);
}

.mi-tag-biologic {
  color: #d9f99d;
  border-color: rgba(190, 242, 100, 0.42);
  background: rgba(190, 242, 100, 0.08);
}

.mi-tag-procedure {
  color: #d4d4d4;
  border-color: rgba(212, 212, 212, 0.34);
  background: rgba(255, 255, 255, 0.06);
}

.mi-tag-control {
  color: #a3a3a3;
  border-color: rgba(163, 163, 163, 0.35);
  background: rgba(163, 163, 163, 0.09);
}

.mi-tag-gene {
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.52);
  background: rgba(74, 222, 128, 0.14);
}

.mi-tag-other {
  color: #e7e7e7;
  border-color: rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.08);
}

.mi-row-selected td {
  background: rgba(34, 197, 94, 0.22) !important;
}

.mi-network-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.9rem;
}

.mi-network-head h3 {
  margin: 0;
  font-size: 1.2rem;
}

.mi-network-head .chart-sub {
  margin-top: 0.28rem;
  max-width: 76ch;
}

.mi-network-controls {
  display: grid;
  grid-template-columns: minmax(170px, 230px) minmax(220px, 280px) minmax(250px, 1fr) minmax(170px, 220px);
  gap: 0.7rem;
  align-items: end;
}

.mi-network-controls label > span {
  display: block;
  color: var(--text-2);
  font-size: 0.79rem;
  margin-bottom: 0.3rem;
}

.mi-network-controls .checkbox-wrap > span {
  display: block;
  color: var(--text-2);
  font-size: 0.79rem;
  margin-bottom: 0.3rem;
}

.checkbox-wrap {
  display: grid;
  gap: 0.35rem;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.56rem 0.65rem;
  background: #060606;
}

.inline-check input[type="checkbox"] {
  width: auto;
  accent-color: var(--accent);
}

.inline-check span {
  color: var(--text-1);
  font-size: 0.86rem;
}

.mi-network-canvas-wrap {
  position: relative;
  height: 500px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  overflow: hidden;
  background:
    radial-gradient(1200px 400px at 85% 0%, rgba(34, 197, 94, 0.16), transparent 55%),
    linear-gradient(180deg, #050505 0%, #020202 100%);
}

#miNetworkCanvas {
  display: block;
  width: 100%;
  height: 100%;
  cursor: grab;
}

#miNetworkCanvas:active {
  cursor: grabbing;
}

.mi-network-tooltip {
  position: absolute;
  pointer-events: none;
  min-width: 160px;
  max-width: 280px;
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 10px;
  background: rgba(6, 6, 6, 0.95);
  padding: 0.5rem 0.62rem;
  color: var(--text-0);
  font-size: 0.78rem;
  z-index: 3;
}

.mi-network-lock-note {
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 10px;
  background: rgba(2, 2, 2, 0.74);
  padding: 0.72rem 0.84rem;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  justify-content: space-between;
  flex-wrap: wrap;
}

.mi-network-lock-note strong {
  font-size: 0.9rem;
}

.mi-network-lock-note span {
  color: var(--text-2);
  font-size: 0.82rem;
  flex: 1;
  min-width: 260px;
}

.mi-network-lock-note .btn {
  white-space: nowrap;
}

.mi-citation-list {
  display: grid;
  gap: 0.5rem;
}

.mi-citation-item {
  border: 1px solid rgba(34, 197, 94, 0.5);
  border-radius: 10px;
  background: rgba(8, 8, 8, 0.72);
  padding: 0.48rem 0.56rem;
  display: grid;
  gap: 0.28rem;
}

.mi-citation-item a {
  color: #c4f7d7;
  text-decoration: underline;
  text-underline-offset: 2px;
  line-height: 1.3;
}

.mi-citation-meta {
  color: var(--text-2);
  font-size: 0.76rem;
  font-family: var(--mono);
}

.mi-citation-empty {
  color: var(--text-2);
  font-size: 0.82rem;
}

.mi-network-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.mi-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.38rem;
  font-size: 0.8rem;
  color: var(--text-1);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 0.23rem 0.52rem;
  background: #050505;
}

.mi-node-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.mi-node-dot.sponsor { background: #22c55e; }
.mi-node-dot.nct { background: #f5f5f5; }
.mi-node-dot.intervention { background: #bef264; }
.mi-node-dot.indication { background: #9ca3af; }
.mi-node-dot.publication { background: #4ade80; }

.side-drawer {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: none;
}

.side-drawer.show {
  display: block;
}

.side-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.58);
}

.side-drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(560px, 100%);
  height: 100%;
  overflow: auto;
  background: #070707;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
  padding: 1rem;
  transform: translateX(100%);
  transition: transform 170ms ease;
}

.side-drawer.show .side-drawer-panel {
  transform: translateX(0);
}

.drawer-summary {
  display: grid;
  gap: 0.5rem;
}

.drawer-summary-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 0.6rem;
  align-items: start;
}

.drawer-summary-row .label {
  color: var(--text-2);
  font-family: var(--mono);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.drawer-summary-row .value {
  color: var(--text-1);
  font-size: 0.88rem;
  line-height: 1.35;
  word-break: break-word;
}

.drawer-evidence-wrap {
  display: grid;
  gap: 0.55rem;
}

.drawer-evidence-shell {
  width: 100%;
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 10px;
}

.drawer-evidence-shell table {
  min-width: 760px;
  table-layout: auto;
}

.drawer-evidence-shell th,
.drawer-evidence-shell td {
  padding: 0.48rem 0.55rem;
  font-size: 0.79rem;
  white-space: normal;
  text-overflow: clip;
}

.drawer-evidence-shell th {
  position: sticky;
  top: 0;
}

@media (max-width: 1100px) {
  .hero-shell {
    grid-template-columns: 1fr;
  }

  .filters-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .metrics-row,
  .kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pricing-grid,
  .code-grid,
  .network-list {
    grid-template-columns: 1fr;
  }

  .table-tools {
    grid-template-columns: 1fr;
  }

  .molecule-top-grid {
    grid-template-columns: 1fr;
  }

  .mi-network-controls {
    grid-template-columns: 1fr 1fr;
  }

  .molecule-top-grid > .card {
    min-height: 390px;
  }

  .molecule-top-table-shell {
    max-height: 340px;
  }

  .table-tools.two-col {
    grid-template-columns: 1fr;
  }

  .usecase-panel[data-usecase-panel="molecule"] .chart-card {
    min-height: 390px;
    max-height: 390px;
  }

  .chart-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .chart-card {
    min-height: 290px;
  }

  .chart-card canvas {
    height: 220px !important;
    min-height: 220px;
    max-height: 220px;
  }

  .usecase-panel[data-usecase-panel="molecule"] .chart-card canvas {
    height: 270px !important;
    min-height: 270px;
    max-height: 270px;
  }

  .mi-network-canvas-wrap {
    height: 420px;
  }

  .api-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .nav {
    display: none;
  }

  .menu-btn {
    display: block;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .topbar-inner {
    height: 68px;
  }

  :root {
    --nav-h: 68px;
  }

  .chart-grid {
    grid-template-columns: 1fr;
  }

  .chart-card {
    min-height: 280px;
    max-height: 320px;
  }

  .chart-card canvas {
    height: 210px !important;
    min-height: 210px;
    max-height: 210px;
  }

  .usecases-tabs {
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mi-network-controls {
    grid-template-columns: 1fr;
  }

  .side-drawer-panel {
    width: 100%;
  }

  .usecase-panel[data-usecase-panel="molecule"] .chart-card {
    min-height: 340px;
    max-height: 340px;
  }

  .usecase-panel[data-usecase-panel="molecule"] .chart-card canvas {
    height: 230px !important;
    min-height: 230px;
    max-height: 230px;
  }
}

@media (max-width: 620px) {
  .metrics-row,
  .kpi-grid,
  .filters-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy,
  .hero-panel,
  .card {
    padding: 0.85rem;
  }

  .chart-card {
    min-height: 270px;
    max-height: 300px;
  }

  .chart-card canvas {
    height: 190px !important;
    min-height: 190px;
    max-height: 190px;
  }

  .usecase-panel[data-usecase-panel="molecule"] .chart-card canvas {
    height: 220px !important;
    min-height: 220px;
    max-height: 220px;
  }

  .gated-panel {
    flex-direction: column;
    align-items: flex-start;
  }

  .mi-network-lock-note span {
    min-width: 0;
  }
}
