:root {
    --bg: #05060a;
    --card: rgba(255, 255, 255, 0.045);
    --line: rgba(255, 255, 255, 0.08);
    --text: #f4f6ff;
    --muted: rgba(244, 246, 255, 0.55);
    --accent: #8b7cff;
    --accent-2: #3ee0c6;
    --in: #3ee0a0;
    --out: #ff7b93;
    --warn: #ffc857;
    --radius: 22px;
    --safe-t: calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + env(safe-area-inset-top, 0px));
    --safe-b: calc(var(--tg-safe-area-inset-bottom, 0px) + var(--tg-content-safe-area-inset-bottom, 0px) + env(safe-area-inset-bottom, 0px));
    --safe-l: calc(var(--tg-safe-area-inset-left, 0px) + var(--tg-content-safe-area-inset-left, 0px) + env(safe-area-inset-left, 0px));
    --safe-r: calc(var(--tg-safe-area-inset-right, 0px) + var(--tg-content-safe-area-inset-right, 0px) + env(safe-area-inset-right, 0px));
}

html.tg-fs {
    --safe-t: max(76px, calc(var(--tg-safe-area-inset-top, 0px) + var(--tg-content-safe-area-inset-top, 0px) + env(safe-area-inset-top, 0px)));
}

* { box-sizing: border-box; }
html, body {
    margin: 0;
    height: 100%;
    height: var(--tg-viewport-stable-height, 100dvh);
    overflow: hidden;
    background: var(--bg);
    color: var(--text);
    font-family: Sora, ui-sans-serif, system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
button, a { font: inherit; color: inherit; }

.orb {
    position: fixed;
    z-index: 0;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    opacity: 0.55;
}
.orb-a { top: -80px; right: -60px; background: #5b4dff; }
.orb-b { bottom: 80px; left: -90px; background: #146f66; }

.hidden { display: none !important; }

.gate {
    min-height: 100dvh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    z-index: 2;
}
.gate-card {
    width: min(100%, 360px);
    padding: 28px 24px 24px;
    border: 1px solid var(--line);
    background: rgba(10, 12, 20, 0.72);
    backdrop-filter: blur(18px);
    border-radius: 28px;
    text-align: center;
}
.mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-weight: 800;
    background: linear-gradient(135deg, #7c6bff, #3ee0c6);
    color: #05060a;
}
.gate h1 { margin: 0 0 8px; font-size: 22px; }
.gate p { margin: 0 0 20px; color: var(--muted); line-height: 1.5; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 48px;
    border-radius: 16px;
    background: linear-gradient(135deg, #8b7cff, #5b4dff);
    text-decoration: none;
    font-weight: 700;
}

.app {
    position: relative;
    z-index: 1;
    height: 100%;
    width: min(560px, 100%);
    margin: 0 auto;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    padding:
        calc(10px + var(--safe-t))
        calc(16px + var(--safe-r))
        calc(96px + var(--safe-b))
        calc(16px + var(--safe-l));
}

.top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 18px;
}
.eyebrow {
    margin: 0 0 4px;
    font-size: 12px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}
.top h1 {
    margin: 0;
    font-size: clamp(18px, 5.4vw, 22px);
    font-weight: 700;
    max-width: 70vw;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pill {
    display: grid;
    justify-items: end;
    gap: 2px;
    padding: 7px 12px;
    border-radius: 16px;
    background: rgba(139, 124, 255, 0.16);
    border: 1px solid rgba(139, 124, 255, 0.28);
    cursor: pointer;
    text-align: right;
}
.pill b {
    font-size: 13px;
    font-weight: 700;
    text-transform: capitalize;
    line-height: 1.2;
}
.pill small {
    font-size: 10px;
    font-weight: 500;
    opacity: 0.72;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.pill.pro {
    background: rgba(62, 224, 198, 0.12);
    border-color: rgba(62, 224, 198, 0.3);
    color: #9ff6e6;
}
html[dir="rtl"] .pill { justify-items: start; text-align: left; }

.hero {
    padding: 22px 20px 20px;
    border-radius: 28px;
    background:
        radial-gradient(120% 90% at 100% 0%, rgba(139, 124, 255, 0.28), transparent 55%),
        linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.03));
    border: 1px solid var(--line);
    margin-bottom: 22px;
    overflow: visible;
}
.hero-line {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
}
.delta {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0;
    white-space: nowrap;
    color: var(--muted);
}
.delta.up { color: var(--in); }
.delta.down { color: var(--out); }
.money {
    margin: 10px 0 8px;
    padding: 2px 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: clamp(30px, 8.4vw, 42px);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.35;
    overflow: visible;
    color: var(--text);
    transition: color 0.35s ease;
}
.money.up, .usd.up { color: var(--in); }
.money.down, .usd.down { color: var(--out); }
.usd {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.35;
    transition: color 0.35s ease;
}
.muted { color: var(--muted); margin: 0; font-size: 13px; line-height: 1.45; }
#heroSub.tap { cursor: pointer; color: #9ff6e6; }

.stage { overflow: hidden; }
.view { display: none; }
.view.is-on { display: block; }
.view.in-next {
    animation: pane-next 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
.view.in-prev {
    animation: pane-prev 0.38s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pane-next {
    from { opacity: 0; transform: translateX(32px); }
    to { opacity: 1; transform: none; }
}
@keyframes pane-prev {
    from { opacity: 0; transform: translateX(-32px); }
    to { opacity: 1; transform: none; }
}
html[dir="rtl"] .view.in-next { animation-name: pane-prev; }
html[dir="rtl"] .view.in-prev { animation-name: pane-next; }

.section-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 0 4px 10px;
}
.section-row h2, .card h2 { margin: 0; font-size: 16px; }
.count {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 12px;
    color: var(--muted);
}

.list { display: grid; gap: 10px; }
.card, .row {
    border: 1px solid var(--line);
    background: var(--card);
    border-radius: var(--radius);
}
.row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
}
.card { padding: 16px; }
.card.soft { margin-bottom: 12px; }
.card.link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
    text-decoration: none;
}
.chev { color: var(--muted); font-size: 13px; }

.icon {
    width: 40px;
    height: 40px;
    object-fit: contain;
    background: none;
    padding: 0;
    border-radius: 0;
}
.row-main { flex: 1; min-width: 0; }
.row-title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.row-sub {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 12px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
}
.row-right { text-align: right; }
.usd {
    margin: 0;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 14px;
    font-weight: 600;
}
.tag {
    display: inline-flex;
    margin-top: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: 0.04em;
    color: var(--muted);
    border: 1px solid var(--line);
}

.empty {
    padding: 28px 12px;
    text-align: center;
}
.empty p:first-child { margin: 0 0 6px; font-weight: 600; }

.alert-in .usd { color: var(--in); }
.alert-out .usd { color: var(--out); }
.alert-watch .usd { color: var(--warn); }

.modes {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.chip {
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 600;
}
.chip.on {
    color: #05060a;
    background: #d7d3ff;
    border-color: transparent;
}

.dock {
    position: fixed;
    left: calc(12px + var(--safe-l));
    right: calc(12px + var(--safe-r));
    bottom: calc(10px + var(--safe-b));
    width: auto;
    max-width: 520px;
    margin: 0 auto;
    position: fixed;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 6px;
    border-radius: 22px;
    background: rgba(10, 12, 18, 0.78);
    border: 1px solid var(--line);
    backdrop-filter: blur(18px);
    z-index: 5;
}
.dock-dot {
    position: absolute;
    top: 6px;
    bottom: 6px;
    left: 6px;
    width: calc((100% - 12px - 18px) / 4);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.08);
    transform: translateX(0);
    transition: transform 0.34s cubic-bezier(0.22, 1, 0.36, 1);
    pointer-events: none;
}
.tab {
    position: relative;
    z-index: 1;
    border: 0;
    background: transparent;
    color: var(--muted);
    border-radius: 16px;
    padding: 8px 4px 6px;
    display: grid;
    justify-items: center;
    gap: 2px;
    font-size: 11px;
    font-weight: 600;
    transition: color 0.25s ease;
}
.tab svg { width: 20px; height: 20px; }
.tab.on {
    color: var(--text);
    background: transparent;
}

html[dir="rtl"] .row-right { text-align: left; }
html[dir="rtl"] .top { flex-direction: row-reverse; }

.ptr {
    height: 52px;
    margin-top: -52px;
    display: grid;
    place-items: center;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, 0, 0);
    will-change: transform;
}
.ptr.on {
    opacity: 1;
    visibility: visible;
}
.ptr-ring {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2.5px solid rgba(255,255,255,0.18);
    border-top-color: #8b7cff;
}
.ptr.ready .ptr-ring { border-top-color: #3ee0c6; }
.ptr.spin .ptr-ring { animation: ptr-spin 0.55s linear infinite; }
@keyframes ptr-spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.more {
    display: block;
    width: 100%;
    margin-top: 10px;
    min-height: 44px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--muted);
    font-weight: 600;
}
.more.busy { opacity: 0.45; }

.pro-now {
    padding: 20px 18px 18px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background:
        radial-gradient(90% 120% at 100% -10%, rgba(139, 124, 255, 0.38), transparent 50%),
        radial-gradient(80% 80% at 0% 120%, rgba(62, 224, 198, 0.16), transparent 45%),
        linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.02));
    margin-bottom: 22px;
}
.pro-now h2 {
    margin: 0 0 4px;
    font-size: 28px;
    text-transform: capitalize;
}
.pro-step {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 2px 10px;
    color: var(--muted);
    font-size: 13px;
}
.pro-step span {
    width: 28px;
    height: 28px;
    border-radius: 9px;
    display: grid;
    place-items: center;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 11px;
    font-weight: 600;
    color: #cfc8ff;
    background: rgba(139, 124, 255, 0.16);
    border: 1px solid rgba(139, 124, 255, 0.28);
}
.pro-step b { color: var(--text); font-weight: 700; }
.pro-picks {
    display: grid;
    grid-template-columns: 1fr 1.15fr 1fr;
    gap: 8px;
    margin-bottom: 14px;
}
.pro-pick {
    position: relative;
    min-height: 92px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
    padding: 14px 10px 12px;
    display: grid;
    align-content: end;
    gap: 2px;
    text-align: left;
}
.pro-pick em {
    font-style: normal;
    font-size: 13px;
    color: var(--muted);
}
.pro-pick strong {
    font-size: 18px;
    font-weight: 800;
}
.pro-pick i {
    position: absolute;
    top: 8px;
    right: 8px;
    font-style: normal;
    font-size: 9px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 3px 6px;
    border-radius: 999px;
    background: #8b7cff;
    color: #fff;
}
.pro-pick.on {
    border-color: transparent;
    background: linear-gradient(160deg, #8b7cff, #5b4dff);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(91, 77, 255, 0.35);
}
.pro-pick.on em { color: rgba(255,255,255,0.78); }
.pro-pick.ult.on {
    background: linear-gradient(160deg, #3ee0c6, #1aa89a);
    box-shadow: 0 12px 28px rgba(62, 224, 198, 0.28);
}
.pro-desc {
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 16px 16px 8px;
    background: rgba(255,255,255,0.03);
    margin-bottom: 22px;
}
.pro-desc h3 { margin: 0 0 10px; font-size: 18px; }
.pro-desc ul {
    margin: 0;
    padding: 0;
    list-style: none;
}
.pro-desc li {
    position: relative;
    padding: 8px 0 8px 26px;
    border-top: 1px solid var(--line);
    font-size: 13px;
    line-height: 1.45;
}
.pro-desc li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background:
        linear-gradient(#3ee0c6, #3ee0c6) center/8px 8px no-repeat,
        rgba(62, 224, 198, 0.18);
}
html[dir="rtl"] .pro-desc li { padding: 8px 26px 8px 0; }
html[dir="rtl"] .pro-desc li::before { left: auto; right: 0; }
html[dir="rtl"] .pro-pick { text-align: right; }
.pro-durs, .pro-nets {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 8px;
    margin-bottom: 18px;
}
.pro-nets { grid-template-columns: 1fr 1fr; }
.pro-dur, .pro-net {
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.03);
    border-radius: 18px;
    min-height: 72px;
    padding: 10px;
    display: grid;
    align-content: center;
    gap: 2px;
}
.pro-dur b, .pro-net b { font-size: 14px; }
.pro-dur span, .pro-net span { color: var(--muted); font-size: 12px; }
.pro-dur.on, .pro-net.on {
    border-color: rgba(139, 124, 255, 0.55);
    background: rgba(139, 124, 255, 0.16);
}
.pro-go {
    width: 100%;
    min-height: 52px;
    border: 0;
    border-radius: 16px;
    font-weight: 800;
    font-size: 15px;
    color: #05060a;
    background: linear-gradient(135deg, #f4f6ff, #cfc8ff);
    margin-bottom: 12px;
}
.pro-go:disabled { opacity: 0.4; }
.pay-note {
    border-radius: 22px;
    padding: 16px 16px 14px;
    margin: 0 0 18px;
    background: rgba(255, 64, 80, 0.12);
    border: 1px solid rgba(255, 86, 98, 0.5);
}
.pay-note-kicker {
    margin: 0 0 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ff8b93;
}
.pay-note ul {
    margin: 0;
    padding: 0 0 0 18px;
}
.pay-note li {
    margin: 0 0 8px;
    font-size: 13px;
    line-height: 1.5;
    color: #f6c9cd;
}
.pay-note li:last-child { margin-bottom: 0; }
html[dir="rtl"] .pay-note ul { padding: 0 18px 0 0; }
.pending-pill {
    display: inline-block;
    margin: 10px 0 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #ffd48a;
    background: rgba(255, 176, 32, 0.16);
    border: 1px solid rgba(255, 176, 32, 0.35);
}
.hash-card {
    scroll-margin-top: 12px;
    border-radius: 22px;
    padding: 18px 16px 16px;
    margin: 8px 0 28px;
    border: 1px solid rgba(255, 86, 98, 0.5);
    background: rgba(255, 64, 80, 0.12);
}
.hash-card h2 {
    margin: 0 0 8px;
    font-size: 20px;
    line-height: 1.25;
}
.hash-card input,
.hash-box input,
#hashIn,
#renameInput {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    min-height: 48px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #0b0d13;
    color: inherit;
    padding: 0 12px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 13px;
    margin: 12px 0 10px;
}
.hash-card input:disabled { opacity: 0.55; }
.hash-send {
    width: 100%;
    min-height: 48px;
    border: 0;
    border-radius: 14px;
    font-weight: 700;
    background: linear-gradient(135deg, #ff6b78, #d9485f);
    color: #fff;
}
.hash-send:disabled { opacity: 0.4; }
.hash-msg { margin: 10px 0 0; }
.pro-invoice {
    position: relative;
    scroll-margin-top: 12px;
    border-radius: 22px;
    padding: 18px 16px 16px;
    margin-bottom: 16px;
    background:
        linear-gradient(180deg, rgba(62, 224, 198, 0.12), rgba(255,255,255,0.03));
    border: 1px dashed rgba(62, 224, 198, 0.4);
}
.pro-invoice .pending-pill {
    position: absolute;
    top: 12px;
    right: 12px;
    margin: 0;
}
.pro-invoice .eyebrow { padding-right: 86px; }
.pro-invoice .amt {
    margin: 6px 0 8px;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 30px;
    font-weight: 600;
}
.sub-addr {
    margin: 10px 0 12px;
    padding: 12px;
    border-radius: 14px;
    background: #0b0d13;
    border: 1px solid var(--line);
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 12px;
    word-break: break-all;
}
.sub-copy {
    width: 100%;
    min-height: 46px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, #8b7cff, #5b4dff);
    font-weight: 700;
}
.cart {
    margin: 8px 0 8px;
    padding: 20px 16px 16px;
    border-radius: 24px;
    border: 1px dashed rgba(255,255,255,0.16);
    background: rgba(255,255,255,0.025);
}
.cart h2 { margin: 4px 0 6px; font-size: 18px; }
.cart-row {
    display: grid;
    grid-template-columns: 52px 1fr 52px;
    gap: 10px;
    align-items: center;
    margin: 14px 0 8px;
}
.cart-qty {
    height: 52px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255,255,255,0.04);
    font-size: 22px;
    font-weight: 700;
}
.cart-mid { text-align: center; }
.cart-mid b { display: block; font-size: 22px; }
.cart-mid span { color: var(--muted); font-size: 12px; }
.cart-total {
    margin: 0 0 12px;
    text-align: center;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 20px;
    font-weight: 600;
}
.cart .pro-nets { margin: 0 0 12px; }
.pro-addon-btn {
    width: 100%;
    min-height: 46px;
    border-radius: 14px;
    border: 0;
    background: rgba(255,255,255,0.1);
    font-weight: 700;
}
.support-card {
    padding: 22px 18px 20px;
    border-radius: 26px;
    border: 1px solid var(--line);
    background:
        radial-gradient(90% 80% at 100% 0%, rgba(139, 124, 255, 0.24), transparent 50%),
        linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
}
.support-card h2 { margin: 0 0 8px; font-size: 26px; }
.support-card .btn { margin: 18px 0 10px; }
.support-card #supportHandle { text-align: center; }
.row.tap { cursor: pointer; }

.sheet {
    position: fixed;
    inset: 0;
    z-index: 20;
    background: rgba(0, 0, 0, 0.45);
    display: grid;
    align-items: end;
    padding: 16px 16px calc(20px + var(--safe-b));
}
.sheet-card {
    width: min(480px, 100%);
    margin: 0 auto;
    background: #12141c;
    border: 1px solid var(--line);
    border-radius: 24px 24px 18px 18px;
    padding: 20px 18px 16px;
    animation: sheet-up 0.28s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes sheet-up {
    from { transform: translateY(24px); opacity: 0; }
    to { transform: none; opacity: 1; }
}
.sheet-card h2 { margin: 0 0 6px; font-size: 18px; }
.sheet-card input {
    width: 100%;
    margin: 14px 0 16px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #0b0d13;
    color: var(--text);
    font: inherit;
}
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.sheet-actions button {
    border: 1px solid var(--line);
    background: transparent;
    border-radius: 14px;
    min-height: 44px;
    font-weight: 600;
}
.sheet-actions .ok {
    background: linear-gradient(135deg, #8b7cff, #5b4dff);
    border-color: transparent;
}
