:root {
    color-scheme: light;
    --ink: #16201c;
    --muted: #5c6863;
    --line: #dbe4df;
    --surface: #ffffff;
    --soft: #eef5f1;
    --accent: #087f5b;
    --accent-dark: #07543e;
    --amber: #b86b00;
    --blue: #1f6feb;
    --shadow: 0 18px 60px rgba(22, 32, 28, 0.12);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    background: #f7faf8;
}

.tree-site {
    background: linear-gradient(180deg, #f5fbf8 0%, #eef7f2 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px clamp(18px, 5vw, 72px);
    background: rgba(247, 250, 248, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 11px;
    color: var(--ink);
    font-weight: 800;
    letter-spacing: 0.01em;
    text-decoration: none;
    transition: opacity 0.18s ease;
}

.brand:hover {
    opacity: 0.86;
}

.brand-mark {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: contain;
    filter: drop-shadow(0 4px 10px rgba(166, 102, 14, 0.28));
}

.brand-wordmark {
    display: inline-block;
    font-size: 17px;
    line-height: 1;
    background: linear-gradient(180deg, #1f2a26 0%, #5a3608 110%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.nav,
.side-nav {
    display: flex;
    gap: 10px;
    align-items: center;
}

.nav a,
.side-nav a {
    padding: 9px 10px;
    color: var(--muted);
    font-size: 14px;
}

.wallet-nav-action {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    border: 1px solid rgba(8, 127, 91, 0.22);
    border-radius: 999px;
    padding: 9px 14px !important;
    color: var(--accent-dark) !important;
    background: linear-gradient(180deg, #ffffff 0%, #edf9f4 100%);
    box-shadow: 0 6px 18px rgba(8, 127, 91, 0.12);
    font-weight: 800;
}

.wallet-nav-action svg {
    display: block;
    flex-shrink: 0;
}

.nav-action {
    color: var(--ink) !important;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 520px);
    gap: clamp(24px, 5vw, 72px);
    align-items: center;
    min-height: calc(100vh - 72px);
    padding: clamp(36px, 7vw, 92px) clamp(18px, 5vw, 72px);
}

.tree-hero {
    display: grid;
    grid-template-columns: minmax(360px, 0.78fr) minmax(520px, 1.22fr);
    gap: clamp(32px, 5vw, 82px);
    align-items: center;
    width: min(1240px, calc(100% - 48px));
    min-height: calc(100vh - 96px);
    margin: 0 auto;
    padding: clamp(30px, 4vw, 58px) 0;
}

.tree-hero .hero-copy {
    min-width: 0;
}

.tree-hero h1 {
    max-width: 620px;
    font-size: clamp(48px, 6.5vw, 92px);
}

.tree-hero .lead {
    max-width: 620px;
    font-size: clamp(18px, 1.7vw, 22px);
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: clamp(48px, 7vw, 92px);
    line-height: 0.95;
    letter-spacing: 0;
}

.lead {
    max-width: 760px;
    margin: 24px 0 0;
    color: var(--muted);
    font-size: clamp(18px, 2.1vw, 23px);
    line-height: 1.55;
}

.hero-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 28px;
}

.button,
.icon-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 750;
    cursor: pointer;
}

.button svg,
.icon-button svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.icon-label {
    box-shadow: 0 8px 22px rgba(22, 32, 28, 0.06);
    transition:
        transform 0.16s ease,
        box-shadow 0.16s ease,
        border-color 0.16s ease,
        background 0.16s ease;
}

.icon-label:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 12px 26px rgba(22, 32, 28, 0.1);
}

.button.primary {
    color: #fff;
    background: var(--accent);
    border-color: var(--accent);
}

.button.secondary,
.icon-button {
    color: var(--ink);
    background: var(--surface);
}

.terminal,
.panel,
.metric {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    box-shadow: var(--shadow);
}

.terminal {
    overflow: hidden;
}

.tree-output {
    max-width: 620px;
}

.tree-message {
    max-width: 620px;
    margin-top: 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 14px 16px;
    color: var(--accent-dark);
    background: #eefbf5;
    font-weight: 750;
}

.terminal-bar {
    display: flex;
    gap: 7px;
    padding: 14px;
    border-bottom: 1px solid var(--line);
}

.terminal-bar span {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
}

.terminal-bar span:nth-child(2) {
    background: var(--amber);
}

.terminal-bar span:nth-child(3) {
    background: var(--blue);
}

pre,
textarea {
    margin: 0;
    overflow: auto;
    font: 14px/1.7 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.terminal pre {
    padding: 22px;
}

.status-band {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1px;
    padding: 0 clamp(18px, 5vw, 72px) 56px;
}

.status-band article {
    display: grid;
    gap: 8px;
    padding: 22px;
    background: var(--soft);
}

.apple-tree-panel {
    position: relative;
    isolation: isolate;
    min-height: min(74vh, 720px);
    overflow: hidden;
    border: 1px solid rgba(15, 76, 58, 0.16);
    border-radius: 22px;
    background:
        radial-gradient(120% 60% at 80% -10%, rgba(255, 248, 214, 0.6), transparent 60%),
        radial-gradient(80% 50% at 50% 110%, rgba(7, 84, 62, 0.14), transparent 70%),
        linear-gradient(#e8f3ff 0 53%, #c7e6c8 53.4% 56%, #dff0e3 56% 100%);
    box-shadow:
        0 32px 80px -32px rgba(7, 60, 44, 0.34),
        0 4px 14px -8px rgba(7, 60, 44, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.92);
}

.apple-tree-panel::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 9;
    pointer-events: none;
    border-radius: inherit;
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.45),
        inset 0 -90px 110px -80px rgba(7, 84, 62, 0.22),
        inset 0 70px 90px -80px rgba(255, 255, 255, 0.6);
}

.tree-status {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 0;
    padding: 5px 6px;
    border: 1px solid rgba(15, 76, 58, 0.16);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow:
        0 10px 26px -12px rgba(7, 60, 44, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tree-status span,
.tree-status strong {
    position: relative;
    border: none;
    border-radius: 999px;
    padding: 4px 12px;
    background: transparent;
    font-size: 11.5px;
    line-height: 1;
}

.tree-status span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: var(--muted);
    font-weight: 750;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.tree-status span::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #94a3b8;
    box-shadow: 0 0 0 3px rgba(148, 163, 184, 0.18);
    transition: background 0.25s ease, box-shadow 0.25s ease;
}

.apple-tree-panel:has(.apple-tree.is-watered) .tree-status span {
    color: var(--accent-dark);
}

.apple-tree-panel:has(.apple-tree.is-watered) .tree-status span::before {
    background: linear-gradient(180deg, #34d399 0%, #0aa67f 100%);
    box-shadow:
        0 0 0 3px rgba(10, 166, 127, 0.22),
        0 0 10px rgba(10, 166, 127, 0.45);
}

.tree-status strong {
    color: var(--ink);
    font-weight: 800;
    font-feature-settings: "tnum" 1;
    letter-spacing: 0.01em;
}

.tree-status strong::before {
    content: "";
    position: absolute;
    left: 0;
    top: 22%;
    bottom: 22%;
    width: 1px;
    background: rgba(15, 76, 58, 0.18);
}

.tree-hint {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 10;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(15, 76, 58, 0.16);
    border-radius: 999px;
    padding: 9px 16px 9px 12px;
    color: var(--ink);
    background: rgba(255, 255, 255, 0.94);
    box-shadow:
        0 12px 28px -14px rgba(7, 60, 44, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    font-size: 12.5px;
    font-weight: 750;
    letter-spacing: 0.01em;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.tree-hint::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(180deg, #ff6b5f 0%, #b91c1c 100%);
    box-shadow: 0 0 0 3px rgba(217, 45, 32, 0.18);
}

.apple-tree {
    position: absolute;
    inset: 0;
}

.scene-controls {
    position: absolute;
    right: 18px;
    bottom: 78px;
    z-index: 10;
    display: grid;
    gap: 8px;
    justify-items: end;
}

.water-scene-button {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    border: 1px solid rgba(5, 104, 77, 0.34);
    border-radius: 999px;
    padding: 11px 20px 11px 16px;
    color: #ffffff;
    background: linear-gradient(180deg, #0aa67f 0%, #07795f 100%);
    box-shadow:
        0 16px 32px -12px rgba(7, 84, 62, 0.42),
        0 3px 6px -2px rgba(7, 84, 62, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.32),
        inset 0 -1px 0 rgba(7, 60, 44, 0.32);
    cursor: pointer;
    font-weight: 800;
    letter-spacing: 0.04em;
    transition:
        transform 0.18s ease,
        box-shadow 0.18s ease,
        background 0.18s ease;
}

.water-scene-button::before {
    content: "";
    width: 12px;
    height: 14px;
    background:
        url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 14'><path d='M6 0c2.5 3 5 6 5 8.5a5 5 0 0 1-10 0C1 6 3.5 3 6 0z' fill='white'/><circle cx='4.2' cy='8.6' r='1.4' fill='rgba(255,255,255,0.6)'/></svg>")
            no-repeat center / contain;
    filter: drop-shadow(0 1px 1px rgba(7, 60, 44, 0.3));
}

.water-scene-button:hover:not(:disabled) {
    transform: translateY(-1px);
    background: linear-gradient(180deg, #14b58c 0%, #08886a 100%);
    box-shadow:
        0 22px 44px -16px rgba(7, 84, 62, 0.5),
        0 5px 10px -3px rgba(7, 84, 62, 0.28),
        inset 0 1px 0 rgba(255, 255, 255, 0.34),
        inset 0 -1px 0 rgba(7, 60, 44, 0.32);
}

.water-scene-button:active:not(:disabled) {
    transform: translateY(0);
    box-shadow:
        0 10px 22px -10px rgba(7, 84, 62, 0.42),
        inset 0 2px 4px rgba(7, 60, 44, 0.32);
}

.water-scene-button:focus-visible {
    outline: 2px solid #34d399;
    outline-offset: 3px;
}

.water-scene-button:disabled {
    cursor: wait;
    opacity: 0.72;
    transform: none;
}

.hose {
    position: relative;
    width: 160px;
    height: 56px;
}

.hose-body {
    position: absolute;
    right: 18px;
    bottom: 10px;
    width: 124px;
    height: 34px;
    border: 8px solid #14735f;
    border-top-color: transparent;
    border-left-color: transparent;
    border-radius: 0 0 70px 0;
}

.hose-nozzle {
    position: absolute;
    left: 12px;
    bottom: 25px;
    width: 34px;
    height: 14px;
    border-radius: 10px 4px 4px 10px;
    background: #35564d;
    transform: rotate(-18deg);
}

.water-jet {
    position: absolute;
    left: -80px;
    bottom: 27px;
    width: 110px;
    height: 7px;
    border-radius: 999px;
    background: linear-gradient(90deg, transparent, rgba(41, 171, 226, 0.72), rgba(41, 171, 226, 0));
    opacity: 0;
    transform-origin: 100% 50%;
}

.jet-one {
    rotate: -24deg;
}

.jet-two {
    bottom: 19px;
    rotate: -16deg;
}

.jet-three {
    bottom: 12px;
    rotate: -8deg;
}

.apple-tree.is-watering .water-jet {
    animation: water-spray 760ms ease-out 2;
}

@keyframes water-spray {
    0% {
        opacity: 0;
        scale: 0.5 1;
    }

    24%,
    76% {
        opacity: 1;
        scale: 1 1;
    }

    100% {
        opacity: 0;
        scale: 1.08 1;
    }
}

.sky-glow {
    position: absolute;
    top: 11%;
    right: 14%;
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background: #fff3bf;
    box-shadow: 0 0 38px rgba(255, 214, 102, 0.54);
}

.tree-crown {
    position: absolute;
    left: 48%;
    top: 7%;
    width: min(76%, 560px);
    aspect-ratio: 1.22;
    border-radius: 44% 56% 50% 50%;
    background:
        radial-gradient(circle at 26% 34%, #58c783 0 24%, transparent 25%),
        radial-gradient(circle at 65% 28%, #74d99a 0 27%, transparent 28%),
        radial-gradient(circle at 46% 62%, #2f9e68 0 37%, transparent 38%),
        radial-gradient(circle at 74% 62%, #248957 0 24%, transparent 25%),
        #3bb273;
    transform: translateX(-50%);
    box-shadow: inset 0 -22px 52px rgba(7, 84, 62, 0.24);
    z-index: 2;
}

.tree-trunk {
    position: absolute;
    left: 49%;
    bottom: 10%;
    width: min(12%, 76px);
    height: 42%;
    border-radius: 24px 24px 8px 8px;
    background: linear-gradient(90deg, #7a4d24, #9b672f 48%, #6d431f);
    transform: translateX(-50%);
    z-index: 1;
}

.tree-ground {
    position: absolute;
    left: 8%;
    right: 8%;
    bottom: 7%;
    height: 14%;
    border-radius: 50%;
    background: rgba(7, 84, 62, 0.16);
    z-index: 0;
}

.apple {
    position: absolute;
    z-index: 5;
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 2px solid #8b1d1d;
    border-radius: 50%;
    color: #d92d20;
    background: #d92d20;
    box-shadow: 0 8px 18px rgba(139, 29, 29, 0.22);
    cursor: pointer;
    font-size: 0;
    appearance: none;
    transform: translate(-50%, -50%);
    transition: box-shadow 150ms ease;
    animation:
        apple-sway 3.2s ease-in-out var(--sway-delay, 0s) infinite,
        apple-drop var(--fall-duration, 6s) ease-in var(--fall-delay, 0s) forwards;
}

.apple::before {
    content: "";
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #ff6b5f;
}

.apple::after {
    content: "";
    position: absolute;
    top: -6px;
    left: 18px;
    width: 11px;
    height: 7px;
    border-radius: 11px 2px;
    background: #2b8a3e;
    transform: rotate(-22deg);
}

.apple:hover {
    box-shadow: 0 12px 24px rgba(139, 29, 29, 0.28);
    animation-play-state: paused;
    transform: translate(-50%, -50%) scale(1.1);
}

@keyframes apple-sway {
    0%,
    100% {
        margin-left: 0;
    }

    50% {
        margin-left: 7px;
    }
}

@keyframes apple-drop {
    0%,
    56% {
        opacity: 1;
        translate: 0 0;
    }

    78% {
        opacity: 1;
        translate: var(--drop-x, 0) var(--drop-y, min(290px, 42vh));
    }

    86% {
        opacity: 1;
        translate: var(--drop-x, 0) calc(var(--drop-y, min(290px, 42vh)) - 18px);
    }

    100% {
        opacity: 1;
        translate: var(--drop-x, 0) var(--drop-y, min(290px, 42vh));
    }
}

.apple-fallen {
    z-index: 7;
    animation-play-state: paused;
}

.tree-status-band {
    width: min(1240px, calc(100% - 48px));
    margin: 0 auto;
    padding: 0 0 48px;
}

.newton-figure {
    position: absolute;
    left: 9%;
    bottom: 6%;
    width: 286px;
    height: 310px;
    z-index: 6;
    pointer-events: none;
}

.newton-head {
    position: absolute;
    left: 116px;
    top: 73px;
    width: 62px;
    height: 58px;
    border: 2px solid #8f5d3d;
    border-radius: 44% 54% 48% 46%;
    background: #f1c6a8;
    transform: rotate(15deg);
    transform-origin: 50% 80%;
    z-index: 4;
    animation: newton-think 4.6s ease-in-out infinite;
}

.newton-head::after {
    content: "";
    position: absolute;
    right: -11px;
    top: 24px;
    width: 18px;
    height: 13px;
    border: 2px solid #8f5d3d;
    border-left: 0;
    border-radius: 0 16px 16px 0;
    background: #f1c6a8;
}

.newton-eye {
    position: absolute;
    right: 11px;
    top: 24px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #16201c;
    z-index: 2;
}

.newton-nose {
    position: absolute;
    right: -7px;
    top: 31px;
    width: 12px;
    height: 7px;
    border-bottom: 2px solid #7a4d24;
    border-radius: 50%;
    transform: rotate(20deg);
    z-index: 3;
}

.newton-hair {
    position: absolute;
    top: 59px;
    width: 56px;
    height: 88px;
    border-radius: 48% 48% 52% 52%;
    background: #f7f2df;
    box-shadow: inset 0 -12px 18px rgba(122, 77, 36, 0.12);
    z-index: 3;
}

.hair-left {
    left: 82px;
    transform: rotate(21deg);
}

.hair-right {
    left: 136px;
    transform: rotate(-2deg);
}

.newton-neck {
    position: absolute;
    left: 132px;
    top: 128px;
    width: 24px;
    height: 22px;
    background: #e5b895;
    z-index: 2;
}

.newton-body {
    position: absolute;
    left: 78px;
    top: 143px;
    width: 125px;
    height: 94px;
    border: 2px solid #21352d;
    border-radius: 34px 34px 18px 18px;
    background: linear-gradient(110deg, #17352d, #2f5b4f);
    transform: rotate(8deg);
    z-index: 2;
}

.newton-body::before {
    content: "";
    position: absolute;
    left: 41px;
    top: 0;
    width: 26px;
    height: 76px;
    background: #f7f2df;
    clip-path: polygon(0 0, 100% 0, 76% 100%, 24% 100%);
}

.newton-arm {
    position: absolute;
    width: 22px;
    height: 64px;
    border: 2px solid #17352d;
    border-radius: 999px;
    background: linear-gradient(180deg, #24483f, #17352d);
    transform-origin: 50% 12%;
    z-index: 4;
}

.arm-left {
    left: 84px;
    top: 173px;
    transform: rotate(32deg);
}

.arm-right {
    left: 167px;
    top: 174px;
    transform: rotate(-32deg);
    animation: writing-arm 1.2s ease-in-out infinite;
}

.newton-hand {
    position: absolute;
    width: 22px;
    height: 18px;
    border: 2px solid #8f5d3d;
    border-radius: 50%;
    background: #f1c6a8;
}

.hand-left {
    left: 118px;
    top: 229px;
    z-index: 8;
}

.hand-right {
    left: 202px;
    top: 222px;
    z-index: 10;
    animation: writing-hand 1.2s ease-in-out infinite;
}

.newton-paper {
    position: absolute;
    left: 124px;
    top: 222px;
    width: 128px;
    height: 78px;
    border: 2px solid #d8cfb8;
    border-radius: 4px;
    background:
        linear-gradient(transparent 16px, rgba(92, 104, 99, 0.18) 17px, transparent 18px),
        linear-gradient(transparent 32px, rgba(92, 104, 99, 0.18) 33px, transparent 34px),
        #fffdf2;
    transform: rotate(-8deg);
    z-index: 7;
}

.newton-pen {
    position: absolute;
    left: 202px;
    top: 220px;
    width: 5px;
    height: 72px;
    border-radius: 999px;
    background: #3a2a1d;
    transform: rotate(55deg);
    z-index: 11;
    animation: writing-pen 1.2s ease-in-out infinite;
}

.newton-leg {
    position: absolute;
    top: 232px;
    width: 76px;
    height: 34px;
    border-radius: 12px;
    background: #17251f;
    z-index: 1;
}

.leg-left {
    left: 48px;
    transform: rotate(-15deg);
}

.leg-right {
    left: 128px;
    transform: rotate(11deg);
}

.thought-bubble {
    position: absolute;
    left: 162px;
    top: 14px;
    display: grid;
    width: 74px;
    height: 52px;
    place-items: center;
    border: 2px solid #dbe4df;
    border-radius: 50%;
    color: var(--accent-dark);
    background: rgba(255, 255, 255, 0.94);
    font-size: 26px;
    z-index: 7;
}

@keyframes writing-pen {
    0%,
    100% {
        translate: 0 0;
        rotate: 0deg;
    }

    50% {
        translate: -7px 5px;
        rotate: -7deg;
    }
}

@keyframes writing-hand {
    0%,
    100% {
        translate: 0 0;
    }

    50% {
        translate: -6px 4px;
    }
}

@keyframes writing-arm {
    0%,
    100% {
        rotate: 0deg;
    }

    50% {
        rotate: 4deg;
    }
}

@keyframes newton-think {
    0%,
    100% {
        rotate: 0deg;
    }

    50% {
        rotate: 1deg;
    }
}

.thought-bubble span {
    position: absolute;
    width: 10px;
    height: 10px;
    border: 2px solid #dbe4df;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.94);
}

.thought-bubble span:first-child {
    left: -14px;
    bottom: -6px;
}

.thought-bubble span:nth-child(2) {
    left: -28px;
    bottom: -17px;
    width: 6px;
    height: 6px;
}

.claim-dialog {
    width: min(440px, calc(100vw - 28px));
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0;
}

.claim-dialog::backdrop {
    background: rgba(22, 32, 28, 0.36);
}

.claim-form {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.claim-form h2 {
    margin: 0;
}

.claim-form label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.status-band strong {
    font-size: 18px;
}

.status-band span {
    color: var(--muted);
    line-height: 1.45;
}

.admin-shell {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    background: #f7faf8;
}

.wallet-shell {
    background: #f7faf8;
    overflow-x: clip;
}

.wallet-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 14px;
    padding: 18px clamp(18px, 5vw, 72px);
    border-bottom: 1px solid var(--line);
    background: rgba(247, 250, 248, 0.94);
    backdrop-filter: blur(12px);
}

.wallet-main {
    display: grid;
    gap: 18px;
    width: 100%;
    min-width: 0;
    padding: clamp(18px, 4vw, 42px) clamp(18px, 5vw, 72px);
}

.wallet-hero,
.wallet-balance {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 18px;
    align-items: end;
}

.wallet-hero h1 {
    font-size: clamp(34px, 5vw, 56px);
}

.wallet-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    min-width: 0;
}

.wallet-actions select {
    flex: 1 1 210px;
    min-height: 42px;
    min-width: 210px;
    max-width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    color: var(--ink);
    background: var(--surface);
    font: inherit;
    font-weight: 750;
}

.wallet-empty {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 18px;
    align-items: center;
    margin-top: 0;
    padding: clamp(18px, 4vw, 28px);
    background:
        linear-gradient(135deg, rgba(238, 251, 245, 0.95) 0%, #ffffff 68%),
        var(--surface);
}

.wallet-empty[hidden] {
    display: none;
}

.wallet-shell.no-wallet [data-wallet-required],
.wallet-shell:not(.has-wallet) [data-wallet-required] {
    display: none !important;
}

.wallet-shell.has-wallet .wallet-empty {
    display: none !important;
}

.wallet-empty-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    border-radius: 18px;
    color: var(--accent-dark);
    background: rgba(8, 127, 91, 0.1);
    border: 1px solid rgba(8, 127, 91, 0.16);
}

.wallet-empty-icon svg {
    width: 30px;
    height: 30px;
}

.wallet-empty h2 {
    margin: 0;
    font-size: clamp(24px, 4vw, 34px);
}

.wallet-empty p:not(.eyebrow) {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.empty-create-wallet {
    min-width: 170px;
}

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

.wallet-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    gap: 16px;
    align-items: start;
    min-width: 0;
}

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

.send-form {
    display: grid;
    gap: 12px;
}

.send-form label {
    display: grid;
    gap: 6px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 22px;
    border-right: 1px solid var(--line);
    background: var(--surface);
}

.side-nav {
    align-items: stretch;
    flex-direction: column;
    margin-top: 28px;
}

.side-nav a {
    border-radius: 8px;
}

.side-nav a:hover {
    background: var(--soft);
}

.admin-main {
    min-width: 0;
    padding: clamp(18px, 4vw, 42px);
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.admin-header h1 {
    font-size: clamp(30px, 4vw, 48px);
}

.metrics {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr) 180px;
    gap: 12px;
    margin: 24px 0;
}

.metric {
    display: grid;
    gap: 8px;
    min-width: 0;
    padding: 16px;
    box-shadow: none;
}

.metric span {
    color: var(--muted);
    font-size: 13px;
    font-weight: 750;
}

.metric strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.panel {
    margin-top: 16px;
    padding: 18px;
    box-shadow: none;
}

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

.panel h2 {
    margin: 0;
    font-size: 20px;
}

.segmented {
    display: inline-flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--soft);
}

.segmented button {
    border: 0;
    border-radius: 6px;
    padding: 8px 10px;
    color: var(--muted);
    background: transparent;
    cursor: pointer;
    font: inherit;
    font-weight: 750;
}

.segmented button.active {
    color: var(--ink);
    background: var(--surface);
}

.inline-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.node-add-form {
    grid-template-columns: minmax(160px, 0.35fr) minmax(260px, 1fr) auto;
    margin-bottom: 14px;
}

.compact-actions {
    margin-top: 0;
}

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

.ops-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
}

.ops-card span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.ops-card code {
    overflow: auto;
    color: var(--ink);
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    white-space: pre-wrap;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 12px;
    color: var(--ink);
    background: #fbfdfc;
    font: inherit;
}

textarea {
    min-height: 280px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

.output {
    min-height: 120px;
    margin-top: 14px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #101815;
    color: #dff7ec;
}

.replication-watch {
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid rgba(8, 127, 91, 0.35);
    background: rgba(8, 127, 91, 0.08);
    color: var(--accent-dark);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.replication-watch[hidden] {
    display: none !important;
}

.replication-node-strip {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px 6px;
    margin: 8px 0 2px;
    min-height: 22px;
}

.quorum-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(22, 32, 28, 0.12);
    border: 1px solid rgba(22, 32, 28, 0.1);
    flex-shrink: 0;
    transition: background 0.25s ease, border-color 0.25s ease, transform 0.2s ease;
}

.quorum-dot.is-confirmed {
    background: linear-gradient(180deg, #2fcc8b, #18a878);
    border-color: rgba(8, 127, 91, 0.45);
    box-shadow: 0 0 0 2px rgba(24, 168, 120, 0.2);
    transform: scale(1.05);
}

.quorum-dot--pending {
    background: rgba(31, 111, 235, 0.25);
    border-color: rgba(31, 111, 235, 0.35);
    animation: quorum-pulse 1.1s ease-in-out infinite;
}

.quorum-dot--pending:nth-child(2n) {
    animation-delay: 0.15s;
}

.quorum-dot--pending:nth-child(3n) {
    animation-delay: 0.3s;
}

@keyframes quorum-pulse {
    0%, 100% {
        opacity: 0.45;
        transform: scale(0.92);
    }

    50% {
        opacity: 1;
        transform: scale(1);
    }
}

.quorum-strip-more {
    font-size: 11px;
    font-weight: 800;
    color: var(--muted);
    padding-left: 2px;
}

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

.node-card {
    display: grid;
    gap: 10px;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
}

.node-card div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.node-card span,
.node-card small {
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.node-card p {
    width: fit-content;
    margin: 0;
    border-radius: 999px;
    padding: 4px 8px;
    color: var(--muted);
    background: var(--soft);
    font-size: 12px;
    font-weight: 800;
}

.node-card.online p {
    color: #07543e;
    background: #dff7ec;
}

.node-card.offline p {
    color: #8b1d1d;
    background: #ffe3e3;
}

.node-card code {
    overflow: hidden;
    color: var(--ink);
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

.timeline-item {
    display: grid;
    gap: 4px;
    min-height: 72px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
}

.timeline-item span {
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.timeline-item.done {
    border-color: #b8e6d1;
    background: #eefbf5;
}

.timeline-item.active {
    border-color: #b8cff5;
    background: #eef4ff;
}

.timeline-item.error {
    border-color: #ffc9c9;
    background: #fff0f0;
}

.ledger-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.ledger-summary-item {
    display: grid;
    gap: 6px;
    min-width: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
}

.ledger-summary-item span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
}

.ledger-summary-item strong {
    overflow: hidden;
    color: var(--ink);
    font-size: 15px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ledger-grid {
    display: grid;
    grid-template-columns: 1.25fr 1fr 1fr;
    gap: 14px;
}

.ledger-grid h3 {
    margin: 0 0 8px;
    font-size: 14px;
}

.ledger-table {
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
}

.ledger-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 12px;
}

.ledger-table th,
.ledger-table td {
    max-width: 180px;
    padding: 9px 10px;
    border-bottom: 1px solid var(--line);
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ledger-table th {
    color: var(--muted);
    font-weight: 800;
}

.ledger-table tr:last-child td {
    border-bottom: 0;
}

.empty-state {
    padding: 14px;
    color: var(--muted);
    font-size: 13px;
}

.empty-state.error {
    color: #8b1d1d;
}

@media (max-width: 860px) {
    .hero,
    .tree-hero,
    .admin-shell,
    .metrics,
    .wallet-hero,
    .wallet-balance,
    .wallet-layout,
    .wallet-backup-grid,
    .node-add-form,
    .node-grid,
    .ops-grid,
    .ledger-summary,
    .ledger-grid,
    .timeline,
    .status-band {
        grid-template-columns: 1fr;
    }

    .apple-tree-panel {
        min-height: 520px;
    }

    .sidebar {
        position: static;
        height: auto;
    }

    .nav {
        display: none;
    }

    .tree-site .topbar {
        padding: 12px 14px;
    }

    .tree-site .topbar .brand {
        min-width: 0;
    }

    .tree-site .topbar .brand-wordmark {
        max-width: 40vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .tree-site .topbar .landing-nav {
        display: flex;
        margin-left: auto;
    }

    .tree-site .topbar .state-nav-link {
        display: none;
    }

    .tree-site .topbar .wallet-nav-action {
        min-height: 38px;
        padding: 8px 12px !important;
        font-size: 13px;
    }

    .tree-site .hero-wallet-action {
        display: none;
    }

    .tree-site .tree-hero {
        width: min(100% - 28px, 640px);
        gap: 18px;
        min-height: auto;
        padding: 18px 0 28px;
    }

    .tree-site .tree-hero h1 {
        font-size: clamp(34px, 11vw, 48px);
        line-height: 1;
    }

    .tree-site .tree-hero .lead {
        margin-top: 14px;
        font-size: 16px;
    }

    .tree-site .tree-message {
        margin-top: 14px;
        padding: 12px 14px;
        font-size: 16px;
    }

    .tree-site .apple-tree-panel {
        width: 100%;
        min-height: 520px;
        margin: 0 auto;
    }

    .wallet-header .wallet-header-nav {
        display: flex;
        margin-left: auto;
    }

    .wallet-header .wallet-header-nav a {
        min-height: 38px;
        padding: 8px 12px;
        font-size: 13px;
        font-weight: 800;
    }

    .panel-header,
    .admin-header,
    .wallet-hero {
        align-items: flex-start;
        flex-direction: column;
    }

    .wallet-actions {
        justify-content: flex-start;
    }
}

/* ─── Wallet UI: status pill ───────────────────────────────── */

.wallet-header-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 6px 12px;
    background: var(--surface);
    box-shadow: 0 4px 18px rgba(22, 32, 28, 0.06);
    font-size: 13px;
    font-weight: 750;
}

.wallet-header-status .pill-label {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-header-status .pill-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #c7cfca;
    box-shadow: 0 0 0 0 rgba(8, 127, 91, 0.4);
}

.wallet-header-status .pill-dot.ok {
    background: #18a878;
    box-shadow: 0 0 0 4px rgba(24, 168, 120, 0.18);
    animation: pill-pulse 2.4s ease-in-out infinite;
}

.wallet-header-status .pill-dot.warn {
    background: var(--amber);
}

.wallet-header-status .pill-dot.down {
    background: #d9534f;
}

.wallet-header-status .pill-meta {
    flex-shrink: 0;
    color: var(--muted);
    font-weight: 700;
}

/* ─── Wallet UI: sticky header quorum + wallet nav badge ───── */

.wallet-header-quorum {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: min(440px, 100%);
    padding: 5px 12px 5px 12px;
    border-radius: 999px;
    border: 1px solid rgba(31, 111, 235, 0.3);
    background: linear-gradient(135deg, rgba(31, 111, 235, 0.1), rgba(8, 127, 91, 0.08));
    font-size: 12px;
    font-weight: 800;
    color: var(--ink);
}

.wallet-header-quorum[hidden] {
    display: none !important;
}

.wallet-header-quorum-label {
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 10px;
    color: #1748a8;
}

.wallet-header-quorum-dots {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-wrap: wrap;
    min-width: 0;
}

.wallet-header-quorum-fraction {
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    color: var(--accent-dark);
    font-size: 12px;
}

.nav-wallet-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.wallet-nav-badge {
    display: inline-grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    color: #fff;
    background: linear-gradient(180deg, #ef5c4d 0%, #c53030 100%);
    box-shadow: 0 2px 8px rgba(197, 48, 48, 0.4);
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.wallet-nav-badge[hidden] {
    display: none !important;
}

.wallet-nav-badge--live {
    animation: wallet-badge-pop 0.45s ease-out;
}

@keyframes wallet-badge-pop {
    0% {
        transform: scale(0.6);
        opacity: 0;
    }

    70% {
        transform: scale(1.08);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.wallet-hero-wallet-cta {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.wallet-nav-badge--hero {
    min-width: 22px;
    height: 22px;
    font-size: 12px;
}

@keyframes pill-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(24, 168, 120, 0.4);
    }

    50% {
        box-shadow: 0 0 0 6px rgba(24, 168, 120, 0);
    }
}

/* ─── Wallet UI: identity card ─────────────────────────────── */

.wallet-identity {
    margin: 0;
    padding: 18px;
}

.identity-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 0.9fr);
    gap: 18px;
    align-items: center;
}

.identity-meta {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.identity-name {
    font-size: 22px;
    font-weight: 800;
}

.identity-key {
    display: flex;
    gap: 8px;
    align-items: stretch;
    min-width: 0;
}

.key-block {
    flex: 1 1 auto;
    min-width: 0;
    overflow: hidden;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
    color: var(--ink);
    font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    overflow-wrap: anywhere;
    white-space: normal;
    word-break: break-word;
}

.copy-btn {
    flex-shrink: 0;
}

.muted-line {
    color: var(--muted);
    font-size: 13px;
}

.lead-sm {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
}

/* ─── Wallet UI: ghost button ─────────────────────────────── */

.button.ghost {
    color: var(--muted);
    background: transparent;
    border-color: transparent;
}

.button.ghost:hover {
    color: var(--ink);
    background: var(--soft);
    border-color: var(--line);
}

/* ─── Wallet UI: input + trailing icon button ──────────────── */

.input-with-action {
    display: flex;
    gap: 6px;
    align-items: stretch;
}

.receiver-wallet-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 8px;
}

.receiver-wallet-cards[hidden] {
    display: none;
}

.receiver-wallet-card {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    min-height: 58px;
    border: 1px solid rgba(8, 127, 91, 0.18);
    border-radius: 8px;
    padding: 10px;
    color: var(--ink);
    background: linear-gradient(180deg, #ffffff 0%, #f3fbf7 100%);
    cursor: pointer;
    text-align: left;
    font: inherit;
    transition:
        border-color 0.16s ease,
        box-shadow 0.16s ease,
        transform 0.16s ease;
}

.receiver-wallet-card:hover,
.receiver-wallet-card:focus-visible {
    border-color: rgba(8, 127, 91, 0.42);
    box-shadow: 0 10px 24px rgba(8, 127, 91, 0.1);
    transform: translateY(-1px);
    outline: 0;
}

.receiver-wallet-card-icon {
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--accent-dark);
    background: rgba(8, 127, 91, 0.1);
}

.receiver-wallet-card-icon svg {
    width: 20px;
    height: 20px;
}

.receiver-wallet-card-copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.receiver-wallet-card-copy strong,
.receiver-wallet-card-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.receiver-wallet-card-copy strong {
    color: var(--ink);
    font-size: 13px;
    font-weight: 850;
}

.receiver-wallet-card-copy small {
    color: var(--muted);
    font-size: 12px;
    font-weight: 750;
}

.input-with-action input {
    flex: 1 1 auto;
    min-width: 0;
}

.input-with-action .icon-button {
    flex-shrink: 0;
    min-height: 44px;
    padding: 0 12px;
}

.field-hint {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.field-hint.error {
    color: #b42318;
}

.field-hint.success {
    color: var(--accent-dark);
}

/* ─── Wallet UI: status banner ────────────────────────────── */

.status-banner {
    display: grid;
    gap: 4px;
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: var(--soft);
    font-size: 14px;
    line-height: 1.45;
}

.status-banner strong {
    font-weight: 800;
}

.status-banner span {
    color: var(--muted);
}

.status-banner.success {
    border-color: rgba(8, 127, 91, 0.32);
    background: rgba(8, 127, 91, 0.08);
    color: var(--accent-dark);
}

.status-banner.success span {
    color: rgba(7, 84, 62, 0.8);
}

.status-banner.warning {
    border-color: rgba(184, 107, 0, 0.32);
    background: rgba(184, 107, 0, 0.08);
    color: #7a4500;
}

.status-banner.error {
    border-color: rgba(180, 35, 24, 0.32);
    background: rgba(180, 35, 24, 0.08);
    color: #8b1d1d;
}

.status-banner.info {
    border-color: rgba(31, 111, 235, 0.32);
    background: rgba(31, 111, 235, 0.08);
    color: #1f3f7a;
}

.status-banner.info span {
    color: #3b5fa1;
}

/* ─── Wallet UI: replication watch ─────────────────────────── */

.replication-watch-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
}

.replication-watch-count {
    flex-shrink: 0;
    border-radius: 999px;
    padding: 2px 8px;
    background: rgba(8, 127, 91, 0.16);
    color: var(--accent-dark);
    font-size: 12px;
    font-weight: 800;
}

.replication-bar {
    width: 100%;
    height: 6px;
    margin-top: 8px;
    border-radius: 999px;
    background: rgba(8, 127, 91, 0.16);
    overflow: hidden;
}

.replication-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width 280ms ease-out;
}

/* ─── Wallet UI: tokens table actions ─────────────────────── */

.row-actions-col {
    width: 1%;
    white-space: nowrap;
    text-align: right;
}

.token-row-actions {
    display: inline-flex;
    gap: 6px;
    justify-content: flex-end;
}

.token-row-actions .icon-button {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 800;
}

.token-id {
    color: var(--ink);
    font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
}

/* Wallet token table: scroll when many rows */
#wallet-tokens {
    max-height: min(440px, 52vh);
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

#wallet-tokens table {
    min-width: 640px;
}

#wallet-tokens thead th {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #fbfdfc;
    box-shadow: 0 1px 0 var(--line);
}

#wallet-tokens tbody tr:last-child td {
    border-bottom: 1px solid var(--line);
}

.empty-tokens {
    display: grid;
    gap: 6px;
    padding: 22px 18px;
    text-align: center;
}

.empty-tokens p {
    margin: 0;
    color: var(--ink);
    font-weight: 800;
}

.empty-tokens small {
    color: var(--muted);
    font-size: 12px;
}

/* ─── Wallet UI: response details ─────────────────────────── */

.output-details {
    margin-top: 12px;
}

.output-details summary {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border-radius: 999px;
    padding: 6px 12px;
    color: var(--muted);
    background: var(--soft);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    user-select: none;
}

.output-details[open] summary {
    margin-bottom: 8px;
    color: var(--ink);
}

.output-details summary::-webkit-details-marker {
    display: none;
}

/* ─── Wallet UI: panel header actions ─────────────────────── */

.panel-header-actions {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

/* ─── Wallet UI: activity list ────────────────────────────── */

.activity-list {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.activity-item {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfdfc;
}

.activity-item .activity-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}

.activity-item .activity-amount {
    color: var(--accent-dark);
    font: 13px/1.2 ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-weight: 800;
}

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

.activity-item .activity-meta {
    color: var(--muted);
    font-size: 12px;
}

.activity-item.success {
    border-color: rgba(8, 127, 91, 0.28);
    background: rgba(8, 127, 91, 0.04);
}

.activity-item.error {
    border-color: rgba(180, 35, 24, 0.28);
    background: rgba(180, 35, 24, 0.04);
}

.activity-item.incoming {
    border-color: rgba(31, 111, 235, 0.38);
    background: linear-gradient(118deg, rgba(31, 111, 235, 0.09), rgba(251, 253, 252, 0.98));
}

.activity-item--fresh {
    border-left: 4px solid #1f6feb;
    box-shadow: 0 10px 32px rgba(31, 111, 235, 0.14);
    animation: activity-fresh-glow 1s ease-out 1;
}

@keyframes activity-fresh-glow {
    0% {
        box-shadow: 0 0 0 0 rgba(31, 111, 235, 0.28);
    }

    100% {
        box-shadow: 0 10px 32px rgba(31, 111, 235, 0.14);
    }
}

.activity-panel {
    scroll-margin-top: 96px;
}

/* ─── Wallet UI: backup grid ──────────────────────────────── */

.backup-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
}

@media (max-width: 860px) {
    .identity-row,
    .backup-grid {
        grid-template-columns: 1fr;
    }

    .row-actions-col {
        width: auto;
        text-align: left;
    }

    .token-row-actions {
        justify-content: flex-start;
    }

    .wallet-header-status {
        order: 3;
        flex-basis: 100%;
        justify-content: center;
    }
}

@media (max-width: 640px) {
    html,
    body,
    .wallet-shell {
        max-width: 100%;
        overflow-x: hidden;
    }

    .wallet-header {
        width: 100%;
        padding: 12px 14px;
    }

    .wallet-header .brand {
        min-width: 0;
    }

    .wallet-header .brand-wordmark {
        max-width: 42vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .wallet-main {
        width: 100%;
        padding: 12px;
        overflow-x: hidden;
    }

    .wallet-hero,
    .wallet-actions,
    .wallet-identity,
    .wallet-balance,
    .wallet-layout,
    .wallet-secondary-layout,
    .panel,
    .metric {
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    .wallet-actions {
        display: grid;
        grid-template-columns: 1fr;
        justify-content: stretch;
    }

    .wallet-actions .button,
    .wallet-actions select {
        width: 100%;
        max-width: 100%;
    }

    .wallet-empty {
        grid-template-columns: 1fr;
        text-align: center;
    }

    .wallet-empty-icon {
        margin: 0 auto;
    }

    .empty-create-wallet {
        width: 100%;
    }

    .wallet-actions .button {
        flex: none;
        min-width: 0;
        padding-inline: 10px;
    }

    .wallet-actions select,
    .wallet-actions .button.primary {
        flex-basis: auto;
    }

    .wallet-balance {
        gap: 10px;
    }

    .metric {
        padding: 13px;
    }

    .metric strong {
        font-size: 16px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .panel,
    .wallet-identity {
        padding: 14px;
    }

    .identity-key,
    .input-with-action,
    .replication-watch-row {
        align-items: stretch;
        flex-direction: column;
        min-width: 0;
    }

    .identity-key .icon-button,
    .input-with-action .icon-button {
        width: 100%;
    }

    .panel-header {
        gap: 10px;
    }

    .panel-header .button,
    .panel-header-actions,
    .panel-header-actions .button,
    .send-form .button {
        width: 100%;
        max-width: 100%;
    }

    .key-block,
    .output,
    .status-banner,
    .activity-item,
    .receiver-wallet-card {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    #wallet-tokens table {
        min-width: 0;
        width: 100%;
    }

    #wallet-tokens thead {
        display: none;
    }

    #wallet-tokens table,
    #wallet-tokens tbody,
    #wallet-tokens tr,
    #wallet-tokens td {
        display: block;
    }

    #wallet-tokens tr {
        border-bottom: 1px solid var(--line);
        padding: 10px;
    }

    #wallet-tokens td {
        max-width: none;
        border-bottom: 0;
        padding: 4px 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    #wallet-tokens .row-actions-col {
        padding-top: 8px;
    }

    #wallet-tokens .token-row-actions,
    #wallet-tokens .token-row-actions .icon-button {
        width: 100%;
    }
}

/* Bilingual footer (lang switcher + notice) */

.admin-shell > .site-footer.lang-footer {
    grid-column: 1 / -1;
}

.site-footer.lang-footer {
    margin-top: auto;
    padding: clamp(20px, 3vw, 28px) clamp(18px, 4vw, 52px) clamp(24px, 3.5vw, 36px);
    background:
        linear-gradient(180deg, rgba(238, 245, 241, 0.65) 0%, rgba(255, 255, 255, 0.92) 55%, #fbfdfc 100%);
    border-top: 1px solid rgba(219, 228, 223, 0.85);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 -10px 28px rgba(22, 32, 28, 0.04);
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 0.01em;
}

.lang-footer-inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px 28px;
    max-width: 1200px;
    margin: 0 auto;
}

.lang-footer-note {
    margin: 0;
    line-height: 1.55;
    max-width: min(52ch, 100%);
    color: rgba(92, 104, 99, 0.92);
    font-size: 12.5px;
}

.lang-footer-switch {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 16px;
}

.lang-footer-label {
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
}

.lang-footer-pills {
    display: inline-flex;
    align-items: center;
    padding: 3px;
    gap: 2px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(219, 228, 223, 0.95);
    box-shadow:
        0 1px 2px rgba(22, 32, 28, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.site-footer.lang-footer .lang-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    padding: 7px 14px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 750;
    letter-spacing: 0.14em;
    text-decoration: none;
    color: var(--muted);
    transition:
        color 0.18s ease,
        background 0.18s ease,
        box-shadow 0.18s ease;
}

.site-footer.lang-footer .lang-link:hover:not(.is-active) {
    color: var(--ink);
    background: rgba(8, 127, 91, 0.07);
}

.site-footer.lang-footer .lang-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.site-footer.lang-footer .lang-link.is-active {
    color: var(--accent-dark);
    background: linear-gradient(180deg, #ffffff 0%, #f3faf7 100%);
    box-shadow:
        0 1px 3px rgba(22, 32, 28, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.95);
    pointer-events: none;
}

.tree-site .site-footer.lang-footer {
    padding-left: clamp(18px, 5vw, 52px);
    padding-right: clamp(18px, 5vw, 52px);
}

@media (max-width: 520px) {
    .lang-footer-inner {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .lang-footer-switch {
        justify-content: center;
    }

    .lang-footer-note {
        max-width: none;
    }
}

/* ─── Admin login ─────────────────────────────────────────── */

.login-shell {
    display: grid;
    place-items: center;
    min-height: 100vh;
    margin: 0;
    padding: clamp(18px, 4vw, 36px);
    background: linear-gradient(180deg, #f7faf8 0%, #eef7f2 100%);
}

.login-panel {
    width: min(440px, 100%);
    padding: clamp(22px, 4vw, 32px);
}

.login-brand {
    display: flex;
    gap: 14px;
    align-items: center;
    margin-bottom: 22px;
}

.login-brand-title {
    margin: 0;
    font-size: clamp(18px, 2.6vw, 22px);
    font-weight: 850;
}

.login-brand-sub {
    margin: 6px 0 0;
    font-size: 13px;
    line-height: 1.45;
}

.login-errors {
    margin-bottom: 16px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(180, 35, 24, 0.35);
    background: rgba(180, 35, 24, 0.06);
    color: #8b1d1d;
    font-size: 13px;
    font-weight: 650;
}

.login-errors p {
    margin: 0;
}

.login-form {
    display: grid;
    gap: 14px;
}

.login-field {
    display: grid;
    gap: 6px;
    font-weight: 700;
    font-size: 13px;
}

.login-field input {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 10px;
    padding: 10px 12px;
    font: inherit;
    background: var(--surface);
}

.login-field input:focus-visible {
    outline: 2px solid rgba(233, 169, 58, 0.65);
    outline-offset: 1px;
}

.login-remember {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    justify-self: start;
    font-size: 13px;
    color: var(--muted);
}

.login-remember input {
    width: 14px;
    height: 14px;
    margin: 0;
    padding: 0;
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.login-remember span {
    line-height: 1.3;
}

.login-submit {
    width: 100%;
}

.login-footer-note {
    margin: 22px 0 0;
    text-align: center;
    font-size: 13px;
}

.login-footer-note a {
    color: var(--accent-dark);
    font-weight: 750;
}

@media (prefers-reduced-motion: reduce) {
    .wallet-nav-badge--live,
    .quorum-dot--pending,
    .activity-item--fresh,
    .wallet-header-status .pill-dot.ok {
        animation: none !important;
    }
}
