*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #0d1117;
  --surface:   #161b22;
  --surface2:  #21262d;
  --border:    #30363d;
  --text:      #e6edf3;
  --muted:     #8b949e;
  --accent:    #58a6ff;
  --cyan:      #39d0f5;
  --green:     #3fb950;
  --yellow:    #d29922;
  --red:       #f85149;
  --mono:      'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex; flex-direction: column;
}

/* ── Layout ── */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }
#main { flex: 1; }

/* ── Header ── */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.hdr-inner {
  display: flex; align-items: center; gap: 14px;
  height: 56px;
}
.logo-link { display: flex; align-items: center; gap: 9px; text-decoration: none; flex-shrink: 0; }
.logo-img  { width: 32px; height: 32px; }
.logo-text { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.logo-text .accent { color: var(--cyan); }

.nav { display: flex; gap: 2px; flex-shrink: 0; }
.nav-link {
  color: var(--muted); text-decoration: none;
  padding: 5px 11px; border-radius: 6px;
  font-size: 0.875rem; transition: color .12s, background .12s;
}
.nav-link:hover { color: var(--text); background: var(--surface2); }

.search-wrap { display: flex; gap: 7px; flex: 1; max-width: 460px; margin-left: auto; }
.search-input {
  flex: 1; min-width: 0;
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); padding: 6px 12px; border-radius: 7px;
  font-size: 0.82rem; outline: none; transition: border-color .12s;
}
.search-input:focus { border-color: var(--accent); }
.search-input::placeholder { color: var(--muted); }
.search-btn {
  background: var(--accent); color: #0d1117;
  border: none; padding: 6px 15px; border-radius: 7px;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
  transition: opacity .12s; white-space: nowrap; flex-shrink: 0;
}
.search-btn:hover { opacity: 0.85; }

/* ── Hero ── */
.hero {
  background: linear-gradient(135deg, #1c3a8a 0%, #064e7c 100%);
  padding: 26px 0 22px;
}
.hero h1 { font-size: 1.45rem; font-weight: 700; margin-bottom: 4px; }
.hero p  { color: rgba(255,255,255,.6); font-size: 0.875rem; }

/* ── Stats bar ── */
.stats {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 13px; margin: 18px 0;
}
.stat-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
}
.stat-label { font-size: 0.7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 5px; }
.stat-value { font-size: 1.4rem; font-weight: 700; line-height: 1.2; }
.stat-sub   { font-size: 0.76rem; color: var(--muted); margin-top: 3px; }
.stat-sub a { color: var(--accent); text-decoration: none; }

/* ── Two-panel layout ── */
.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }

/* ── Card ── */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden; margin-bottom: 0;
}
.card-header {
  padding: 13px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.card-title { font-size: 0.88rem; font-weight: 600; }

/* ── Live indicator ── */
.live-dot {
  font-size: 0.7rem; color: var(--green);
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.4} }

/* ── Table ── */
table { width: 100%; border-collapse: collapse; }
th {
  padding: 9px 13px; text-align: left;
  font-size: 0.68rem; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); border-bottom: 1px solid var(--border); font-weight: 500;
}
td {
  padding: 9px 13px; font-size: 0.825rem;
  border-bottom: 1px solid var(--border); vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: rgba(255,255,255,.02); }

/* ── Mono / hash links ── */
.mono-val {
  font-family: var(--mono); font-size: 0.78rem;
  color: var(--accent); word-break: break-all;
}
a.mono-val:hover, a.mono-link:hover { text-decoration: underline; }
.mono-link {
  font-family: var(--mono); font-size: 0.79rem;
  color: var(--accent); text-decoration: none;
}
.mono-sm { font-family: var(--mono); font-size: 0.79rem; }

/* ── Copy button ── */
.copy-btn {
  background: none; border: none; cursor: pointer;
  color: var(--muted); padding: 1px 4px; margin-left: 3px;
  border-radius: 4px; vertical-align: middle;
  transition: color .12s, background .12s;
}
.copy-btn:hover { color: var(--text); background: var(--surface2); }
.copy-btn.copied { color: var(--green); }

/* ── Gas bar ── */
.gas-bar-wrap {
  width: 100%; height: 5px; background: var(--surface2);
  border-radius: 3px; overflow: hidden; margin-bottom: 2px;
}
.gas-bar { height: 100%; background: var(--accent); border-radius: 3px; min-width: 1px; }

/* ── Badges ── */
.badge {
  display: inline-block; padding: 2px 7px; border-radius: 4px;
  font-size: 0.7rem; font-weight: 600; letter-spacing: .03em;
}
.badge-transfer { background: rgba(56,189,248,.12); color: #38bdf8; }
.badge-stake    { background: rgba(63,185,80,.12);  color: #3fb950; }
.badge-unstake  { background: rgba(210,153,34,.12); color: #d29922; }

/* ── Tag ── */
.tag {
  display: inline-block; font-size: 0.68rem; padding: 1px 6px;
  border-radius: 3px; background: var(--surface2); border: 1px solid var(--border);
  color: var(--muted); vertical-align: middle;
}

/* ── New row flash ── */
@keyframes row-flash { 0%{background:rgba(56,189,248,.14)} 100%{background:transparent} }
.row-new td { animation: row-flash .7s ease-out forwards; }

/* ── Page header ── */
.page-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  padding: 22px 0 16px;
}
.breadcrumb { font-size: 0.78rem; color: var(--muted); margin-bottom: 4px; }
.bc-link { color: var(--muted); text-decoration: none; }
.bc-link:hover { color: var(--text); }
.page-head h2 { font-size: 1.2rem; font-weight: 700; }
.accent { color: var(--accent); }
.nav-arrows { display: flex; gap: 14px; font-size: 0.84rem; align-items: center; padding-top: 26px; }

/* ── Detail grid ── */
.dg { display: grid; grid-template-columns: 160px 1fr; }
.dk {
  padding: 12px 16px; color: var(--muted); font-size: 0.81rem;
  border-bottom: 1px solid var(--border); background: var(--surface2);
}
.dv {
  padding: 12px 16px; font-size: 0.84rem;
  border-bottom: 1px solid var(--border); word-break: break-all;
}
.dk:last-of-type, .dv:last-of-type { border-bottom: none; }
.big-num { font-size: 1.05rem; font-weight: 700; }

/* ── Loading ── */
.loading {
  text-align: center; padding: 72px 20px;
}
.loading::before {
  content: ''; display: block; width: 34px; height: 34px; margin: 0 auto 14px;
  border: 3px solid var(--border); border-top-color: var(--accent);
  border-radius: 50%; animation: spin .75s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Error / Empty ── */
.error-box {
  background: rgba(248,81,73,.08); border: 1px solid var(--red);
  border-radius: 8px; padding: 15px 18px; color: var(--red);
  margin: 22px 0; font-size: 0.875rem; line-height: 1.6;
}
.error-box code { font-family: var(--mono); font-size: 0.8rem; background: var(--surface2); padding: 1px 5px; border-radius: 3px; color: var(--text); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); font-size: 0.84rem; }

/* ── Footer ── */
.footer {
  border-top: 1px solid var(--border);
  padding: 16px 0; margin-top: 28px;
  font-size: 0.78rem; color: var(--muted); text-align: center;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .stats  { grid-template-columns: repeat(2, 1fr); }
  .panels { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .hdr-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px; }
  .search-wrap { order: 3; width: 100%; max-width: none; }
  .dg { grid-template-columns: 1fr; }
  .dk { background: transparent; padding-bottom: 2px; border-bottom: none; }
  .page-head { flex-direction: column; gap: 8px; }
  .nav-arrows { padding-top: 0; }
}
