:root {
    --bg: #030d1a;
    --bg1: #051526;
    --bg2: #071d32;
    --bg3: #0d2540;
    --card: #061220;
    --card2: #0a1c30;
    --border: rgba(0, 200, 255, .40);
    --border2: rgba(0, 200, 255, .70);
    --border3: rgba(100, 60, 255, .35);
    --cyan: #00c8ff;
    --cyan2: #5de0ff;
    --sky: #38bdf8;
    --teal: #00e5cc;
    --violet: #6d28d9;
    --violet2: #8b5cf6;
    --amber: #f59e0b;
    --amber2: #fcd34d;
    --purple: #7c3aed;
    --purple2: #a78bfa;
    --blue: #0ea5e9;
    --blue2: #38bdf8;
    --green: #00e5aa;
    --red: #f43f5e;
    --yellow: #fbbf24;
    --txt: #f5faff;
    --txt2: #b8d8f0;
    --txt3: #6a9bbf;
    --mono: 'JetBrains Mono', monospace;
    --display: 'Orbitron', sans-serif;
    --body: 'Space Grotesk', sans-serif;
    --nav: 60px;
    --r: 12px;
    --r2: 8px;
    --r3: 6px;
    --glow-cyan: 0 0 20px rgba(0, 200, 255, .55);
    --glow-violet: 0 0 16px rgba(109, 40, 217, .40);
    --glow-amber: 0 0 16px rgba(245, 158, 11, .45);
    --grad: linear-gradient(135deg, #00c8ff, #38bdf8, #00e5cc);
    --grad2: linear-gradient(135deg, #38bdf8, #00c8ff, #6d28d9);
    --rainbow: linear-gradient(90deg, #00c8ff, #38bdf8, #00e5cc, #6d28d9, #a78bfa, #f59e0b, #00c8ff);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0
}

html {
    scroll-behavior: smooth
}

body {
    background: var(--bg);
    color: var(--txt);
    font-family: var(--body);
    font-size: 14px;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

.bg-canvas {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: .35;
}

.scanlines {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: repeating-linear-gradient(to bottom, transparent 0px, transparent 2px, rgba(0, 200, 255, .028) 2px, rgba(0, 200, 255, .028) 4px);
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(0, 200, 255, .022) 1px, transparent 1px), linear-gradient(90deg, rgba(0, 200, 255, .022) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* ====== NAVBAR ====== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 0 16px;
    height: var(--nav);
    background: rgba(3, 13, 26, .97);
    border-bottom: 1px solid rgba(0, 200, 255, .25);
    backdrop-filter: blur(20px);
    box-shadow: 0 2px 30px rgba(0, 200, 255, .2), 0 0 60px rgba(0, 200, 255, .06);
    flex-wrap: nowrap;
    overflow: visible;
}

.navbar::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rainbow);
    background-size: 300% 100%;
    animation: rainbowFlow 6s linear infinite;
    opacity: .65;
}

@keyframes rainbowFlow {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
}

.logo-hex {
    font-size: 22px;
    color: var(--cyan);
    line-height: 1;
    filter: drop-shadow(0 0 7px rgba(0, 200, 255, .75));
    animation: logoGlow 3s ease-in-out infinite;
}

@keyframes logoGlow {

    0%,
    100% {
        filter: drop-shadow(0 0 7px rgba(0, 200, 255, .75));
    }

    50% {
        filter: drop-shadow(0 0 13px rgba(56, 189, 248, .9));
        color: var(--sky);
    }
}

.logo-text {
    font-family: var(--display);
    font-size: clamp(13px, 2.5vw, 18px);
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--txt);
    white-space: nowrap;
}

.logo-text em {
    font-style: normal;
    background: linear-gradient(135deg, var(--cyan), var(--sky), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-center {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: nowrap;
    gap: 2px;
    flex: 1;
    overflow: visible;
}

@media (max-width: 640px) {
    .nav-center {
        display: none;
    }
}

.nav-link {
    padding: 6px 10px;
    border-radius: var(--r3);
    background: none;
    border: none;
    color: var(--txt2);
    font-family: var(--body);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

@media (min-width:1101px) {
    .nav-link {
        padding: 7px 14px;
        font-size: 13px;
    }
}

.nav-link:hover {
    color: var(--cyan);
    background: rgba(0, 200, 255, .09);
    box-shadow: 0 0 10px rgba(0, 200, 255, .22);
}

.nav-link.active {
    color: var(--cyan);
    background: rgba(0, 200, 255, .11);
    border: 1px solid rgba(0, 200, 255, .45);
    box-shadow: 0 0 12px rgba(0, 200, 255, .3);
}

.nav-link.ext {
    font-size: 11px;
}

.nav-end {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    flex-wrap: nowrap;
    overflow: visible;
    position: static;
}

.chain-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(0, 229, 170, .08);
    border: 1px solid rgba(0, 229, 170, .38);
    font-size: 11px;
    font-weight: 700;
    color: var(--green);
    white-space: nowrap;
}

.chain-label {
    display: none;
}

@media(min-width:480px) {
    .chain-label {
        display: inline;
    }
}

.pulse-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    flex-shrink: 0;
    animation: pulse 2.5s ease-in-out infinite;
    box-shadow: 0 0 6px var(--green);
}

@keyframes pulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(0, 229, 170, .6);
    }

    50% {
        box-shadow: 0 0 0 4px rgba(0, 229, 170, 0);
    }
}

/* Wallet pill — RGB, cyan dominant */
.wallet-pill {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--r3);
    background: linear-gradient(90deg, #00c8ff, #38bdf8, #00e5cc, #6d28d9, #f59e0b, #00c8ff);
    background-size: 300% 100%;
    border: none;
    color: #fff;
    font-family: var(--body);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    transition: opacity .2s, transform .2s, box-shadow .2s;
    white-space: nowrap;
    max-width: 160px;
    overflow: hidden;
    box-shadow: 0 0 18px rgba(0, 200, 255, .4);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
    flex-shrink: 0;
    animation: rainbowBtn 4s linear infinite;
}

@keyframes rainbowBtn {
    0% {
        background-position: 0% 50%;
    }

    100% {
        background-position: 300% 50%;
    }
}

.wallet-pill:hover {
    opacity: .9;
    transform: translateY(-1px);
    box-shadow: 0 0 28px rgba(0, 200, 255, .6), 0 0 50px rgba(0, 229, 204, .25);
}

.wallet-pill:active {
    transform: scale(.97);
}

.wp-icon {
    font-size: 14px;
    flex-shrink: 0;
}

.wp-text {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.burger {
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    width: 36px;
    height: 36px;
    border: 1px solid rgba(0, 200, 255, .4);
    border-radius: var(--r3);
    background: rgba(0, 200, 255, .06);
    cursor: pointer;
    flex-shrink: 0;
    transition: all .2s;
}

.burger:hover {
    box-shadow: 0 0 10px rgba(0, 200, 255, .35);
}

@media(max-width:640px) {
    .burger {
        display: flex;
    }
}

.burger span {
    display: block;
    width: 16px;
    height: 1.5px;
    background: var(--cyan);
    border-radius: 2px;
    transition: all .3s;
}

.burger.open span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg)
}

.burger.open span:nth-child(2) {
    opacity: 0
}

.burger.open span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg)
}

/* ====== CHAIN DROPDOWN ====== */
.sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.chain-dropdown-wrap {
    position: relative;
    flex-shrink: 0;
    z-index: 200;
}

.chain-trigger-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px 6px 8px;
    border-radius: var(--r3);
    background: rgba(0, 229, 170, .05);
    border: 1px solid var(--chain-color, rgba(0, 229, 170, .45));
    color: var(--chain-color, var(--green));
    font-family: var(--body);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.chain-trigger-btn:hover {
    background: rgba(0, 229, 170, .1);
    box-shadow: 0 0 10px rgba(0, 229, 170, .25);
}

.chain-trigger-btn .pulse-dot {
    background: var(--chain-color, var(--green));
    box-shadow: 0 0 6px var(--chain-color, var(--green));
    flex-shrink: 0;
}

.chain-trigger-label {
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
}

.chain-caret {
    flex-shrink: 0;
    opacity: .7;
    transition: transform .2s;
}

.chain-dropdown-wrap:has(.chain-dropdown.open) .chain-caret {
    transform: rotate(180deg);
}

.chain-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 201;
    background: var(--card);
    border: 1px solid rgba(0, 200, 255, .28);
    border-radius: var(--r2);
    padding: 6px;
    min-width: 180px;
    max-width: 90vw;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .7), 0 0 18px rgba(0, 200, 255, .1);
    display: none;
    flex-direction: column;
    gap: 4px;
    animation: dropIn .18s ease;
}

.chain-dropdown.open {
    display: flex;
}

@keyframes dropIn {
    from {
        opacity: 0;
        transform: translateY(-6px) scale(.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chain-item-btn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    padding: 9px 12px;
    border-radius: var(--r3);
    background: transparent;
    border: 1px solid transparent;
    color: var(--txt2);
    font-family: var(--body);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    text-align: left;
}

.chain-item-btn:hover {
    background: rgba(0, 200, 255, .07);
    border-color: var(--chain-color, var(--cyan));
    color: var(--chain-color, var(--cyan));
}

.chain-item-btn.active {
    background: rgba(0, 229, 170, .06);
    border-color: var(--chain-color, var(--green));
    color: var(--chain-color, var(--green));
}

.ci-logo {
    font-size: 15px;
    line-height: 1;
    flex-shrink: 0;
}

.ci-name {
    flex: 1;
}

.ci-check {
    font-size: 12px;
    font-weight: 900;
    flex-shrink: 0;
}

.ci-logo-img {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    object-fit: contain;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .navbar {
        padding: 0 10px;
        gap: 6px;
        height: var(--nav);
        overflow: visible;
    }

    .nav-end {
        gap: 6px;
        flex-wrap: nowrap;
        overflow: visible;
        position: static;
    }

    .chain-trigger-btn {
        padding: 0;
        width: 36px;
        height: 36px;
        justify-content: center;
        border-radius: var(--r3);
        max-width: 36px;
        min-width: 36px;
    }

    .chain-trigger-label,
    .chain-caret {
        display: none !important;
    }

    .chain-trigger-btn .pulse-dot {
        width: 10px;
        height: 10px;
    }

    .chain-dropdown-wrap {
        position: static;
    }

    .chain-dropdown {
        position: fixed;
        top: calc(var(--nav) + 5px);
        right: 10px;
        left: auto;
        min-width: 200px;
        max-width: calc(100vw - 20px);
        z-index: 1000;
    }

    .wallet-pill {
        padding: 6px 10px;
        font-size: 12px;
        max-width: 140px;
    }

    .wp-icon {
        display: none;
    }
}

@media (max-width: 380px) {
    .navbar {
        padding: 0 8px;
        gap: 4px;
        overflow: visible;
    }

    .wallet-pill {
        padding: 5px 8px;
        font-size: 11px;
        max-width: 110px;
    }

    .chain-trigger-btn {
        width: 32px;
        height: 32px;
        min-width: 32px;
        max-width: 32px;
    }

    .burger {
        width: 32px;
        height: 32px;
    }

    .chain-dropdown {
        right: 8px;
        min-width: 180px;
    }
}

/* ====== MOBILE MENU ====== */
.mob-menu {
    position: fixed;
    top: var(--nav);
    left: 0;
    right: 0;
    z-index: 99;
    background: rgba(3, 13, 26, .99);
    border-bottom: 1px solid rgba(0, 200, 255, .22);
    backdrop-filter: blur(24px);
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    transform: translateY(-110%);
    transition: transform .3s cubic-bezier(.4, 0, .2, 1);
    max-height: 80vh;
    overflow-y: auto;
}

.mob-menu.open {
    transform: translateY(0);
}

.mob-overlay {
    position: fixed;
    inset: 0;
    z-index: 98;
    background: rgba(0, 0, 0, .65);
    display: none;
    backdrop-filter: blur(4px);
}

.mob-overlay.show {
    display: block;
}

.mob-link {
    display: block;
    padding: 12px 16px;
    border-radius: var(--r2);
    background: none;
    border: none;
    color: var(--txt2);
    font-family: var(--body);
    font-size: 14px;
    font-weight: 600;
    text-align: left;
    cursor: pointer;
    transition: all .2s;
    text-decoration: none;
}

.mob-link:hover,
.mob-link.active {
    color: var(--cyan);
    background: rgba(0, 200, 255, .08);
    border-left: 2px solid var(--cyan);
    padding-left: 14px;
}

.mob-sep {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, .35), transparent);
    margin: 6px 0;
}

.mob-wallet-area {
    padding: 4px;
}

.mob-wallet-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: rgba(0, 200, 255, .05);
    border: 1px solid rgba(0, 200, 255, .22);
    border-radius: var(--r2);
    margin-bottom: 8px;
}

.mob-addr {
    font-family: var(--mono);
    font-size: 13px;
    color: var(--cyan);
    font-weight: 600;
}

.mob-act {
    font-size: 11px;
    color: var(--green);
    font-weight: 700;
}

.mob-network-row {
    padding: 6px 12px 8px;
}

.mob-net-label {
    display: block;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--cyan);
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 8px;
}

#chainSelectorMob {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#chainSelectorMob .chain-item-btn {
    font-size: 14px;
    padding: 10px 14px;
    border: 1px solid rgba(255, 255, 255, .07);
}

#chainSelectorMob .chain-item-btn:hover,
#chainSelectorMob .chain-item-btn.active {
    border-color: var(--chain-color, var(--cyan));
    background: rgba(0, 200, 255, .07);
    color: var(--chain-color, var(--cyan));
}

/* ====== MAIN ====== */
.main-content {
    position: relative;
    z-index: 2;
    padding-top: calc(var(--nav) + 30px);
    padding-bottom: 60px;
    min-height: 100vh;
}

@media (max-width: 640px) {
    .main-content {
        padding-top: calc(var(--nav) + 20px);
    }
}

.page {
    display: none;
}

.page.active {
    display: block;
    animation: pageIn .3s ease;
}

@keyframes pageIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.page-hd {
    text-align: center;
    padding: 0 16px 24px;
    position: relative;
    z-index: 5;
}

.page-hd h1 {
    font-family: var(--display);
    font-size: clamp(24px, 7vw, 40px);
    font-weight: 900;
    letter-spacing: 5px;
    background: linear-gradient(135deg, #38bdf8, #00c8ff, #00e5cc, #6d28d9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 18px rgba(0, 200, 255, .45));
}

.page-hd p {
    font-size: 13px;
    color: var(--txt2);
}

.center-wrap {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 5;
}

.center-wrap.single {
    max-width: 500px;
}

/* ====== CYBER CARD ====== */
.cyber-card {
    background: var(--card);
    border: 1px solid rgba(0, 200, 255, .38);
    border-radius: var(--r);
    padding: 16px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(0, 200, 255, .06);
    transition: box-shadow .3s;
}

.cyber-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rainbow);
    background-size: 300% 100%;
    animation: rainbowFlow 6s linear infinite;
}

.cyber-card:hover {
    box-shadow: 0 8px 32px rgba(0, 0, 0, .5), inset 0 1px 0 rgba(0, 200, 255, .06), 0 0 22px rgba(0, 200, 255, .09);
}

.card-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(0, 200, 255, .16);
}

.bar-tag {
    font-family: var(--display);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 2px;
    color: #00d4ff;
    background: rgba(0, 200, 255, .12);
    padding: 4px 12px;
    border-radius: 20px;
    border: 1px solid rgba(0, 200, 255, .35);
    text-shadow: 0 0 8px rgba(0, 200, 255, .5);
}

.bar-acts {
    display: flex;
    gap: 6px;
}

.icon-act {
    width: 30px;
    height: 30px;
    border-radius: var(--r3);
    background: rgba(0, 200, 255, .06);
    border: 1px solid rgba(0, 200, 255, .25);
    color: var(--txt2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.icon-act:hover {
    color: var(--cyan);
    background: rgba(0, 200, 255, .16);
    box-shadow: 0 0 10px rgba(0, 200, 255, .35);
}

.icon-act.spin svg {
    animation: spin .6s linear;
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

/* ====== SETTINGS ====== */
.sett-panel {
    display: none;
    background: rgba(5, 21, 38, .9);
    border: 1px solid rgba(0, 200, 255, .18);
    border-radius: var(--r2);
    padding: 12px 14px;
    margin-bottom: 12px;
    animation: slideDown .2s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.sett-panel.open {
    display: block;
}

.sett-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.sett-row:last-child {
    margin-bottom: 0;
}

.sett-row>span {
    font-size: 12px;
    color: var(--txt2);
    font-weight: 600;
}

.slip-btns {
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
}

.slip-b {
    padding: 4px 9px;
    border-radius: var(--r3);
    background: var(--bg3);
    border: 1px solid rgba(0, 200, 255, .28);
    color: var(--txt2);
    font-size: 12px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 2px 0 rgba(0, 40, 80, .5);
}

.slip-b.active,
.slip-b:hover {
    background: rgba(0, 200, 255, .15);
    border-color: var(--cyan);
    color: var(--cyan);
    box-shadow: 0 3px 0 rgba(0, 60, 100, .5), 0 0 10px rgba(0, 200, 255, .3);
    transform: translateY(-1px);
}

.slip-b:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0, 40, 80, .5);
}

.slip-inp {
    display: flex;
    align-items: center;
    gap: 4px;
    background: var(--bg3);
    border: 1px solid rgba(0, 200, 255, .22);
    border-radius: var(--r3);
    padding: 3px 8px;
}

.slip-inp input {
    width: 50px;
    background: none;
    border: none;
    color: #c8e8ff;
    font-size: 12px;
    outline: none;
}

.slip-inp span,
.deadline-inp span {
    font-size: 11px;
    color: var(--txt2);
}

.deadline-inp {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--bg3);
    border: 1px solid rgba(0, 200, 255, .22);
    border-radius: var(--r3);
    padding: 4px 10px;
}

.deadline-inp input {
    width: 44px;
    background: none;
    border: none;
    color: #c8e8ff;
    font-size: 12px;
    font-family: var(--mono);
    outline: none;
}

/* ====== TOKEN BOX ====== */
.tok-box {
    background: rgba(4, 14, 26, .9);
    border: 1px solid rgba(0, 200, 255, .32);
    border-radius: var(--r2);
    padding: 12px 14px;
    margin-bottom: 8px;
    transition: border-color .25s, box-shadow .25s;
}

.tok-box:focus-within {
    border-color: rgba(0, 200, 255, .5);
    box-shadow: 0 0 0 2px rgba(0, 200, 255, .16), 0 0 14px rgba(0, 200, 255, .1);
}

.tok-box:last-of-type {
    margin-bottom: 0;
}

.tok-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

/* Amber label like original */
.tok-lbl {
    font-size: 11px;
    color: var(--amber);
    font-weight: 800;
    letter-spacing: .5px;
    text-transform: uppercase;
    background: rgba(245, 158, 11, .09);
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(245, 158, 11, .28);
}

.bal-btn {
    font-size: 11px;
    color: var(--cyan);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
    transition: all .2s;
    padding: 2px 6px;
    border-radius: var(--r3);
}

.bal-btn:hover {
    background: rgba(0, 200, 255, .09);
    color: var(--cyan2);
}

.tok-mid {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Input */
.tok-amt {
    flex: 1;
    background: #ffffff;
    border: 2px solid rgba(0, 200, 255, .5);
    border-radius: var(--r3);
    outline: none;
    font-size: clamp(18px, 5vw, 26px);
    font-weight: 800;
    font-family: var(--display);
    color: #0a1628;
    min-width: 0;
    width: 100%;
    padding: 10px 12px;
    transition: border-color .2s, box-shadow .2s;
    caret-color: #0a1628;
    box-shadow: inset 0 2px 6px rgba(0, 200, 255, .08);
}

.tok-amt:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 0 3px rgba(0, 200, 255, .25), inset 0 2px 6px rgba(0, 200, 255, .05);
}

.tok-amt::placeholder {
    color: #6b8baa;
    font-weight: 500;
}

.tok-amt[readonly] {
    background: #f0f7ff;
    color: #1a3a5c;
    cursor: default;
    border-color: rgba(0, 200, 255, .3);
}

.tok-amt::-webkit-outer-spin-button,
.tok-amt::-webkit-inner-spin-button {
    -webkit-appearance: none;
}

/* Token picker */
.tok-pick {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: var(--r3);
    background: rgba(10, 30, 55, .95);
    border: 1px solid rgba(0, 200, 255, .4);
    color: var(--txt);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    white-space: nowrap;
    font-family: var(--body);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 0 rgba(0, 60, 100, .6), 0 6px 12px rgba(0, 0, 0, .3), inset 0 1px 0 rgba(0, 200, 255, .15);
}

.tok-pick::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, .07), transparent);
    transform: translateX(-100%);
    transition: transform .45s;
}

.tok-pick:hover::after {
    transform: translateX(100%);
}

.tok-pick:hover {
    border-color: rgba(0, 200, 255, .65);
    background: rgba(0, 200, 255, .15);
    box-shadow: 0 5px 0 rgba(0, 60, 100, .6), 0 8px 16px rgba(0, 200, 255, .25), inset 0 1px 0 rgba(0, 200, 255, .2);
    color: var(--cyan);
    transform: translateY(-1px);
}

.tok-pick:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0, 60, 100, .6), 0 3px 8px rgba(0, 0, 0, .3);
}

.tok-pick.sm {
    font-size: 12px;
    padding: 5px 8px;
}

.tok-logo {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: none;
    flex-shrink: 0;
}

.tok-logo[src]:not([src=""]):not([src="undefined"]) {
    display: block;
}

.caret {
    color: var(--cyan);
    flex-shrink: 0;
}

.tok-bot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    flex-wrap: wrap;
    gap: 6px;
}

.tok-usd {
    font-size: 11px;
    color: var(--txt2);
    font-family: var(--mono);
    font-weight: 500;
    background: rgba(0, 0, 0, .3);
    padding: 2px 8px;
    border-radius: 20px;
}

.pcts {
    display: flex;
    gap: 5px;
}

.pcts.center {
    justify-content: center;
    flex-wrap: wrap;
}

/* PCT BUTTONS — RGB, each hue */
.pct {
    padding: 4px 11px;
    border-radius: var(--r3);
    background: rgba(4, 16, 30, .85);
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    text-transform: uppercase;
    border: 1px solid;
}

.pcts .pct:nth-child(1) {
    border-color: rgba(0, 200, 255, .65);
    color: var(--cyan);
    box-shadow: 0 3px 0 rgba(0, 60, 100, .55), 0 4px 8px rgba(0, 200, 255, .15);
}

.pcts .pct:nth-child(1):hover {
    background: rgba(0, 200, 255, .18);
    box-shadow: 0 4px 0 rgba(0, 60, 100, .55), 0 6px 12px rgba(0, 200, 255, .3);
    transform: translateY(-1px);
}

.pcts .pct:nth-child(1):active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 60, 100, .55);
}

.pcts .pct:nth-child(2) {
    border-color: rgba(139, 92, 246, .65);
    color: var(--violet2);
    box-shadow: 0 3px 0 rgba(60, 20, 120, .55), 0 4px 8px rgba(139, 92, 246, .15);
}

.pcts .pct:nth-child(2):hover {
    background: rgba(139, 92, 246, .18);
    box-shadow: 0 4px 0 rgba(60, 20, 120, .55), 0 6px 12px rgba(139, 92, 246, .3);
    transform: translateY(-1px);
}

.pcts .pct:nth-child(2):active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(60, 20, 120, .55);
}

.pcts .pct:nth-child(3) {
    border-color: rgba(245, 158, 11, .7);
    color: var(--amber);
    box-shadow: 0 3px 0 rgba(100, 60, 0, .55), 0 4px 8px rgba(245, 158, 11, .15);
}

.pcts .pct:nth-child(3):hover {
    background: rgba(245, 158, 11, .18);
    box-shadow: 0 4px 0 rgba(100, 60, 0, .55), 0 6px 12px rgba(245, 158, 11, .3);
    transform: translateY(-1px);
}

.pcts .pct:nth-child(3):active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(100, 60, 0, .55);
}

.pcts .pct:nth-child(4) {
    border-color: rgba(0, 229, 204, .65);
    color: var(--teal);
    box-shadow: 0 3px 0 rgba(0, 80, 70, .55), 0 4px 8px rgba(0, 229, 204, .15);
}

.pcts .pct:nth-child(4):hover {
    background: rgba(0, 229, 204, .18);
    box-shadow: 0 4px 0 rgba(0, 80, 70, .55), 0 6px 12px rgba(0, 229, 204, .3);
    transform: translateY(-1px);
}

.pcts .pct:nth-child(4):active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 80, 70, .55);
}

.pcts.center .pct:nth-child(1) {
    border-color: rgba(0, 200, 255, .6);
    color: var(--cyan);
}

.pcts.center .pct:nth-child(2) {
    border-color: rgba(139, 92, 246, .6);
    color: var(--violet2);
}

.pcts.center .pct:nth-child(3) {
    border-color: rgba(245, 158, 11, .65);
    color: var(--amber);
}

.pcts.center .pct:nth-child(4) {
    border-color: rgba(0, 229, 204, .6);
    color: var(--teal);
}

.pcts.center .pct:hover {
    transform: translateY(-1px);
}

/* ====== FLIP ====== */
.flip-row {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    position: relative;
    z-index: 1;
    margin: 4px 0;
}

.flip-row::before,
.flip-row::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, .28), transparent);
}

.flip-row::before {
    top: -6px;
}

.flip-row::after {
    bottom: -6px;
}

.flip-btn {
    width: 32px;
    height: 32px;
    border-radius: var(--r2);
    background: var(--card);
    border: 1px solid rgba(0, 200, 255, .32);
    color: var(--txt2);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .35s cubic-bezier(.34, 1.56, .64, 1);
}

.flip-btn:hover {
    background: rgba(0, 200, 255, .13);
    border-color: var(--cyan);
    color: var(--cyan);
    transform: rotate(180deg) scale(1.1);
    box-shadow: 0 0 14px rgba(0, 200, 255, .45);
}

.plus-chip {
    width: 32px;
    height: 32px;
    border-radius: var(--r2);
    background: var(--card);
    border: 1px solid rgba(0, 200, 255, .28);
    color: var(--cyan);
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ====== DETAIL BOX ====== */
.detail-box {
    background: rgba(2, 9, 20, .75);
    border: 1px solid rgba(0, 200, 255, .22);
    border-radius: var(--r2);
    padding: 12px 14px;
    margin: 12px 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    padding: 5px 0;
    border-bottom: 1px solid rgba(0, 200, 255, .07);
}

.detail-row:last-child {
    border-bottom: none;
}

.detail-row>span:first-child {
    color: var(--txt2);
    font-weight: 600;
}

.detail-row>span:last-child {
    color: #00d4ff;
    font-family: var(--mono);
    font-weight: 700;
    text-align: right;
    max-width: 65%;
    word-break: break-all;
    background: rgba(0, 200, 255, .09);
    padding: 2px 10px;
    border-radius: 20px;
    border: 1px solid rgba(0, 200, 255, .18);
    text-shadow: 0 0 8px rgba(0, 200, 255, .4);
}

.imp-low {
    color: var(--green) !important;
}

.imp-mid {
    color: var(--amber) !important;
}

.imp-high {
    color: var(--red) !important;
}

/* ====== ACTION BUTTON — RGB rainbow, cyan-leading ====== */
.action-btn {
    width: 100%;
    padding: 13px;
    border-radius: var(--r2);
    font-family: var(--display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1.5px;
    border: none;
    cursor: pointer;
    transition: transform .15s ease, box-shadow .15s ease;
    background: linear-gradient(90deg, #00c8ff, #38bdf8, #00e5cc, #6d28d9, #a78bfa, #f59e0b, #00c8ff);
    background-size: 300% 100%;
    color: #fff;
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    text-transform: uppercase;
    box-shadow: 0 6px 0 rgba(0, 80, 120, .75), 0 8px 18px rgba(0, 200, 255, .38), inset 0 1px 0 rgba(255, 255, 255, .25), inset 0 -1px 0 rgba(0, 0, 0, .2);
    text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
    animation: rainbowBtn 4s linear infinite;
    transform: translateY(0);
}

.action-btn::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -75%;
    width: 50%;
    height: 200%;
    background: rgba(255, 255, 255, .12);
    transform: skewX(-20deg);
    transition: left .5s;
}

.action-btn:hover:not(:disabled)::after {
    left: 125%;
}

.action-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 0 rgba(0, 80, 120, .75), 0 12px 22px rgba(0, 200, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .3), inset 0 -1px 0 rgba(0, 0, 0, .2);
}

.action-btn:active:not(:disabled) {
    transform: translateY(4px);
    box-shadow: 0 2px 0 rgba(0, 80, 120, .75), 0 4px 10px rgba(0, 200, 255, .3), inset 0 1px 0 rgba(255, 255, 255, .15), inset 0 -1px 0 rgba(0, 0, 0, .2);
}

.action-btn:disabled {
    background: rgba(13, 37, 64, .8);
    color: var(--txt3);
    cursor: not-allowed;
    box-shadow: 0 3px 0 rgba(0, 0, 0, .4);
    animation: none;
}

.action-btn.sm {
    width: auto;
    padding: 8px 18px;
    font-size: 11px;
}

.action-btn.warn {
    background: linear-gradient(90deg, #f59e0b, #f43f5e, #f97316);
    background-size: 200% 100%;
    animation: warnPulse 2s ease-in-out infinite;
}

@keyframes warnPulse {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

/* ====== APPROVE ====== */
.approve-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.approve-row button,
.approve-btn-solo {
    flex: 1;
    padding: 10px;
    border-radius: var(--r2);
    background: rgba(0, 200, 255, .08);
    border: 1px solid rgba(0, 200, 255, .4);
    color: var(--cyan);
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--body);
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 4px 0 rgba(0, 60, 100, .55), 0 6px 10px rgba(0, 200, 255, .15), inset 0 1px 0 rgba(0, 200, 255, .15);
}

.approve-btn-solo {
    width: 100%;
    display: block;
    margin-bottom: 8px;
}

.approve-row button:hover,
.approve-btn-solo:hover {
    background: rgba(0, 200, 255, .18);
    box-shadow: 0 5px 0 rgba(0, 60, 100, .55), 0 8px 14px rgba(0, 200, 255, .25), inset 0 1px 0 rgba(0, 200, 255, .2);
    transform: translateY(-1px);
}

.approve-row button:active,
.approve-btn-solo:active {
    transform: translateY(3px);
    box-shadow: 0 1px 0 rgba(0, 60, 100, .55);
}

.approve-row button:disabled {
    opacity: .4;
    cursor: not-allowed;
}

/* ====== GHOST ====== */
.ghost-btn {
    background: rgba(0, 200, 255, .05);
    border: 1px solid rgba(0, 200, 255, .4);
    border-radius: var(--r3);
    padding: 5px 12px;
    color: var(--cyan);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--body);
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 3px 0 rgba(0, 60, 100, .55), 0 4px 8px rgba(0, 200, 255, .15);
}

.ghost-btn:hover {
    background: rgba(0, 200, 255, .14);
    box-shadow: 0 4px 0 rgba(0, 60, 100, .55), 0 6px 12px rgba(0, 200, 255, .25);
    transform: translateY(-1px);
}

.ghost-btn:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 60, 100, .55);
}

.ghost-btn.full {
    width: 100%;
    padding: 10px;
}

/* ====== TXNS ====== */
.txns-card {
    margin-top: 0;
}

.txns-card .card-bar {
    margin-bottom: 10px;
}

.empty-msg {
    font-size: 12px;
    color: var(--txt2);
    text-align: center;
    padding: 16px 0;
}

.tx-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--r3);
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(0, 200, 255, .13);
    margin-bottom: 5px;
    font-size: 12px;
    gap: 6px;
    transition: border-color .2s;
}

.tx-item:hover {
    border-color: rgba(0, 200, 255, .28);
}

.tx-txt {
    flex: 1;
    color: var(--txt);
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}

.tx-ok {
    color: var(--green);
    flex-shrink: 0;
}

.tx-fail {
    color: var(--red);
    flex-shrink: 0;
}

.tx-pend {
    color: var(--amber);
    flex-shrink: 0;
    animation: blink 1.2s ease-in-out infinite;
}

@keyframes blink {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .3;
    }
}

.tx-link {
    color: var(--cyan);
    text-decoration: none;
    font-size: 11px;
    flex-shrink: 0;
}

.tx-link:hover {
    text-decoration: underline;
}

/* ====== PAIR SELECT ====== */
.pair-select {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    flex-wrap: wrap;
}

.pair-btn {
    flex: 1;
    min-width: 120px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6px;
    padding: 10px 12px;
    border-radius: var(--r2);
    background: rgba(4, 14, 26, .8);
    border: 1px solid rgba(0, 200, 255, .22);
    color: var(--txt);
    font-weight: 700;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s;
    font-family: var(--body);
}

.pair-btn:hover {
    border-color: rgba(0, 200, 255, .5);
    background: rgba(0, 200, 255, .09);
    box-shadow: 0 0 12px rgba(0, 200, 255, .28);
    color: var(--cyan);
}

.pair-logo {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: none;
    flex-shrink: 0;
}

.pair-logo[src]:not([src=""]):not([src="undefined"]) {
    display: block;
}

.plus-sep {
    color: var(--cyan);
    font-size: 18px;
    flex-shrink: 0;
    font-weight: 700;
}

.empty-prompt {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 32px 16px;
    text-align: center;
    color: var(--txt2);
    background: rgba(0, 0, 0, .18);
    border-radius: var(--r2);
    border: 1px dashed rgba(0, 200, 255, .18);
}

.ep-icon {
    font-size: 36px;
    color: var(--cyan);
    line-height: 1;
    animation: floatIcon 3s ease-in-out infinite;
}

@keyframes floatIcon {

    0%,
    100% {
        transform: translateY(0);
        opacity: .45;
    }

    50% {
        transform: translateY(-6px);
        opacity: .9;
    }
}

/* ====== POOL ====== */
.pool-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.empty-pool {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 16px;
    text-align: center;
}

.empty-pool p {
    font-size: 15px;
    font-weight: 700;
    color: var(--txt2);
}

.empty-pool span {
    font-size: 12px;
    color: var(--txt2);
}

.pool-pos {
    background: rgba(4, 14, 26, .85);
    border: 1px solid rgba(0, 200, 255, .2);
    border-radius: var(--r);
    padding: 14px;
    margin-bottom: 12px;
    position: relative;
    overflow: hidden;
    transition: border-color .2s, box-shadow .2s;
}

.pool-pos::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rainbow);
    background-size: 300% 100%;
    animation: rainbowFlow 5s linear infinite;
}

.pool-pos:hover {
    border-color: rgba(0, 200, 255, .38);
    box-shadow: 0 4px 18px rgba(0, 200, 255, .09);
}

.pos-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.pos-pair {
    font-family: var(--display);
    font-weight: 800;
    font-size: 13px;
    color: #00d4ff;
    background: rgba(0, 200, 255, .1);
    padding: 4px 14px;
    border-radius: 20px;
    border: 1px solid rgba(0, 200, 255, .35);
    text-shadow: 0 0 8px rgba(0, 200, 255, .4);
}

.pos-acts {
    display: flex;
    gap: 6px;
}

.pos-add {
    padding: 5px 12px;
    border-radius: var(--r3);
    background: rgba(0, 200, 255, .1);
    border: 1px solid rgba(0, 200, 255, .45);
    color: var(--cyan);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 3px 0 rgba(0, 80, 120, .6), 0 5px 10px rgba(0, 200, 255, .2);
}

.pos-add:hover {
    background: rgba(0, 200, 255, .2);
    box-shadow: 0 4px 0 rgba(0, 80, 120, .6), 0 8px 14px rgba(0, 200, 255, .3);
    transform: translateY(-1px);
}

.pos-add:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(0, 80, 120, .6), 0 2px 6px rgba(0, 200, 255, .2);
}

.pos-rm {
    padding: 5px 12px;
    border-radius: var(--r3);
    background: rgba(244, 63, 94, .1);
    border: 1px solid rgba(244, 63, 94, .45);
    color: var(--red);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 3px 0 rgba(120, 20, 40, .6), 0 5px 10px rgba(244, 63, 94, .2);
}

.pos-rm:hover {
    background: rgba(244, 63, 94, .2);
    box-shadow: 0 4px 0 rgba(120, 20, 40, .6), 0 8px 14px rgba(244, 63, 94, .3);
    transform: translateY(-1px);
}

.pos-rm:active {
    transform: translateY(2px);
    box-shadow: 0 1px 0 rgba(120, 20, 40, .6);
}

.pos-data {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.pos-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    padding: 4px 0;
}

.pos-row>span:first-child {
    color: var(--txt2);
    font-weight: 600;
}

.pos-row .mono {
    font-family: var(--mono);
    color: var(--cyan);
    font-weight: 600;
    background: rgba(0, 0, 0, .28);
    padding: 2px 8px;
    border-radius: 20px;
    border: 1px solid rgba(0, 200, 255, .1);
}

.import-strip {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: var(--r2);
    background: rgba(0, 0, 0, .18);
    border: 1px solid rgba(0, 200, 255, .13);
    margin-top: 10px;
}

.import-strip span {
    font-size: 12px;
    color: var(--txt2);
    font-weight: 500;
}

/* ====== MODAL ====== */
.modal-wrap {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0, 0, 0, .85);
    backdrop-filter: blur(16px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

.modal-wrap.open {
    display: flex;
    animation: fadein .2s ease;
}

#tokModalWrap {
    z-index: 1100;
}

@keyframes fadein {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal {
    background: var(--card);
    border: 1px solid rgba(0, 200, 255, .32);
    border-radius: var(--r);
    width: 100%;
    max-width: 440px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: modalSlideUp .28s cubic-bezier(.34, 1.2, .64, 1);
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .8), 0 0 35px rgba(0, 200, 255, .1);
}

.modal::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rainbow);
    background-size: 300% 100%;
    animation: rainbowFlow 4s linear infinite;
}

.modal.sm {
    max-width: 380px;
}

@keyframes modalSlideUp {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media(max-width:480px) {
    .modal-wrap {
        padding: 0;
        align-items: flex-end;
    }

    .modal {
        max-width: 100%;
        max-height: 90vh;
        border-radius: var(--r) var(--r) 0 0;
    }
}

.modal-hd {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px 14px;
    border-bottom: 1px solid rgba(0, 200, 255, .13);
    flex-shrink: 0;
}

.modal-hd span {
    font-family: var(--display);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--cyan);
}

.x-btn {
    width: 26px;
    height: 26px;
    border-radius: var(--r3);
    background: rgba(244, 63, 94, .07);
    border: 1px solid rgba(244, 63, 94, .28);
    color: var(--red);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
    flex-shrink: 0;
}

.x-btn:hover {
    background: rgba(244, 63, 94, .18);
    box-shadow: 0 0 8px rgba(244, 63, 94, .35);
    transform: rotate(90deg);
}

.modal-search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(0, 200, 255, .1);
    background: rgba(0, 0, 0, .18);
    flex-shrink: 0;
}

.modal-search-bar svg {
    color: var(--cyan);
    flex-shrink: 0;
}

.modal-search-bar input {
    flex: 1;
    background: #f4f9ff;
    border: 1px solid rgba(0, 200, 255, .4);
    border-radius: var(--r3);
    outline: none;
    color: #0d1f38;
    font-size: 13px;
    min-width: 0;
    padding: 8px 12px;
    transition: border-color .2s;
    caret-color: #0a1628;
}

.modal-search-bar input:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 8px rgba(0, 200, 255, .22);
}

.modal-search-bar input::placeholder {
    color: #5a7fa0;
}

.x-btn-sm {
    background: none;
    border: none;
    color: var(--txt3);
    cursor: pointer;
    font-size: 12px;
    padding: 2px;
}

.common-row {
    padding: 10px 16px 8px;
    flex-shrink: 0;
}

.sec-lbl {
    display: block;
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--amber);
    text-transform: uppercase;
    margin-bottom: 8px;
    font-weight: 800;
}

.chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tok-chip {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(4, 18, 36, .9);
    border: 1px solid rgba(0, 200, 255, .35);
    color: var(--txt);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .15s, box-shadow .15s;
    box-shadow: 0 2px 0 rgba(0, 50, 90, .5), 0 3px 6px rgba(0, 0, 0, .3);
}

.tok-chip:hover {
    border-color: var(--cyan);
    background: rgba(0, 200, 255, .12);
    box-shadow: 0 3px 0 rgba(0, 50, 90, .5), 0 0 10px rgba(0, 200, 255, .3);
    color: var(--cyan);
    transform: translateY(-1px);
}

.tok-chip:active {
    transform: translateY(1px);
    box-shadow: 0 1px 0 rgba(0, 50, 90, .5);
}

.tok-chip img {
    width: 16px;
    height: 16px;
    border-radius: 50%;
}

.modal-div {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, .32), transparent);
    flex-shrink: 0;
}

.tok-list-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 6px 8px;
}

.tok-list-wrap::-webkit-scrollbar {
    width: 4px;
}

.tok-list-wrap::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--cyan), var(--teal));
    border-radius: 2px;
}

.tok-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 10px;
    border-radius: var(--r2);
    cursor: pointer;
    transition: all .15s;
}

.tok-item:hover {
    background: rgba(0, 200, 255, .06);
    box-shadow: inset 0 0 0 1px rgba(0, 200, 255, .13);
}

.tok-ico {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(0, 200, 255, .07);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 800;
    color: var(--cyan);
    overflow: hidden;
    border: 1px solid rgba(0, 200, 255, .16);
}

.tok-ico img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.tok-inf {
    flex: 1;
    min-width: 0;
}

.tok-sym {
    font-weight: 800;
    font-size: 13px;
    color: var(--txt);
}

.tok-name {
    font-size: 11px;
    color: var(--txt2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.tok-bal {
    font-family: var(--mono);
    font-size: 12px;
    color: var(--amber);
    flex-shrink: 0;
    font-weight: 600;
}

.loading-row {
    padding: 24px;
    text-align: center;
    color: var(--txt2);
    font-size: 13px;
}

.modal-ft {
    padding: 10px 14px;
    border-top: 1px solid rgba(0, 200, 255, .1);
    flex-shrink: 0;
}

.wallet-opts {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.wallet-opt {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--r2);
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(0, 200, 255, .18);
    cursor: pointer;
    transition: all .2s;
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.wallet-opt::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, .05), transparent);
    transform: translateX(-100%);
    transition: transform .4s;
}

.wallet-opt:hover::after {
    transform: translateX(100%);
}

.wallet-opt:hover {
    border-color: rgba(0, 200, 255, .45);
    background: rgba(0, 200, 255, .08);
    box-shadow: 0 0 14px rgba(0, 200, 255, .18);
}

.wallet-opt img {
    border-radius: 8px;
    flex-shrink: 0;
}

.wo-name {
    font-weight: 800;
    font-size: 13px;
    color: var(--txt);
    margin-bottom: 2px;
}

.wo-hint {
    font-size: 11px;
    color: var(--txt2);
}

.wo-badge {
    position: absolute;
    right: 12px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(0, 200, 255, .1);
    border: 1px solid rgba(0, 200, 255, .32);
    font-size: 10px;
    font-weight: 800;
    color: var(--cyan);
}

.wallet-note {
    padding: 8px 16px 14px;
    font-size: 11px;
    color: var(--txt2);
    text-align: center;
}

.wd-body {
    padding: 20px;
}

.wd-addr {
    font-family: var(--mono);
    font-size: 14px;
    font-weight: 600;
    color: var(--cyan);
    margin-bottom: 8px;
    word-break: break-all;
    background: rgba(0, 200, 255, .06);
    padding: 6px 10px;
    border-radius: var(--r3);
    border: 1px solid rgba(0, 200, 255, .22);
}

.wd-bal {
    font-family: var(--display);
    font-size: 28px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--sky), var(--cyan), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 4px;
}

.wd-net {
    font-size: 11px;
    color: var(--txt2);
    margin-bottom: 16px;
}

.wd-acts {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.wd-act {
    display: block;
    padding: 9px 12px;
    border-radius: var(--r2);
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(0, 200, 255, .18);
    color: var(--txt);
    font-size: 13px;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: all .2s;
    font-family: var(--body);
    font-weight: 600;
}

.wd-act:hover {
    border-color: var(--cyan);
    background: rgba(0, 200, 255, .09);
    box-shadow: 0 0 10px rgba(0, 200, 255, .28);
    color: var(--cyan);
}

.wd-act.red {
    color: var(--red);
    border-color: rgba(244, 63, 94, .22);
}

.wd-act.red:hover {
    background: rgba(244, 63, 94, .1);
    box-shadow: 0 0 10px rgba(244, 63, 94, .3);
    border-color: var(--red);
}

.remove-body,
.import-body,
.manage-body {
    padding: 16px;
}

.pct-display {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.pct-display>span {
    font-size: 12px;
    color: var(--txt2);
    font-weight: 600;
}

.pct-big {
    font-family: var(--display);
    font-size: 32px;
    font-weight: 900;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.range-inp {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    margin-bottom: 12px;
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
    outline: none;
    background: linear-gradient(to right, var(--cyan) 50%, var(--bg3) 50%);
}

.range-inp::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    cursor: pointer;
    box-shadow: 0 0 12px rgba(0, 200, 255, .75);
    transition: transform .2s;
}

.range-inp::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

.hint-text {
    font-size: 12px;
    color: var(--txt2);
    margin-bottom: 12px;
    font-weight: 500;
}

.sep {
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(0, 200, 255, .28), transparent);
    margin: 14px 0;
}

.text-inp {
    width: 100%;
    padding: 10px 12px;
    border-radius: var(--r2);
    background: #f4f9ff;
    border: 1px solid rgba(0, 200, 255, .4);
    color: #0d1f38;
    font-size: 13px;
    font-family: var(--mono);
    outline: none;
    margin-bottom: 10px;
    transition: border-color .2s;
    caret-color: #0a1628;
    box-shadow: inset 0 2px 4px rgba(0, 200, 255, .06);
}

.text-inp:focus {
    border-color: var(--cyan);
    box-shadow: 0 0 8px rgba(0, 200, 255, .22);
}

.custom-preview {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0, 200, 255, .04);
    border: 1px solid rgba(0, 200, 255, .18);
    border-radius: var(--r2);
    padding: 10px;
    margin-bottom: 10px;
}

.custom-preview.hidden {
    display: none;
}

.prev-logo {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg3);
    flex-shrink: 0;
}

.mono-sm {
    font-family: var(--mono);
    font-size: 10px;
    color: var(--txt2);
    word-break: break-all;
}

#customTokList .tok-item {
    background: rgba(0, 0, 0, .22);
    border: 1px solid rgba(0, 200, 255, .13);
    border-radius: var(--r2);
    margin-bottom: 4px;
}

.del-tok {
    background: none;
    border: none;
    color: var(--red);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    font-weight: 800;
    transition: all .2s;
}

.del-tok:hover {
    transform: scale(1.2);
}

/* ====== TX MASK ====== */
.tx-mask {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 5, 14, .93);
    backdrop-filter: blur(20px);
    display: none;
    align-items: center;
    justify-content: center;
}

.tx-mask.show {
    display: flex;
    animation: fadein .2s ease;
}

.tx-card {
    background: var(--card);
    border: 1px solid rgba(0, 200, 255, .38);
    border-radius: var(--r);
    padding: 36px 28px;
    text-align: center;
    min-width: 280px;
    box-shadow: 0 0 50px rgba(0, 200, 255, .18), 0 20px 60px rgba(0, 0, 0, .8);
    position: relative;
    overflow: hidden;
    animation: modalSlideUp .3s cubic-bezier(.34, 1.2, .64, 1);
}

.tx-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rainbow);
    background-size: 300% 100%;
    animation: rainbowFlow 2s linear infinite;
}

.tx-spin {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 3px solid rgba(0, 200, 255, .13);
    border-top-color: var(--cyan);
    border-right-color: var(--teal);
    animation: spin .8s linear infinite;
    margin: 0 auto 18px;
    box-shadow: 0 0 18px rgba(0, 200, 255, .3);
}

.tx-title {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 800;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tx-msg {
    font-size: 12px;
    color: var(--txt2);
    font-family: var(--mono);
}

/* ====== TOAST NOTIFICATIONS — gaya TX card ====== */
.toast-stack {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    width: min(88vw, 300px);
    align-items: center;
}

.toast {
    width: 100%;
    padding: 28px 24px 22px;
    border-radius: var(--r);
    background: var(--card);
    border: 1px solid rgba(0, 200, 255, .38);
    text-align: center;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    box-shadow:
        0 0 40px rgba(0, 200, 255, .15),
        0 20px 60px rgba(0, 0, 0, .8);
    animation: toastPop .3s cubic-bezier(.34, 1.2, .64, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

/* Rainbow top bar — sama persis TX card */
.toast::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--rainbow);
    background-size: 300% 100%;
    animation: rainbowFlow 2s linear infinite;
}

/* Icon circle */
.toast .ti {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 900;
    flex-shrink: 0;
    margin-bottom: 2px;
}

/* Teks pesan */
.toast>span:last-child {
    font-size: 13px;
    font-weight: 600;
    color: var(--txt2);
    font-family: var(--body);
    line-height: 1.5;
}

/* SUCCESS */
.toast.ok {
    border-color: rgba(0, 229, 170, .45);
    box-shadow: 0 0 40px rgba(0, 229, 170, .18), 0 20px 60px rgba(0, 0, 0, .8);
}

.toast.ok::before {
    background: linear-gradient(90deg, var(--green), var(--teal), var(--cyan));
}

.toast.ok .ti {
    background: rgba(0, 229, 170, .12);
    border: 1px solid rgba(0, 229, 170, .4);
    color: var(--green);
    box-shadow: 0 0 16px rgba(0, 229, 170, .4);
}

.toast.ok .ti::before {
    content: '✓';
}

.toast.ok>span:last-child {
    color: var(--green);
}

/* ERROR */
.toast.err {
    border-color: rgba(244, 63, 94, .45);
    box-shadow: 0 0 40px rgba(244, 63, 94, .18), 0 20px 60px rgba(0, 0, 0, .8);
}

.toast.err::before {
    background: linear-gradient(90deg, var(--red), #f97316, var(--red));
}

.toast.err .ti {
    background: rgba(244, 63, 94, .12);
    border: 1px solid rgba(244, 63, 94, .4);
    color: var(--red);
    box-shadow: 0 0 16px rgba(244, 63, 94, .4);
}

.toast.err .ti::before {
    content: '✕';
}

.toast.err>span:last-child {
    color: #fca5a5;
}

/* WARNING */
.toast.warn {
    border-color: rgba(245, 158, 11, .45);
    box-shadow: 0 0 40px rgba(245, 158, 11, .18), 0 20px 60px rgba(0, 0, 0, .8);
}

.toast.warn::before {
    background: linear-gradient(90deg, var(--amber), var(--yellow), var(--amber));
}

.toast.warn .ti {
    background: rgba(245, 158, 11, .12);
    border: 1px solid rgba(245, 158, 11, .4);
    color: var(--amber);
    box-shadow: 0 0 16px rgba(245, 158, 11, .4);
}

.toast.warn .ti::before {
    content: '⚠';
}

.toast.warn>span:last-child {
    color: #fde68a;
}

/* INFO */
.toast.info {
    border-color: rgba(0, 200, 255, .45);
    box-shadow: 0 0 40px rgba(0, 200, 255, .18), 0 20px 60px rgba(0, 0, 0, .8);
}

.toast.info::before {
    background: var(--rainbow);
    background-size: 300% 100%;
    animation: rainbowFlow 2s linear infinite;
}

.toast.info .ti {
    background: rgba(0, 200, 255, .1);
    border: 1px solid rgba(0, 200, 255, .4);
    color: var(--cyan);
    box-shadow: 0 0 16px rgba(0, 200, 255, .4);
}

.toast.info .ti::before {
    content: 'ℹ';
}

.toast.info>span:last-child {
    color: var(--txt2);
}

@keyframes toastPop {
    from {
        opacity: 0;
        transform: scale(.88) translateY(12px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: scale(1) translateY(0);
    }

    to {
        opacity: 0;
        transform: scale(.85) translateY(-10px);
    }
}

@media (max-width: 640px) {
    .toast-stack {
        width: min(86vw, 280px);
    }

    .toast {
        padding: 22px 18px 18px;
    }

    .toast .ti {
        width: 38px;
        height: 38px;
        font-size: 17px;
    }
}

/* ====== WRAP BANNER ====== */
.wrap-banner {
    background: rgba(0, 229, 170, .05);
    border: 1px solid rgba(0, 229, 170, .32);
    border-radius: var(--r2);
    padding: 9px 14px;
    font-size: 12px;
    font-weight: 600;
    color: var(--green);
    text-align: center;
    margin-bottom: 10px;
}

/* ====== DISABLED ====== */
.tok-disabled {
    opacity: .4;
    cursor: not-allowed !important;
    pointer-events: none;
}

.tok-chip.disabled {
    opacity: .35;
    cursor: not-allowed;
    pointer-events: none;
}

.tok-used {
    font-size: 10px;
    color: var(--amber);
    background: rgba(245, 158, 11, .09);
    border-radius: 4px;
    padding: 1px 5px;
    font-weight: 600;
    vertical-align: middle;
    border: 1px solid rgba(245, 158, 11, .22);
}

/* ====== UTILS ====== */
.hidden {
    display: none !important;
}

@media(max-width:380px) {
    .tok-amt {
        font-size: 18px;
        padding: 8px 10px;
    }

    .tok-pick {
        padding: 6px 8px;
        font-size: 12px;
    }
}

::-webkit-scrollbar {
    width: 5px;
    height: 5px;
}

::-webkit-scrollbar-track {
    background: var(--bg2);
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--cyan), var(--teal));
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--cyan2), var(--sky));
}