:root {
    color-scheme: dark;
    --bg: #0d151d;
    --panel: #16222e;
    --panel-soft: #1d2b38;
    --line: rgba(255, 255, 255, 0.08);
    --text: #f5f8fa;
    --muted: #91a2b2;
    --green: #51b354;
    --green-bright: #66d66a;
    --danger: #ff6b6b;
    --radius: 18px;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background:
        radial-gradient(circle at 80% -10%, rgba(81, 179, 84, 0.16), transparent 34%),
        var(--bg);
    color: var(--text);
    font-family:
        Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
        "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

button {
    color: inherit;
}

.app-shell {
    width: min(100%, 560px);
    min-height: 100vh;
    margin: 0 auto;
    padding:
        max(18px, env(safe-area-inset-top))
        16px
        calc(94px + env(safe-area-inset-bottom));
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
}

.brand {
    color: var(--green-bright);
    font-size: 21px;
    font-weight: 900;
    letter-spacing: 0.1em;
}

.subtitle {
    margin-top: 3px;
    color: var(--muted);
    font-size: 14px;
}

.icon-button,
.back-button {
    border: 1px solid var(--line);
    border-radius: 13px;
    background: var(--panel);
    cursor: pointer;
}

.icon-button {
    width: 48px;
    height: 42px;
    font-weight: 800;
}

.view {
    display: none;
    animation: appear 0.18s ease-out;
}

.view.active {
    display: block;
}

@keyframes appear {
    from {
        opacity: 0;
        transform: translateY(5px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.profile-card,
.hero-card,
.form-card,
.settings-card,
.security-card,
.request-item {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(150deg, var(--panel-soft), var(--panel));
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.profile-card {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 15px;
}

.avatar {
    display: grid;
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    place-items: center;
    border-radius: 15px;
    background: linear-gradient(135deg, var(--green-bright), #2c8f46);
    color: #07120b;
    font-weight: 900;
}

.profile-copy {
    min-width: 0;
    flex: 1;
}

.profile-name {
    overflow: hidden;
    font-size: 16px;
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-id {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.verified-mark {
    display: grid;
    width: 27px;
    height: 27px;
    place-items: center;
    border-radius: 50%;
    background: rgba(81, 179, 84, 0.18);
    color: var(--green-bright);
    font-weight: 900;
}

.hero-card {
    margin-top: 14px;
    padding: 20px;
    background:
        radial-gradient(circle at 90% 0%, rgba(102, 214, 106, 0.24), transparent 36%),
        linear-gradient(150deg, #1e3235, #17232d);
}

.hero-label,
.hero-note {
    color: var(--muted);
}

.hero-value {
    margin: 7px 0;
    font-size: 42px;
    font-weight: 900;
    line-height: 1;
}

.hero-note {
    max-width: 350px;
    font-size: 13px;
    line-height: 1.5;
}

.primary-button {
    width: 100%;
    min-height: 50px;
    margin-top: 17px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--green-bright), var(--green));
    color: #07120b;
    cursor: pointer;
    font-weight: 900;
}

.primary-button:disabled {
    cursor: wait;
    opacity: 0.6;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 5px;
    font-size: 24px;
}

h2 {
    margin: 24px 2px 12px;
    font-size: 17px;
}

.section-heading {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.section-heading p {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.5;
}

.back-button {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
}

.form-card,
.settings-card,
.security-card {
    padding: 17px;
}

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

label {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 13px;
}

input,
select {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--line);
    border-radius: 13px;
    outline: none;
    background: #101a23;
    color: var(--text);
    padding: 0 14px;
}

input:focus,
select:focus {
    border-color: rgba(102, 214, 106, 0.72);
}

.swap-button {
    width: 46px;
    height: 38px;
    margin: -4px auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel-soft);
    color: var(--green-bright);
    cursor: pointer;
    font-size: 20px;
}

.notice-box,
.security-card {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.55;
}

.notice-box {
    padding: 12px;
    border: 1px solid rgba(102, 214, 106, 0.16);
    border-radius: 12px;
    background: rgba(81, 179, 84, 0.08);
}

.request-list {
    display: grid;
    gap: 10px;
}

.request-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 15px;
}

.request-route {
    font-size: 15px;
    font-weight: 850;
}

.request-meta {
    margin-top: 5px;
    color: var(--muted);
    font-size: 12px;
}

.status {
    align-self: start;
    padding: 6px 9px;
    border-radius: 99px;
    background: rgba(255, 193, 7, 0.12);
    color: #ffd166;
    font-size: 11px;
    font-weight: 800;
}

.empty-state {
    padding: 24px 14px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
}

.setting-row:first-child {
    padding-top: 0;
}

.setting-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

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

.setting-row strong,
.setting-row a {
    max-width: 58%;
    overflow: hidden;
    color: var(--text);
    text-decoration: none;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.security-card {
    margin-top: 13px;
}

.security-card strong {
    color: var(--green-bright);
}

.security-card p {
    margin: 7px 0 0;
}

.bottom-nav {
    position: fixed;
    z-index: 10;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: min(100%, 560px);
    margin: 0 auto;
    padding:
        9px 10px
        max(10px, env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(13, 21, 29, 0.94);
    backdrop-filter: blur(18px);
}

.nav-button {
    display: grid;
    gap: 3px;
    place-items: center;
    min-height: 52px;
    border: 0;
    border-radius: 13px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
}

.nav-button span {
    font-size: 20px;
}

.nav-button.active {
    background: rgba(81, 179, 84, 0.1);
    color: var(--green-bright);
}

.toast {
    position: fixed;
    z-index: 30;
    right: 18px;
    bottom: calc(86px + env(safe-area-inset-bottom));
    left: 18px;
    max-width: 520px;
    margin: 0 auto;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #223240;
    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: 0.2s ease;
}

.toast.visible {
    opacity: 1;
    transform: translateY(0);
}

.toast.error {
    border-color: rgba(255, 107, 107, 0.4);
    color: #ffc1c1;
}

@media (min-width: 520px) {
    .app-shell {
        padding-right: 22px;
        padding-left: 22px;
    }
}


/* PIN protection bottom sheet */
:root {
    --security-accent: #66d66a;
    --security-accent-dark: #51b354;
    --security-panel: #0f1721;
    --security-panel-2: #14212d;
    --security-soft: rgba(102, 214, 106, 0.10);
    --security-soft-2: rgba(81, 179, 84, 0.18);
}

body.modal-open {
    overflow: hidden;
}

.security-overlay {
    position: fixed;
    z-index: 100;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding-top: 40px;
    background: rgba(2, 8, 14, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.24s ease;
    backdrop-filter: blur(6px);
}

.security-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.security-sheet {
    width: min(100%, 560px);
    max-height: calc(100vh - 24px);
    overflow-y: auto;
    padding:
        8px 19px
        max(28px, calc(20px + env(safe-area-inset-bottom)));
    border: 1px solid rgba(102, 214, 106, 0.10);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background:
        radial-gradient(circle at 50% 0%, rgba(102, 214, 106, 0.12), transparent 36%),
        linear-gradient(180deg, var(--security-panel-2), var(--security-panel));
    box-shadow: 0 -26px 70px rgba(0, 0, 0, 0.52);
    transform: translateY(105%);
    transition: transform 0.3s cubic-bezier(0.2, 0.78, 0.2, 1);
}

.security-overlay.visible .security-sheet {
    transform: translateY(0);
}

.sheet-handle {
    width: 38px;
    height: 4px;
    margin: 0 auto 12px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.16);
}

.security-step {
    text-align: center;
}

.security-step[hidden] {
    display: none;
}

.shield-orbit {
    display: grid;
    width: 94px;
    height: 94px;
    margin: 3px auto 14px;
    place-items: center;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(102, 214, 106, 0.20), rgba(102, 214, 106, 0.06) 62%, transparent 64%);
    box-shadow:
        0 0 0 13px rgba(81, 179, 84, 0.12),
        0 0 36px rgba(102, 214, 106, 0.16);
}

.shield-orbit.compact {
    width: 78px;
    height: 78px;
}

.shield-icon {
    display: grid;
    width: 47px;
    height: 56px;
    place-items: center;
    background: linear-gradient(135deg, var(--security-accent), var(--security-accent-dark));
    color: #07120b;
    font-size: 26px;
    font-weight: 950;
    clip-path: polygon(50% 0, 91% 17%, 84% 73%, 50% 100%, 16% 73%, 9% 17%);
}

.security-step h2 {
    max-width: 390px;
    margin: 0 auto 16px;
    font-size: clamp(25px, 7vw, 33px);
    line-height: 1.08;
    letter-spacing: -0.03em;
}

.security-step p {
    max-width: 420px;
    margin: 0 auto 21px;
    color: rgba(245, 248, 250, 0.80);
    font-size: 15px;
    font-weight: 650;
    line-height: 1.22;
}

.security-primary-button,
.security-secondary-button {
    width: 100%;
    min-height: 50px;
    border: 0;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 850;
}

.security-primary-button {
    background: linear-gradient(135deg, var(--security-accent), var(--security-accent-dark));
    color: #07120b;
    box-shadow: 0 10px 28px rgba(81, 179, 84, 0.22);
}

.security-secondary-button {
    margin-top: 12px;
    border: 1px solid rgba(102, 214, 106, 0.12);
    background: rgba(102, 214, 106, 0.08);
    color: var(--security-accent);
}

.security-primary-button:disabled {
    cursor: wait;
    opacity: 0.62;
}

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

.pin-input {
    min-height: 58px;
    border: 1px solid rgba(102, 214, 106, 0.28);
    border-radius: 13px;
    background: #101a23;
    color: #07120b;
    text-align: center;
    font-size: 27px;
    font-weight: 900;
    letter-spacing: 0.35em;
}

.pin-input:focus {
    border-color: var(--security-accent);
    box-shadow: 0 0 0 3px rgba(102, 214, 106, 0.14);
}

@media (min-width: 560px) {
    .security-sheet {
        margin-bottom: 16px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        border-radius: 24px;
    }
}



/* Account header + account modal */
.account-header-button {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-height: 56px;
    padding: 4px 2px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
    box-shadow: none;
}

.account-header-avatar {
    position: relative;
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--green-bright), var(--green));
    color: #07120b;
    font-size: 20px;
    font-weight: 900;
}

.account-header-copy {
    display: flex;
    align-items: center;
    gap: 4px;
    min-width: 0;
    flex: 0 1 auto;
}

.account-header-username {
    min-width: 0;
    overflow: hidden;
    font-size: 17px;
    font-weight: 850;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.account-header-arrow {
    flex: 0 0 auto;
    color: var(--green-bright);
    font-size: 18px;
    line-height: 1;
}

.account-overlay {
    position: fixed;
    z-index: 92;
    inset: 0;
    background: rgba(4, 9, 15, 0.70);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(7px);
}

.account-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.account-sheet {
    width: min(100%, 560px);
    min-height: 100vh;
    margin: 0 auto;
    padding:
        max(18px, env(safe-area-inset-top))
        16px
        max(26px, calc(24px + env(safe-area-inset-bottom)));
    background:
        radial-gradient(circle at 80% -10%, rgba(102, 214, 106, 0.10), transparent 30%),
        var(--bg);
    color: var(--text);
    transform: translateX(-16px);
    transition: transform 0.24s ease;
}

.account-overlay.visible .account-sheet {
    transform: translateX(0);
}

.account-sheet-top {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.account-sheet-top h2 {
    margin: 0;
    text-align: center;
    font-size: 18px;
    font-weight: 850;
}

.account-back-button {
    width: 42px;
    height: 42px;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    color: var(--text);
    cursor: pointer;
    font-size: 18px;
}

.account-sheet-spacer {
    width: 42px;
    height: 42px;
}

.account-sheet-content {
    padding-bottom: 16px;
}

.account-group-label {
    margin: 20px 4px 10px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.account-card {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, #20293b, #1a2433);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.16);
}

.account-static-card {
    padding: 15px 16px;
}

.account-card-main {
    font-size: 16px;
    font-weight: 800;
}

.account-row-card {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 72px;
    padding: 12px 14px;
}

.account-row-card.action {
    margin-top: 14px;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.account-row-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 12px;
    background: rgba(102, 214, 106, 0.12);
    color: var(--green-bright);
    font-size: 17px;
    font-weight: 900;
}

.account-row-icon.exit {
    background: rgba(255, 255, 255, 0.08);
    color: #cfd7de;
}

.account-row-copy {
    min-width: 0;
    flex: 1;
}

.account-row-title {
    color: var(--muted);
    font-size: 13px;
}

.account-row-value {
    margin-top: 3px;
    font-size: 16px;
    font-weight: 800;
}

.account-row-action {
    font-size: 17px;
    font-weight: 800;
}

.account-row-arrow {
    color: var(--muted);
    font-size: 22px;
    line-height: 1;
}

.account-delete-button {
    width: 100%;
    margin-top: 28px;
    border: 0;
    background: transparent;
    color: #ff5f5f;
    cursor: pointer;
    font-size: 15px;
    font-weight: 800;
}

@media (max-width: 420px) {
    .account-header-button {
        min-height: 52px;
        padding: 4px 0;
    }

    .account-header-avatar {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
        font-size: 18px;
    }

    .account-header-username {
        font-size: 15px;
    }
}


/* Verified Telegram phone and real Telegram avatar */
.account-header-avatar {
    overflow: hidden;
}

.account-header-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.account-header-avatar.has-photo {
    background: #17222d;
}

.phone-account-row.verified {
    cursor: default;
    border-color: rgba(102, 214, 106, 0.18);
    background:
        radial-gradient(circle at 0 50%, rgba(102, 214, 106, 0.08), transparent 35%),
        linear-gradient(145deg, #202d39, #18242f);
}

.phone-account-row.verified .account-row-icon {
    background: rgba(102, 214, 106, 0.16);
    color: var(--green-bright);
}

.phone-account-row.verified .account-row-arrow {
    color: var(--green-bright);
    font-size: 12px;
    font-weight: 850;
}


/* Profile screen and profile settings */
body.profile-view-open .topbar {
    display: none;
}

#profileView {
    padding-bottom: 14px;
}

.profile-toolbar {
    display: flex;
    justify-content: flex-end;
    min-height: 44px;
}

.profile-settings-button {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: linear-gradient(145deg, #202f3c, #18242f);
    color: var(--text);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.18);
}

.profile-identity {
    display: flex;
    align-items: center;
    flex-direction: column;
    padding: 8px 12px 24px;
    text-align: center;
}

.profile-main-avatar {
    position: relative;
    display: grid;
    width: 82px;
    height: 82px;
    place-items: center;
    overflow: hidden;
    border: 2px solid rgba(102, 214, 106, 0.26);
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-bright), #2c8f46);
    color: #07120b;
    font-size: 31px;
    font-weight: 900;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.profile-main-avatar img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-main-avatar.has-photo {
    background: #17222d;
}

.profile-main-avatar:not(.has-photo) {
    border-color: transparent;
}

.profile-identity h1 {
    max-width: 100%;
    margin: 13px 0 0;
    overflow: hidden;
    font-size: 21px;
    font-weight: 900;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-display-phone {
    margin-top: 4px;
    color: var(--muted);
    font-size: 14px;
}

.profile-summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.profile-summary-card {
    display: flex;
    align-items: flex-start;
    min-height: 128px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background:
        radial-gradient(circle at 90% 0%, rgba(102, 214, 106, 0.12), transparent 43%),
        linear-gradient(150deg, var(--panel-soft), var(--panel));
    color: var(--text);
    cursor: pointer;
    flex-direction: column;
    text-align: left;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.14);
}

.profile-summary-icon {
    display: grid;
    width: 36px;
    height: 36px;
    margin-bottom: 13px;
    place-items: center;
    border-radius: 12px;
    background: rgba(102, 214, 106, 0.13);
    color: var(--green-bright);
    font-size: 19px;
    font-weight: 900;
}

.profile-summary-icon.verified {
    border-radius: 50%;
    background: rgba(102, 214, 106, 0.19);
}

.profile-summary-card strong {
    font-size: 15px;
    line-height: 1.25;
}

.profile-summary-card small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 13px;
}

.profile-menu-group {
    overflow: hidden;
    margin-top: 14px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background: linear-gradient(145deg, #1c2936, #17232e);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.13);
}

.profile-menu-row {
    position: relative;
    display: flex;
    width: 100%;
    min-height: 64px;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.profile-menu-row + .profile-menu-row::before {
    position: absolute;
    top: 0;
    right: 14px;
    left: 58px;
    height: 1px;
    background: var(--line);
    content: "";
}

.profile-menu-icon {
    display: grid;
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    place-items: center;
    border-radius: 11px;
    background: rgba(102, 214, 106, 0.12);
    color: var(--green-bright);
    font-size: 15px;
    font-weight: 900;
}

.profile-menu-icon.exit {
    background: rgba(255, 255, 255, 0.07);
    color: #d7dee5;
}

.profile-menu-copy {
    min-width: 0;
    flex: 1;
}

.profile-menu-copy strong {
    display: block;
    font-size: 15px;
    font-weight: 820;
}

.profile-menu-copy small {
    display: block;
    margin-top: 3px;
    overflow: hidden;
    color: var(--muted);
    font-size: 12px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu-value {
    max-width: 38%;
    overflow: hidden;
    color: var(--muted);
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.profile-menu-arrow {
    flex: 0 0 auto;
    color: var(--muted);
    font-size: 21px;
    line-height: 1;
}

.profile-logout-group {
    margin-top: 18px;
}

.profile-logout-row {
    min-height: 60px;
}

.profile-settings-overlay {
    position: fixed;
    z-index: 96;
    inset: 0;
    overflow-y: auto;
    background: rgba(4, 9, 15, 0.72);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(7px);
}

.profile-settings-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.profile-settings-sheet {
    width: min(100%, 560px);
    min-height: 100vh;
    margin: 0 auto;
    padding:
        max(18px, env(safe-area-inset-top))
        16px
        max(26px, calc(24px + env(safe-area-inset-bottom)));
    background:
        radial-gradient(circle at 78% -8%, rgba(102, 214, 106, 0.12), transparent 31%),
        var(--bg);
    color: var(--text);
    transform: translateX(16px);
    transition: transform 0.24s ease;
}

.profile-settings-overlay.visible .profile-settings-sheet {
    transform: translateX(0);
}

.profile-settings-top {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.profile-settings-top h2 {
    margin: 0;
    text-align: center;
    font-size: 19px;
    font-weight: 880;
}

.settings-menu-group {
    margin-top: 10px;
}

.profile-settings-button:active,
.profile-summary-card:active,
.profile-menu-row:active {
    transform: scale(0.985);
}

@media (max-width: 380px) {
    .profile-main-avatar {
        width: 74px;
        height: 74px;
        font-size: 28px;
    }

    .profile-summary-card {
        min-height: 120px;
        padding: 14px;
    }

    .profile-menu-row {
        padding-right: 12px;
        padding-left: 12px;
    }

    .profile-menu-value {
        max-width: 32%;
        font-size: 12px;
    }
}


/* Wallet balance on the home screen */
.wallet-name-chip {
    display: inline-flex;
    max-width: 100%;
    min-height: 43px;
    align-items: center;
    gap: 9px;
    padding: 7px 13px 7px 8px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(145deg, #202f3c, #192631);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.14);
}

.wallet-name-mark {
    display: grid;
    width: 29px;
    height: 29px;
    place-items: center;
    border-radius: 10px;
    border: 0;
    background: transparent;
    box-shadow: none;
    color: #07120b;
    font-size: 15px;
    font-weight: 950;
    overflow: hidden;
}

.wallet-name-mark img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wallet-name-chip strong {
    overflow: hidden;
    font-size: 15px;
    font-weight: 880;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-balance-card {
    margin-top: 12px;
    padding: 16px 17px 15px;
    border: 1px solid var(--line);
    border-radius: 19px;
    background:
        radial-gradient(circle at 95% 0%, rgba(102, 214, 106, 0.15), transparent 37%),
        linear-gradient(150deg, #1d2d39, #17232e);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.16);
}

.wallet-balance-heading {
    display: flex;
    min-height: 25px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--muted);
    font-size: 14px;
    font-weight: 720;
}

.balance-visibility-button {
    display: grid;
    width: 30px;
    height: 30px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 17px;
    line-height: 1;
    position: relative;
}

.balance-eye-icon {
    width: 19px;
    height: 19px;
    fill: none;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 1.8;
}

.balance-visibility-button.balance-hidden::after {
    position: absolute;
    width: 22px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    content: "";
    transform: rotate(-45deg);
}

.wallet-balance-value {
    display: flex;
    width: 100%;
    min-height: 39px;
    align-items: baseline;
    gap: 7px;
    margin-top: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.wallet-balance-value strong {
    min-width: 1ch;
    font-family: Roboto, "Segoe UI", sans-serif;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -0.025em;
}

.wallet-balance-value > span:not(.wallet-balance-arrow) {
    color: var(--muted);
    font-family: Roboto, "Segoe UI", sans-serif;
    font-size: 15px;
    font-weight: 700;
}

.wallet-balance-arrow {
    color: var(--muted);
    font-size: 14px;
    font-weight: 800;
}

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

.wallet-action-button {
    display: flex;
    min-width: 0;
    align-items: center;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    flex-direction: column;
    text-align: center;
}

.wallet-action-icon {
    display: grid;
    width: 100%;
    height: 52px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 15px;
    background: linear-gradient(145deg, #1c2a36, #16222d);
    color: var(--green-bright);
    font-size: 25px;
    font-weight: 500;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.13);
}

.wallet-action-icon.qr {
    font-size: 23px;
}

.wallet-action-button small {
    display: -webkit-box;
    width: 100%;
    min-height: 32px;
    margin-top: 7px;
    overflow: hidden;
    font-size: 11px;
    font-weight: 760;
    line-height: 1.2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.wallet-action-button:active .wallet-action-icon,
.balance-visibility-button:active {
    transform: scale(0.96);
}

.digital-assets-section {
    margin-top: 2px;
}

.digital-assets-section h2 {
    margin: 0 0 11px;
    font-size: 18px;
    font-weight: 880;
}

.digital-assets-list {
    display: grid;
    gap: 10px;
}

.digital-asset-row {
    display: grid;
    min-height: 72px;
    grid-template-columns: 42px minmax(0, 1fr) auto;
    align-items: center;
    gap: 11px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, #1d2b38, #17232e);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.digital-asset-logo {
    display: block;
    width: 42px;
    height: 42px;
    padding: 6px;
    border-radius: 50%;
    background: #53ae94;
    object-fit: contain;
}

.digital-asset-copy,
.digital-asset-values {
    display: flex;
    min-width: 0;
    flex-direction: column;
}

.digital-asset-copy strong,
.digital-asset-values strong {
    font-family: Roboto, "Segoe UI", sans-serif;
    font-size: 16px;
    font-weight: 700;
}

.digital-asset-copy small,
.digital-asset-values small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 13px;
    font-weight: 620;
}

.digital-asset-values {
    align-items: flex-end;
    text-align: right;
}

@media (max-width: 360px) {
    .wallet-actions {
        gap: 6px;
    }

    .wallet-action-icon {
        height: 48px;
        border-radius: 14px;
        font-size: 22px;
    }

    .wallet-action-button small {
        font-size: 10px;
    }
}


/* Balance currency selector and rate-based quote */
.currency-overlay {
    position: fixed;
    z-index: 98;
    inset: 0;
    overflow-y: auto;
    background: rgba(4, 9, 15, 0.74);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(7px);
}

.currency-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.currency-sheet {
    width: min(100%, 560px);
    min-height: 100vh;
    margin: 0 auto;
    padding:
        max(18px, env(safe-area-inset-top))
        16px
        max(26px, calc(24px + env(safe-area-inset-bottom)));
    background:
        radial-gradient(circle at 82% -8%, rgba(102, 214, 106, 0.12), transparent 31%),
        var(--bg);
    color: var(--text);
    transform: translateX(16px);
    transition: transform 0.24s ease;
}

.currency-overlay.visible .currency-sheet {
    transform: translateX(0);
}

.currency-sheet-top {
    display: grid;
    grid-template-columns: 42px 1fr 42px;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.currency-sheet-top h2 {
    margin: 0;
    text-align: center;
    font-size: 19px;
    font-weight: 880;
}

.currency-search-field {
    display: flex;
    min-height: 52px;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    padding: 0 15px;
    border: 1px solid var(--line);
    border-radius: 17px;
    background: linear-gradient(145deg, #1d2a37, #18242f);
}

.currency-search-icon {
    color: var(--muted);
    font-size: 21px;
}

.currency-search-field input {
    width: 100%;
    min-width: 0;
    padding: 0;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text);
    font-size: 15px;
}

.currency-search-field input::placeholder {
    color: var(--muted);
}

.currency-list {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: linear-gradient(145deg, #192632, #141f2a);
    box-shadow: 0 16px 38px rgba(0, 0, 0, 0.16);
}

.currency-row {
    position: relative;
    display: grid;
    width: 100%;
    min-height: 72px;
    grid-template-columns: 42px minmax(0, 1fr) auto 20px;
    align-items: center;
    gap: 11px;
    padding: 10px 14px;
    border: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
    text-align: left;
}

.currency-row + .currency-row::before {
    position: absolute;
    top: 0;
    right: 14px;
    left: 67px;
    height: 1px;
    background: var(--line);
    content: "";
}

.currency-row:disabled {
    opacity: 0.55;
    cursor: wait;
}

.currency-flag {
    display: grid;
    width: 40px;
    height: 40px;
    place-items: center;
    overflow: hidden;
    border-radius: 50%;
    background: #202d39;
    font-size: 28px;
    line-height: 1;
}

.currency-flag img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.currency-row-copy {
    min-width: 0;
}

.currency-row-copy strong,
.currency-row-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.currency-row-copy strong {
    font-size: 16px;
    font-weight: 870;
}

.currency-row-copy small {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
}

.currency-row-balance {
    max-width: 120px;
    overflow: hidden;
    color: var(--muted);
    font-family: Roboto, "Segoe UI", sans-serif;
    font-size: 12px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.currency-radio {
    width: 19px;
    height: 19px;
    border: 2px solid #52606d;
    border-radius: 50%;
}

.currency-radio.selected {
    border: 5px solid var(--green-bright);
    background: #f6faf7;
}

.exchange-quote {
    display: grid;
    gap: 4px;
    padding: 14px;
    border: 1px solid rgba(102, 214, 106, 0.16);
    border-radius: 15px;
    background: rgba(102, 214, 106, 0.07);
}

.exchange-quote span,
.exchange-quote small {
    color: var(--muted);
    font-size: 12px;
}

.exchange-quote strong {
    font-family: Roboto, "Segoe UI", sans-serif;
    font-size: 19px;
    font-weight: 700;
}

@media (max-width: 400px) {
    .currency-row {
        grid-template-columns: 42px minmax(0, 1fr) 20px;
    }

    .currency-row-balance {
        grid-column: 2 / 3;
        margin-top: -8px;
    }

    .currency-radio {
        grid-column: 3;
        grid-row: 1 / span 2;
    }
}


/* Wallet top-up bottom sheet */
.top-up-overlay {
    position: fixed;
    z-index: 99;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: rgba(3, 8, 13, 0.76);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.22s ease;
    backdrop-filter: blur(6px);
}

.top-up-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.top-up-sheet {
    width: min(100%, 560px);
    max-height: min(72vh, 620px);
    overflow-y: auto;
    padding: 9px 16px max(18px, env(safe-area-inset-bottom));
    border: 1px solid var(--line);
    border-bottom: 0;
    border-radius: 24px 24px 0 0;
    background:
        radial-gradient(circle at 80% 0%, rgba(102, 214, 106, 0.12), transparent 34%),
        #101a23;
    color: var(--text);
    box-shadow: 0 -24px 70px rgba(0, 0, 0, 0.38);
    transform: translateY(105%);
    transition: transform 0.28s cubic-bezier(0.2, 0.78, 0.2, 1);
}

.top-up-overlay.visible .top-up-sheet {
    transform: translateY(0);
}

.top-up-sheet .sheet-handle {
    margin-top: 1px;
    margin-bottom: 7px;
}

.top-up-sheet-top {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 40px;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}

.top-up-sheet-top h2 {
    margin: 0;
    overflow: hidden;
    font-size: 19px;
    font-weight: 880;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-up-close-button {
    display: grid;
    width: 38px;
    height: 38px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.06);
    color: var(--text);
    cursor: pointer;
    font-size: 25px;
    line-height: 1;
}

.top-up-options {
    display: grid;
    gap: 11px;
}

.top-up-option {
    display: flex;
    width: 100%;
    min-height: 72px;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: linear-gradient(145deg, #1d2b38, #17232e);
    color: var(--text);
    cursor: pointer;
    text-align: left;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
}

.top-up-option-icon {
    display: grid;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    place-items: center;
    border-radius: 14px;
    background: linear-gradient(145deg, rgba(102, 214, 106, 0.22), rgba(81, 179, 84, 0.12));
    color: var(--green-bright);
    font-size: 23px;
    font-weight: 800;
}

.top-up-option-copy {
    min-width: 0;
    flex: 1;
}

.top-up-option-copy strong,
.top-up-option-copy small {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.top-up-option-copy strong {
    font-size: 16px;
    font-weight: 850;
}

.top-up-option-copy small {
    margin-top: 4px;
    color: var(--muted);
    font-size: 12px;
}

.top-up-option-arrow {
    color: var(--muted);
    font-size: 24px;
    line-height: 1;
}

.top-up-option:active,
.top-up-close-button:active {
    transform: scale(0.98);
}
