:root {
    --profile-surface: #111113;
    --profile-surface-raised: #17171a;
    --profile-surface-inner: #0d0e11;
    --profile-border: #2c2c2e;
    --profile-text: #f5f5f7;
    --profile-muted: #8e8e93;
    --profile-blue: #0a84ff;
}

.wallet-profile-trigger,
.menu-profile-trigger,
.menu-edit-profile-button {
    font: inherit;
    -webkit-tap-highlight-color: transparent;
}

.wallet-profile-trigger {
    min-width: 0;
    max-width: 190px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 0;
    border: 0;
    background: transparent;
    color: white;
    cursor: pointer;
    text-align: left;
}

.wallet-profile-trigger__avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 15px;
    background: #1746ff;
    color: white;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.09), 0 8px 22px rgba(0, 0, 0, 0.24);
    transition: border-color 0.16s ease, transform 0.16s ease;
}

.wallet-profile-trigger__name {
    min-width: 0;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.88);
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 14px;
    font-weight: 750;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.16s ease;
}

.wallet-profile-trigger:hover .wallet-profile-trigger__avatar,
.wallet-profile-trigger:focus-visible .wallet-profile-trigger__avatar {
    border-color: rgba(122, 157, 255, 0.78);
    transform: translateY(-1px);
}

.wallet-profile-trigger:hover .wallet-profile-trigger__name,
.wallet-profile-trigger:focus-visible .wallet-profile-trigger__name {
    color: white;
}

.wallet-profile-trigger:focus-visible,
.menu-profile-trigger:focus-visible,
.menu-edit-profile-button:focus-visible {
    outline: 2px solid rgba(53, 99, 255, 0.82);
    outline-offset: 4px;
}

#dt3-account-overview #dt3-wallet-profile-pill.wallet-profile-trigger {
    min-width: 0 !important;
    max-width: 280px !important;
    display: inline-flex !important;
    gap: 12px !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.wallet-profile-trigger--desktop,
#dt3-wallet-profile-pill.wallet-profile-trigger--desktop {
    padding: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

#dt3-account-overview #dt3-wallet-profile-pill #dt3-wallet-avatar {
    width: 44px !important;
    height: 44px !important;
    flex-basis: 44px !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 14px !important;
    background: var(--wallet-avatar-bg, #1746ff) !important;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.09), 0 8px 22px rgba(0, 0, 0, 0.24) !important;
}

#dt3-account-overview #dt3-wallet-profile-pill #dt3-wallet-display-name {
    color: rgba(255, 255, 255, 0.9) !important;
    font-size: 16px !important;
    font-weight: 700 !important;
}

.menu-profile-trigger {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0;
    border: 0;
    background: transparent;
    color: white;
    cursor: pointer;
    text-align: left;
}

.menu-profile-trigger__copy {
    min-width: 0;
    display: block;
}

.menu-profile-trigger:hover #menu-username {
    color: #9ab4ff !important;
}

.menu-edit-profile-button {
    width: 100%;
    min-height: 68px;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.045);
    color: rgba(255, 255, 255, 0.28);
    cursor: pointer;
    text-align: left;
    transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.menu-edit-profile-button:hover {
    border-color: rgba(255, 255, 255, 0.15);
    background: rgba(255, 255, 255, 0.075);
    transform: translateY(-1px);
}

.menu-edit-profile-button__icon {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(94, 133, 255, 0.3);
    border-radius: 14px;
    background: rgba(23, 70, 255, 0.16);
    color: #8ba8ff;
}

.menu-edit-profile-button__copy {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.menu-edit-profile-button__copy strong {
    color: white;
    font-size: 15px;
    font-weight: 700;
}

.menu-edit-profile-button__copy small {
    overflow: hidden;
    color: rgba(255, 255, 255, 0.38);
    font-size: 11.5px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-profile-editor {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    font-family: Inter, system-ui, sans-serif;
}

.wallet-profile-editor.hidden {
    display: none !important;
}

.wallet-profile-editor__scrim {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.76);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.wallet-profile-editor__panel {
    position: relative;
    width: min(560px, calc(100vw - 48px));
    max-height: min(820px, calc(100dvh - 48px));
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 24px;
    border: 1px solid var(--profile-border);
    border-radius: 28px;
    background: var(--profile-surface);
    box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), inset 0 1px rgba(255, 255, 255, 0.035);
    color: var(--profile-text);
    scrollbar-width: thin;
    scrollbar-color: #3a3a3c transparent;
}

.wallet-profile-editor__grabber {
    display: none;
}

.wallet-profile-editor__head,
.wallet-profile-editor__preview-row,
.wallet-profile-editor__actions {
    display: flex;
    align-items: center;
}

.wallet-profile-editor__head {
    justify-content: space-between;
    margin-bottom: 18px;
}

.wallet-profile-editor__eyebrow,
.wallet-profile-editor__label,
.wallet-profile-editor__collection-kicker {
    margin: 0;
    color: #8aaefc;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.wallet-profile-editor__head h3 {
    margin: 4px 0 0;
    font-family: "Space Grotesk", Inter, sans-serif;
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -0.035em;
}

.wallet-profile-editor__icon-btn {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border: 1px solid var(--profile-border);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    color: #b8b8bd;
    cursor: pointer;
}

.wallet-profile-editor__icon-btn svg {
    stroke: currentColor;
}

.wallet-profile-editor__preview-row {
    gap: 14px;
    padding: 14px;
    margin-bottom: 20px;
    border: 1px solid var(--profile-border);
    border-radius: 20px;
    background: var(--profile-surface-raised);
}

.wallet-profile-editor__avatar {
    width: 72px;
    height: 72px;
    flex: 0 0 72px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 20px;
    color: white;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.08), 0 8px 24px rgba(0, 0, 0, 0.28);
}

.wallet-profile-avatar--mascot {
    overflow: hidden !important;
    padding: 0 !important;
    color: transparent !important;
}

.wallet-profile-avatar--mascot > img,
.wallet-profile-editor__avatar > img {
    width: 96%;
    height: 96%;
    display: block;
    object-fit: contain;
}

.wallet-profile-editor__preview-copy {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.wallet-profile-editor__preview-copy strong {
    overflow: hidden;
    color: var(--profile-text);
    font-size: 17px;
    font-weight: 750;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-profile-editor__preview-copy span {
    color: var(--profile-muted);
    font-size: 12px;
    line-height: 1.45;
}

.wallet-profile-editor__label {
    display: block;
    margin: 18px 0 8px;
    color: #a7a7ad;
    letter-spacing: 0.075em;
}

.wallet-profile-editor__input {
    width: 100%;
    height: 50px;
    padding: 0 15px;
    border: 1px solid var(--profile-border);
    border-radius: 15px;
    outline: none;
    background: var(--profile-surface-inner);
    color: var(--profile-text);
    font-size: 15px;
    font-weight: 650;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.wallet-profile-editor__input:focus {
    border-color: rgba(10, 132, 255, 0.74);
    box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.13);
}

.wallet-profile-editor__mode {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    margin: 16px 0 14px;
    padding: 4px;
    border: 1px solid var(--profile-border);
    border-radius: 15px;
    background: var(--profile-surface-inner);
}

.wallet-profile-editor__mode button {
    min-height: 38px;
    border: 0;
    border-radius: 11px;
    background: transparent;
    color: #77777d;
    font-size: 12px;
    font-weight: 750;
    cursor: pointer;
}

.wallet-profile-editor__mode button.active {
    background: #222226;
    color: #fff;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.055), 0 4px 14px rgba(0, 0, 0, 0.22);
}

.wallet-profile-editor__collection-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 2px 2px 10px;
}

.wallet-profile-editor__collection-head span {
    color: #68686e;
    font-size: 11px;
    font-weight: 650;
}

.wallet-profile-editor__mascot-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.wallet-profile-editor__mascot-grid.is-hidden,
.wallet-profile-editor__emoji-grid.is-hidden,
.wallet-profile-editor__color-groups.is-hidden,
.wallet-profile-editor__label.is-hidden,
.wallet-profile-editor__collection-head.is-hidden {
    display: none !important;
}

.wallet-profile-editor__mascot-grid button {
    position: relative;
    min-width: 0;
    padding: 5px 5px 7px;
    border: 1px solid var(--profile-border);
    border-radius: 16px;
    background: var(--profile-surface-inner);
    color: #9d9da3;
    cursor: pointer;
    transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.wallet-profile-editor__mascot-grid button:hover {
    transform: translateY(-1px);
    border-color: #44444a;
    background: #15161a;
}

.wallet-profile-editor__mascot-grid button.active {
    border-color: var(--profile-blue);
    background: rgba(10, 132, 255, 0.08);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.12);
}

.wallet-profile-editor__mascot-grid button.active::after {
    content: "✓";
    position: absolute;
    top: 8px;
    right: 8px;
    width: 18px;
    height: 18px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--profile-blue);
    color: white;
    font-size: 11px;
    font-weight: 900;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.34);
}

.wallet-profile-editor__mascot-grid img {
    width: 100%;
    aspect-ratio: 1;
    display: block;
    padding: 4px;
    border-radius: 11px;
    object-fit: contain;
    transition: background 0.16s ease;
}

.wallet-profile-editor__mascot-grid button > span {
    display: block;
    overflow: hidden;
    margin-top: 6px;
    font-size: 10px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wallet-profile-editor__emoji-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 8px;
}

.wallet-profile-editor__emoji-grid button,
.wallet-profile-editor__color-grid button {
    border: 1px solid var(--profile-border);
    cursor: pointer;
}

.wallet-profile-editor__emoji-grid button {
    aspect-ratio: 1;
    border-radius: 14px;
    background: var(--profile-surface-inner);
    font-size: 22px;
}

.wallet-profile-editor__emoji-grid button.active,
.wallet-profile-editor__color-grid button.active {
    border-color: var(--profile-blue);
    box-shadow: 0 0 0 2px rgba(10, 132, 255, 0.18), inset 0 0 0 1px rgba(255, 255, 255, 0.24);
}

.wallet-profile-editor__color-groups {
    display: grid;
    gap: 14px;
}

.wallet-profile-editor__color-group {
    min-width: 0;
}

.wallet-profile-editor__color-group-label {
    display: block;
    margin: 0 0 8px 2px;
    color: #717177;
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.wallet-profile-editor__color-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    gap: 8px;
}

.wallet-profile-editor__color-grid button {
    min-width: 0;
    aspect-ratio: 1.35;
    border-radius: 11px;
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.14);
    transition: transform 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease;
}

.wallet-profile-editor__color-grid button:hover {
    transform: translateY(-1px);
}

.wallet-profile-editor__error {
    min-height: 18px;
    margin: 10px 2px 0;
    color: #ff6961;
    font-size: 12px;
    font-weight: 650;
}

.wallet-profile-editor__actions {
    position: sticky;
    bottom: -24px;
    z-index: 2;
    gap: 10px;
    margin: 4px -24px -24px;
    padding: 14px 24px calc(20px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--profile-border);
    background: rgba(17, 17, 19, 0.96);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.wallet-profile-editor__secondary,
.wallet-profile-editor__primary {
    min-height: 48px;
    flex: 1;
    border-radius: 15px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
}

.wallet-profile-editor__secondary {
    border: 1px solid var(--profile-border);
    background: var(--profile-surface-inner);
    color: #b8b8bd;
}

.wallet-profile-editor__primary {
    border: 1px solid #2f72ff;
    background: #3262ff;
    color: white;
    box-shadow: 0 10px 24px rgba(50, 98, 255, 0.2);
}

.wallet-profile-editor__primary:disabled {
    cursor: wait;
    opacity: 0.56;
}

body.wallet-profile-editor-open {
    overflow: hidden !important;
}

body.wallet-profile-editor-open #bottom-nav {
    display: none !important;
}

@media (max-width: 640px) {
    .wallet-profile-editor {
        align-items: flex-end;
        padding: 0;
    }

    .wallet-profile-editor__panel {
        width: 100%;
        max-height: min(92dvh, 820px);
        padding: 20px 18px;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 26px 26px 0 0;
    }

    .wallet-profile-editor__grabber {
        width: 38px;
        height: 4px;
        display: block;
        margin: -7px auto 15px;
        border-radius: 99px;
        background: #3a3a3c;
    }

    .wallet-profile-editor__head h3 {
        font-size: 23px;
    }

    .wallet-profile-editor__avatar {
        width: 68px;
        height: 68px;
        flex-basis: 68px;
        border-radius: 19px;
    }

    .wallet-profile-editor__mascot-grid {
        gap: 8px;
    }

    .wallet-profile-editor__mascot-grid button {
        padding: 4px 4px 6px;
        border-radius: 14px;
    }

    .wallet-profile-editor__mascot-grid img {
        border-radius: 10px;
    }

    .wallet-profile-editor__color-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 9px;
    }

    .wallet-profile-editor__color-grid button {
        aspect-ratio: 1.55;
        border-radius: 12px;
    }

    .wallet-profile-editor__actions {
        bottom: -20px;
        margin-right: -18px;
        margin-bottom: -20px;
        margin-left: -18px;
        padding-right: 18px;
        padding-left: 18px;
    }
}

@media (max-width: 370px) {
    .wallet-profile-editor__panel {
        padding-right: 14px;
        padding-left: 14px;
    }

    .wallet-profile-editor__mascot-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }

    .wallet-profile-editor__mascot-grid button > span {
        display: none;
    }
}
