.account-auth, .account-panel {
    border: 1px solid var(--border);
    border-radius: 16px;
    background: var(--panel);
}

.account-auth {
    width: min(440px, calc(100% - 2 * var(--gutter)));
    margin: clamp(28px, 7vw, 90px) auto;
    padding: clamp(20px, 4vw, 32px);
}

.account-page {
    padding-block: clamp(24px, 5vw, 52px) 64px;
}

.account-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 24px;
}

.account-page h1, .account-auth h1 {
    margin: 0;
    font-size: clamp(1.8rem, 5vw, 3rem);
    font-weight: 900;
    letter-spacing: -.045em;
    line-height: 1.15;
}

.account-auth h1 {
    margin-bottom: 22px;
}

.account-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.account-stack {
    grid-template-columns: minmax(0, 1fr);
}

.account-panel {
    min-width: 0;
    padding: clamp(15px, 2.6vw, 26px);
}

.account-wide {
    grid-column: 1 / -1;
}

.account-panel h2 {
    margin: 0 0 15px;
    font-size: 1.32rem;
    font-weight: 900;
}

.account-panel p, .account-form p {
    margin: 0 0 10px;
}

.account-muted, .account-form small {
    color: var(--muted);
}

.account-form {
    display: grid;
    gap: 13px;
}

.account-form label {
    display: grid;
    gap: 5px;
    font-weight: 750;
}

.account-form small {
    font-size: .85rem;
    font-weight: 600;
}

.account-form input, .account-form select {
    width: 100%;
    min-width: 0;
    min-height: 43px;
    padding: 8px 11px;
    border: 1px solid #454545;
    border-radius: 8px;
    background: #0e0e0e;
    color: var(--text);
    font: inherit;
    font-weight: 600;
}

.account-form input:focus, .account-form select:focus, button:focus-visible {
    outline: 2px solid #e5e5e5;
    outline-offset: 2px;
}

.account-form .button {
    justify-self: start;
    font-family: inherit;
    cursor: pointer;
}

.account-form p a, .account-pages a {
    color: var(--text);
    text-decoration: underline;
}

.account-inline {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
}

.account-inline label {
    flex: 1 1 140px;
}

.account-inline .button {
    min-height: 43px;
}

.account-notice, .account-error {
    padding: 10px 12px;
    border: 1px solid #666;
    border-radius: 8px;
    background: #252525;
    color: var(--text);
    overflow-wrap: anywhere;
}

.account-error {
    border-color: #999;
}

.account-facts, .account-stats {
    margin: 0 0 12px;
    display: grid;
    gap: 8px;
}

.account-facts div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 10px;
}

.account-facts dd, .account-stats dd {
    margin: 0;
    color: var(--text);
    font-weight: 900;
    overflow-wrap: anywhere;
}

.account-facts div dd {
    text-align: right;
}

.account-facts dt, .account-stats dt {
    color: var(--muted);
}

.account-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
}

.account-stats dd {
    font-size: 1.35rem;
}

.account-secret {
    overflow-wrap: anywhere;
    padding: 8px 11px;
    border-radius: 8px;
    background: #0e0e0e;
}

.account-table-wrap {
    overflow-x: auto;
}

.account-table {
    width: 100%;
    border-collapse: collapse;
    font-size: .9rem;
}

.account-table th, .account-table td {
    padding: 9px 7px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.account-table th {
    color: var(--muted);
}

.account-pages {
    display: flex;
    gap: 12px;
    padding-top: 10px;
}

.role-list {
    margin-top: 0;
    padding-left: 20px;
}

@media (max-width: 680px) {
    .account-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .account-stats {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

.purchase-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: end;
    gap: 18px 24px;
    background: linear-gradient(115deg, #242424, var(--panel) 62%);
}

.purchase-product {
    display: flex;
    align-items: center;
    gap: 14px;
}

.purchase-product img {
    flex: none;
    width: 48px;
    height: 48px;
    border-radius: 10px;
    filter: grayscale(1);
}

.purchase-product h2 {
    margin-bottom: 4px;
}

.purchase-product p, .account-panel .referral-stats {
    margin-bottom: 0;
    color: var(--muted);
}

.account-panel .referral-stats {
    margin-top: 12px;
}

@media (max-width: 830px) {
    .purchase-panel {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (prefers-reduced-motion: no-preference) {
    .account-auth, .account-page {
        animation: account-in 320ms ease-out both;
    }

    .account-form input, .account-form select, .account-secondary {
        transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease;
    }

    @keyframes account-in {
        from {
            opacity: 0;
            transform: translateY(7px);
        }

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

.cabinet-page {
    max-width: 1040px;
}

.cabinet-layout {
    display: grid;
    grid-template-columns: minmax(146px, 180px) minmax(0, 1fr);
    align-items: start;
    gap: clamp(18px, 3.3vw, 44px);
}

.cabinet-sidebar {
    padding-top: 3px;
}

.cabinet-sidebar nav {
    display: grid;
    gap: 5px;
}

.cabinet-sidebar nav a {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    color: var(--muted);
    font-weight: 800;
}

.cabinet-sidebar nav a:hover {
    background: #181818;
    color: var(--text);
}

.cabinet-sidebar nav a[aria-current="page"] {
    border-color: #383838;
    background: #262626;
    color: var(--text);
}

.cabinet-sidebar form {
    margin: 15px 13px 0;
}

.cabinet-content {
    min-width: 0;
    display: grid;
    gap: 14px;
}

.cabinet-content .account-panel > form + form {
    margin-top: 12px;
}

@media (max-width: 620px) {
    .cabinet-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 14px;
    }

    .cabinet-sidebar nav {
        display: flex;
        flex-wrap: wrap;
    }

    .cabinet-sidebar nav a {
        padding-inline: 9px;
        min-height: 36px;
        font-size: .92rem;
    }

    .cabinet-sidebar form {
        margin: 8px 9px 0;
    }
}

@media (prefers-reduced-motion: no-preference) {
    .cabinet-sidebar nav a {
        transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease;
    }
}

.cabinet-content .reseller-card {
    margin-top: 0;
}

.account-select-wrap {
    position: relative;
    display: grid;
    color: var(--muted);
}

.account-select-wrap::after {
    position: absolute;
    top: 50%;
    right: 15px;
    width: 8px;
    height: 8px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    content: "";
    pointer-events: none;
    transform: translateY(-68%) rotate(45deg);
}

.account-form .account-select {
    appearance: none;
    min-height: 45px;
    padding-inline: 12px 35px;
    border-color: #454545;
    background: #1e1e1e;
    font-weight: 750;
    cursor: pointer;
}

.account-form .account-select:hover {
    border-color: #777;
}

.account-select option {
    background: #171717;
    color: var(--text);
}

@supports (appearance: base-select) {
    .account-form .account-select, .account-select::picker(select) {
        appearance: base-select;
    }

    .account-select::picker-icon {
        display: none;
    }

    .account-select:open {
        border-color: #bdbdbd;
    }

    .account-select-wrap:has(.account-select:open)::after {
        transform: translateY(-25%) rotate(225deg);
    }

    .account-select::picker(select) {
        margin-top: 5px;
        padding: 4px;
        border: 1px solid #4c4c4c;
        border-radius: 10px;
        background: #171717;
        color: var(--text);
        box-shadow: 0 8px 24px #0009;
    }

    .account-select option {
        min-height: 36px;
        padding: 7px 9px;
        border-radius: 6px;
    }

    .account-select option:is(:focus, :hover, :checked) {
        background: #303030;
    }
}

.account-identity {
    justify-content: flex-start;
    gap: 14px;
}

.account-identity h1 {
    font-size: clamp(1.65rem, 4vw, 2.4rem);
    overflow-wrap: anywhere;
}

.account-identity p {
    margin: 2px 0 0;
    color: var(--muted);
    font-weight: 750;
}

.account-avatar {
    display: grid;
    place-items: center;
    flex: 0 0 58px;
    width: 58px;
    height: 58px;
    overflow: hidden;
    border: 1px solid #383838;
    border-radius: 50%;
    background: #1c1c1c;
}

.account-avatar img {
    display: block;
    max-width: 100%;
    object-fit: cover;
}

.account-password-reset summary {
    width: fit-content;
    color: var(--muted);
    cursor: pointer;
    font-weight: 750;
}

.account-password-reset .account-form {
    margin-top: 13px;
}

.account-form input[type="file"]::file-selector-button {
    margin-right: 9px;
    padding: 5px 10px;
    border: 1px solid #444;
    border-radius: 6px;
    background: #252525;
    color: var(--text);
    font-family: inherit;
    cursor: pointer;
}

.account-form .account-checkbox {
    display: flex;
    align-items: center;
    gap: 7px;
}

.account-checkbox input[type="checkbox"] {
    width: 16px;
    min-height: 16px;
    accent-color: #dcdcdc;
}

.profile-setup-uid {
    margin: 0 0 10px;
    color: var(--muted);
    font-weight: 800;
}

.profile-setup-logout {
    margin-top: 16px;
}
