:root {
  --ex-bg: #f4f9fc;
  --ex-ink: #132b45;
  --ex-muted: #69849a;
  --ex-accent: #0d82bc;
  --ex-accent-soft: #e6f2fa;
  --ex-line: #d8e7f1;
  --ex-surface: #ffffff;
  --ex-success: #2a7a68;
  --ex-danger: #9b1c1c;
  --ex-font: "DM Sans", "Segoe UI", sans-serif;
  --ex-display: "Manrope", "DM Sans", sans-serif;
  --ex-mono: "IBM Plex Mono", ui-monospace, monospace;
}

.cn-explorer-page {
  margin: 0;
  background:
    radial-gradient(1200px 480px at 8% -10%, rgba(13, 130, 188, 0.10), transparent 60%),
    radial-gradient(900px 420px at 100% 0%, rgba(165, 207, 223, 0.35), transparent 55%),
    linear-gradient(180deg, #eef6fb 0%, var(--ex-bg) 28%, #f7fbfd 100%);
  color: var(--ex-ink);
  font-family: var(--ex-font);
  min-height: 100vh;
}

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

.explorer {
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px clamp(1.1rem, 3vw, 2rem) 80px;
}

.explorer-hero .eyebrow,
.panel-kicker {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ex-accent);
}

.explorer-hero h1 {
  margin: 0;
  font-family: var(--ex-display);
  font-size: clamp(2.1rem, 4vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.05;
}

.explorer-hero h1 span {
  color: var(--ex-accent);
}

.explorer-hero .lede {
  max-width: 42rem;
  margin: 14px 0 0;
  color: var(--ex-muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.network-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 28px 0 16px;
}

.net-btn {
  border: 1px solid var(--ex-line);
  background: var(--ex-surface);
  color: var(--ex-ink);
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  padding: 11px 16px;
  cursor: pointer;
  transition: background 280ms cubic-bezier(0.22, 1, 0.36, 1), border-color 280ms ease, color 280ms ease;
}

.net-btn:hover {
  border-color: var(--ex-accent);
  color: var(--ex-accent);
}

.net-btn.is-active {
  background: var(--ex-accent);
  border-color: var(--ex-accent);
  color: #fff;
}

.net-meta {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  font-size: 12px;
  color: var(--ex-muted);
}

.conn {
  font-weight: 700;
}

.search {
  display: flex;
  gap: 10px;
  background: var(--ex-surface);
  border: 1px solid var(--ex-line);
  padding: 10px;
  box-shadow: 0 10px 35px rgba(24, 78, 114, 0.045);
}

.search input {
  flex: 1;
  border: 0;
  outline: 0;
  padding: 12px 14px;
  font: inherit;
  font-size: 14px;
  min-width: 0;
  color: var(--ex-ink);
  background: transparent;
  font-family: var(--ex-mono);
}

.search button,
.panel button,
.token-form button {
  background: var(--ex-accent);
  color: #fff;
  border: 0;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: background 220ms ease, transform 220ms ease;
}

.search button:hover,
.panel button:hover,
.token-form button:hover {
  background: #0a6fa3;
}

.panel button {
  padding: 9px 13px;
  font-size: 12px;
}

.feedback {
  min-height: 1.4em;
  margin: 10px 0 0;
  color: var(--ex-muted);
  font-size: 13px;
}

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

.metrics article,
.panel {
  background: var(--ex-surface);
  border: 1px solid var(--ex-line);
  box-shadow: 0 4px 18px rgba(12, 31, 51, 0.04);
}

.metrics article {
  padding: 20px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  animation: ex-rise 480ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.metrics article:nth-child(2) { animation-delay: 60ms; }
.metrics article:nth-child(3) { animation-delay: 120ms; }
.metrics article:nth-child(4) { animation-delay: 180ms; }

.metrics small {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  color: #8da2b3;
}

.metrics strong {
  font-family: var(--ex-display);
  font-size: 1.35rem;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}

.metrics .rpc-label {
  font-size: 0.85rem;
  font-family: var(--ex-mono);
  font-weight: 600;
}

.metrics span {
  color: #8a9faf;
  font-size: 11px;
}

.explorer-grid {
  display: grid;
  grid-template-columns: 1.12fr 1fr;
  gap: 16px;
}

.panel {
  min-width: 0;
  overflow: hidden;
  animation: ex-rise 520ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 22px;
  border-bottom: 1px solid #e5edf4;
}

.panel-header h2 {
  margin: 0;
  font-family: var(--ex-display);
  font-size: 1.15rem;
  letter-spacing: -0.02em;
}

.panel-header p:not(.panel-kicker) {
  margin: 6px 0 0;
  color: var(--ex-muted);
  font-size: 13px;
  line-height: 1.45;
}

.table-wrap {
  overflow-x: auto;
  min-height: 200px;
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  white-space: nowrap;
  font-size: 12px;
}

th {
  font-size: 10px;
  color: #8398a8;
  background: #fafcfe;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid #edf1f5;
}

td {
  color: #536f83;
  font-family: var(--ex-mono);
}

td a {
  color: var(--ex-accent);
  text-decoration: none;
  font-weight: 600;
  cursor: pointer;
}

td a:hover {
  text-decoration: underline;
}

.paging {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 16px;
}

.paging button:disabled,
.panel button:disabled {
  background: #c9d8e3;
  cursor: not-allowed;
}

.detail-panel,
.token-panel {
  margin-top: 18px;
}

.details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  padding: 8px 22px 20px;
}

.detail-row {
  padding: 14px 0;
  border-bottom: 1px solid #e8eff4;
  min-width: 0;
}

.detail-row small {
  display: block;
  color: #8199aa;
  font-size: 11px;
  margin-bottom: 7px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
}

.detail-row div {
  overflow-wrap: anywhere;
  font-size: 13px;
  font-family: var(--ex-mono);
  color: #183b55;
}

.detail-row.wide {
  grid-column: 1 / -1;
}

.token-form {
  display: grid;
  grid-template-columns: 1.2fr 1fr auto;
  gap: 12px;
  padding: 0 22px 18px;
  align-items: end;
}

.token-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #8199aa;
}

.token-form input {
  border: 1px solid var(--ex-line);
  padding: 12px 12px;
  font: inherit;
  font-family: var(--ex-mono);
  font-size: 13px;
  color: var(--ex-ink);
  background: #fbfdfe;
}

.explorer-footer {
  font-size: 12px;
  color: var(--ex-muted);
  line-height: 1.7;
  margin-top: 28px;
}

.explorer-footer a {
  color: var(--ex-accent);
  font-weight: 600;
}

.explorer-footer code {
  font-family: var(--ex-mono);
  font-size: 11px;
}

@keyframes ex-rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1000px) {
  .explorer-grid {
    grid-template-columns: 1fr;
  }
  .metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .token-form {
    grid-template-columns: 1fr;
  }
  .net-meta {
    margin-left: 0;
    width: 100%;
    align-items: flex-start;
  }
}

@media (max-width: 580px) {
  .explorer {
    padding-top: 28px;
  }
  .search {
    flex-direction: column;
  }
  .details {
    grid-template-columns: 1fr;
  }
  .metrics article {
    padding: 14px;
  }
  .metrics strong {
    font-size: 1.05rem;
  }
}
