:root {
  color-scheme: dark;
  --bg: #0b1016;
  --panel: rgba(20, 27, 35, 0.96);
  --panel-solid: #141b23;
  --panel-soft: #1d2834;
  --line: rgba(255, 255, 255, 0.12);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #f5f7fa;
  --muted: #adb8c4;
  --muted-bright: #d5dde5;
  --red: #ff8c82;
  --red-soft: rgba(255, 93, 82, 0.12);
  --green: #8fefc1;
  --green-soft: rgba(101, 230, 180, 0.11);
  --link: #a4cfff;
  --amber: #f6bd60;
  --mono: "DM Mono", monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--text);
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    var(--bg);
  background-size: 48px 48px;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
}

button,
input,
select {
  font: inherit;
}

button {
  color: inherit;
}

a {
  color: inherit;
}

.page-glow {
  position: fixed;
  z-index: 0;
  width: 36rem;
  height: 36rem;
  border-radius: 50%;
  opacity: 0.07;
  filter: blur(100px);
  pointer-events: none;
}

.page-glow--one {
  top: -16rem;
  right: -9rem;
  background: var(--red);
}

.page-glow--two {
  top: 42rem;
  left: -25rem;
  background: #356f64;
}

.shell {
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 48px));
  margin: 0 auto;
}

.sponsor-banner {
  display: flex;
  gap: 13px;
  align-items: center;
  min-height: 48px;
  margin-top: 14px;
  padding: 0 16px;
  border: 1px solid rgba(166, 79, 255, 0.28);
  border-radius: 10px;
  color: var(--text);
  background: linear-gradient(90deg, rgba(166, 79, 255, 0.13), rgba(166, 79, 255, 0.035) 55%, rgba(255, 255, 255, 0.02));
  text-decoration: none;
  transition: 160ms ease;
}

.sponsor-banner:hover {
  border-color: rgba(166, 79, 255, 0.5);
  background: linear-gradient(90deg, rgba(166, 79, 255, 0.19), rgba(166, 79, 255, 0.055) 55%, rgba(255, 255, 255, 0.035));
}

.sponsor-banner__label,
.sponsor-banner__tagline {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sponsor-banner__brand {
  display: flex;
  gap: 8px;
  align-items: center;
}

.sponsor-banner__brand img {
  width: 21px;
  height: 24px;
}

.sponsor-banner__brand strong {
  font-size: 13px;
  letter-spacing: -0.015em;
}

.sponsor-banner__tagline {
  margin-left: auto;
  letter-spacing: 0.06em;
  text-transform: none;
}

.sponsor-banner > svg {
  width: 15px;
  fill: none;
  stroke: #b97aff;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
  transition: transform 160ms ease;
}

.sponsor-banner:hover > svg {
  transform: translateX(3px);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 88px;
  border-bottom: 1px solid var(--line);
}

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

.brand__mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid rgba(255, 93, 82, 0.55);
  border-radius: 10px;
  color: var(--red);
  background: var(--red-soft);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 500;
}

.brand strong,
.brand small {
  display: block;
}

.brand strong {
  font-size: 15px;
  letter-spacing: 0.01em;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.refresh-status {
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--muted-bright);
  font-size: 13px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.live-dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 5px rgba(101, 230, 180, 0.08), 0 0 16px rgba(101, 230, 180, 0.45);
}

.button {
  margin-left: 8px;
  padding: 9px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-weight: 600;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
  transition: 160ms ease;
}

.button:hover {
  border-color: rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.07);
}

.button:disabled {
  cursor: wait;
  color: var(--muted);
  background: var(--panel-soft);
}

.hero {
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: clamp(40px, 8vw, 120px);
  align-items: end;
  padding: 88px 0 70px;
}

.eyebrow {
  margin: 0 0 18px;
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 24px;
  font-size: clamp(52px, 7.3vw, 104px);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

h1 span {
  color: var(--red);
}

.hero__copy {
  max-width: 630px;
  margin-bottom: 0;
  color: var(--muted-bright);
  font-size: 16px;
  line-height: 1.75;
}

.formula-card {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(16px);
}

.formula-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 23px;
  color: var(--muted-bright);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.code-pill {
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-bright);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.formula-card code {
  display: block;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  color: var(--muted-bright);
  font-family: var(--mono);
  font-size: 13px;
  line-height: 1.75;
}

.formula-card code span {
  color: var(--green);
}

.formula-card p {
  margin: 10px 0 0;
  color: var(--muted-bright);
  font-size: 14px;
  line-height: 1.75;
}

.network-alert {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 18px;
  padding: 14px 17px;
  border: 1px solid rgba(246, 189, 96, 0.25);
  border-radius: 10px;
  color: #f8d69e;
  background: rgba(246, 189, 96, 0.08);
  font-size: 13px;
}

.network-alert::before {
  content: "!";
  display: grid;
  flex: 0 0 auto;
  width: 21px;
  height: 21px;
  place-items: center;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-family: var(--mono);
  font-size: 11px;
}

.network-alert.is-error {
  border-color: rgba(255, 93, 82, 0.3);
  color: #ffaaa4;
  background: rgba(255, 93, 82, 0.09);
}

.is-hidden {
  display: none;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat-card {
  position: relative;
  padding: 28px 28px 27px;
  border-right: 1px solid var(--line);
}

.stat-card:first-child {
  padding-left: 0;
}

.stat-card:last-child {
  border-right: 0;
}

.stat-card p,
.stat-card span {
  color: var(--muted);
  font-size: 13px;
}

.stat-card p {
  margin-bottom: 18px;
  color: var(--muted-bright);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.stat-card strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--mono);
  font-size: clamp(25px, 3vw, 40px);
  font-weight: 500;
  letter-spacing: -0.045em;
}

.stat-card--red strong {
  color: var(--red);
}

.details-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 18px 0 72px;
}

.detail-card {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.022);
  font-size: 13px;
}

.detail-card span {
  color: var(--muted);
}

.detail-card strong {
  font-family: var(--mono);
  font-weight: 500;
}

.nodes-panel {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(18px);
}

.nodes-panel__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 22px;
  padding: 28px;
  border-bottom: 1px solid var(--line);
}

.nodes-panel__header .eyebrow {
  margin-bottom: 7px;
}

h2 {
  margin-bottom: 0;
  font-size: 26px;
  letter-spacing: -0.035em;
}

.controls,
.filter-tabs,
.search {
  display: flex;
  align-items: center;
}

.controls {
  gap: 12px;
  max-width: 100%;
}

.search {
  width: 320px;
  min-width: 0;
  height: 44px;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.16);
}

.search:focus-within {
  border-color: rgba(255, 255, 255, 0.26);
}

.search svg {
  flex-shrink: 0;
  width: 15px;
  fill: none;
  stroke: var(--muted);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-family: var(--sans);
  font-size: 14px;
}

.search input::placeholder {
  color: var(--muted);
  opacity: 1;
}

.filter-tabs {
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(0, 0, 0, 0.16);
}

.filter-tab {
  padding: 8px 11px;
  border: 0;
  border-radius: 6px;
  color: var(--muted-bright);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.filter-tab.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.085);
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 15px 20px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--muted-bright);
  background: rgba(0, 0, 0, 0.14);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

td {
  color: var(--text);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.65;
}

tbody tr {
  transition: background 130ms ease;
}

tbody tr:hover {
  background: rgba(255, 255, 255, 0.025);
}

tbody tr.is-crossed {
  background: linear-gradient(90deg, var(--red-soft), transparent 65%);
}

tbody tr.is-crossed:hover {
  background: linear-gradient(90deg, rgba(255, 93, 82, 0.18), rgba(255, 255, 255, 0.025) 70%);
}

tbody tr:last-child td {
  border-bottom: 0;
}

.number {
  text-align: right;
  font-family: var(--mono);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.node-address {
  display: flex;
  gap: 9px;
  align-items: center;
  color: var(--text);
  font-family: var(--mono);
  font-size: 13px;
}

.copy-button {
  display: grid;
  width: 24px;
  height: 24px;
  padding: 0;
  place-items: center;
  border: 0;
  border-radius: 5px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
}

.copy-button:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
}

.copy-button svg {
  width: 13px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-bright);
  background: rgba(255, 255, 255, 0.025);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #6e7478;
}

.badge--active::before {
  background: var(--green);
}

.badge--crossed {
  border-color: rgba(255, 93, 82, 0.3);
  color: #ff9d96;
  background: var(--red-soft);
}

.badge--crossed::before {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255, 93, 82, 0.7);
}

.badge--safe {
  border-color: rgba(101, 230, 180, 0.18);
  color: #90d9bd;
  background: var(--green-soft);
}

.badge--safe::before {
  background: var(--green);
}

.muted-dash {
  color: var(--muted);
}

.loading-row td,
.empty-row td {
  padding: 70px 20px;
  color: var(--muted);
  text-align: center;
}

.table-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.12);
  font-size: 13px;
}

footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  padding: 25px 0 45px;
  color: var(--muted);
  font-size: 12px;
}

footer p {
  margin: 0;
}

footer a:hover {
  color: var(--text);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[hidden] {
  display: none !important;
}

.utility-nav {
  display: flex;
  gap: 26px;
  border-bottom: 1px solid var(--line);
}

.utility-link {
  padding: 20px 0 17px;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.utility-link:hover,
.utility-link.is-active {
  color: var(--text);
}

.utility-link.is-active {
  border-bottom-color: var(--red);
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
.table-wrap:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 4px;
}

.bond-stats {
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
}

.bond-stats .stat-card {
  min-width: 0;
}

.bond-stats strong {
  font-size: clamp(23px, 2.3vw, 32px);
  overflow-wrap: anywhere;
}

.history-range {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin: 20px 0 40px;
  color: var(--muted-bright);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  line-height: 1.7;
}

#bond-provider {
  color: var(--muted);
}

.churn-filter select {
  width: 100%;
  height: 44px;
  padding: 0 30px 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  color: var(--text);
  background: var(--panel-solid);
  font-family: var(--sans);
  font-size: 14px;
  cursor: pointer;
}

.cell-note {
  display: block;
  max-width: 250px;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
}

.slash-amount {
  color: var(--red);
}

.evidence-link {
  color: var(--link);
  font-family: var(--mono);
  font-size: 13px;
  text-decoration: underline;
  text-decoration-color: rgba(164, 207, 255, 0.45);
  text-underline-offset: 4px;
}

.evidence-link:hover {
  color: var(--text);
  text-decoration-color: currentColor;
}

.text-button {
  padding: 0;
  border: 0;
  color: var(--text);
  background: none;
  cursor: pointer;
  text-decoration: underline;
}

.history-status {
  margin-bottom: 24px;
  padding: 20px 22px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--panel);
}

.history-status__main {
  display: flex;
  align-items: center;
  gap: 14px;
}

.history-status__copy {
  flex: 1;
  min-width: 0;
}

.history-status__copy strong {
  font-size: 15px;
  font-weight: 600;
}

.history-status__copy p {
  margin: 6px 0 0;
  color: var(--muted-bright);
  font-size: 14px;
  line-height: 1.7;
}

.history-status__indicator {
  flex: 0 0 20px;
  height: 20px;
  border: 5px solid var(--green-soft);
  border-radius: 50%;
  background: var(--green);
  background-clip: content-box;
}

.history-status[data-state="loading"] .history-status__indicator {
  border: 2px solid var(--line-strong);
  border-top-color: var(--red);
  background: transparent;
  animation: loading-spin 900ms linear infinite;
}

.history-status[data-state="cached"] .history-status__indicator {
  background-color: var(--amber);
  border-color: rgba(246, 189, 96, 0.12);
}

.history-status[data-state="error"] .history-status__indicator {
  background-color: var(--red);
  border-color: var(--red-soft);
}

.history-progress {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: history-step;
}

.history-progress li {
  padding-top: 10px;
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  counter-increment: history-step;
}

.history-progress li::before {
  content: counter(history-step) ". ";
}

.history-progress .is-current {
  border-color: var(--red);
  color: var(--text);
}

.history-progress .is-complete {
  border-color: var(--green);
  color: var(--green);
}

.skeleton,
.bond-stats.is-loading strong {
  display: block;
  min-width: 45px;
  min-height: 14px;
  border-radius: 4px;
  color: transparent;
  background: linear-gradient(90deg, var(--panel-soft) 25%, rgba(255, 255, 255, 0.09) 50%, var(--panel-soft) 75%);
  background-size: 200% 100%;
  animation: loading-shimmer 1.5s ease-in-out infinite;
}

.bond-stats.is-loading strong {
  max-width: 180px;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

@keyframes loading-shimmer {
  to { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
  .history-status__indicator,
  .skeleton,
  .bond-stats.is-loading strong {
    animation: none !important;
  }
}

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

  .formula-card {
    max-width: 650px;
  }

  .stats,
  .details-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-card:nth-child(2) {
    border-right: 0;
  }

  .stat-card:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .stat-card:nth-child(3) {
    padding-left: 0;
  }

  .nodes-panel__header {
    align-items: flex-start;
    flex-direction: column;
    gap: 22px;
  }

  .controls {
    width: 100%;
  }

  .search {
    flex: 1;
  }
}

@media (max-width: 650px) {
  .history-status {
    padding: 18px 14px;
  }

  .history-status__main {
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 10px;
  }

  .history-status__main > .code-pill {
    margin-left: 30px;
  }

  .history-progress {
    gap: 8px;
  }

  .sponsor-banner {
    gap: 9px;
    margin-top: 10px;
    padding: 0 12px;
  }

  .sponsor-banner__tagline {
    display: none;
  }

  .sponsor-banner > svg {
    margin-left: auto;
  }
  .shell {
    width: min(100% - 28px, 1440px);
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
    padding: 18px 0;
  }

  .refresh-status {
    width: 100%;
    flex-wrap: wrap;
    row-gap: 12px;
  }

  .button {
    margin-left: auto;
  }

  .hero {
    padding: 62px 0 50px;
  }

  h1 {
    font-size: clamp(47px, 16vw, 72px);
  }

  .stats,
  .details-grid {
    grid-template-columns: 1fr;
  }

  .stat-card,
  .stat-card:first-child,
  .stat-card:nth-child(3) {
    padding: 22px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .stat-card:last-child {
    border-bottom: 0;
  }

  .details-grid {
    margin-bottom: 48px;
  }

  .nodes-panel__header {
    padding: 22px 18px;
  }

  .controls {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
    flex: auto;
  }

  .search input,
  .churn-filter select {
    font-size: 16px;
  }

  .filter-tabs {
    align-self: flex-start;
  }

  .table-footer,
  footer {
    flex-direction: column;
    gap: 8px;
  }
}
