:root {
    --bg: #070a12;
    --bg-2: #101827;
    --panel: rgba(15, 23, 42, 0.78);
    --panel-strong: rgba(15, 23, 42, 0.94);
    --panel-soft: rgba(30, 41, 59, 0.64);
    --line: rgba(125, 249, 255, 0.18);
    --line-strong: rgba(125, 249, 255, 0.42);
    --text: #e6fbff;
    --muted: #91a8be;
    --cyan: #22d3ee;
    --blue: #3b82f6;
    --pink: #f472b6;
    --violet: #a78bfa;
    --green: #34d399;
    --amber: #fbbf24;
    --red: #fb7185;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
    --radius: 12px;
}

/* Current single-template UI overrides */
.auth-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    align-items: center;
    gap: 34px;
    padding: 28px 0;
}

.auth-brand {
    min-width: 0;
    padding: 44px 0;
}

.brand-orbit {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.1);
    box-shadow: 0 0 34px rgba(34, 211, 238, 0.22);
}

.auth-brand h1 {
    margin: 24px 0 14px;
    font-size: clamp(36px, 6vw, 66px);
    line-height: 1;
    font-weight: 950;
    color: var(--text);
    text-shadow: 0 0 28px rgba(34, 211, 238, 0.26);
}

.auth-brand p {
    max-width: 580px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}

.feature-grid {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.feature-grid > div {
    min-height: 86px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.42);
}

.feature-grid strong,
.feature-grid span {
    display: block;
}

.feature-grid strong {
    margin-bottom: 7px;
    color: var(--text);
    font-size: 14px;
}

.feature-grid span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.auth-shell > .auth-card {
    width: 100%;
    min-height: 0;
    display: block;
    padding: 34px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: rgba(3, 7, 18, 0.54);
    box-shadow: var(--shadow), inset 0 0 50px rgba(34, 211, 238, 0.04);
    backdrop-filter: blur(20px);
}

[data-theme="light"] .auth-shell > .auth-card,
[data-theme="light"] .feature-grid > div {
    background: rgba(255, 255, 255, 0.72);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    margin-bottom: 28px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.34);
}

.auth-tabs button {
    height: 42px;
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-weight: 900;
}

.auth-tabs button.active {
    color: #06121c;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.form-grid label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 850;
}

.password-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 8px;
    align-items: center;
}

.ghost-icon {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    cursor: pointer;
    font-weight: 900;
}

.text-link {
    display: inline-flex;
    margin-top: 16px;
    color: var(--cyan);
    text-decoration: none;
    font-weight: 800;
}

.brand,
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
    font-weight: 950;
    white-space: nowrap;
}

.nav-center,
.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.icon-chip,
.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #06121c;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    text-decoration: none;
    font-weight: 950;
}

.page-wrap {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 30px 0 96px;
}

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 24px;
}

.page-hero h1 {
    margin: 8px 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
}

.page-hero p {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0;
}

.hero-address,
.code-box,
.secret-box,
.notice {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.38);
    color: var(--muted);
    word-break: break-all;
}

.notice[data-type="ok"] {
    border-color: rgba(52, 211, 153, 0.55);
    color: var(--green);
}

.notice[data-type="error"] {
    border-color: rgba(251, 113, 133, 0.7);
    color: var(--red);
}

.notice[data-type="info"] {
    border-color: var(--line-strong);
    color: var(--cyan);
}

.receive-panel {
    display: grid;
    gap: 18px;
    justify-items: start;
}

.qr-shell {
    display: grid;
    place-items: center;
    width: min(100%, 320px);
    padding: 14px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(59, 130, 246, 0.12));
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

.qr-shell canvas,
.qr-shell img {
    width: 100%;
    max-width: 285px;
    height: auto;
    border-radius: 10px;
    background: #ffffff;
}

.qr-shell img {
    display: block;
    image-rendering: pixelated;
}

.wallet-grid,
.grid {
    display: grid;
    gap: 18px;
}

.wallet-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.balance-panel strong,
#balance-main {
    display: block;
    margin: 12px 0;
    color: var(--cyan);
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1;
    font-weight: 950;
}

.balance-panel span {
    display: block;
    color: var(--muted);
    word-break: break-all;
}

.stats-grid {
    display: grid;
    gap: 14px;
}

.stat-card {
    min-height: 112px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}

.stat-card span,
.stat-card small {
    display: block;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin: 10px 0 8px;
    color: var(--text);
    font-size: 28px;
    line-height: 1;
}

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

.quick-grid.large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-card,
.panel,
.block-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16);
}

.action-card {
    display: block;
    min-height: 118px;
    padding: 20px;
    color: var(--text);
    text-decoration: none;
}

.action-card strong,
.action-card span {
    display: block;
}

.action-card span {
    margin-top: 10px;
    color: var(--muted);
}

.panel {
    padding: 22px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-title {
    margin: 0;
    color: var(--text);
    font-size: 20px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.list {
    display: grid;
    gap: 12px;
}

.list-item,
.block-card {
    padding: 16px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.26);
}

.list-item strong,
.list-item span {
    display: block;
}

.list-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    word-break: break-all;
}

.block-top,
.block-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.block-card code {
    display: block;
    margin: 14px 0;
    color: var(--cyan);
    word-break: break-all;
}

.clickable {
    cursor: pointer;
    transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.clickable:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: rgba(34, 211, 238, 0.08);
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 96px 96px;
    gap: 10px;
    align-items: center;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.code-table {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
}

.code-table > div {
    display: grid;
    grid-template-columns: 86px minmax(0, 1fr) 72px;
    gap: 10px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.28);
}

.code-table span {
    color: var(--muted);
}

.code-table code {
    color: var(--cyan);
    word-break: break-all;
}

.sub-title {
    margin: 18px 0 12px;
    color: var(--text);
}

.list-item.selected {
    border-color: var(--cyan);
    background: rgba(34, 211, 238, 0.1);
}

.btn.small {
    min-height: 34px;
    padding: 0 12px;
    font-size: 12px;
}

.rule-list {
    display: grid;
    gap: 8px;
    margin: 16px 0 0;
    padding-left: 18px;
    color: var(--muted);
    line-height: 1.65;
}

.node-type-card {
    min-height: 260px;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    font-size: 12px;
    font-weight: 900;
}

.node-detail-grid {
    display: grid;
    gap: 10px;
}

.node-detail-item {
    display: grid;
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.26);
}

.node-detail-item span {
    color: var(--muted);
    font-size: 13px;
}

.node-detail-item strong {
    color: var(--text);
    word-break: break-all;
}

.dialog-backdrop {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(2, 6, 23, 0.72);
    backdrop-filter: blur(12px);
}

.dialog-card {
    width: min(460px, 100%);
    padding: 22px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: var(--panel-strong);
    box-shadow: var(--shadow), 0 0 50px rgba(34, 211, 238, 0.16);
}

.dialog-card.ok {
    border-color: rgba(52, 211, 153, 0.55);
}

.dialog-card.error {
    border-color: rgba(251, 113, 133, 0.7);
}

.mobile-only {
    display: none !important;
}

.scanner-modal {
    position: fixed;
    inset: 0;
    z-index: 210;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(2, 6, 23, 0.78);
    backdrop-filter: blur(14px);
}

.scanner-card {
    width: min(480px, 100%);
    display: grid;
    gap: 16px;
    padding: 18px;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    background: var(--panel-strong);
    box-shadow: var(--shadow), 0 0 50px rgba(34, 211, 238, 0.16);
}

.scanner-stage {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(2, 6, 23, 0.6);
}

.scanner-stage video {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.scanner-frame {
    position: absolute;
    inset: 18%;
    border: 2px solid var(--cyan);
    border-radius: 14px;
    box-shadow: 0 0 0 999px rgba(2, 6, 23, 0.32), 0 0 26px rgba(34, 211, 238, 0.45);
    pointer-events: none;
}

.scanner-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.scanner-file-label {
    justify-content: center;
    width: 100%;
}

.scanner-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.dialog-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.dialog-head h3 {
    margin: 0;
    color: var(--text);
}

.dialog-body {
    margin-bottom: 18px;
    color: var(--muted);
    line-height: 1.7;
    white-space: pre-wrap;
}

.block-meta span {
    color: var(--muted);
    font-size: 13px;
}

.empty,
.fatal {
    padding: 18px;
    color: var(--muted);
    text-align: center;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100;
    display: grid;
    gap: 10px;
}

.toast {
    max-width: 360px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    color: var(--text);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.toast.ok {
    border-color: rgba(52, 211, 153, 0.55);
}

.toast.error {
    border-color: rgba(251, 113, 133, 0.7);
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .auth-shell {
        width: min(100% - 28px, 620px);
        grid-template-columns: 1fr;
        gap: 18px;
        align-items: start;
        padding: 28px 0 40px;
    }

    .auth-brand {
        padding: 8px 0;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .auth-shell > .auth-card {
        padding: 24px;
    }

    .top-nav {
        height: 62px;
        display: grid;
        grid-template-columns: 1fr auto;
        padding: 0 16px;
    }

    .nav-center {
        display: none;
    }

    .nav-user span {
        display: none;
    }

    .page-wrap {
        width: min(100% - 28px, 680px);
        padding-top: 22px;
    }

    .page-hero,
    .wallet-grid,
    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4,
    .quick-grid,
    .quick-grid.large {
        grid-template-columns: 1fr;
    }

    .page-hero {
        display: grid;
    }

    .password-wrap {
        grid-template-columns: 1fr;
    }

    .search-row,
    .detail-grid,
    .code-table > div,
    .node-detail-item {
        grid-template-columns: 1fr;
    }
}

[data-theme="light"] {
    --bg: #eaf7ff;
    --bg-2: #f8fbff;
    --panel: rgba(255, 255, 255, 0.82);
    --panel-strong: rgba(255, 255, 255, 0.96);
    --panel-soft: rgba(224, 242, 254, 0.7);
    --line: rgba(37, 99, 235, 0.18);
    --line-strong: rgba(37, 99, 235, 0.34);
    --text: #0f172a;
    --muted: #52657a;
    --shadow: 0 20px 52px rgba(15, 23, 42, 0.14);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 10% -10%, rgba(34, 211, 238, 0.26), transparent 34%),
        radial-gradient(circle at 85% 10%, rgba(244, 114, 182, 0.18), transparent 30%),
        linear-gradient(135deg, var(--bg), var(--bg-2));
    color: var(--text);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
    letter-spacing: 0;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(125, 249, 255, 0.06) 1px, transparent 1px),
        linear-gradient(90deg, rgba(125, 249, 255, 0.06) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,0.65), transparent 78%);
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.auth-card {
    width: min(1040px, 100%);
    min-height: 610px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    overflow: hidden;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: var(--panel);
    box-shadow: var(--shadow), 0 0 60px rgba(34, 211, 238, 0.12);
    backdrop-filter: blur(22px);
}

.auth-hero {
    padding: 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(59, 130, 246, 0.1)),
        rgba(8, 13, 26, 0.42);
}

.brand-lockup {
    display: flex;
    align-items: center;
    gap: 14px;
    font-size: 26px;
    font-weight: 900;
}

.brand-mark {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.24), rgba(244, 114, 182, 0.16));
    color: var(--cyan);
    box-shadow: 0 0 26px rgba(34, 211, 238, 0.2);
    font-size: 16px;
    font-weight: 950;
}

.hero-title {
    margin: 34px 0 14px;
    font-size: clamp(34px, 5vw, 54px);
    line-height: 1.05;
    font-weight: 950;
}

.hero-title .accent {
    color: var(--cyan);
    text-shadow: 0 0 28px rgba(34, 211, 238, 0.38);
}

.hero-copy {
    max-width: 430px;
    color: var(--muted);
    font-size: 16px;
    line-height: 1.8;
}

.feature-strip {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mini-feature {
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.38);
}

.mini-feature strong {
    display: block;
    margin-bottom: 6px;
    color: var(--text);
}

.mini-feature span {
    color: var(--muted);
    font-size: 12px;
}

.auth-panel {
    padding: 52px;
    background: rgba(3, 7, 18, 0.34);
}

[data-theme="light"] .auth-panel,
[data-theme="light"] .mini-feature {
    background: rgba(255, 255, 255, 0.55);
}

.app-shell {
    min-height: 100vh;
}

.top-nav {
    height: 68px;
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr) 230px;
    align-items: center;
    gap: 18px;
    padding: 0 28px;
    border-bottom: 1px solid var(--line);
    background: rgba(7, 10, 18, 0.72);
    backdrop-filter: blur(20px);
    position: sticky;
    top: 0;
    z-index: 20;
}

[data-theme="light"] .top-nav {
    background: rgba(248, 251, 255, 0.82);
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
    font-weight: 900;
    white-space: nowrap;
}

.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.nav-link {
    width: 112px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--muted);
    text-decoration: none;
    font-size: 14px;
    font-weight: 800;
    transition: color 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--cyan);
    border-color: var(--line-strong);
    background: rgba(34, 211, 238, 0.09);
}

.nav-user {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #06121c;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    font-weight: 950;
}

.user-name {
    max-width: 135px;
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 800;
}

.main {
    width: min(1220px, calc(100% - 40px));
    margin: 28px auto 90px;
}

.page-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-end;
    margin-bottom: 20px;
}

.eyebrow {
    margin-bottom: 8px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-title {
    margin: 0;
    font-size: clamp(28px, 4vw, 44px);
    line-height: 1.1;
    font-weight: 950;
}

.page-desc {
    max-width: 640px;
    margin: 10px 0 0;
    color: var(--muted);
    line-height: 1.7;
}

.grid {
    display: grid;
    gap: 16px;
}

.grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.panel,
.stat-card,
.action-card,
.data-card {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    box-shadow: var(--shadow);
    backdrop-filter: blur(18px);
}

.panel {
    padding: 22px;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 16px;
}

.panel-title {
    margin: 0;
    font-size: 20px;
    font-weight: 950;
}

.stat-card {
    min-height: 118px;
    padding: 20px;
}

.stat-label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.stat-value {
    margin-top: 10px;
    color: var(--text);
    font-size: 30px;
    font-weight: 950;
}

.stat-note {
    margin-top: 8px;
    color: var(--muted);
    font-size: 12px;
}

.hero-balance {
    padding: 28px;
    border: 1px solid var(--line-strong);
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(34, 211, 238, 0.18), rgba(244, 114, 182, 0.09)),
        var(--panel);
    box-shadow: var(--shadow), inset 0 0 40px rgba(34, 211, 238, 0.05);
}

.balance-value {
    margin: 12px 0;
    font-size: clamp(42px, 8vw, 72px);
    line-height: 1;
    font-weight: 950;
    color: var(--cyan);
    text-shadow: 0 0 30px rgba(34, 211, 238, 0.28);
}

.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    word-break: break-all;
}

.muted {
    color: var(--muted);
}

.actions {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.action-card {
    min-height: 106px;
    padding: 18px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    transition: border-color 0.16s ease, transform 0.16s ease, background 0.16s ease;
}

.action-card:hover {
    transform: translateY(-2px);
    border-color: var(--line-strong);
    background: rgba(34, 211, 238, 0.08);
}

.action-kicker {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 950;
}

.action-title {
    margin-top: 14px;
    font-size: 18px;
    font-weight: 950;
}

.form-grid {
    display: grid;
    gap: 16px;
}

.field label {
    display: block;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 850;
}

.input,
.select,
.textarea {
    width: 100%;
    min-height: 46px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    outline: none;
    background: rgba(2, 6, 23, 0.48);
    color: var(--text);
}

[data-theme="light"] .input,
[data-theme="light"] .select,
[data-theme="light"] .textarea {
    background: rgba(255, 255, 255, 0.72);
}

.textarea {
    min-height: 120px;
    padding: 12px 14px;
    resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid var(--line-strong);
    border-radius: 10px;
    padding: 0 18px;
    color: #06121c;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    cursor: pointer;
    font-weight: 950;
    text-decoration: none;
}

.btn.secondary {
    color: var(--text);
    background: rgba(34, 211, 238, 0.08);
}

.btn.danger {
    color: white;
    background: linear-gradient(135deg, var(--red), var(--pink));
}

.tabs {
    display: inline-flex;
    padding: 4px;
    gap: 4px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.34);
}

.tab {
    height: 38px;
    min-width: 100px;
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-weight: 850;
}

.tab.active {
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.12);
}

.list {
    display: grid;
    gap: 12px;
}

.list-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
}

.list-row {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    align-items: center;
}

.amount-pos { color: var(--green); }
.amount-neg { color: var(--red); }
.cyan { color: var(--cyan); }
.pink { color: var(--pink); }
.green { color: var(--green); }
.amber { color: var(--amber); }

.toast {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: min(420px, calc(100% - 40px));
    display: none;
    z-index: 60;
    padding: 14px 16px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    background: var(--panel-strong);
    color: var(--text);
    box-shadow: var(--shadow);
}

.toast.show {
    display: block;
}

.bottom-nav {
    display: none;
}

.loading {
    color: var(--muted);
}

.empty {
    padding: 28px;
    color: var(--muted);
    text-align: center;
}

@media (max-width: 900px) {
    .auth-card {
        grid-template-columns: 1fr;
    }

    .auth-hero,
    .auth-panel {
        padding: 32px;
    }

    .feature-strip,
    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4,
    .actions {
        grid-template-columns: 1fr;
    }

    .top-nav {
        display: none;
    }

    .main {
        width: calc(100% - 28px);
        margin-top: 18px;
        margin-bottom: 92px;
    }

    .page-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .bottom-nav {
        height: 68px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        border-top: 1px solid var(--line);
        background: rgba(7, 10, 18, 0.86);
        backdrop-filter: blur(18px);
    }

    [data-theme="light"] .bottom-nav {
        background: rgba(248, 251, 255, 0.9);
    }

    .bottom-nav a {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--muted);
        text-decoration: none;
        font-size: 13px;
        font-weight: 850;
    }

    .bottom-nav a.active {
        color: var(--cyan);
    }
}

/* Final overrides for the rewritten cyber UI. Keep this block last. */
.auth-shell {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
    min-height: 100vh;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 430px);
    align-items: center;
    gap: 34px;
    padding: 28px 0;
    place-items: initial;
}

.auth-brand {
    min-width: 0;
    padding: 44px 0;
}

.brand-orbit {
    width: 54px;
    height: 54px;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-strong);
    border-radius: 16px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.1);
    box-shadow: 0 0 34px rgba(34, 211, 238, 0.22);
}

.auth-brand h1 {
    margin: 24px 0 14px;
    font-size: clamp(36px, 6vw, 66px);
    line-height: 1;
    font-weight: 950;
    color: var(--text);
    text-shadow: 0 0 28px rgba(34, 211, 238, 0.26);
}

.auth-brand p {
    max-width: 580px;
    margin: 0;
    color: var(--muted);
    font-size: 17px;
    line-height: 1.8;
}

.feature-grid {
    margin-top: 30px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.feature-grid > div {
    min-height: 86px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(15, 23, 42, 0.42);
}

.feature-grid strong,
.feature-grid span {
    display: block;
}

.feature-grid strong {
    margin-bottom: 7px;
    color: var(--text);
    font-size: 14px;
}

.feature-grid span {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.45;
}

.auth-shell > .auth-card {
    width: 100%;
    min-height: 0;
    display: block;
    grid-template-columns: none;
    padding: 34px;
    border: 1px solid var(--line-strong);
    border-radius: 20px;
    background: rgba(3, 7, 18, 0.54);
    box-shadow: var(--shadow), inset 0 0 50px rgba(34, 211, 238, 0.04);
    backdrop-filter: blur(20px);
}

.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 5px;
    margin-bottom: 28px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.34);
}

.auth-tabs button {
    height: 42px;
    border: 0;
    border-radius: 9px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font-weight: 900;
}

.auth-tabs button.active {
    color: #06121c;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.form-grid label {
    display: grid;
    gap: 8px;
    color: var(--text);
    font-weight: 850;
}

.password-wrap {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 64px;
    gap: 8px;
    align-items: center;
}

.ghost-icon {
    min-height: 46px;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--cyan);
    background: rgba(34, 211, 238, 0.08);
    cursor: pointer;
    font-weight: 900;
}

.text-link {
    display: inline-flex;
    margin-top: 16px;
    color: var(--cyan);
    text-decoration: none;
    font-weight: 800;
}

.brand,
.nav-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    color: var(--text);
    text-decoration: none;
    font-weight: 950;
    white-space: nowrap;
}

.nav-center,
.nav-menu {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
}

.icon-chip,
.avatar {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    color: #06121c;
    background: linear-gradient(135deg, var(--cyan), var(--blue));
    text-decoration: none;
    font-weight: 950;
}

.mobile-nav {
    display: none;
}

.page-wrap {
    width: min(1180px, calc(100% - 40px));
    margin: 0 auto;
    padding: 30px 0 96px;
}

.page-hero {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 24px;
    margin-bottom: 24px;
}

.page-hero h1 {
    margin: 8px 0;
    font-size: clamp(30px, 4vw, 48px);
    line-height: 1.05;
}

.page-hero p {
    margin: 0;
    color: var(--muted);
}

.eyebrow {
    color: var(--cyan);
    font-size: 12px;
    font-weight: 950;
    letter-spacing: 0;
}

.hero-address,
.code-box,
.secret-box,
.notice {
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.38);
    color: var(--muted);
    word-break: break-all;
}

.wallet-grid,
.grid {
    display: grid;
    gap: 18px;
}

.wallet-grid {
    grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
}

.grid.cols-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid.cols-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid.cols-4 {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.balance-panel strong,
#balance-main {
    display: block;
    margin: 12px 0;
    color: var(--cyan);
    font-size: clamp(42px, 7vw, 76px);
    line-height: 1;
    font-weight: 950;
}

.balance-panel span {
    display: block;
    color: var(--muted);
    word-break: break-all;
}

.stats-grid {
    display: grid;
    gap: 14px;
}

.stat-card {
    min-height: 112px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
}

.stat-card span,
.stat-card small {
    display: block;
    color: var(--muted);
}

.stat-card strong {
    display: block;
    margin: 10px 0 8px;
    color: var(--text);
    font-size: 28px;
    line-height: 1;
}

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

.quick-grid.large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-card,
.panel,
.block-card {
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    box-shadow: 0 18px 46px rgba(0, 0, 0, 0.16);
}

.action-card {
    display: block;
    min-height: 118px;
    padding: 20px;
    color: var(--text);
    text-decoration: none;
}

.action-card strong,
.action-card span {
    display: block;
}

.action-card span {
    margin-top: 10px;
    color: var(--muted);
}

.panel {
    padding: 22px;
}

.panel-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
}

.panel-title {
    margin: 0;
    color: var(--text);
    font-size: 20px;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.list {
    display: grid;
    gap: 12px;
}

.list-item,
.block-card {
    padding: 16px;
}

.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.26);
}

.list-item strong,
.list-item span {
    display: block;
}

.list-item span {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
    word-break: break-all;
}

.block-top,
.block-meta {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
}

.block-card code {
    display: block;
    margin: 14px 0;
    color: var(--cyan);
    word-break: break-all;
}

.block-meta span {
    color: var(--muted);
    font-size: 13px;
}

.toast-stack {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 100;
    display: grid;
    gap: 10px;
}

.toast {
    max-width: 360px;
    padding: 12px 14px;
    border: 1px solid var(--line-strong);
    border-radius: 12px;
    color: var(--text);
    background: var(--panel-strong);
    box-shadow: var(--shadow);
}

.toast.ok {
    border-color: rgba(52, 211, 153, 0.55);
}

.toast.error {
    border-color: rgba(251, 113, 133, 0.7);
}

.hidden {
    display: none !important;
}

@media (max-width: 900px) {
    .auth-shell {
        width: min(100% - 28px, 620px);
        grid-template-columns: 1fr;
        gap: 18px;
        align-items: start;
        padding: 28px 0 40px;
    }

    .auth-brand {
        padding: 8px 0;
    }

    .feature-grid {
        grid-template-columns: 1fr;
    }

    .auth-shell > .auth-card {
        padding: 24px;
    }

    .top-nav {
        height: 62px;
        display: grid;
        grid-template-columns: 1fr auto;
        padding: 0 16px;
    }

    .nav-center {
        display: none;
    }

    .nav-user span {
        display: none;
    }

    .mobile-nav {
        height: 68px;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 30;
        border-top: 1px solid var(--line);
        background: rgba(7, 10, 18, 0.86);
        backdrop-filter: blur(18px);
    }

    .mobile-nav a {
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--muted);
        text-decoration: none;
        font-size: 13px;
        font-weight: 850;
    }

    .mobile-nav a.active {
        color: var(--cyan);
    }

    .page-wrap {
        width: min(100% - 28px, 680px);
        padding-top: 22px;
    }

    .page-hero,
    .wallet-grid,
    .grid.cols-2,
    .grid.cols-3,
    .grid.cols-4,
    .quick-grid,
    .quick-grid.large {
        grid-template-columns: 1fr;
    }

    .page-hero {
        display: grid;
    }

    .password-wrap {
        grid-template-columns: 1fr;
    }
}

/* UI audit fixes: final effective layout rules */
:root {
    --space-page-x: 40px;
    --space-section: 18px;
    --control-sm: 36px;
    --control-md: 44px;
    --control-lg: 48px;
}

.top-nav {
    height: 68px;
    grid-template-columns: minmax(150px, 220px) minmax(360px, 1fr) minmax(52px, 230px);
    gap: 16px;
}

.nav-center {
    display: flex;
    gap: 8px;
}

.nav-link {
    width: 112px;
    min-width: 112px;
    height: 38px;
    padding: 0 12px;
    box-sizing: border-box;
    flex: 0 0 112px;
}

.page-wrap {
    width: min(1180px, calc(100% - var(--space-page-x)));
    padding: 26px 0 96px;
}

.page-hero {
    margin-bottom: 20px;
}

.wallet-grid,
.grid {
    gap: var(--space-section);
}

.panel,
.stat-card,
.action-card,
.block-card {
    border-radius: 10px;
}

.panel {
    padding: 18px;
}

.panel-head {
    gap: 12px;
    margin-bottom: 14px;
}

.panel-title {
    font-size: 18px;
    line-height: 1.25;
}

.stat-card {
    min-height: 96px;
    padding: 16px;
}

.stat-card strong {
    margin: 8px 0 6px;
    font-size: 26px;
}

.action-card {
    min-height: 96px;
    padding: 16px;
}

.btn {
    height: var(--control-md);
    min-height: var(--control-md);
    padding: 0 16px;
    box-sizing: border-box;
    border-radius: 9px;
    line-height: 1;
    white-space: nowrap;
}

.btn.small {
    height: var(--control-sm);
    min-height: var(--control-sm);
    padding: 0 12px;
    font-size: 13px;
}

.btn.full {
    width: 100%;
    height: var(--control-lg);
    min-height: var(--control-lg);
}

.btn.ghost,
.btn.secondary {
    color: var(--text);
    background: rgba(34, 211, 238, 0.08);
}

.toolbar,
.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.search-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 10px;
    align-items: center;
}

.block-list {
    gap: 8px;
}

.block-card {
    padding: 12px 14px;
}

.block-card code {
    margin: 8px 0;
    font-size: 12px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.block-meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}

.list {
    gap: 10px;
}

.list-item {
    padding: 12px 14px;
}

.node-type-card .rule-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 18px;
    margin-bottom: 0;
}

.node-type-card .rule-list li {
    margin: 0;
}

#ref-levels .stat-card,
#recharge-stats .stat-card {
    min-height: 84px;
}

@media (min-width: 721px) and (max-width: 980px) {
    .top-nav {
        height: 68px;
        grid-template-columns: minmax(140px, 180px) minmax(360px, 1fr) 52px;
        padding: 0 18px;
    }

    .nav-center {
        display: flex;
    }

    .nav-user span {
        display: none;
    }

    .mobile-nav {
        display: none;
    }

    .page-wrap {
        width: min(100% - 32px, 920px);
        padding-top: 24px;
    }

    .grid.cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .grid.cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .grid.cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .quick-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 720px) {
    :root {
        --space-page-x: 28px;
        --space-section: 14px;
    }

    .top-nav {
        height: 60px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 0 14px;
    }

    .nav-center {
        display: none;
    }

    .nav-user span {
        display: none;
    }

    .mobile-nav {
        height: 64px;
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        left: 0;
        right: 0;
        overflow: hidden;
    }

    .mobile-nav .nav-link,
    .mobile-nav a {
        width: auto;
        min-width: 0;
        height: 100%;
        min-height: 0;
        padding: 0;
        flex: 1 1 auto;
        border-radius: 0;
        border-color: transparent;
        background: transparent;
        font-size: 12px;
    }

    .mobile-nav .nav-link.active {
        border-color: var(--line-strong);
        background: rgba(34, 211, 238, 0.1);
    }

    .page-wrap {
        width: min(100% - var(--space-page-x), 680px);
        padding-top: 20px;
        padding-bottom: 88px;
    }

    .page-hero {
        display: grid;
        gap: 12px;
        margin-bottom: 16px;
    }

    .page-hero h1 {
        font-size: 30px;
    }

    .hero-address,
    .notice {
        padding: 12px 14px;
    }

    .wallet-grid,
    .grid.cols-2,
    .grid.cols-3 {
        grid-template-columns: 1fr;
    }

    .grid.cols-4,
    .quick-grid,
    .quick-grid.large {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .panel {
        padding: 16px;
    }

    .stat-card {
        min-height: 88px;
        padding: 14px;
    }

    .stat-card strong {
        font-size: 24px;
    }

    .action-card {
        min-height: 86px;
        padding: 14px;
    }

    .balance-panel strong,
    #balance-main {
        font-size: 42px;
    }

    .search-row {
        grid-template-columns: 1fr 1fr;
    }

    .search-row .input {
        grid-column: 1 / -1;
    }

    .search-row .btn {
        width: 100%;
    }

    .panel-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel-head .button-row,
    .panel-head .toolbar {
        width: 100%;
    }

    .block-meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .node-type-card .rule-list {
        grid-template-columns: 1fr;
    }
}

.list > *,
.block-card,
.block-top,
.block-meta,
.block-card code {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.block-card {
    width: 100%;
}

.page-wrap > section + section {
    margin-top: 26px;
}

.wallet-grid,
.grid,
.list,
.block-list {
    gap: 22px;
}

.panel,
.stat-card,
.action-card,
.block-card {
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.2);
}

/* Final polish pass: stable navigation, spacing, and overflow guards */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.top-nav {
    min-height: 68px;
    align-items: center;
}

.nav-center {
    justify-content: center;
    align-items: center;
}

.nav-link {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 116px;
    min-width: 116px;
    max-width: 116px;
    height: 40px;
    min-height: 40px;
    line-height: 1;
}

.nav-link.active {
    transform: none;
}

.nav-user {
    min-width: 0;
    justify-content: flex-end;
}

.nav-user span {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.btn {
    height: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn.small {
    height: 36px;
    min-height: 36px;
}

.btn.primary,
.btn.full {
    height: 48px;
    min-height: 48px;
}

.panel,
.stat-card,
.action-card,
.list-item,
.block-card,
.ledger-item,
.block-tx-item {
    min-width: 0;
}

.hero-address,
.secret-box,
.ledger-grid code,
.block-tx-grid code,
.block-card code,
.mono,
code {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ledger-summary,
.ledger-head,
.block-tx-head,
.list-item {
    gap: 14px;
}

.ledger-actions,
.button-row,
.toolbar {
    gap: 10px;
}

.grid,
.wallet-grid,
.list,
.block-list,
.ledger-list {
    gap: 20px;
}

.form-grid {
    gap: 14px;
}

@media (min-width: 769px) and (max-width: 980px) {
    .top-nav {
        grid-template-columns: minmax(150px, 190px) minmax(360px, 1fr) minmax(52px, 90px);
    }

    .nav-link {
        width: 104px;
        min-width: 104px;
        max-width: 104px;
    }
}

@media (max-width: 768px) {
    .top-nav {
        min-height: 60px;
    }

    .mobile-nav {
        display: grid;
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
        max-width: 100%;
    }

    .mobile-nav .nav-link,
    .mobile-nav a {
        width: auto;
        min-width: 0;
        max-width: none;
        height: 100%;
        min-height: 0;
        padding: 0 4px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .grid,
    .wallet-grid,
    .list,
    .block-list,
    .ledger-list {
        gap: 14px;
    }

    .panel,
    .stat-card,
    .action-card,
    .list-item,
    .block-card {
        padding: 14px;
    }

    .ledger-summary,
    .ledger-head,
    .block-tx-head,
    .block-tx-grid,
    .ledger-grid,
    .ledger-summary-main,
    .ledger-summary-foot {
        grid-template-columns: 1fr;
        min-width: 0;
    }
}

.kv-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.kv-grid > div {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(2, 6, 23, 0.28);
}

.kv-grid span,
.kv-grid strong,
.kv-grid code {
    display: block;
}

.kv-grid span {
    color: var(--muted);
    font-size: 12px;
}

.kv-grid strong,
.kv-grid code {
    margin-top: 8px;
    color: var(--text);
    word-break: break-all;
}

.tx-item.income {
    border-color: rgba(52, 211, 153, 0.45);
}

.tx-item.expense {
    border-color: rgba(251, 191, 36, 0.35);
}

.ledger-list,
.ledger-item {
    min-width: 0;
}

.ledger-item {
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.28);
}

.ledger-summary {
    min-width: 0;
    padding: 15px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.28);
    cursor: pointer;
    transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.ledger-summary:hover,
.ledger-summary:focus-visible {
    border-color: var(--line-strong);
    background: rgba(34, 211, 238, 0.08);
    outline: none;
    transform: translateY(-1px);
}

.ledger-summary-main {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
}

.ledger-summary-main strong,
.ledger-summary-main span,
.ledger-summary-foot span {
    display: block;
}

.ledger-summary-main span,
.ledger-summary-foot {
    color: var(--muted);
    font-size: 13px;
}

.ledger-summary-main > div {
    min-width: 0;
}

.ledger-summary-main > div:first-child strong,
.ledger-summary-main > div:first-child span,
.ledger-summary-foot span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ledger-summary-foot {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    margin-top: 10px;
}

.ledger-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    margin-bottom: 14px;
}

.ledger-head strong,
.ledger-head span,
.ledger-amount strong,
.ledger-amount span {
    display: block;
}

.ledger-head span,
.ledger-amount span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.ledger-amount {
    text-align: right;
}

.ledger-amount.positive strong {
    color: var(--green);
}

.ledger-amount.negative strong {
    color: var(--amber);
}

.ledger-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.ledger-grid > div {
    min-width: 0;
    padding: 10px 12px;
    border: 1px solid rgba(34, 211, 238, 0.16);
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.45);
}

.ledger-grid span,
.ledger-grid strong,
.ledger-grid code {
    display: block;
}

.ledger-grid span {
    color: var(--muted);
    font-size: 12px;
}

.ledger-grid strong,
.ledger-grid code {
    margin-top: 6px;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.ledger-grid code {
    color: var(--cyan);
}

.ledger-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.transaction-code-table code {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.secret-box {
    white-space: pre-wrap;
}

.status-pill.danger {
    border-color: rgba(251, 113, 133, 0.55);
    color: var(--red);
}

.block-tx-item {
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(2, 6, 23, 0.26);
}

.block-tx-item.selected {
    border-color: var(--cyan);
    background: rgba(34, 211, 238, 0.1);
}

.block-tx-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    align-items: start;
    margin-bottom: 12px;
}

.block-tx-head strong,
.block-tx-head span {
    display: block;
    min-width: 0;
}

.block-tx-head > div > strong {
    overflow: hidden;
    color: var(--text);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.block-tx-head span {
    margin-top: 5px;
    color: var(--muted);
    font-size: 13px;
}

.block-tx-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.2fr) repeat(4, auto);
    gap: 10px;
    align-items: end;
}

.block-tx-grid > div {
    min-width: 0;
}

.block-tx-grid span,
.block-tx-grid code {
    display: block;
}

.block-tx-grid span {
    color: var(--muted);
    font-size: 12px;
}

.block-tx-grid code {
    margin-top: 6px;
    color: var(--cyan);
    overflow-wrap: anywhere;
    word-break: break-word;
}

@media (max-width: 720px) {
    .mobile-only {
        display: inline-flex !important;
        justify-content: center;
    }

    .page-wrap > section + section {
        margin-top: 20px;
    }

    .wallet-grid,
    .grid,
    .list,
    .block-list {
        gap: 18px;
    }

    .kv-grid {
        grid-template-columns: 1fr;
    }

    .block-tx-head,
    .block-tx-grid,
    .ledger-head,
    .ledger-grid,
    .ledger-summary-main,
    .ledger-summary-foot {
        grid-template-columns: 1fr;
    }

    .block-tx-grid .btn,
    .ledger-actions .btn {
        width: 100%;
    }

    .ledger-amount {
        text-align: left;
    }
}
