/* ==========================================================================
   Private Key Tools — shared stylesheet
   Used by every page under /tools/. Light-first, honours prefers-color-scheme.
   ========================================================================== */

:root {
    --bg: #f5f6f8;
    --bg-elev: #ffffff;
    --bg-soft: #f8fafc;
    --bg-code: #f1f3f6;
    --border: #e3e6ea;
    --border-strong: #cfd4da;
    --text: #1a1d21;
    --text-soft: #4b5563;
    --muted: #6b7280;
    --faint: #9ca3af;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-soft: #eff6ff;
    --ok: #15803d;
    --ok-soft: #ecfdf5;
    --warn: #b45309;
    --warn-soft: #fffbeb;
    --err: #b91c1c;
    --err-soft: #fef2f2;
    --radius: 10px;
    --radius-sm: 6px;
    --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", "Microsoft YaHei", "PingFang SC", sans-serif;
    --shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #0f1115;
        --bg-elev: #171a21;
        --bg-soft: #1c2029;
        --bg-code: #1e232c;
        --border: #2a2f3a;
        --border-strong: #3a4150;
        --text: #e6e9ef;
        --text-soft: #b6bdc9;
        --muted: #8b93a1;
        --faint: #6b7280;
        --accent: #5b8dee;
        --accent-hover: #7aa3f2;
        --accent-soft: #1a2438;
        --ok: #4ade80;
        --ok-soft: #12261a;
        --warn: #fbbf24;
        --warn-soft: #2a2010;
        --err: #f87171;
        --err-soft: #2a1414;
        --shadow: 0 1px 3px rgba(0, 0, 0, .4);
    }
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    padding: 0 0 64px;
    background: var(--bg);
    color: var(--text);
    font-family: var(--sans);
    font-size: 15px;
    line-height: 1.65;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------------------------------------------------------------- topbar */

.topbar {
    position: sticky; top: 0; z-index: 50;
    background: color-mix(in srgb, var(--bg-elev) 88%, transparent);
    backdrop-filter: saturate(160%) blur(10px);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 1080px; margin: 0 auto; padding: 10px 20px;
    display: flex; align-items: center; gap: 14px;
}
.brand {
    display: inline-flex; align-items: center; gap: 8px;
    font-weight: 700; font-size: 15px; color: var(--text); letter-spacing: -.01em;
}
.brand:hover { text-decoration: none; color: var(--accent); }
.brand .logo { font-size: 17px; line-height: 1; }
.topbar-spacer { flex: 1; }
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.pill {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 6px 11px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--bg-elev);
    color: var(--text-soft); font-size: 13px; font-weight: 600; line-height: 1.2;
    cursor: pointer; white-space: nowrap;
}
.pill:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; background: var(--accent-soft); }
.pill svg { width: 15px; height: 15px; display: block; }

/* ------------------------------------------------------------------ wrap */

.wrap { max-width: 1080px; margin: 0 auto; padding: 26px 20px 0; }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.crumbs .sep { margin: 0 6px; color: var(--faint); }

h1.page-title {
    font-size: 1.65rem; line-height: 1.3; margin: 0 0 10px;
    letter-spacing: -.02em; font-weight: 750;
}
p.lead {
    margin: 0 0 22px; color: var(--text-soft); font-size: 15.5px; max-width: 78ch;
}

.card {
    background: var(--bg-elev); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 20px; margin-bottom: 18px; box-shadow: var(--shadow);
}
.card > :first-child { margin-top: 0; }
.card > :last-child { margin-bottom: 0; }

.card-title {
    font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 14px;
}

/* ------------------------------------------------------------------ form */

.fields { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; }
.field > label {
    font-size: 13px; font-weight: 650; color: var(--text-soft);
}
.field .hint { font-size: 12.5px; color: var(--muted); line-height: 1.55; }
.field .hint code { font-size: 12px; }

input[type=text], input[type=number], textarea, select {
    width: 100%; padding: 11px 13px; font-size: 14.5px;
    font-family: var(--mono);
    color: var(--text); background: var(--bg-soft);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    outline: none; transition: border-color .12s, box-shadow .12s;
}
textarea { resize: vertical; min-height: 84px; line-height: 1.6; }
select { font-family: var(--sans); font-size: 14px; cursor: pointer; }
input:focus, textarea:focus, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent);
}
input::placeholder, textarea::placeholder { color: var(--faint); opacity: 1; }

.field-row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; }
.field-row > .field { flex: 1 1 240px; }
.field-row > .field.narrow { flex: 0 1 190px; }

.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 4px; }

.btn {
    padding: 10px 22px; font-size: 14.5px; font-weight: 650; font-family: var(--sans);
    border: 1px solid transparent; border-radius: var(--radius-sm);
    background: var(--accent); color: #fff; cursor: pointer;
    transition: background .12s;
}
.btn:hover { background: var(--accent-hover); }

.btn-ghost {
    padding: 9px 16px; font-size: 14px; font-weight: 600; font-family: var(--sans);
    border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
    background: var(--bg-elev); color: var(--text-soft); cursor: pointer;
    transition: border-color .12s, color .12s, background .12s;
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* ---------------------------------------------------------------- alerts */

.alert {
    border-radius: var(--radius); padding: 13px 16px; margin-bottom: 18px;
    font-size: 14px; border: 1px solid transparent;
}
.alert strong { display: block; margin-bottom: 3px; font-size: 13.5px; }
.alert-error { background: var(--err-soft); border-color: color-mix(in srgb, var(--err) 35%, transparent); color: var(--err); }
.alert-info { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 30%, transparent); color: var(--text-soft); }
.alert-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); color: var(--warn); }
.alert-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 35%, transparent); color: var(--ok); }
.alert .mono { font-family: var(--mono); font-size: 13px; word-break: break-all; }

/* --------------------------------------------------------------- results */

.result-head {
    display: flex; align-items: baseline; justify-content: space-between;
    gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.result-head h2 { font-size: 15px; margin: 0; font-weight: 700; }
.result-head .meta { font-size: 12.5px; color: var(--muted); }

.rows { display: block; }

.row {
    display: grid; grid-template-columns: minmax(140px, 210px) 1fr auto;
    gap: 8px 14px; align-items: start;
    margin-bottom: 9px;
    padding: 11px 13px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-soft);
}
.row:last-child { margin-bottom: 0; }
.row-label {
    font-size: 12.5px; font-weight: 650; color: var(--text-soft);
    line-height: 1.5; word-break: break-word;
}
.row-label .abbr {
    display: inline-block; min-width: 17px; margin-right: 5px; padding: 0 4px;
    font-family: var(--mono); font-size: 11px; font-weight: 700; text-align: center;
    color: var(--accent); background: var(--accent-soft); border-radius: 4px;
}
.row-value {
    font-family: var(--mono); font-size: 13px; line-height: 1.65;
    word-break: break-all; overflow-wrap: anywhere; grid-column: 2;
}
.row-note {
    grid-column: 2; font-size: 12.5px; color: var(--muted);
    font-family: var(--sans); line-height: 1.55; word-break: normal;
}
.row-tools { grid-column: 3; grid-row: 1; }
.row.wide { grid-template-columns: minmax(140px, 210px) 1fr auto; }
.row.tone-ok { border-color: color-mix(in srgb, var(--ok) 35%, var(--border)); }
.row.tone-warn { border-color: color-mix(in srgb, var(--warn) 35%, var(--border)); }
.row.tone-accent { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); }

.copy-btn {
    padding: 3px 9px; font-size: 11.5px; font-weight: 600;
    font-family: var(--sans); white-space: nowrap;
    border: 1px solid var(--border-strong); border-radius: 5px;
    background: var(--bg-elev); color: var(--muted); cursor: pointer;
}
.copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.copy-btn.done { border-color: var(--ok); color: var(--ok); }

.subhead {
    margin: 22px 0 4px; padding-top: 16px; border-top: 1px solid var(--border);
    font-size: 12px; font-weight: 700; letter-spacing: .06em;
    text-transform: uppercase; color: var(--muted);
}
.subhead:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.subhead-note { font-size: 13px; color: var(--muted); margin: 0 0 12px; max-width: 80ch; }

.mini-note {
    margin: 14px 0 0; padding: 11px 14px; font-size: 13.5px; line-height: 1.6;
    border-left: 3px solid var(--border-strong); background: var(--bg-soft);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--text-soft);
}
.mini-note.tone-info { border-left-color: var(--accent); }
.mini-note.tone-warn { border-left-color: var(--warn); }
.mini-note.tone-ok { border-left-color: var(--ok); }
.mini-note strong { color: var(--text); }

pre.block {
    margin: 0; padding: 13px 15px; overflow-x: auto;
    background: var(--bg-code); border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-family: var(--mono);
    font-size: 12.5px; line-height: 1.7; color: var(--text-soft);
    white-space: pre-wrap; word-break: break-all;
}

/* ------------------------------------------------------------------ docs */

.docs {
    margin-top: 34px; padding-top: 26px; border-top: 1px solid var(--border);
    max-width: 900px;
}
.docs-label {
    font-size: 12px; font-weight: 700; letter-spacing: .07em;
    text-transform: uppercase; color: var(--muted); margin-bottom: 14px;
}
.docs > h2:first-child { margin-top: 0; }
.docs h2 {
    font-size: 1.2rem; font-weight: 700; letter-spacing: -.01em;
    margin: 38px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.docs h2:first-of-type { margin-top: 0; }
.docs h3 { font-size: 1.02rem; font-weight: 700; margin: 26px 0 8px; }
.docs h4 { font-size: .94rem; font-weight: 700; margin: 20px 0 6px; color: var(--text-soft); }
.docs p { margin: 0 0 13px; color: var(--text-soft); }
.docs ul, .docs ol { margin: 0 0 14px; padding-left: 22px; color: var(--text-soft); }
.docs li { margin-bottom: 6px; }
.docs li > ul, .docs li > ol { margin-top: 6px; }
.docs strong { color: var(--text); font-weight: 700; }
.docs em { font-style: italic; }
.docs hr { border: 0; border-top: 1px solid var(--border); margin: 28px 0; }

.docs code {
    font-family: var(--mono); font-size: .855em;
    background: var(--bg-code); color: var(--text);
    padding: 1.5px 5px; border-radius: 4px; word-break: break-word;
}
.docs pre {
    margin: 0 0 16px; padding: 14px 16px; overflow-x: auto;
    background: var(--bg-code); border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}
.docs pre code {
    background: none; padding: 0; font-size: 12.5px; line-height: 1.75;
    color: var(--text-soft); white-space: pre; word-break: normal;
}
.docs a { text-decoration: underline; text-underline-offset: 2px; }

.docs table {
    width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: 13.5px;
    display: block; overflow-x: auto;
}
.docs table thead th {
    text-align: left; font-size: 12px; font-weight: 700; letter-spacing: .03em;
    text-transform: uppercase; color: var(--muted);
    padding: 8px 12px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
.docs table td {
    padding: 9px 12px; border-bottom: 1px solid var(--border);
    color: var(--text-soft); vertical-align: top;
}
.docs table tbody tr:last-child td { border-bottom: 0; }
.docs table code { font-size: 12px; }
.docs table td:first-child { white-space: nowrap; }

.callout {
    margin: 0 0 18px; padding: 14px 17px; font-size: 14px;
    border: 1px solid var(--border); border-left-width: 4px;
    border-radius: var(--radius-sm); background: var(--bg-soft); color: var(--text-soft);
}
.callout > :last-child { margin-bottom: 0; }
.callout > :first-child { margin-top: 0; }
.callout .callout-title {
    display: block; font-weight: 700; color: var(--text); margin-bottom: 5px; font-size: 13.5px;
}
.callout.info { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.callout.danger { border-left-color: var(--err); background: var(--err-soft); }
.callout.ok { border-left-color: var(--ok); background: var(--ok-soft); }

.formula {
    margin: 0 0 18px; padding: 15px 17px; text-align: center;
    font-family: var(--mono); font-size: 13.5px; line-height: 1.9;
    background: var(--bg-code); border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm); color: var(--text); word-break: break-word;
}

.flow {
    display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
    margin: 0 0 18px; padding: 14px 16px;
    background: var(--bg-soft); border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.flow .step {
    padding: 5px 11px; font-family: var(--mono); font-size: 12.5px;
    background: var(--bg-elev); border: 1px solid var(--border-strong);
    border-radius: 999px; color: var(--text-soft); white-space: nowrap;
}
.flow .arrow { color: var(--faint); font-size: 13px; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 0 0 18px; }
.grid-2 > * { min-width: 0; }
@media (max-width: 700px) { .grid-2 { grid-template-columns: 1fr; } }

.panel {
    padding: 14px 16px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-soft);
}
.panel h4 { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.panel.accent { border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: var(--accent-soft); }

.badge {
    display: inline-block; padding: 1px 8px; margin-right: 5px;
    font-family: var(--mono); font-size: 11.5px; font-weight: 700;
    background: var(--bg-code); color: var(--text-soft);
    border: 1px solid var(--border-strong); border-radius: 999px;
}
.badge.ok { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, var(--border)); background: var(--ok-soft); }
.badge.warn { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, var(--border)); background: var(--warn-soft); }

/* --------------------------------------------------------------- related */

.related { margin-top: 30px; padding-top: 22px; border-top: 1px solid var(--border); }
.related h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 12px; font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 9px 14px; font-size: 13.5px; font-weight: 600;
    background: var(--bg-elev); border: 1px solid var(--border-strong);
    border-radius: 999px; color: var(--text-soft);
}
.chip:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.chip .arrow { color: var(--faint); font-size: 12px; }

/* ------------------------------------------------------------ tool index */

.tool-group { margin-bottom: 34px; }
.tool-group > h2 {
    font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--muted); margin: 0 0 14px;
}
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(310px, 1fr)); gap: 12px; }
.tool-card {
    display: block; padding: 16px 17px; background: var(--bg-elev);
    border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
    transition: border-color .12s, transform .12s;
}
.tool-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.tool-card .tname { font-weight: 700; font-size: 14.5px; color: var(--text); margin-bottom: 5px; }
.tool-card:hover .tname { color: var(--accent); }
.tool-card .tdesc { font-size: 13px; color: var(--muted); line-height: 1.6; }
.tool-card .tslug {
    display: inline-block; margin-top: 9px; font-family: var(--mono);
    font-size: 11.5px; color: var(--faint);
}

/* ------------------------------------------------- live balance (client JS) */

.balbar {
    display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
    margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--border);
}
.balbar .js-status { font-size: 13px; color: var(--muted); }
.balbar .spin {
    display: inline-block; width: 11px; height: 11px; margin-right: 6px;
    border: 2px solid var(--border-strong); border-top-color: var(--accent);
    border-radius: 50%; animation: balspin .7s linear infinite; vertical-align: -1px;
}
@keyframes balspin { to { transform: rotate(360deg); } }

.balrow {
    display: grid; grid-template-columns: minmax(120px, 1fr) minmax(150px, auto) minmax(100px, auto);
    gap: 4px 14px; align-items: center;
    padding: 10px 13px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-soft); margin-bottom: 8px;
}
.balrow.is-self { border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); background: var(--accent-soft); }
.balrow .baladdr { font-family: var(--mono); font-size: 12.5px; word-break: break-all; }
.balrow .baltype { font-size: 11.5px; color: var(--muted); }
.balrow .balval { font-family: var(--mono); font-size: 13px; font-weight: 650; text-align: right; white-space: nowrap; }
.balrow .balval.zero { color: var(--faint); font-weight: 500; }
.balrow .balval.positive { color: var(--ok); }
.balrow .balmeta { grid-column: 1 / -1; font-size: 12px; color: var(--muted); }
.balrow.pending .balval { color: var(--faint); font-weight: 500; }

.baltotal {
    margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border);
    font-size: 13.5px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.baltotal b { font-family: var(--mono); }

@media (max-width: 720px) {
    .balrow { grid-template-columns: 1fr; }
    .balrow .balval { text-align: left; }
}

/* ------------------------------------------------------- transaction table */

.txwrap { overflow-x: auto; margin: 0 0 4px; }
table.tx-table {
    width: 100%; border-collapse: collapse; font-size: 12.5px; min-width: 760px;
}
table.tx-table thead th {
    position: sticky; top: 0; z-index: 1;
    text-align: left; font-size: 11px; font-weight: 700; letter-spacing: .04em;
    text-transform: uppercase; color: var(--muted); background: var(--bg-elev);
    padding: 8px 10px; border-bottom: 2px solid var(--border); white-space: nowrap;
}
table.tx-table td {
    padding: 9px 10px; border-bottom: 1px solid var(--border);
    color: var(--text-soft); vertical-align: top;
}
table.tx-table tbody tr:hover { background: var(--bg-soft); }
table.tx-table td.mono, table.tx-table .mono { font-family: var(--mono); word-break: break-all; }
table.tx-table .amt { font-family: var(--mono); white-space: nowrap; font-weight: 650; }
table.tx-table .amt.in { color: var(--ok); }
table.tx-table .amt.out { color: var(--err); }
table.tx-table .amt.self { color: var(--muted); font-weight: 500; }
table.tx-table .sub { display: block; font-size: 11px; color: var(--faint); }
table.tx-table .party {
    display: block; font-family: var(--mono); font-size: 11.5px;
    word-break: break-all; color: var(--muted);
}
table.tx-table tbody tr.pending { background: var(--warn-soft); }
table.tx-table tbody tr.pending:hover { background: var(--warn-soft); }

/* ------------------------------------------- 地址内链（SEO 伪静态链接） */

a.addr-link {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted color-mix(in srgb, currentColor 45%, transparent);
}
a.addr-link:hover {
    color: var(--accent);
    text-decoration: none;
    border-bottom-color: var(--accent);
    border-bottom-style: solid;
}
a.addr-link > code { background: var(--bg-code); }
.baladdr a.addr-link { color: inherit; }

/* -------------------------------- 行内扩展：实时余额 / 可展开的历史记录 */

.row-extra {
    grid-column: 1 / -1;
    margin-top: 2px;
    padding-top: 9px;
    border-top: 1px dashed var(--border);
    font-family: var(--sans);
}

.row-live {
    display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
    font-size: 13px;
}
.row-live .live-bal {
    font-family: var(--mono); font-size: 13.5px; font-weight: 650; white-space: nowrap;
}
.row-live .live-bal.positive { color: var(--ok); }
.row-live .live-bal.zero { color: var(--faint); font-weight: 500; }
.row-live .live-meta { font-size: 12px; color: var(--muted); }
.row-live .live-hint { font-size: 12px; color: var(--accent); cursor: pointer; }
.row-live .spin {
    display: inline-block; width: 10px; height: 10px;
    border: 2px solid var(--border-strong); border-top-color: var(--accent);
    border-radius: 50%; animation: balspin .7s linear infinite;
}

.hist {
    margin-top: 11px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); background: var(--bg-elev); overflow: hidden;
}
.hist-head {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    flex-wrap: wrap; padding: 9px 12px; background: var(--bg-soft);
    border-bottom: 1px solid var(--border); font-size: 12.5px;
}
.hist-head b { font-size: 12.5px; }
.hist-head .hist-src { color: var(--muted); font-size: 11.5px; }
.hist-body { max-height: 340px; overflow-y: auto; }
.hist-empty { padding: 12px; font-size: 13px; color: var(--muted); }
.hist-msg { padding: 12px; font-size: 13px; }
.hist-msg.err { color: var(--warn); }

table.hist-table { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 640px; }
table.hist-table th {
    text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em;
    color: var(--muted); padding: 7px 10px; border-bottom: 1px solid var(--border);
    white-space: nowrap; background: var(--bg-elev);
}
table.hist-table td {
    padding: 7px 10px; border-bottom: 1px solid var(--border);
    color: var(--text-soft); vertical-align: top; font-family: var(--mono); font-size: 11.5px;
    word-break: break-all;
}
table.hist-table tr:last-child td { border-bottom: 0; }
table.hist-table .h-amt { white-space: nowrap; font-weight: 650; }
table.hist-table .h-amt.in { color: var(--ok); }
table.hist-table .h-amt.out { color: var(--err); }
table.hist-table .h-amt.self { color: var(--muted); font-weight: 500; }
table.hist-table .h-sub { display: block; color: var(--faint); font-size: 10.5px; }
table.hist-table .h-party { display: block; }

/* ------------------------------------------------------------ misc small */

.extlinks { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
.extlinks a {
    font-size: 12.5px; padding: 6px 12px; border-radius: 999px;
    border: 1px solid var(--border-strong); background: var(--bg-elev); color: var(--text-soft);
}
.extlinks a:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); text-decoration: none; }

.verdict {
    display: inline-flex; align-items: center; gap: 7px;
    font-weight: 700; font-size: 14.5px;
}
.verdict.ok { color: var(--ok); }
.verdict.bad { color: var(--err); }

/* ---------------------------------------------------------------- footer */

.footer {
    max-width: 1080px; margin: 44px auto 0; padding: 20px;
    border-top: 1px solid var(--border); color: var(--muted); font-size: 12.5px;
}
.footer p { margin: 0 0 6px; max-width: 88ch; }

/* ------------------------------------------------------------ responsive */

@media (max-width: 720px) {
    .wrap { padding: 20px 14px 0; }
    .topbar-inner { padding: 9px 14px; }
    .brand span.brand-text { display: none; }
    h1.page-title { font-size: 1.35rem; }
    .card { padding: 16px; }
    .row { grid-template-columns: 1fr; gap: 5px; }
    .row-value, .row-note, .row-tools { grid-column: 1; }
    .row-tools { grid-row: auto; margin-top: 4px; }
    .docs table td:first-child { white-space: normal; }
}
