:root {
    --ink: #17171a;
    --muted: #77777e;
    --line: #e8e8eb;
    --soft: #f2f2f4;
    --soft-2: #f7f7f8;
    --orange: #ff9800;
    --blue: #1717f5;
    --green: #11a85b;
    --red: #c31d22;
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --app-width: 520px;
    color-scheme: light;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, Arial, sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
    background: #e9eaee;
    color: var(--ink);
    overscroll-behavior: none;
}

body {
    min-height: 100dvh;
}

button,
input {
    font: inherit;
}

button {
    border: 0;
}

svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.is-hidden {
    display: none !important;
}

.app-stage {
    position: relative;
    width: min(100%, var(--app-width));
    min-height: 100dvh;
    margin: 0 auto;
    background: #fff;
    overflow: hidden;
}

.splash-screen,
.login-screen,
.wallet-screen {
    position: absolute;
    inset: 0;
    min-height: 100dvh;
    background: #fff;
}

.splash-screen {
    z-index: 40;
    display: grid;
    place-items: center;
    overflow: hidden;
}

.splash-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #fff;
}

.splash-fallback {
    position: relative;
    display: grid;
    place-items: center;
    gap: 22px;
}

.splash-video:not([data-failed]) + .splash-fallback {
    opacity: 0;
}

.splash-logo {
    position: relative;
    z-index: 2;
    width: 94px;
    height: 94px;
    border-radius: 25px;
    box-shadow: 0 26px 60px rgba(255, 152, 0, .25);
    animation: splash-breathe 1.7s ease-in-out infinite;
}

.splash-fallback p {
    position: relative;
    z-index: 2;
    margin: 0;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: .22em;
}

.splash-orbit {
    position: absolute;
    border: 1px solid rgba(38, 38, 245, .12);
    border-radius: 999px;
    animation: orbit-spin 7s linear infinite;
}

.splash-orbit-one {
    width: 270px;
    height: 270px;
}

.splash-orbit-two {
    width: 390px;
    height: 390px;
    border-color: rgba(255, 152, 0, .12);
    animation-direction: reverse;
}

.splash-status {
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: calc(38px + var(--safe-bottom));
    margin: 0;
    text-align: center;
    color: #8b8b91;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .02em;
}

@keyframes splash-breathe {
    0%,
    100% { transform: scale(.96); }
    50% { transform: scale(1.04); }
}

@keyframes orbit-spin {
    to { transform: rotate(360deg); }
}

.login-screen {
    z-index: 20;
    overflow: auto;
    padding: calc(36px + var(--safe-top)) 22px calc(26px + var(--safe-bottom));
    isolation: isolate;
}

.login-glow {
    position: absolute;
    z-index: -1;
    border-radius: 50%;
    filter: blur(4px);
    pointer-events: none;
}

.login-glow-one {
    top: -180px;
    right: -170px;
    width: 390px;
    height: 390px;
    background: radial-gradient(circle, rgba(73, 73, 255, .14), rgba(73, 73, 255, 0) 70%);
}

.login-glow-two {
    bottom: -120px;
    left: -140px;
    width: 340px;
    height: 340px;
    background: radial-gradient(circle, rgba(255, 152, 0, .13), rgba(255, 152, 0, 0) 70%);
}

.login-content {
    width: 100%;
    max-width: 430px;
    min-height: calc(100dvh - 62px - var(--safe-top) - var(--safe-bottom));
    margin: 0 auto;
    display: flex;
    flex-direction: column;
}

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

.login-brand img {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(255, 152, 0, .18);
}

.login-brand span {
    font-size: 11px;
    font-weight: 850;
    letter-spacing: .18em;
}

.login-copy {
    margin-top: clamp(62px, 13vh, 118px);
}

.eyebrow {
    margin: 0 0 14px;
    color: #74747c;
    font-size: 10px;
    font-weight: 850;
    letter-spacing: .18em;
}

.login-copy h1 {
    margin: 0;
    font-size: clamp(41px, 10.5vw, 55px);
    line-height: .98;
    letter-spacing: -.055em;
    font-weight: 820;
}

.login-copy > p:last-child {
    max-width: 355px;
    margin: 22px 0 0;
    color: #68686f;
    font-size: 15px;
    line-height: 1.55;
}

.login-card {
    margin-top: 44px;
}

.login-card > label {
    display: block;
    margin: 0 0 10px 3px;
    color: #4f4f55;
    font-size: 13px;
    font-weight: 700;
}

.password-field {
    height: 62px;
    display: grid;
    grid-template-columns: 25px 1fr 42px;
    align-items: center;
    gap: 12px;
    padding: 0 10px 0 18px;
    border: 1.5px solid #dedee3;
    border-radius: 21px;
    background: rgba(255, 255, 255, .78);
    box-shadow: 0 8px 30px rgba(25, 25, 35, .04);
    transition: border-color .18s ease, box-shadow .18s ease;
}

.password-field:focus-within {
    border-color: #6464f8;
    box-shadow: 0 0 0 4px rgba(23, 23, 245, .08);
}

.password-field > svg {
    color: #777780;
}

.password-field input {
    min-width: 0;
    height: 100%;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--ink);
    font-size: 16px;
    font-weight: 600;
}

.password-field input::placeholder {
    color: #aaaab0;
    font-weight: 500;
}

.reveal-password {
    width: 42px;
    height: 42px;
    padding: 10px;
    border-radius: 14px;
    background: transparent;
    color: #777780;
}

.form-message {
    min-height: 19px;
    margin: 9px 4px 5px;
    color: var(--red);
    font-size: 12px;
    font-weight: 600;
}

.unlock-button {
    width: 100%;
    height: 62px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 21px;
    background: var(--ink);
    color: #fff;
    font-weight: 750;
    box-shadow: 0 14px 30px rgba(23, 23, 26, .2);
    cursor: pointer;
}

.unlock-button svg {
    width: 20px;
    height: 20px;
}

.unlock-button:disabled {
    opacity: .62;
}

.unlock-button.is-loading svg {
    animation: button-spin .8s linear infinite;
}

@keyframes button-spin {
    to { transform: rotate(360deg); }
}

.privacy-note {
    margin-top: auto;
    padding-top: 44px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    color: #77777d;
}

.privacy-note svg {
    width: 25px;
    height: 25px;
}

.privacy-note p {
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.privacy-note strong {
    color: #4d4d53;
    font-size: 12px;
}

.privacy-note span {
    font-size: 10px;
}

.wallet-screen {
    z-index: 10;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wallet-scroll {
    flex: 1;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    scrollbar-width: none;
    padding: calc(22px + var(--safe-top)) 20px calc(118px + var(--safe-bottom));
}

.wallet-scroll::-webkit-scrollbar {
    display: none;
}

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

.wallet-identity {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 7px 16px 7px 8px;
    border-radius: 999px;
    background: #f0f0f2;
}

.wallet-mark {
    width: 43px;
    height: 43px;
    flex: 0 0 43px;
    display: grid;
    place-items: center;
    padding: 10px;
    border-radius: 50%;
    background: var(--orange);
    color: #fff;
}

.wallet-identity > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wallet-identity strong {
    max-width: 180px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 17px;
    letter-spacing: -.015em;
}

.wallet-identity small {
    color: #85858b;
    font-size: 10px;
    font-weight: 650;
}

.header-actions {
    display: flex;
    gap: 9px;
}

.round-control {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 13px;
    border-radius: 50%;
    background: #f0f0f2;
    color: #252529;
}

.exit-control {
    cursor: pointer;
}

.read-only-banner {
    margin-top: 23px;
    min-height: 72px;
    display: grid;
    grid-template-columns: 18px 48px 1fr;
    align-items: center;
    gap: 10px;
    padding: 11px 14px 11px 10px;
    border: 1.2px solid #dedee1;
    border-radius: 22px;
}

.info-mark {
    color: #8e8e93;
    font-size: 24px;
    font-weight: 800;
    text-align: center;
}

.banner-icon {
    width: 48px;
    height: 48px;
    display: grid;
    place-items: center;
    padding: 12px;
    border-radius: 16px;
    background: #f0f0f2;
}

.read-only-banner > span:last-child {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.read-only-banner strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 16px;
    letter-spacing: -.015em;
}

.read-only-banner small {
    color: #77777d;
    font-size: 12px;
}

.balance-section {
    margin-top: 31px;
}

.balance-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.live-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 9px;
    border-radius: 999px;
    background: #edf9f2;
    color: #13874d;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.live-chip i {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #1ab163;
    box-shadow: 0 0 0 3px rgba(26, 177, 99, .12);
}

.live-chip.is-demo {
    background: #fff6e6;
    color: #9f6200;
}

.live-chip.is-demo i {
    background: var(--orange);
    box-shadow: 0 0 0 3px rgba(255, 152, 0, .12);
}

.privacy-toggle {
    width: 38px;
    height: 38px;
    padding: 9px;
    border-radius: 50%;
    background: transparent;
    color: #77777d;
}

.total-balance {
    margin: 8px 0 0;
    font-size: clamp(56px, 16vw, 76px);
    line-height: 1;
    font-weight: 820;
    letter-spacing: -.06em;
    white-space: nowrap;
}

.daily-change {
    margin: 15px 0 0;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 19px;
    font-weight: 720;
}

.daily-change.positive {
    color: var(--green);
}

.daily-change.negative {
    color: var(--red);
}

.change-arrow {
    width: 0;
    height: 0;
    border-left: 7px solid transparent;
    border-right: 7px solid transparent;
    border-bottom: 9px solid currentColor;
}

.daily-change.negative .change-arrow {
    transform: rotate(180deg);
}

.updated-label {
    margin: 8px 0 0;
    color: #aaaab0;
    font-size: 10px;
    font-weight: 600;
}

.quick-actions {
    margin-top: 42px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
}

.quick-action {
    min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.quick-action button {
    width: 100%;
    aspect-ratio: 1.3;
    display: grid;
    place-items: center;
    padding: 22%;
    border-radius: 22px;
    background: #f0f0f2;
    color: #202024;
    opacity: 1;
}

.quick-action button.primary-action {
    background: var(--blue);
    color: #fff;
}

.quick-action span {
    font-size: 14px;
    font-weight: 710;
}

.tokens-section {
    margin-top: 47px;
}

.tokens-heading-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tokens-heading-row h2 {
    margin: 0;
    font-size: 22px;
    letter-spacing: -.025em;
}

.tokens-heading-row h2 span {
    display: inline-block;
    margin-left: 4px;
    font-size: 30px;
    line-height: 0;
    vertical-align: -2px;
}

.token-count {
    color: #9a9aa0;
    font-size: 11px;
    font-weight: 650;
}

.token-list {
    margin-top: 18px;
}

.token-row {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    min-height: 79px;
}

.token-logo-wrap {
    position: relative;
    width: 52px;
    height: 52px;
}

.token-logo {
    width: 52px;
    height: 52px;
    object-fit: contain;
}

.network-badge {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 20px;
    height: 20px;
    display: grid;
    place-items: center;
    padding: 3px;
    border: 2px solid #fff;
    border-radius: 7px;
    background: #6686e9;
}

.network-badge img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.token-main,
.token-values {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.token-main strong {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 18px;
    letter-spacing: -.02em;
}

.token-main span,
.token-values span {
    color: #7f7f85;
    font-size: 14px;
    font-weight: 520;
}

.token-values {
    align-items: flex-end;
    padding-left: 9px;
}

.token-values strong {
    font-size: 18px;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.token-values span {
    white-space: nowrap;
}

.token-values span.positive {
    color: var(--green);
}

.token-values span.negative {
    color: var(--red);
}

.token-skeleton {
    height: 79px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 26px 39px, #eeeeef 0 25px, transparent 26px),
        linear-gradient(90deg, transparent 66px, #eeeeef 66px 55%, transparent 55%);
    animation: skeleton-pulse 1.4s ease-in-out infinite;
}

@keyframes skeleton-pulse {
    50% { opacity: .48; }
}

.preview-disclaimer {
    margin: 25px auto 0;
    max-width: 300px;
    color: #aaaab0;
    text-align: center;
    font-size: 10px;
    line-height: 1.45;
}

.bottom-nav {
    position: absolute;
    z-index: 5;
    left: 14px;
    right: 14px;
    bottom: calc(10px + var(--safe-bottom));
    height: 76px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    align-items: center;
    padding: 7px;
    border: 1px solid rgba(225, 225, 229, .92);
    border-radius: 28px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 10px 35px rgba(20, 20, 30, .08);
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
}

.nav-item {
    height: 62px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border-radius: 21px;
    color: #73737a;
}

.nav-item.active {
    background: #eeeeef;
    color: #222226;
}

.nav-icon {
    width: 26px;
    height: 26px;
}

.nav-item small {
    font-size: 9px;
    font-weight: 700;
}

.privacy-mode .value-sensitive,
.privacy-mode .token-values,
.privacy-mode .token-main span {
    filter: blur(10px);
    user-select: none;
}

.sheet-backdrop {
    position: fixed;
    z-index: 70;
    inset: 0;
    background: rgba(22, 22, 27, .28);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
}

.install-sheet {
    position: fixed;
    z-index: 80;
    left: 50%;
    bottom: 0;
    width: min(100%, var(--app-width));
    transform: translateX(-50%);
    padding: 14px 24px calc(24px + var(--safe-bottom));
    border-radius: 30px 30px 0 0;
    background: #fff;
    box-shadow: 0 -20px 50px rgba(25, 25, 35, .13);
}

.sheet-grabber {
    width: 42px;
    height: 5px;
    margin: 0 auto 20px;
    border-radius: 999px;
    background: #d8d8dc;
}

.sheet-close {
    position: absolute;
    top: 22px;
    right: 20px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f1f3;
    color: #55555c;
    font-size: 25px;
    line-height: 1;
}

.install-sheet > img {
    display: block;
    margin-bottom: 20px;
    border-radius: 18px;
}

.install-sheet h2 {
    max-width: 350px;
    margin: 0;
    font-size: 29px;
    line-height: 1.05;
    letter-spacing: -.04em;
}

.install-sheet > p:not(.eyebrow) {
    margin: 13px 0 22px;
    color: #6d6d74;
    font-size: 14px;
    line-height: 1.5;
}

.ios-install-steps {
    display: flex;
    flex-direction: column;
    gap: 9px;
    margin: 0 0 20px;
    padding: 15px 17px;
    border-radius: 17px;
    background: #f4f4f6;
    color: #55555c;
    font-size: 13px;
}

.install-button,
.install-later {
    width: 100%;
    height: 56px;
    border-radius: 18px;
    font-weight: 750;
}

.install-button {
    background: var(--blue);
    color: #fff;
}

.install-later {
    margin-top: 7px;
    background: transparent;
    color: #77777d;
}

.toast {
    position: fixed;
    z-index: 100;
    left: 50%;
    bottom: calc(24px + var(--safe-bottom));
    max-width: min(360px, calc(100% - 40px));
    transform: translate(-50%, 24px);
    padding: 12px 16px;
    border-radius: 14px;
    background: rgba(24, 24, 28, .92);
    color: #fff;
    font-size: 12px;
    font-weight: 650;
    text-align: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.toast.is-visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (min-width: 560px) {
    body {
        padding: 24px 0;
    }

    .app-stage {
        min-height: calc(100dvh - 48px);
        border-radius: 34px;
        box-shadow: 0 30px 90px rgba(20, 20, 30, .16);
    }

    .splash-screen,
    .login-screen,
    .wallet-screen {
        min-height: calc(100dvh - 48px);
        border-radius: 34px;
    }

    .login-content {
        min-height: calc(100dvh - 110px);
    }
}

@media (max-width: 385px) {
    .wallet-scroll {
        padding-left: 16px;
        padding-right: 16px;
    }

    .wallet-identity strong {
        max-width: 130px;
        font-size: 15px;
    }

    .round-control {
        width: 44px;
        height: 44px;
    }

    .quick-actions {
        gap: 9px;
    }

    .quick-action button {
        border-radius: 19px;
    }

    .token-row {
        grid-template-columns: 49px minmax(0, 1fr) auto;
        gap: 9px;
    }

    .token-logo-wrap,
    .token-logo {
        width: 47px;
        height: 47px;
    }

    .token-main strong,
    .token-values strong {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }

    .splash-video {
        display: none;
    }
}
