:root {
  color-scheme: light;
  --bg: #f4f6f3;
  --panel: #ffffff;
  --panel-2: #eef3ec;
  --ink: #151a17;
  --muted: #667066;
  --soft: #8b948b;
  --line: #dbe2d8;
  --line-strong: #bfc9ba;
  --green: #13c978;
  --green-dark: #0d8c55;
  --green-soft: #dff8eb;
  --graphite: #222925;
  --graphite-2: #333b36;
  --warning: #d69421;
  --radius: 8px;
  --shadow: 0 18px 48px rgba(33, 42, 35, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

button,
a {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

code,
pre {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

.app-shell {
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr) 328px;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 24px 18px;
  border-right: 1px solid var(--line);
  background: #fafbf8;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

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

.brand strong {
  font-size: 15px;
  line-height: 18px;
}

.brand span {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border: 1px solid #b8c6b6;
  border-radius: var(--radius);
  background: #050706;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.brand-mark img,
.x-mark img,
.vercel-button img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.side-nav {
  display: grid;
  gap: 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 0 10px;
  color: #455046;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 650;
}

.nav-item svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

.nav-item:hover,
.nav-item.active {
  color: var(--ink);
  background: #edf3eb;
}

.network-tile {
  margin-top: auto;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.network-top {
  display: flex;
  align-items: center;
  gap: 10px;
}

.x-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  overflow: hidden;
  background: #050706;
}

.network-top strong,
.network-top span {
  display: block;
}

.network-top strong {
  font-size: 13px;
}

.network-top span {
  color: var(--muted);
  font-size: 12px;
}

.network-top i,
.status-strip i,
.rail-head i {
  display: inline-block;
  width: 7px;
  height: 7px;
  margin-right: 5px;
  border-radius: 999px;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(19, 201, 120, 0.14);
}

.copy-field,
.source-button,
.primary-link,
.explorer-link,
.text-link {
  border: 0;
  cursor: pointer;
}

.copy-field {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  height: 38px;
  padding: 0 10px;
  color: #253028;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #f6f8f4;
}

.copy-field span {
  font-size: 12px;
  font-weight: 700;
}

.copy-field svg,
.explorer-link svg,
.source-button svg,
.primary-link svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.explorer-link,
.text-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 750;
}

.main-content {
  padding: 28px;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.topbar h1 {
  margin: 0;
  font-size: 38px;
  line-height: 44px;
  font-weight: 850;
  color: var(--graphite);
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
  line-height: 22px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.source-button,
.vercel-button,
.language-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 110px;
  height: 42px;
  padding: 0 14px;
  color: #ffffff;
  border-radius: 7px;
  background: var(--graphite);
  font-size: 13px;
  font-weight: 760;
  white-space: nowrap;
}

.vercel-button,
.language-toggle {
  color: #253028;
  border: 1px solid var(--line);
  background: var(--panel);
}

.vercel-button img {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #050706;
}

.language-toggle {
  min-width: 96px;
}

.language-toggle b {
  color: var(--soft);
}

.status-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.status-strip span {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.72);
  color: #455046;
  font-size: 12px;
  font-weight: 760;
}

.flow-panel {
  min-height: 294px;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(19, 201, 120, 0.05), rgba(255, 255, 255, 0) 38%),
    var(--panel);
  box-shadow: var(--shadow);
}

.flow-node,
.hook-stack {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fcfdfb;
}

.flow-node {
  display: grid;
  justify-items: center;
  align-content: center;
  text-align: center;
}

.node-label {
  margin-bottom: 12px;
  color: var(--soft);
  font-size: 11px;
  line-height: 14px;
  font-weight: 800;
  text-transform: uppercase;
}

.flow-node strong {
  margin-top: 12px;
  font-size: 14px;
  line-height: 18px;
}

.flow-node code {
  max-width: 100%;
  margin-top: 6px;
  color: #4d594e;
  font-size: 11px;
  overflow-wrap: anywhere;
}

.flow-node small {
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.agent-glyph {
  width: 76px;
  height: 76px;
  position: relative;
  border: 1px solid #aec1ae;
  border-radius: 50%;
  background: radial-gradient(circle at 38% 30%, #ffffff 0, #e7f2e3 42%, #26352b 43%, #162018 100%);
}

.agent-glyph .eye {
  position: absolute;
  top: 32px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}

.agent-glyph .left {
  left: 27px;
}

.agent-glyph .right {
  right: 27px;
}

.agent-glyph .mouth {
  position: absolute;
  left: 31px;
  top: 47px;
  width: 14px;
  height: 2px;
  background: #c7f7d9;
}

.pool-mark {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border: 1px solid #cfd9cc;
  border-radius: var(--radius);
  color: var(--green);
  background:
    linear-gradient(45deg, transparent 0 48%, rgba(19, 201, 120, 0.16) 48% 52%, transparent 52%),
    #f2f7ef;
  font-size: 34px;
  font-weight: 900;
}

.ledger-icon {
  display: grid;
  align-items: end;
  grid-template-columns: repeat(3, 14px);
  gap: 5px;
  width: 76px;
  height: 76px;
  padding: 16px;
  border: 1px solid #c6d4c3;
  border-radius: var(--radius);
  background: #f3f8f1;
}

.ledger-icon span {
  display: block;
  border-radius: 4px 4px 2px 2px;
  background: var(--green);
}

.ledger-icon span:nth-child(1) {
  height: 20px;
}

.ledger-icon span:nth-child(2) {
  height: 34px;
}

.ledger-icon span:nth-child(3) {
  height: 44px;
}

.xp-node b {
  margin-top: 6px;
  color: var(--graphite);
  font-size: 34px;
  line-height: 38px;
}

.flow-arrow {
  display: none;
  place-items: center;
  min-width: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

.flow-arrow::before {
  content: "";
  display: block;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), var(--green));
  grid-area: 1 / 1;
}

.flow-arrow::after {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 2px solid var(--green);
  border-right: 2px solid var(--green);
  transform: rotate(45deg);
  justify-self: end;
  grid-area: 1 / 1;
}

.flow-arrow span {
  grid-area: 1 / 1;
  display: none;
  padding: 4px 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  white-space: nowrap;
}

.hook-stack {
  display: grid;
  align-content: center;
}

.callback-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.callback-row strong {
  display: block;
  font-size: 14px;
  line-height: 18px;
}

.callback-row p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.cycle-icon {
  width: 34px;
  height: 34px;
  border: 1px solid #bad0b9;
  border-radius: 7px;
  background:
    linear-gradient(90deg, transparent 45%, var(--green) 45% 55%, transparent 55%),
    linear-gradient(0deg, transparent 45%, var(--green) 45% 55%, transparent 55%),
    #f1f8ef;
}

.callback-divider {
  height: 1px;
  margin: 14px 0;
  background: var(--line);
}

.tab-panel,
.transaction-panel {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 12px 34px rgba(33, 42, 35, 0.05);
}

.tabs {
  display: flex;
  gap: 4px;
  padding: 8px;
  border-bottom: 1px solid var(--line);
}

.tab {
  height: 38px;
  padding: 0 14px;
  color: #4d594e;
  border: 0;
  border-radius: 7px;
  background: transparent;
  font-size: 13px;
  font-weight: 760;
  cursor: pointer;
}

.tab.active {
  color: var(--ink);
  background: var(--panel-2);
}

.tab-content {
  display: none;
  padding: 18px;
}

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

.detail-grid,
.proof-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.8fr);
  gap: 18px;
}

h2 {
  margin: 0;
  color: var(--graphite);
  font-size: 18px;
  line-height: 24px;
}

.check-list {
  display: grid;
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.check-list li {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  color: #3d463f;
  font-size: 14px;
  line-height: 21px;
}

.check-list em {
  font-style: normal;
}

.check-list li span {
  width: 18px;
  height: 18px;
  margin-top: 1px;
  border-radius: 6px;
  background: var(--green-soft);
  position: relative;
}

.check-list li span::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 4px;
  width: 7px;
  height: 4px;
  border-left: 2px solid var(--green-dark);
  border-bottom: 2px solid var(--green-dark);
  transform: rotate(-45deg);
}

.code-card {
  margin: 0;
  min-height: 214px;
  padding: 16px;
  color: #dbeee2;
  border-radius: var(--radius);
  background: #1d2721;
  overflow: auto;
  font-size: 12px;
  line-height: 20px;
}

.proof-block {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
}

.proof-block p {
  margin: 12px 0 14px;
  color: #4d594e;
  font-size: 14px;
  line-height: 22px;
}

dl {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

dd {
  margin: 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 820;
  text-align: right;
}

.proof-block .text-link + .text-link {
  margin-left: 14px;
}

.score-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.score-grid article {
  min-height: 164px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fbfcfa;
}

.score-index {
  display: inline-flex;
  align-items: center;
  height: 24px;
  margin-bottom: 22px;
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 850;
}

.score-grid p {
  margin: 10px 0 0;
  color: #4d594e;
  font-size: 13px;
  line-height: 20px;
}

.transaction-panel {
  padding: 18px;
}

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 19px;
}

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

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

th,
td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 11px;
  line-height: 14px;
  font-weight: 850;
  text-transform: uppercase;
}

td {
  color: #38433a;
  font-size: 12px;
  line-height: 17px;
  font-weight: 650;
}

td code {
  color: #1f2a22;
  font-size: 11px;
}

.hash-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-button {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: #4d594e;
  background: #f8faf6;
  cursor: pointer;
}

.icon-button svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--green-dark);
  background: var(--green-soft);
  font-size: 11px;
  font-weight: 820;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--green);
}

.proof-rail {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 20px;
  border-left: 1px solid var(--line);
  background: #fcfdfb;
}

.rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.rail-head strong {
  color: var(--graphite);
  font-size: 16px;
  line-height: 22px;
}

.rail-head span {
  color: var(--green-dark);
  font-size: 12px;
  font-weight: 800;
}

.proof-list {
  display: grid;
  gap: 10px;
}

.proof-item {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
}

.proof-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  line-height: 14px;
  font-weight: 830;
  text-transform: uppercase;
}

.proof-item strong {
  display: block;
  margin-top: 5px;
  color: var(--ink);
  font-size: 14px;
  line-height: 19px;
  overflow-wrap: anywhere;
}

.primary-link {
  width: 100%;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
  color: #ffffff;
  border-radius: 7px;
  background: var(--graphite);
  font-size: 13px;
  font-weight: 820;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  transform: translateX(-50%) translateY(16px);
  min-width: 118px;
  height: 40px;
  display: grid;
  place-items: center;
  color: #ffffff;
  border-radius: 7px;
  background: var(--graphite);
  box-shadow: 0 12px 34px rgba(21, 26, 23, 0.18);
  font-size: 13px;
  font-weight: 780;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }

  .proof-rail {
    display: none;
  }

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

  .flow-arrow {
    display: none;
  }
}

@media (max-width: 840px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    padding: 16px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

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

  .network-tile {
    margin-top: 0;
  }

  .main-content {
    padding: 18px;
  }

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

  .status-strip span {
    width: 100%;
    min-width: 0;
    align-items: center;
  }

  .topbar {
    display: grid;
  }

  .topbar h1 {
    font-size: 30px;
    line-height: 36px;
  }

  .source-button {
    width: 100%;
  }

  .topbar-actions {
    justify-content: stretch;
  }

  .topbar-actions > * {
    flex: 1 1 100%;
  }

  .flow-panel,
  .detail-grid,
  .proof-grid,
  .score-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    overflow-x: auto;
  }

  .tab {
    flex: 0 0 auto;
  }

  .section-head {
    display: grid;
  }

  table {
    min-width: 760px;
  }
}

@media (max-width: 520px) {
  .status-strip {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
