:root {
    --ink: #0c1517;
    --panel: #101d20;
    --line: #1e3136;
    --line-soft: #17282c;
    --text: #e7efec;
    --muted: #8ca29f;
    --brass: #dfa63c;
    --brass-soft: rgba(223, 166, 60, 0.12);
    --ok: #66c08c;
    --bad: #e0796a;
    --family-evm: #7c9cf0;
    --family-cosmos: #b79cf0;
    --family-nano: #6fd0c4;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    background: var(--ink);
    color: var(--text);
    font-family: "IBM Plex Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--text); text-decoration: none; border-bottom: 1px solid transparent; }
a:hover { color: var(--brass); border-bottom-color: rgba(223, 166, 60, 0.5); }

:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; }

.mono { font-family: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); }
.break { word-break: break-all; }
.num { text-align: right; }
.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* Header */
.top {
    position: sticky; top: 0; z-index: 50;
    display: flex; align-items: center; gap: 26px;
    padding: 0 28px; min-height: 62px;
    background: rgba(12, 21, 23, 0.92);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: baseline; gap: 7px; border: 0; white-space: nowrap; }
.brand-mark { font-weight: 600; letter-spacing: 0.03em; font-size: 14.5px; }
.brand-sub { color: var(--muted); font-size: 13px; font-weight: 300; }

.chains { display: flex; align-items: stretch; gap: 2px; }

/* Family dropdowns */
.dd { position: relative; }
.dd-btn {
    display: inline-flex; align-items: center; gap: 7px; height: 100%;
    padding: 0 11px; list-style: none; cursor: pointer;
    color: var(--muted); font-family: inherit; font-size: 13px;
    border-bottom: 2px solid transparent;
}
.dd-btn::-webkit-details-marker { display: none; }
.dd-btn::marker { content: ""; }
.dd-btn:hover { color: var(--text); border-bottom-color: var(--line); }
.dd[open] .dd-btn,
.dd-btn.is-current { color: var(--text); border-bottom-color: var(--brass); }
.dd-caret {
    width: 0; height: 0; margin-left: 1px;
    border-left: 3.5px solid transparent; border-right: 3.5px solid transparent;
    border-top: 4px solid currentColor; opacity: 0.7;
}
.dd-menu {
    position: absolute; top: calc(100% - 2px); left: 0; z-index: 40;
    min-width: 216px; padding: 6px 0;
    background: #0e1a1d; border: 1px solid var(--line);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
    max-height: 70vh; overflow-y: auto;
}
.dd-menu[hidden] { display: none; }
.dd:not([open]) .dd-menu { display: none; }
.dd-item {
    display: flex; align-items: baseline; justify-content: space-between; gap: 20px;
    padding: 9px 14px; font-size: 13px; color: var(--text); border: 0;
}
.dd-item:hover { background: rgba(255, 255, 255, 0.045); color: var(--brass); }
.dd-item.is-active { color: var(--brass); }
.dd-ticker { color: var(--muted); font-size: 11px; }

.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); flex: none; }
.dot--evm { background: var(--family-evm); }
.dot--cosmos { background: var(--family-cosmos); }
.dot--nano { background: var(--family-nano); }
.dot--pactus { background: #e0a05c; }
.dot--substrate { background: #e0796a; }

.lang { margin-left: auto; display: flex; gap: 2px; }
.lang button {
    background: none; border: 0; color: var(--muted); cursor: pointer;
    font-family: "IBM Plex Mono", monospace; font-size: 11px; padding: 6px 7px;
}
.lang button:hover { color: var(--text); }
.lang button.is-active { color: var(--brass); }

.net-badge { margin-left: 10px; padding: 1px 7px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); font-size: 10.5px; }
.net-badge.is-testnet { border-color: var(--brass); color: var(--brass); }
.net-sup { font-size: 10px; color: var(--brass); margin-left: 4px; vertical-align: super; }

html.is-navigating body::before {
    content: ""; position: fixed; top: 0; left: 0; right: 0; height: 2px;
    background: var(--brass); z-index: 200; animation: nav-progress 1.1s ease-out forwards;
}
@keyframes nav-progress { from { transform: scaleX(0); transform-origin: left; } to { transform: scaleX(0.85); transform-origin: left; } }
@media (prefers-reduced-motion: reduce) { html.is-navigating body::before { animation: none; transform: none; opacity: 0.7; } }

/* Chain sub-navigation */
.subnav { border-bottom: 1px solid var(--line); }
.subnav-in { display: flex; gap: 22px; max-width: 1160px; margin: 0 auto; padding: 0 28px; }
.subnav a {
    padding: 10px 0 9px; font-size: 12.5px; color: var(--muted);
    border-bottom: 2px solid transparent;
}
.subnav a:hover { color: var(--text); }
.subnav a.is-active { color: var(--text); border-bottom-color: var(--brass); }

/* Layout */
.wrap { max-width: 1160px; margin: 0 auto; padding: 0 28px 80px; }

/* Search */
.search {
    display: flex; align-items: center; gap: 10px;
    margin: 26px 0 4px; border-bottom: 1px solid var(--line);
}
.search input[type="text"] {
    flex: 1; min-width: 0; padding: 14px 0;
    background: none; border: 0; color: var(--text);
    font-family: "IBM Plex Mono", monospace; font-size: 15px;
}
.search input::placeholder { color: #5f746f; font-family: "IBM Plex Sans", sans-serif; }
.search button {
    background: none; border: 1px solid var(--line); color: var(--text);
    font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: 0.06em;
    padding: 9px 16px; cursor: pointer;
}
.search button:hover { border-color: var(--brass); color: var(--brass); }

/* Hero */
.hero { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; padding: 32px 0 6px; }
.hero h1 { margin: 4px 0 6px; font-size: clamp(30px, 4vw, 44px); font-weight: 300; letter-spacing: -0.02em; line-height: 1.1; }
.kicker { display: flex; align-items: center; gap: 8px; margin: 0; color: var(--muted); font-size: 12.5px; }
.lede { margin: 0; color: var(--muted); max-width: 62ch; }
.live {
    display: flex; align-items: center; gap: 8px; flex: none;
    font-size: 11px; color: var(--muted); padding-bottom: 8px;
}
.live-label { color: var(--text); }
.pulse {
    width: 6px; height: 6px; border-radius: 50%; background: var(--brass);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* Stats */
.stats {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 26px 0 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 16px 18px 15px 0; border-right: 1px solid var(--line-soft); min-width: 0; }
.stat + .stat { padding-left: 18px; }
.stat:last-child { border-right: 0; }
.stat-label { display: block; color: var(--muted); font-size: 11.5px; margin-bottom: 4px; }
.stat-value { display: block; font-size: 19px; line-height: 1.2; overflow-wrap: anywhere; }
.stat-value.small { font-size: 13px; padding-top: 4px; }
.stat-value small { font-size: 11px; color: var(--muted); }
.stat-sub { display: block; margin-top: 3px; font-size: 11px; color: var(--muted); }

/* Panels */
.panel { margin: 38px 0 0; }
.panel-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    padding-bottom: 10px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { margin: 0; font-size: 15px; font-weight: 500; }
.panel-note { color: var(--muted); font-size: 11px; }
.panel--quiet { max-width: 780px; }

/* Tables */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.table th {
    text-align: left; font-weight: 400; color: var(--muted);
    font-size: 11.5px; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line-soft);
}
.table th.num, .table td.num { text-align: right; padding-right: 26px; }
.table th:last-child, .table td:last-child { padding-right: 0; }
.table td { padding: 11px 12px 11px 0; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
.table tbody tr:hover { background: rgba(255, 255, 255, 0.022); }
.table td a { border-bottom: 0; }
.table td a:hover { border-bottom: 1px solid rgba(223, 166, 60, 0.5); }
.table .mono { font-size: 12.5px; }

/* Page head */
.page-head { padding: 34px 0 16px; }
.page-head h1 { margin: 4px 0 6px; font-size: clamp(25px, 3.4vw, 34px); font-weight: 400; letter-spacing: -0.01em; }
.page-head .sub { margin: 0; color: var(--muted); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.sep { color: #3d5350; }

/* Meta rows */
.meta { border-top: 1px solid var(--line); }
.meta-row {
    display: grid; grid-template-columns: 180px minmax(0, 1fr);
    gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line-soft);
}
.meta-key { color: var(--muted); font-size: 12.5px; }
.meta-val { font-size: 13.5px; min-width: 0; }

/* Badges */
.badge {
    display: inline-block; padding: 1px 7px; border-radius: 2px;
    font-family: "IBM Plex Mono", monospace; font-size: 11px;
}
.badge--ok { background: rgba(102, 192, 140, 0.13); color: var(--ok); }
.badge--bad { background: rgba(224, 121, 106, 0.13); color: var(--bad); }
.badge--warn { background: var(--brass-soft); color: var(--brass); }

/* Empty and notices */
.empty-state { padding: 24px 0 6px; }
.empty-state p { margin: 0 0 8px; color: var(--muted); max-width: 74ch; }
.hint { font-size: 12.5px; color: #6f8581; }
.hint code, .empty-state code { font-family: "IBM Plex Mono", monospace; color: var(--muted); }

.notice { margin: 22px 0 0; padding: 14px 16px; border-left: 2px solid var(--brass); background: var(--brass-soft); }
.notice p { margin: 6px 0 0; font-size: 13.5px; color: var(--muted); }
.notice strong { font-weight: 500; }
.notice--error { border-left-color: var(--bad); background: rgba(224, 121, 106, 0.09); }
.notice--warn { border-left-color: var(--brass); }

/* Collapsed extra balances */
.other-denoms { border-bottom: 1px solid var(--line-soft); }
.other-denoms summary {
    display: flex; gap: 8px; align-items: baseline;
    padding: 11px 0; cursor: pointer; color: var(--muted); font-size: 12.5px;
}
.other-denoms summary::marker { color: var(--brass); }

/* Capability list */
.caps { list-style: none; margin: 6px 0 0; padding: 0; }
.caps li {
    display: flex; justify-content: space-between; gap: 16px;
    padding: 10px 0; border-bottom: 1px solid var(--line-soft); font-size: 13.5px;
}
.cap-state { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; }
.cap-state.ok { color: var(--ok); }
.cap-state.no { color: var(--muted); }

/* Raw JSON */
.raw { margin-top: 28px; }
.raw summary { cursor: pointer; color: var(--muted); font-size: 12.5px; padding: 6px 0; }
.raw pre {
    margin: 10px 0 0; padding: 16px; background: var(--panel);
    border: 1px solid var(--line-soft); overflow: auto; max-height: 440px;
    font-size: 12px; line-height: 1.55;
}

/* Copy button */
.copy {
    margin-left: 8px; padding: 1px 7px;
    background: none; border: 1px solid var(--line); border-radius: 2px;
    color: var(--muted); cursor: pointer;
    font-family: "IBM Plex Mono", monospace; font-size: 10.5px;
    vertical-align: 1px;
}
.copy:hover { color: var(--brass); border-color: var(--brass); }
.copy.is-copied { color: var(--ok); border-color: var(--ok); }

/* Pagination */
.pager {
    display: flex; align-items: center; gap: 16px;
    padding: 16px 0 0; font-size: 12.5px;
}
.pager a { color: var(--text); }
.pager .is-off { color: #4c615d; }
.pager .mono { margin-left: auto; margin-right: auto; }

/* Validator names */
.val-name { font-weight: 500; }
.val-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; margin-left: 6px;
    border: 1px solid var(--line); border-radius: 50%;
    color: var(--muted); vertical-align: -7px; border-bottom: 0;
}
.val-icon:hover { color: var(--brass); border-color: var(--brass); }
.val-help {
    display: inline-flex; align-items: center; justify-content: center;
    width: 22px; height: 22px; margin-left: 6px; position: relative;
    border: 1px solid var(--line); border-radius: 50%;
    color: var(--muted); font-size: 12px; font-family: "IBM Plex Mono", monospace;
    vertical-align: -7px; cursor: help;
}
.val-help:hover, .val-help:focus { color: var(--brass); border-color: var(--brass); outline: none; }
.hover-tip {
    position: absolute; z-index: 300; max-width: 340px; padding: 10px 12px;
    background: #0e1a1d; border: 1px solid var(--line); box-shadow: 0 12px 28px rgba(0,0,0,.45);
    color: var(--text); font-size: 12px; line-height: 1.5; pointer-events: none;
}

.val-site { margin-left: 8px; font-size: 11px; border-bottom: 0; }
.val-site:hover { border-bottom: 1px solid rgba(223, 166, 60, 0.5); }

.val-avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; vertical-align: -6px; margin-right: 8px; background: var(--line-soft); }
.val-avatar--lg { width: 56px; height: 56px; margin: 0 0 8px; display: block; }

/* Uptime */
.up-ok { color: var(--ok); }
.up-warn { color: var(--brass); }
.up-bad { color: var(--bad); }
.val-op { display: block; font-size: 10.5px; margin-top: 2px; }
.ubar { display: flex; gap: 2px; align-items: center; }
.ub {
    display: inline-block; width: 5px; height: 13px; border-radius: 1px;
    background: #2a3f43;
}
.ub--ok { background: var(--ok); }
.ub--nil { background: var(--brass); }
.ub--missed { background: var(--bad); }
.ub--unknown { background: #2a3f43; }
.legend {
    display: flex; gap: 18px; align-items: center;
    margin: 14px 0 0; font-size: 11.5px; color: var(--muted);
}
.legend span { display: inline-flex; gap: 6px; align-items: center; }

/* Wallet and governance */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 9px 16px; background: none; border: 1px solid var(--line);
    color: var(--text); font-family: inherit; font-size: 13px; cursor: pointer;
}
.btn:hover { border-color: var(--brass); color: var(--brass); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--ghost { padding: 9px 12px; font-size: 12px; color: var(--muted); }
.btn--yes:hover { border-color: var(--ok); color: var(--ok); }
.btn--no:hover { border-color: var(--bad); color: var(--bad); }

.wallet-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.balances {
    display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
    margin: 18px 0 0; padding: 14px 0;
    border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft);
}
.balances .stat-value { font-size: 22px; }

.wallet-body { margin-top: 22px; }
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
    padding: 10px 14px; background: none; border: 0; border-bottom: 2px solid transparent;
    color: var(--muted); font-family: inherit; font-size: 13px; cursor: pointer;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); border-bottom-color: var(--brass); }
.tab-panel { padding-top: 20px; max-width: 560px; }

.field { margin-bottom: 16px; }
.field label { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--muted); }
.field input, .field select {
    width: 100%; padding: 10px 12px;
    background: transparent; border: 1px solid var(--line); border-radius: 0;
    color: var(--text); font-family: "IBM Plex Mono", monospace; font-size: 13px;
}
.field select { font-family: inherit; }
.field input:focus, .field select:focus { outline: none; border-color: var(--brass); }
.field input::placeholder { color: #5f746f; }
.field--spaced { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line-soft); }
.input-suffix { display: flex; align-items: center; gap: 10px; }
.input-suffix input { flex: 1; }
.input-inline { display: flex; gap: 8px; }
.input-inline input { flex: 1; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 4px; }

.tx-status { min-height: 18px; margin: 12px 0 0; font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--muted); word-break: break-all; }
.tx-status.is-ok { color: var(--ok); }
.tx-status.is-bad { color: var(--bad); }
.tx-status.is-pending { color: var(--brass); }
.tx-status a { color: inherit; text-decoration: underline; }

/* Governance */
.gov-title { font-size: 13.5px; }
.gov-title a { border-bottom: 0; }
.gov-title a:hover { color: var(--brass); }
.proposal-title { max-width: 70ch; }
.proposal-summary { max-width: 82ch; line-height: 1.7; color: var(--text); }
.tally { max-width: 640px; }
.tally-bar {
    display: flex; height: 10px; margin: 18px 0 14px;
    background: var(--line-soft); overflow: hidden;
}
.tally-seg { display: block; height: 100%; }
.tally-seg--yes { background: var(--ok); }
.tally-seg--no { background: var(--bad); }
.tally-seg--abstain { background: var(--brass); }
.tally-seg--veto { background: #8f3b33; }
.tally-rows { margin: 0; }
.tally-rows > div {
    display: flex; justify-content: space-between; gap: 20px;
    padding: 8px 0; border-bottom: 1px solid var(--line-soft); font-size: 13px;
}
.tally-rows dt { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.tally-rows dd { margin: 0; }
.tally-dot { display: inline-block; width: 8px; height: 8px; }
.vote-options { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

/* Footer */
.foot {
    border-top: 1px solid var(--line); margin-top: 64px; padding: 22px 28px;
    color: var(--muted); font-size: 12px; text-align: center;
}
.foot p { margin: 0; }

/* Motion */
@media (prefers-reduced-motion: reduce) {
    * { animation: none !important; transition: none !important; }
}

/* Small screens */
@media (max-width: 860px) {
    .top { flex-wrap: wrap; padding: 10px 18px; gap: 4px 14px; }
    .chains { order: 3; width: 100%; flex-wrap: wrap; }
    .dd-btn { padding: 9px 12px 9px 0; height: auto; }
    .dd-menu {
        position: static; min-width: 0; margin: 0 0 6px 14px;
        border: 0; box-shadow: none; background: none; padding: 2px 0;
    }
    .dd-item { padding: 8px 10px; }
    .lang { margin-left: auto; }
    .wrap { padding: 0 18px 60px; }
    .subnav-in { padding: 0 18px; flex-wrap: wrap; }
    .tab-panel { max-width: none; }
    .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat:nth-child(2) { border-right: 0; }
    .stat:nth-child(n+3) { border-top: 1px solid var(--line-soft); }
    .stat + .stat { padding-left: 18px; }
    .stat:nth-child(odd) { padding-left: 0; }
    .hero { flex-direction: column; align-items: flex-start; }
    .meta-row { grid-template-columns: 1fr; gap: 2px; }
    .table { font-size: 12.5px; }
    .table th:nth-child(2), .table td:nth-child(2),
    .table th:nth-child(5), .table td:nth-child(5) { display: none; }
    .table--uptime th:nth-child(2), .table--uptime td:nth-child(2) { display: table-cell; }
    .table--uptime th:nth-child(3), .table--uptime td:nth-child(3),
    .table--uptime th:nth-child(5), .table--uptime td:nth-child(5) { display: none; }
}
