/* Explorer theme.
   Mobile first, one layout breakpoint (800px), one type scale.
   Every card shares the same surface; plain text and data inherit 1em. */

:root {
    color-scheme: light;
    --bg: #f0f2f5;
    --surface: rgba(255, 255, 255, 0.7);
    --menu-surface: rgba(255, 255, 255, 0.88);
    --line: rgba(0, 0, 0, 0.1);
    --text: #1a1a1a;
    --muted: #5c6370;
    --accent: #4361ee;
    --accent-2: #7209b7;
    --btn-text: #ffffff;
    --shadow: rgba(26, 26, 26, 0.12);
    --radius: 0.75rem;
    --gap: 1.25rem;
    --pad: 1.25rem;
}

[data-theme="dim"] {
    color-scheme: dark;
    --bg: #1b263b;
    --surface: rgba(65, 90, 119, 0.5);
    --menu-surface: rgba(65, 90, 119, 0.88);
    --line: rgba(255, 255, 255, 0.15);
    --text: #e0e1dd;
    --muted: rgba(224, 225, 221, 0.68);
    --accent: #38b000;
    --accent-2: #ccff33;
    --btn-text: #1b263b;
    --shadow: rgba(0, 0, 0, 0.28);
}

[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0d1117;
    --surface: rgba(22, 27, 34, 0.7);
    --menu-surface: rgba(22, 27, 34, 0.88);
    --line: rgba(255, 255, 255, 0.05);
    --text: #c9d1d9;
    --muted: #8b949e;
    --accent: #58a6ff;
    --accent-2: #f778ba;
    --btn-text: #ffffff;
    --shadow: rgba(0, 0, 0, 0.45);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }
html { font-size: 100%; }

body {
    margin: 0;
    min-height: 100vh;
    background: var(--bg);
    color: var(--text);
    font: 1em/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    transition: background-color 0.3s, color 0.3s, filter 0.22s ease, opacity 0.22s ease;
}
.theme-switching body { filter: blur(2px); opacity: 0.97; }

/* One type scale for the whole site: data inherits 1em, only headings scale. */
h1, h2, h3, h4, h5, h6 { margin: 0 0 0.5rem; font-weight: 600; line-height: 1.25; }
h1, .page-title { font-size: 1.5em; }
h2, .panel-title, .data-card-title { font-size: 1.25em; }
h3 { font-size: 1.125em; }
h4, h5, h6 { font-size: 1em; }
p { margin: 0 0 0.75rem; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.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;
}

.shell { width: 100%; }
.pad { padding-inline: var(--pad); }
.muted { color: var(--muted); }
.empty { padding: 1rem 0; color: var(--muted); }
[hidden] { display: none !important; }

.img-dim, .img-dark { display: none; }
[data-theme="dim"] .img-light, [data-theme="dim"] .img-dark,
[data-theme="dark"] .img-light, [data-theme="dark"] .img-dim { display: none; }
[data-theme="dim"] .img-dim, [data-theme="dark"] .img-dark { display: inline; }

/* ---------- Shared surfaces ---------- */

.card, .panel, .data-card, .detail-card, .mainboxes, .cookie,
.topbar, .site-header, .menu, .search, .site-footer {
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    transition: background-color 0.3s, border-color 0.3s;
}

.card, .panel, .data-card, .detail-card, .mainboxes, .cookie {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: 0 0.375rem 1.25rem var(--shadow);
}

.card-header, .card-body, .card-footer, .panel-head, .panel-body,
.panel-foot, .data-card-head, .data-card-foot { padding-inline: var(--pad); }
.card-header, .card-body, .card-footer, .panel-head, .panel-foot,
.data-card-head, .data-card-foot { padding-block: 1rem; }
.card-header, .panel-head, .data-card-head { border-bottom: 1px solid var(--line); }
.card-body + .card-footer, .card-footer + .card-body { border-top: 1px solid var(--line); }
.card-footer, .panel-foot, .data-card-foot { background: var(--bg); color: var(--muted); }
.panel-foot { display: block; text-align: center; font-weight: 500; }
.panel-foot:hover { color: var(--accent); text-decoration: none; }

main { display: block; padding-bottom: var(--gap); }
.data-card, .detail-card, .mainboxes, .panels, .stat-grid { margin-bottom: var(--gap); }

/* ---------- Shell ---------- */

.topbar {
    position: sticky;
    top: 0;
    z-index: 9000;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding-block: 0.375rem;
}
.topbar-inner, .header-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
}
.topbar-inner { min-height: 2.375rem; }
.topbar-left { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1rem; color: var(--muted); }
.topbar-left a { color: var(--text); }
.topbar-left .info { color: var(--accent); }
.topbar-right { display: flex; align-items: center; gap: 0.5rem; }

.icon-btn {
    display: grid;
    place-items: center;
    width: 2.375rem;
    height: 2.375rem;
    padding: 0;
    background: transparent;
    color: var(--accent);
    cursor: pointer;
}
.icon-btn img { width: 1.125rem; height: 1.125rem; }

details.dropdown, .nav-item { position: relative; }
details.dropdown > summary { list-style: none; cursor: pointer; }
details.dropdown > summary::-webkit-details-marker { display: none; }
.menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    z-index: 9999;
    min-width: 14rem;
    margin: 0;
    padding: 0.5rem;
    list-style: none;
    background: var(--menu-surface);
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    box-shadow: 0 0.5rem 1.5rem var(--shadow);
    visibility: hidden;
    opacity: 0;
    transform: translateY(-0.5rem) scale(0.98);
    filter: blur(4px);
    pointer-events: none;
    transition: opacity 0.18s ease, transform 0.18s ease, filter 0.18s ease,
                visibility 0s linear 0.18s;
}
details.dropdown[open] > .menu, .nav-item[open] > .menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
    pointer-events: auto;
    transition-delay: 0s;
}
.menu li { margin: 0; }
.menu a, .menu button, .menu span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.5rem 0.75rem;
    background: transparent;
    color: var(--text);
    font: inherit;
    text-align: left;
    border: 0;
    border-radius: 0.375rem;
}
.menu a:hover, .menu button:hover { background: var(--bg); text-decoration: none; }
.menu .menu-rule { display: block; height: 0; margin: 0.375rem 0; padding: 0; border: 0; border-top: 1px solid var(--line); }
.menu .menu-arrow { margin-left: auto; }

.theme-icon { width: 1.25rem; color: var(--accent); }
.theme-btn { cursor: pointer; }
.theme-btn:hover { background: var(--bg); text-decoration: none; }
.theme-btn.active { color: var(--accent); font-weight: 600; }
.theme-btn.active::after {
    content: "\f00c";
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    margin-left: auto;
    color: var(--accent);
}

.site-header { position: relative; z-index: 8000; background: var(--surface); border-bottom: 1px solid var(--line); }
.header-inner { min-height: 4.5rem; }
.brand { display: inline-flex; align-items: center; }
.brand img { width: 10rem; height: auto; }

.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem 1rem; }
.site-nav > a, .site-nav > span { color: var(--muted); font-weight: 500; }
.site-nav > a:hover { color: var(--accent); text-decoration: none; }
.site-nav > .active, .nav-item > summary.active { color: var(--text); }
.nav-sep { color: var(--line); }
.nav-item > summary {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0;
    color: var(--muted);
    font-weight: 500;
    cursor: pointer;
    list-style: none;
}
.nav-item > summary::-webkit-details-marker { display: none; }
.nav-item > summary::after { content: "\f107"; font-family: "Font Awesome 6 Free"; font-weight: 900; font-size: 0.8em; }
.nav-item > summary:hover, .nav-item[open] > summary { color: var(--accent); }

/* ---------- Home overview ---------- */

.hero {
    padding-block: 2.5rem;
    background: #0b1b30 url(../img/waves-light.svg) no-repeat center / cover;
    color: #fff;
}
[data-theme="dim"] .hero { background-image: url(../img/waves-dim.svg); }
[data-theme="dark"] .hero { background-image: url(../img/waves-dark.svg); }
.hero h1 { margin-bottom: 0.75rem; }

.search {
    display: flex;
    gap: 0.5rem;
    width: min(42rem, 100%);
    padding: 0.375rem;
}
.search input {
    flex: 1;
    min-width: 0;
    padding: 0.625rem 0.75rem;
    border: 0;
    border-radius: 0.5rem;
    font: inherit;
    color: var(--text);
    background: transparent;
}
.search input:focus { outline: 2px solid var(--accent); outline-offset: -2px; }
.search button {
    flex: none;
    min-width: 2.75rem;
    min-height: 2.75rem;
    border: 0;
    border-radius: 0.5rem;
    background: var(--bg);
    color: var(--text);
    cursor: pointer;
}
.search button:hover { background: var(--accent); color: var(--btn-text); }

.mainboxes {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
    margin-inline: var(--pad);
    padding: var(--pad);
}
.hero + .mainboxes { position: relative; z-index: 1; margin-top: -1.25rem; }
.stat-col { min-width: 0; }
.stat-item { display: flex; gap: 0.75rem; }
.stat-item + .stat-item { margin-top: 0.75rem; padding-top: 0.75rem; border-top: 1px solid var(--line); }
.stat-icon { flex: none; width: 1.5rem; text-align: center; color: var(--muted); font-size: 1.25em; }
.stat-icon img { width: 1.5rem; height: 1.5rem; }
.stat-info { flex: 1; min-width: 0; }
.stat-label { margin-bottom: 0.125rem; color: var(--muted); }
.stat-value { font-weight: 500; overflow-wrap: anywhere; }
.stat-value a { color: var(--text); }
.stat-muted { color: var(--muted); }
.stat-side { flex: none; text-align: right; }

.stat-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.stat-box { display: flex; min-width: 0; }
.stat-box .card { flex: 1; transition: border-color 0.15s ease; }
.stat-box .card:hover { border-color: var(--accent); }
.stat-box .card-body { display: flex; flex-direction: column; gap: 0.75rem; }
.stat-box-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.stat-box-title { margin: 0; color: var(--muted); font-weight: 500; }
.stat-box-icon { flex: none; color: var(--muted); }
.stat-box-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.375rem; font-weight: 500; }
.stat-box-note { color: var(--muted); }
.stat-box-note.up { color: #0f9d73; }

/* ---------- Panels and feed rows ---------- */

.panels {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: var(--gap);
    padding-inline: var(--pad);
}
.panel { display: flex; flex-direction: column; min-width: 0; overflow: hidden; }
.panel-title, .data-card-title { margin: 0; }
.panel-body { flex: 1; max-height: 32rem; overflow-y: auto; padding-block: 0; }

.feed-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem 0.75rem;
    padding: 0.75rem 0;
}
.feed-row + .feed-row { border-top: 1px solid var(--line); }
.feed-col { min-width: 0; }
.feed-col-id { display: flex; align-items: center; gap: 0.75rem; }
.feed-id-lines { min-width: 0; }
.feed-col-detail { display: grid; align-content: center; gap: 0.125rem; min-width: 0; }
.feed-col-value { min-width: 0; }
.feed-icon {
    flex: none;
    display: grid;
    place-items: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: var(--radius);
    background: var(--bg);
    color: var(--muted);
    font-size: 1.125em;
}
.feed-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0.375rem; }
.feed-age { color: var(--muted); }
.hash-link, .addr {
    display: inline-block;
    max-width: 10rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: bottom;
}
.chip {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    font-weight: 600;
    color: var(--text);
}

/* ---------- Page heads, tables, pagination ---------- */

.page-head { padding: var(--gap) var(--pad); border-bottom: 1px solid var(--line); }
.page-title-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.75rem; }
.page-title { margin: 0; }
.page-subtitle { color: var(--muted); overflow-wrap: anywhere; }

.table-scroll { width: 100%; overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; }
.data-table th, .data-table td {
    padding: 0.75rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--line);
    white-space: nowrap;
}
.data-table th { color: var(--muted); font-weight: 500; background: var(--bg); }
.data-table tbody tr:hover { background: var(--bg); }
.data-table td.wrap { white-space: normal; overflow-wrap: anywhere; min-width: 10rem; }

.status-pill { display: inline-block; padding: 0.125rem 0.5rem; border-radius: 2rem; font-weight: 500; }
.status-pill.ok { background: rgba(16, 185, 129, 0.12); color: #0f9d73; }
.status-pill.warn { background: rgba(245, 158, 11, 0.12); color: #c2740a; }
.status-pill.fail { background: rgba(239, 68, 68, 0.12); color: #d94841; }
.method-badge {
    display: inline-block;
    max-width: 8rem;
    padding: 0.125rem 0.5rem;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    background: var(--bg);
    color: var(--muted);
    text-overflow: ellipsis;
    white-space: nowrap;
    vertical-align: middle;
}
.direction-cell { display: inline-grid; place-items: center; width: 1.5rem; height: 1.5rem; border-radius: 2rem; background: rgba(16, 185, 129, 0.12); color: #0f9d73; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }
.pager a, .pager span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    min-width: 2.5rem;
    min-height: 2.25rem;
    padding: 0.375rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    color: var(--text);
    line-height: 1.2;
    white-space: nowrap;
}
.pager a:hover { background: var(--bg); text-decoration: none; }

/* ---------- Detail pages ---------- */

.detail-card { padding: var(--pad); }
.detail-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.25rem; margin-bottom: 1rem; }
.detail-row:last-child { margin-bottom: 0; }
.detail-label { color: var(--muted); }
.detail-value { min-width: 0; overflow-wrap: anywhere; }
.detail-rule { margin: var(--gap) 0; border: 0; border-top: 1px solid var(--line); }
.detail-summary { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.detail-stat-label { margin-bottom: 0.125rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.03em; }
.detail-stat-value { font-weight: 500; overflow-wrap: anywhere; }

.detail-pre, .detail-textarea {
    background: var(--bg);
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    color: var(--text);
    font: inherit;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.detail-pre { margin: 0; padding: 0.75rem 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.detail-textarea { display: block; width: 100%; max-width: 100%; padding: 0.5rem; resize: vertical; }

.detail-more { margin-top: var(--gap); padding-top: var(--gap); border-top: 1px solid var(--line); }
.detail-rule + .detail-more { margin-top: 0; padding-top: 0; border-top: 0; }
.detail-more > summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
    cursor: pointer;
    list-style: none;
    color: var(--accent);
}
.detail-more > summary::-webkit-details-marker { display: none; }
.detail-extra {
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    padding-top: 0;
    transition: max-height 0.22s ease, opacity 0.18s ease, padding-top 0.22s ease;
}
.detail-more[open] .detail-extra { max-height: 60rem; opacity: 1; padding-top: 1rem; }
.detail-more.is-closing[open] .detail-extra { max-height: 0; opacity: 0; padding-top: 0; }
.detail-more .more-open, .detail-more[open] .more-closed { display: none; }
.detail-more[open] .more-open { display: inline; }
.detail-more.is-closing .more-open { display: none; }
.detail-more.is-closing .more-closed { display: inline; }
.detail-extra .table-scroll { max-height: 30rem; overflow: auto; }

.step-btns { display: inline-flex; gap: 0.375rem; }
.step-btn {
    display: inline-grid;
    place-items: center;
    width: 1.75rem;
    height: 1.75rem;
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    color: var(--text);
}
.step-btn:hover { background: var(--bg); text-decoration: none; }
.detail-link { display: inline-flex; align-items: center; gap: 0.25rem; }

/* ---------- Legal, forms, empty states ---------- */

.legal { max-width: 70rem; margin: 0 auto var(--gap); padding: var(--pad); }
.legal-updated { margin-bottom: var(--gap); color: var(--muted); }
.legal h2, .legal h3 { margin: var(--gap) 0 0.5rem; }
.legal p { color: var(--muted); line-height: 1.7; }
.legal ul { margin: 0 0 1rem; padding-left: 1.25rem; }
.legal li { margin-bottom: 0.35rem; color: var(--muted); line-height: 1.7; }
.legal a { color: var(--accent); text-decoration: underline; }

.form-card, .contact-box { max-width: 44rem; margin: 0 auto var(--gap); padding: var(--pad); }
.auth-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.form-note { margin-bottom: var(--gap); color: var(--muted); line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); }
.form-field { display: flex; flex-direction: column; gap: 0.375rem; }
.form-label { color: var(--muted); }
.form-control {
    width: 100%;
    min-height: 2.375rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 0.375rem;
    font: inherit;
}
textarea.form-control { resize: vertical; }
.form-check { display: inline-flex; align-items: center; gap: 0.375rem; margin: 1rem 0; color: var(--muted); }
.form-submit, .cookie button, .notfound-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    min-height: 2.375rem;
    padding: 0.5rem 1.25rem;
    background: var(--accent);
    color: var(--btn-text);
    border: 0;
    border-radius: 0.375rem;
    font: inherit;
    text-decoration: none;
    cursor: pointer;
}
.form-submit { opacity: 0.55; cursor: not-allowed; }
fieldset:disabled .form-control, fieldset:disabled .form-check { opacity: 0.65; }

.notfound-card { max-width: 40rem; margin: 0 auto var(--gap); padding: var(--pad); text-align: center; }
.notfound-code { color: var(--accent); font-size: 3em; font-weight: 700; line-height: 1; }
.notfound-card h2 { margin: 1rem 0 0.5rem; }
.notfound-card p { color: var(--muted); }
.notfound-home { margin-top: 0.5rem; }

/* ---------- Footer ---------- */

.site-footer { padding: var(--gap) var(--pad); background: var(--surface); border-top: 1px solid var(--line); }
.footer-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; }
.footer-social { display: flex; flex-wrap: wrap; gap: 1rem; }
.footer-rule { height: 1px; margin: var(--gap) 0; background: var(--line); }
.footer-cols { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--gap); padding-bottom: var(--gap); }
.footer-cols h2 { margin-bottom: 0.5rem; }
.footer-cols p { color: var(--muted); }
.footer-brand { display: inline-flex; align-items: center; gap: 0.5rem; margin-bottom: 0.5rem; font-weight: 600; }
.footer-brand img { width: 1.75rem; height: 1.75rem; }
.footer-list { margin: 0; padding: 0; list-style: none; }
.footer-list li { margin-bottom: 0.5rem; }
.network-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    color: var(--text);
    border-radius: 0.375rem;
    text-decoration: none;
}
.network-btn img { width: 1.125rem; height: 1.125rem; }
.copyright {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0.75rem 1rem;
    padding-top: var(--gap);
    border-top: 1px solid var(--line);
    color: var(--muted);
}
.copyright p { margin: 0; }
.cookie { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem; margin: var(--pad); padding: var(--pad); }
.cookie p { margin: 0; }

/* ---------- The only layout breakpoint ---------- */

@media (min-width: 800px) {
    .topbar-inner, .header-inner, .site-nav { flex-wrap: nowrap; }
    .topbar-inner, .header-inner { gap: 1.5rem; }
    .site-nav { gap: 0.25rem 1.25rem; }
    .menu-right, .nav-item > .menu { left: auto; right: 0; }

    .mainboxes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .stat-col + .stat-col { padding-left: var(--gap); border-left: 1px solid var(--line); }
    .stat-grid { grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
    .panels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .feed-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr) auto; align-items: center; }
    .feed-col-value { justify-self: end; text-align: right; }

    .detail-row, .detail-more > summary { grid-template-columns: 12rem minmax(0, 1fr); gap: 1rem; }
    .detail-summary { grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); }
    .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .footer-cols { grid-template-columns: 2fr repeat(3, minmax(0, 1fr)); }
}

button:active, .pager a:active { transform: scale(0.96); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}
