:root {
  --bg: #080d10;
  --panel: #0f171b;
  --panel-2: #141e23;
  --ink: #eef7f4;
  --muted: #90a7a4;
  --line: rgba(159, 188, 181, 0.2);
  --cyan: #5eead4;
  --blue: #60a5fa;
  --green: #84cc16;
  --amber: #ffb74d;
  --coral: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
  color-scheme: dark;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100%;
  margin: 0;
  background:
    linear-gradient(180deg, rgba(8, 13, 16, 1), rgba(11, 18, 20, 1) 52%, rgba(8, 13, 16, 1));
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.graph-app {
  min-height: 100svh;
  padding-bottom: 72px;
}

.graph-hero {
  position: relative;
  min-height: 420px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 18% 18%, rgba(94, 234, 212, 0.16), transparent 32%),
    linear-gradient(135deg, #0a1114 0%, #111b20 48%, #071013 100%);
}

#graph-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.86;
}

.graph-nav,
.hero-grid,
.data-source-band,
.metrics-grid,
.workspace {
  position: relative;
  z-index: 1;
  width: min(1240px, calc(100% - 40px));
  margin: 0 auto;
}

.graph-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 0;
}

.graph-logo,
.graph-nav-links {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.graph-logo {
  text-decoration: none;
}

.graph-logo span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(94, 234, 212, 0.44);
  border-radius: 8px;
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-weight: 800;
}

.graph-logo strong {
  font-size: 15px;
  letter-spacing: 0;
}

.graph-nav-links a {
  border: 1px solid rgba(238, 247, 244, 0.14);
  border-radius: 8px;
  padding: 9px 12px;
  color: rgba(238, 247, 244, 0.78);
  font-size: 13px;
  text-decoration: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: end;
  padding: 52px 0 68px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cyan);
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-grid h1 {
  max-width: 830px;
  margin: 0;
  font-size: clamp(44px, 6vw, 82px);
  line-height: 0.96;
  letter-spacing: 0;
}

.hero-copy {
  max-width: 670px;
  margin: 18px 0 0;
  color: rgba(238, 247, 244, 0.74);
  font-size: 18px;
}

.token-panel {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(94, 234, 212, 0.2);
  border-radius: 8px;
  padding: 16px;
  background: rgba(15, 23, 27, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.token-panel label,
.search-shell label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.token-panel div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.token-panel input,
.search-shell input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(238, 247, 244, 0.16);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(8, 13, 16, 0.76);
  color: var(--ink);
  outline: none;
}

.token-panel input:focus,
.search-shell input:focus {
  border-color: rgba(94, 234, 212, 0.72);
}

.token-panel button,
.tab-row button,
.table-action,
#close-evidence,
.export-button {
  min-height: 40px;
  border: 1px solid rgba(238, 247, 244, 0.16);
  border-radius: 8px;
  padding: 0 12px;
  background: rgba(238, 247, 244, 0.07);
  color: var(--ink);
  cursor: pointer;
  text-decoration: none;
}

.token-panel small {
  color: var(--muted);
}

.data-source-band {
  padding: 28px 0 0;
}

.section-head,
.workspace-top,
.drawer-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-head h2,
.drawer-head h2 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.export-button {
  display: inline-flex;
  align-items: center;
  background: rgba(94, 234, 212, 0.1);
  color: var(--cyan);
  font-weight: 800;
}

.source-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.source-card,
.metric-card,
.workspace,
.evidence-drawer {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(15, 23, 27, 0.86);
  box-shadow: var(--shadow);
}

.source-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.source-card > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  width: 11px;
  height: 11px;
  border-radius: 999px;
  background: var(--coral);
  box-shadow: 0 0 0 4px rgba(251, 113, 133, 0.14);
}

.status-dot.is-on {
  background: var(--green);
  box-shadow: 0 0 0 4px rgba(132, 204, 22, 0.14);
}

.source-card dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}

.source-card dt,
.evidence-drawer dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.source-card dd,
.evidence-drawer dd {
  margin: 4px 0 0;
  color: rgba(238, 247, 244, 0.86);
  overflow-wrap: anywhere;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 0;
}

.metric-card {
  min-height: 110px;
  padding: 16px;
  background:
    linear-gradient(180deg, rgba(96, 165, 250, 0.1), transparent),
    rgba(15, 23, 27, 0.86);
}

.metric-card strong {
  display: block;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 34px;
  line-height: 1;
}

.metric-card span {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.workspace {
  padding: 18px;
}

.workspace-top {
  align-items: center;
}

.search-shell {
  display: grid;
  gap: 8px;
  width: min(520px, 100%);
}

.tab-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tab-row button.is-active {
  border-color: rgba(94, 234, 212, 0.7);
  background: rgba(94, 234, 212, 0.13);
  color: var(--cyan);
}

.status-line {
  margin: 14px 0;
  color: var(--muted);
  font-size: 13px;
}

.table-shell {
  position: relative;
  min-height: 280px;
  overflow: auto;
  border: 1px solid rgba(238, 247, 244, 0.1);
  border-radius: 8px;
  background: rgba(8, 13, 16, 0.52);
}

table {
  width: 100%;
  min-width: 960px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid rgba(238, 247, 244, 0.08);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #111a1f;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

td {
  color: rgba(238, 247, 244, 0.84);
  font-size: 13px;
}

.table-action {
  min-height: 32px;
  color: var(--amber);
}

.empty-state {
  position: absolute;
  inset: 72px 18px 18px;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  color: var(--ink);
  font-size: 18px;
}

.evidence-drawer {
  position: fixed;
  top: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 4;
  display: grid;
  grid-template-rows: auto 1fr;
  width: min(460px, calc(100% - 36px));
  padding: 18px;
  transform: translateX(calc(100% + 30px));
  transition: transform 180ms ease;
}

.evidence-drawer.is-open {
  transform: translateX(0);
}

.drawer-head {
  align-items: start;
  border-bottom: 1px solid var(--line);
  padding-bottom: 14px;
}

#close-evidence {
  color: var(--muted);
}

.evidence-drawer dl {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px 12px;
  align-content: start;
  margin: 18px 0 0;
  overflow: auto;
}

.snippet {
  border-left: 3px solid var(--cyan);
  padding-left: 12px;
  color: var(--ink);
}

@media (max-width: 980px) {
  .hero-grid,
  .source-grid,
  .metrics-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-grid {
    align-items: stretch;
  }

  .workspace-top,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .tab-row {
    justify-content: flex-start;
  }
}

@media (max-width: 640px) {
  .graph-nav,
  .graph-nav-links {
    align-items: stretch;
    flex-direction: column;
  }

  .graph-nav,
  .hero-grid,
  .data-source-band,
  .metrics-grid,
  .workspace {
    width: min(100% - 24px, 1240px);
  }

  .hero-grid h1 {
    font-size: 42px;
  }

  .source-card dl,
  .metrics-grid,
  .evidence-drawer dl {
    grid-template-columns: 1fr;
  }

  .token-panel div {
    grid-template-columns: 1fr;
  }
}
