html:has(body:not(.inbox-page):not(.chat-embedded):not(.workspace-embedded)) {
    scrollbar-gutter: stable;
}

.avatar-crop-modal .modal-dialog {
    max-width: 440px;
}

.avatar-crop-stage {
    position: relative;
    width: min(100%, 320px);
    aspect-ratio: 1;
    margin: 0 auto;
    overflow: hidden;
    border-radius: 12px;
    background: #171923;
    cursor: grab;
    touch-action: none;
    user-select: none;
}

.avatar-crop-stage:active {
    cursor: grabbing;
}

.avatar-crop-stage:focus-visible {
    outline: 3px solid #7165ef;
    outline-offset: 3px;
}

.avatar-crop-stage img {
    position: absolute;
    max-width: none;
    pointer-events: none;
    user-select: none;
}

.avatar-crop-stage img[hidden] {
    display: none;
}

@media (max-width: 420px) {
    .avatar-crop-modal .modal-dialog {
        margin: .75rem;
    }

    .avatar-crop-stage {
        width: min(100%, 280px);
    }
}

* {
    scrollbar-width: thin;
    scrollbar-color: #aeb7c6 transparent;
}

*::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

*::-webkit-scrollbar-track {
    background: transparent;
}

*::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #aeb7c6;
    background-clip: padding-box;
}

*::-webkit-scrollbar-thumb:hover {
    background: #7f8ba0;
    background-clip: padding-box;
}

html[data-theme="dark"] *,
html[data-theme="neumorphism"] *,
html[data-theme="claymorphism"] * {
    scrollbar-color: #697287 transparent;
}

html[data-theme="dark"] *::-webkit-scrollbar-thumb,
html[data-theme="neumorphism"] *::-webkit-scrollbar-thumb,
html[data-theme="claymorphism"] *::-webkit-scrollbar-thumb {
    background: #697287;
    background-clip: padding-box;
}

body {
    background: #f1f3f6;
}

.app-nav-rail {
    position: fixed;
    z-index: 1020;
    inset: 0 auto 0 0;
    display: flex;
    width: 88px;
    box-sizing: border-box;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 22px 10px 16px;
    overflow-y: auto;
    border-right: 1px solid #edf0f6;
    background: #fff;
}

.app-nav-rail.admin-nav-rail {
    width: 220px;
    align-items: stretch;
    padding: 24px 14px 16px;
}

.app-nav-link {
    position: relative;
    display: inline-flex;
    width: 54px;
    height: 50px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 15px;
    color: #858c9a;
    background: transparent;
    text-decoration: none;
    cursor: pointer;
}

.admin-nav-rail .app-nav-link {
    width: 100%;
    height: 48px;
    justify-content: flex-start;
    gap: 14px;
    padding: 0 14px;
    border-radius: 12px;
    font-size: .94rem;
    font-weight: 600;
}

.admin-nav-rail .app-nav-link span {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    white-space: normal;
}

.admin-nav-rail .admin-nav-exit {
    margin-top: 10px;
}

.app-nav-link:hover,
.app-nav-link.is-active {
    color: #7165ef;
    background: #f3f1ff;
}

.app-nav-link svg {
    width: 25px;
    height: 25px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-nav-link span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

.app-nav-spacer {
    flex: 1;
}

.app-nav-profile {
    display: inline-flex;
    width: 46px;
    height: 46px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 3px solid #ecebff;
    border-radius: 50%;
}

.app-nav-profile .avatar {
    width: 40px;
    height: 40px;
}

.app-nav-logout {
    margin: 0;
}

.container.has-app-sidebar {
    width: 100%;
    max-width: 1320px;
    margin-right: auto;
    margin-left: auto;
}

.admin-area .container.has-app-sidebar {
    max-width: none;
}

body.has-app-sidebar {
    padding-left: 88px;
}

body.has-app-sidebar.admin-area {
    padding-left: 220px;
}

html[data-theme="dark"] .app-nav-rail {
    border-color: #343746;
    background: #222531;
}

html[data-theme="dark"] .app-nav-link {
    color: #aeb8ca;
}

html[data-theme="dark"] .app-nav-link:hover,
html[data-theme="dark"] .app-nav-link.is-active {
    color: #b8aaff;
    background: #343044;
}

html[data-theme="neumorphism"] .app-nav-rail,
html[data-theme="claymorphism"] .app-nav-rail {
    border-color: #fff;
    background: #eceef5;
    box-shadow: 6px 6px 13px #c9cbd6, -6px -6px 13px #fff;
}

html[data-theme="claymorphism"] .app-nav-rail {
    background: #f0eff7;
    box-shadow: 7px 7px 16px #cccad7, -7px -7px 16px #fff;
}

@media (max-width: 620px) {
    .app-nav-rail {
        inset: auto 0 0;
        width: 100%;
        height: 68px;
        box-sizing: border-box;
        flex-direction: row;
        justify-content: flex-start;
        gap: 4px;
        overflow-x: auto;
        padding: 6px 8px max(6px, env(safe-area-inset-bottom));
        border-top: 1px solid #edf0f6;
        border-right: 0;
    }

    .app-nav-rail.admin-nav-rail {
        width: 100%;
        height: 76px;
        align-items: center;
        justify-content: flex-start;
        gap: 4px;
        padding: 5px 8px max(5px, env(safe-area-inset-bottom));
        overflow-x: auto;
        overflow-y: hidden;
        scrollbar-width: none;
    }

    .app-nav-rail.admin-nav-rail::-webkit-scrollbar,
    .admin-billing-tabs::-webkit-scrollbar {
        display: none;
    }

    .app-nav-link {
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }

    .app-nav-link svg {
        width: 22px;
        height: 22px;
    }

    .admin-nav-rail .app-nav-link {
        width: 72px;
        height: 60px;
        flex: 0 0 72px;
        flex-direction: column;
        justify-content: center;
        gap: 3px;
        padding: 4px;
        font-size: .65rem;
    }

    .admin-nav-rail .app-nav-link svg {
        width: 20px;
        height: 20px;
    }

    .admin-nav-rail .app-nav-link span {
        max-width: 100%;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .admin-nav-rail .admin-nav-exit {
        margin-top: 0;
    }

    .app-nav-spacer {
        display: none;
    }

    .app-nav-profile {
        width: 38px;
        height: 38px;
        flex: 0 0 38px;
        border-width: 2px;
    }

    .app-nav-profile .avatar {
        width: 34px;
        height: 34px;
    }

    .app-nav-logout {
        flex: 0 0 auto;
    }

    body.has-app-sidebar {
        padding-right: 0;
        padding-bottom: calc(68px + env(safe-area-inset-bottom));
        padding-left: 0;
    }

    body.has-app-sidebar.admin-area {
        padding-bottom: calc(76px + env(safe-area-inset-bottom));
        padding-left: 0;
    }

    html:has(body:not(.inbox-page):not(.chat-embedded):not(.workspace-embedded)):has(body.admin-area) {
        scrollbar-gutter: auto;
    }

    html:has(body.admin-area) {
        overflow-x: clip;
    }

    body.admin-area {
        overflow-x: clip;
    }

    .container.has-app-sidebar {
        width: 100%;
        max-width: none;
    }
}

.embedded-page-close {
    position: fixed;
    z-index: 1040;
    top: 12px;
    left: 12px;
}

.embedded-page-close,
.page-back-icon,
.btn-close {
    display: grid;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    place-items: center;
    padding: 0;
    line-height: 1;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    color: #fff;
    background-color: #171923;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
    cursor: pointer;
    opacity: 1;
    transition: color .15s ease, background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.embedded-page-close svg,
.page-back-icon svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

#chat-room-close svg {
    transform: translateX(-1px);
}

.embedded-page-close:hover,
.embedded-page-close:focus-visible,
.page-back-icon:hover,
.page-back-icon:focus-visible,
.btn-close:hover,
.btn-close:focus-visible {
    color: #fff;
    border-color: #c9c4ff;
    background-color: #6659e8;
    box-shadow: 0 0 0 2px rgba(113, 101, 239, .2);
    opacity: 1;
}

.btn-close:hover,
.btn-close:focus-visible {
    color: #fff;
    border-color: #c9c4ff;
    background-color: #6659e8;
    box-shadow: 0 0 0 2px rgba(113, 101, 239, .2);
    opacity: 1;
}

/* Back arrow: no circle, border or background; colour follows the active theme. */
.embedded-page-close,
.page-back-icon,
html[data-theme] .embedded-page-close,
html[data-theme] .page-back-icon {
    border: 0;
    background: transparent;
    background-color: transparent;
    box-shadow: none;
    color: #4b5563;
}

.embedded-page-close:hover,
.embedded-page-close:focus-visible,
.page-back-icon:hover,
.page-back-icon:focus-visible,
html[data-theme] .embedded-page-close:hover,
html[data-theme] .embedded-page-close:focus-visible,
html[data-theme] .page-back-icon:hover,
html[data-theme] .page-back-icon:focus-visible {
    border: 0;
    background: transparent;
    background-color: transparent;
    box-shadow: none;
    color: #6659e8;
}

html[data-theme="dark"] .embedded-page-close,
html[data-theme="dark"] .page-back-icon {
    color: #e4e7ee;
}

html[data-theme="neumorphism"] .embedded-page-close,
html[data-theme="neumorphism"] .page-back-icon,
html[data-theme="claymorphism"] .embedded-page-close,
html[data-theme="claymorphism"] .page-back-icon {
    color: #6048c4;
}

html[data-theme="dark"] .embedded-page-close:hover,
html[data-theme="dark"] .page-back-icon:hover,
html[data-theme="dark"] .embedded-page-close:focus-visible,
html[data-theme="dark"] .page-back-icon:focus-visible {
    color: #c9c4ff;
}

.embedded-page-close:focus-visible,
.page-back-icon:focus-visible,
.btn-close:focus-visible {
    outline: 3px solid rgba(113, 101, 239, .3);
    outline-offset: 2px;
}

/* ---------- Auth pages (login / register / forgot / reset) ---------- */

.auth-card {
    max-width: 460px;
    width: 100%;
    margin: 40px auto;
    border: 0;
    border-radius: 14px;
}

body.auth-screen > .container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 56px - 1.5rem);
    align-items: center;
    justify-content: center;
    padding-top: 24px;
    padding-bottom: 24px;
}

body.auth-screen > .container > .alert {
    width: 100%;
    flex: 0 0 auto;
}

body.auth-screen .auth-card {
    margin: 0 auto;
    flex: 0 0 auto;
    border-radius: 18px;
    box-shadow: 0 18px 50px rgba(35, 43, 65, .12) !important;
}

body.auth-register-screen .auth-card {
    max-width: 520px;
}

body.auth-register-screen .auth-card form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
}

body.auth-register-screen .auth-card form > button {
    grid-column: 1 / -1;
}

.auth-card .card-body {
    padding: 2rem;
}

.auth-title {
    font-weight: 700;
    text-align: center;
    margin-bottom: .25rem;
}

.auth-sub {
    text-align: center;
    color: #6c757d;
    font-size: .95rem;
    margin-bottom: 1.5rem;
}

.auth-card .form-control {
    padding: .65rem .85rem;
    border-radius: 8px;
}

.auth-card .btn-auth {
    padding: .7rem;
    border-radius: 8px;
    font-weight: 600;
}

.auth-links {
    text-align: center;
    margin-top: 1.25rem;
    font-size: .92rem;
}

/* ---------- Avatar ---------- */

.avatar {
    border-radius: 50%;
    object-fit: cover;
    display: inline-block;
}

.avatar-initials {
    background: #0d6efd;
    color: #fff;
    font-weight: 600;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

html[data-theme="dark"] body {
    color: #e4e7ee;
    background: #171923;
}

html[data-theme="dark"] .card,
html[data-theme="dark"] .modal-content,
html[data-theme="dark"] .list-group-item,
html[data-theme="dark"] .dropdown-menu {
    color: #e4e7ee;
    border-color: #343746;
    background-color: #222531;
}

html[data-theme="dark"] body.auth-screen .auth-card {
    box-shadow: 0 18px 50px rgba(0, 0, 0, .28) !important;
}

html[data-theme="dark"] .text-dark,
html[data-theme="dark"] .text-body {
    color: #e4e7ee !important;
}

html[data-theme="dark"] .text-muted,
html[data-theme="dark"] .form-text {
    color: #a1a8b8 !important;
}

html[data-theme="dark"] .form-control,
html[data-theme="dark"] .form-select,
html[data-theme="dark"] .input-group-text {
    color: #e4e7ee;
    border-color: #414657;
    background-color: #191c26;
}

html[data-theme="dark"] .form-control:disabled,
html[data-theme="dark"] .form-control[readonly] {
    color: #a1a8b8;
    background-color: #252936;
}

html[data-theme="dark"] .form-control::placeholder {
    color: #8d95a6;
}

html[data-theme="dark"] hr {
    border-color: #414657;
}

html[data-theme="dark"] .modal-header,
html[data-theme="dark"] .modal-footer {
    border-color: #414657;
}

html[data-theme="dark"] .btn-close {
    filter: none;
}

.btn-close {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23fff' stroke-linecap='round' stroke-width='2'%3E%3Cpath d='m4 4 8 8M12 4l-8 8'/%3E%3C/svg%3E");
    background-position: center;
    background-size: 12px;
    background-repeat: no-repeat;
}

.profile-page {
    max-width: 1180px;
    margin: 0 auto;
}

body.profile-screen > nav {
    display: none !important;
}

body.user-profile-screen > nav {
    display: none !important;
}

body.profile-screen > .container {
    margin-top: 0 !important;
    padding-top: 24px;
}

body.user-profile-screen > .container {
    margin-top: 0 !important;
    padding-top: 72px;
}

.user-profile-page {
    max-width: 960px;
    margin: 0 auto;
}

body.user-profile-screen .user-profile-page-back {
    top: max(12px, env(safe-area-inset-top));
    left: max(12px, env(safe-area-inset-left));
}

@media (max-width: 767.98px) {
    body.user-profile-screen > .container {
        padding-right: 12px;
        padding-left: 12px;
        overflow-x: hidden;
    }

    .user-profile-page .card-body {
        padding: 1.25rem !important;
    }
}

.user-profile-card {
    border-radius: 20px;
}

.user-profile-page .profile-photo-trigger {
    display: flex;
    width: max-content;
    max-width: 100%;
    margin-right: auto;
    margin-left: auto;
}

.user-profile-page .profile-photo-trigger > .avatar,
.user-profile-page .card-body > .mb-3 > .avatar {
    flex: 0 0 auto;
    margin-right: auto;
    margin-left: auto;
}

.user-profile-page .profile-photo-trigger > .avatar:not(.avatar-initials),
.user-profile-page .card-body > .mb-3 > .avatar:not(.avatar-initials) {
    display: block;
}

.user-profile-page .avatar-initials {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    line-height: 1;
}

.user-profile-page .card-body > div.mb-3:has(> .avatar) {
    display: flex;
    justify-content: center;
}

.user-profile-page .profile-photo-trigger > .avatar {
    width: 176px !important;
    height: 176px !important;
}

.user-action-icon {
    width: 17px;
    height: 17px;
    margin-right: .35rem;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -3px;
}

.profile-summary-card {
    border-radius: 20px;
}

.profile-photo-trigger {
    position: relative;
    display: inline-flex;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
}

.profile-photo-trigger > .avatar {
    width: 176px !important;
    height: 176px !important;
    border: 5px solid #f0efff;
    box-shadow: 0 8px 24px rgba(58, 55, 112, .12);
}

.profile-photo-camera {
    position: absolute;
    right: 8px;
    bottom: 8px;
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 3px solid #fff;
    border-radius: 50%;
    color: #fff;
    background: #7165ef;
}

.profile-photo-camera svg {
    width: 21px;
    height: 21px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.profile-photo-large {
    display: block;
    max-width: min(88vw, 640px);
    max-height: 82vh;
    margin: auto;
    object-fit: contain;
    border-radius: 12px;
}

.user-profile-photo-dialog {
    width: fit-content;
    max-width: calc(100vw - 1rem);
}

.user-profile-photo-content {
    width: fit-content;
    max-width: 100%;
    margin: 0 auto;
}

.profile-photo-close {
    position: absolute;
    z-index: 2;
    top: 10px;
    right: 10px;
}

.appearance-options {
    display: grid;
    gap: 12px;
}

.message-requests-page {
    max-width: 900px;
    margin: 0 auto;
}

.message-request-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px;
}

.message-request-details {
    min-width: 0;
    flex: 1;
}

.message-request-preview {
    margin-top: 6px;
    overflow-wrap: anywhere;
    color: #5f6878;
}

.message-request-actions {
    display: flex;
    flex: 0 0 auto;
    gap: 8px;
}

.message-request-actions form {
    margin: 0;
}

.appearance-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border: 1px solid #e3e6ed;
    border-radius: 12px;
    cursor: pointer;
}

.appearance-option:has(input:checked) {
    border-color: #7165ef;
    box-shadow: 0 0 0 2px rgba(113, 101, 239, .12);
}

.appearance-option input {
    width: 18px;
    height: 18px;
    accent-color: #7165ef;
}

.appearance-preview {
    display: flex;
    width: 88px;
    height: 60px;
    flex: 0 0 88px;
    flex-direction: column;
    gap: 5px;
    padding: 9px;
    border: 1px solid #dfe2ea;
    border-radius: 8px;
}

.appearance-preview span {
    display: block;
    width: 72%;
    height: 7px;
    border-radius: 8px;
}

.appearance-preview span:nth-child(2) {
    width: 88%;
}

.appearance-preview span:nth-child(3) {
    width: 54%;
}

.appearance-preview-light {
    background: #fff;
}

.appearance-preview-light span {
    background: #e5e7ef;
}

.appearance-preview-dark {
    border-color: #424655;
    background: #20232d;
}

.appearance-preview-dark span {
    background: #4a5061;
}

.appearance-preview-neumorphism {
    border: 0;
    background: #eceef5;
    box-shadow: inset 3px 3px 6px #d0d2dc, inset -3px -3px 6px #fff;
}

.appearance-preview-neumorphism span {
    background: #765ce2;
    box-shadow: 2px 2px 4px #c8c9d4, -2px -2px 4px #fff;
}

.appearance-preview-clay {
    border: 0;
    background: #f0eff7;
    box-shadow: 4px 4px 8px #d0ced9, -4px -4px 8px #fff;
}

.appearance-preview-clay span {
    background: #765ce2;
    box-shadow: 2px 2px 4px #c8c5d4, -2px -2px 4px #fff;
}

.appearance-option-copy {
    display: grid;
    gap: 3px;
}

.appearance-option-copy small {
    color: #818a9b;
}

html[data-theme="dark"] .appearance-option {
    border-color: #414657;
    background: #222531;
}

html[data-theme="dark"] .message-request-preview {
    color: #a1a8b8;
}

html[data-theme="dark"] .appearance-option:has(input:checked) {
    border-color: #9188ff;
}

html[data-theme="dark"] .appearance-option-copy small {
    color: #a1a8b8;
}

@media (max-width: 767.98px) {
    body.auth-screen > .container {
        min-height: calc(100vh - 56px - 1.5rem);
        min-height: calc(100svh - 56px - 1.5rem);
        align-items: stretch;
        padding: 20px 14px 28px !important;
    }

    body.auth-screen .auth-card {
        width: 100%;
    }

    body.auth-screen .auth-card .card-body {
        padding: 1.5rem;
    }

    body.auth-register-screen .auth-card form {
        grid-template-columns: minmax(0, 1fr);
    }

    body.auth-register-screen .auth-card form > .mb-3,
    body.auth-register-screen .auth-card form > button {
        grid-column: 1;
    }

    body.workspace-embedded > .container {
        padding: 14px !important;
    }

    .profile-photo-trigger > .avatar {
        width: 144px !important;
        height: 144px !important;
    }

    .user-profile-page .profile-photo-trigger > .avatar {
        width: 144px !important;
        height: 144px !important;
    }

    .message-request-item {
        align-items: flex-start;
        flex-wrap: wrap;
    }

    .message-request-actions {
        width: 100%;
        padding-left: 62px;
    }

}

html[data-theme="neumorphism"] body {
    color: #292842;
    background: #eceef5;
}

html[data-theme="neumorphism"] .card,
html[data-theme="neumorphism"] .modal-content,
html[data-theme="neumorphism"] .list-group-item,
html[data-theme="neumorphism"] .dropdown-menu,
html[data-theme="neumorphism"] .appearance-option {
    color: #292842;
    border: 0;
    border-radius: 10px;
    background: #eceef5;
    box-shadow: 7px 7px 15px #c9cbd6, -7px -7px 15px #fff;
}

html[data-theme="neumorphism"] .text-muted,
html[data-theme="neumorphism"] .form-text { color: #74738d !important; }

html[data-theme="neumorphism"] .form-control,
html[data-theme="neumorphism"] .form-select,
html[data-theme="neumorphism"] .input-group-text {
    color: #292842;
    border: 0;
    border-radius: 10px;
    background: #eceef5;
    box-shadow: inset 4px 4px 8px #c9cbd6, inset -4px -4px 8px #fff;
}

html[data-theme="neumorphism"] .btn-primary,
html[data-theme="neumorphism"] .bg-primary {
    border-color: #6c52d5;
    border-radius: 10px;
    color: #fff;
    background: #765ce2;
    box-shadow: 5px 5px 10px #c5c2d2, -4px -4px 9px #fff;
}

html[data-theme="neumorphism"] .appearance-option:has(input:checked) {
    color: #6048c4;
    box-shadow: inset 4px 4px 8px #c9cbd6, inset -4px -4px 8px #fff;
}

html[data-theme="neumorphism"] hr { border-color: #d5d6e0; }

html[data-theme="neumorphism"] .btn-close,
html[data-theme="claymorphism"] .btn-close {
    color: #6048c4;
    border-color: #fff;
    background-color: #eceef5;
}

html[data-theme="claymorphism"] body {
    color: #292842;
    background: #f0eff7;
}

html[data-theme="claymorphism"] .card,
html[data-theme="claymorphism"] .modal-content,
html[data-theme="claymorphism"] .list-group-item,
html[data-theme="claymorphism"] .dropdown-menu,
html[data-theme="claymorphism"] .appearance-option {
    color: #292842;
    border: 1px solid #fff;
    border-radius: 10px;
    background: #f0eff7;
    box-shadow: 8px 8px 18px #cccad7, -8px -8px 18px #fff;
}

html[data-theme="claymorphism"] .text-muted,
html[data-theme="claymorphism"] .form-text { color: #74738d !important; }

html[data-theme="claymorphism"] .form-control,
html[data-theme="claymorphism"] .form-select,
html[data-theme="claymorphism"] .input-group-text {
    color: #292842;
    border: 1px solid #fff;
    border-radius: 10px;
    background: #f0eff7;
    box-shadow: inset 3px 3px 7px #d0ceda, inset -3px -3px 7px #fff;
}

html[data-theme="claymorphism"] .btn-primary,
html[data-theme="claymorphism"] .bg-primary {
    border-color: #6c52d5;
    border-radius: 10px;
    color: #fff;
    background: #765ce2;
    box-shadow: 4px 5px 10px #c9c5d8, -3px -3px 8px #fff;
}

html[data-theme="claymorphism"] .appearance-option:has(input:checked) {
    border-color: #fff;
    box-shadow: inset 3px 3px 7px #d0ceda, inset -3px -3px 7px #fff;
}

html[data-theme="claymorphism"] hr { border-color: #d5d3df; }

html[data-theme="neumorphism"] .navbar.navbar-dark.bg-dark {
    border-bottom: 1px solid #fff;
    background: #eceef5 !important;
    box-shadow: 0 6px 14px #c9cbd6, 0 -3px 10px #fff;
}

html[data-theme="claymorphism"] .navbar.navbar-dark.bg-dark {
    color: #292842;
    border: 0;
    background: #f0eff7 !important;
    box-shadow: 5px 5px 12px #cccad7, -5px -5px 12px #fff;
}

html[data-theme="neumorphism"] .navbar.navbar-dark .navbar-brand,
html[data-theme="neumorphism"] .navbar.navbar-dark .nav-link,
html[data-theme="claymorphism"] .navbar.navbar-dark .navbar-brand,
html[data-theme="claymorphism"] .navbar.navbar-dark .nav-link {
    color: #6048c4;
}

html[data-theme="neumorphism"] .navbar .btn-outline-light,
html[data-theme="claymorphism"] .navbar .btn-outline-light {
    color: #6048c4;
    border-color: #fff;
    background: #eceef5;
    box-shadow: 3px 3px 7px #c9cbd6, -3px -3px 7px #fff;
}

html[data-theme="claymorphism"] .navbar .btn-outline-light {
    background: #f0eff7;
    box-shadow: 3px 3px 7px #cccad7, -3px -3px 7px #fff;
}

html[data-theme="neumorphism"] .navbar .btn-outline-light:hover,
html[data-theme="claymorphism"] .navbar .btn-outline-light:hover {
    color: #fff;
    border-color: #765ce2;
    background: #765ce2;
}

html[data-theme="neumorphism"] .embedded-page-close,
html[data-theme="neumorphism"] .page-back-icon {
    border: 0;
    color: #6048c4;
    background: transparent;
    box-shadow: none;
}

html[data-theme="claymorphism"] .embedded-page-close,
html[data-theme="claymorphism"] .page-back-icon {
    border: 0;
    border-radius: 50%;
    color: #6048c4;
    background: transparent;
    box-shadow: none;
}

html[data-theme="neumorphism"] .settings-appearance,
html[data-theme="claymorphism"] .settings-appearance {
    width: min(100%, 860px);
    margin: 0 auto;
}

html[data-theme="neumorphism"] .settings-appearance > .card,
html[data-theme="claymorphism"] .settings-appearance > .card {
    margin: 12px;
    overflow: visible;
}

html[data-theme="neumorphism"] .settings-appearance > .card > .card-body,
html[data-theme="claymorphism"] .settings-appearance > .card > .card-body {
    padding: clamp(20px, 4vw, 32px) !important;
}

html[data-theme="neumorphism"] .appearance-options,
html[data-theme="claymorphism"] .appearance-options {
    gap: 14px;
}

html[data-theme="neumorphism"] .appearance-option,
html[data-theme="claymorphism"] .appearance-option {
    min-height: 88px;
    padding: 14px 18px;
    gap: 16px;
}

html[data-theme="neumorphism"] .appearance-option input,
html[data-theme="claymorphism"] .appearance-option input {
    flex: 0 0 18px;
    margin: 0;
}

html[data-theme="neumorphism"] .appearance-option-copy,
html[data-theme="claymorphism"] .appearance-option-copy {
    min-width: 0;
    line-height: 1.4;
}

html[data-theme="neumorphism"] .appearance-preview,
html[data-theme="claymorphism"] .appearance-preview {
    flex: 0 0 88px;
}

html[data-theme="neumorphism"] .auth-card,
html[data-theme="claymorphism"] .auth-card {
    overflow: visible;
}

html[data-theme="neumorphism"] .auth-card .card-body,
html[data-theme="claymorphism"] .auth-card .card-body {
    padding: clamp(24px, 5vw, 36px);
}

html[data-theme="neumorphism"] .auth-card .form-label,
html[data-theme="claymorphism"] .auth-card .form-label {
    display: block;
    margin-bottom: 8px;
}

html[data-theme="neumorphism"] .auth-card .form-control,
html[data-theme="claymorphism"] .auth-card .form-control {
    min-height: 46px;
    padding: 10px 14px;
    line-height: 1.4;
}

html[data-theme="neumorphism"] .btn,
html[data-theme="claymorphism"] .btn {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

html[data-theme="neumorphism"] .navbar > .container,
html[data-theme="claymorphism"] .navbar > .container {
    min-height: 64px;
    align-items: center;
}

@media (max-width: 575.98px) {
    html[data-theme="neumorphism"] .settings-appearance > .card,
    html[data-theme="claymorphism"] .settings-appearance > .card {
        margin: 8px 4px;
    }

    html[data-theme="neumorphism"] .appearance-option,
    html[data-theme="claymorphism"] .appearance-option {
        min-height: 78px;
        gap: 12px;
        padding: 12px;
    }

    html[data-theme="neumorphism"] .appearance-preview,
    html[data-theme="claymorphism"] .appearance-preview {
        width: 72px;
        height: 52px;
        flex-basis: 72px;
        padding: 7px;
    }
}

.hidden-chat-list {
    max-height: 360px;
    overflow-y: auto;
    border-radius: 16px;
}

.hidden-chat-option {
    display: flex;
    min-height: 64px;
    align-items: center;
    gap: 14px;
    padding: 11px 16px;
    cursor: pointer;
}

.hidden-chat-option .form-check-input {
    flex: 0 0 18px;
    margin: 0;
}

.hidden-chat-copy {
    display: grid;
    min-width: 0;
    gap: 3px;
    line-height: 1.35;
}

.hidden-chat-copy strong,
.hidden-chat-copy small {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.hidden-chat-copy small {
    color: #74738d;
}

html[data-theme="neumorphism"] .hidden-chat-option,
html[data-theme="claymorphism"] .hidden-chat-option {
    border: 0;
    border-bottom: 1px solid rgba(116, 115, 141, .12);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

html[data-theme="neumorphism"] .hidden-chat-option:hover,
html[data-theme="claymorphism"] .hidden-chat-option:hover {
    background: rgba(118, 92, 226, .06);
}

html[data-theme="neumorphism"] .hidden-chat-option .form-check-input,
html[data-theme="claymorphism"] .hidden-chat-option .form-check-input {
    width: 18px;
    height: 18px;
    padding: 0;
    accent-color: #765ce2;
}

html[data-theme="neumorphism"] .hidden-chat-list,
html[data-theme="claymorphism"] .hidden-chat-list {
    padding: 8px;
    border: 0;
    background: #eceef5;
    box-shadow: inset 4px 4px 8px #c9cbd6, inset -4px -4px 8px #fff;
}

html[data-theme="claymorphism"] .hidden-chat-list {
    background: #f0eff7;
    box-shadow: inset 4px 4px 8px #cccad7, inset -4px -4px 8px #fff;
}

@media (max-width: 575.98px) {
    .hidden-chat-option {
        min-height: 58px;
        gap: 10px;
        padding: 10px;
    }
}
.workspace-choice {
    height: 100%;
    padding: 18px;
    border: 1px solid #e5e8ef;
    border-radius: 14px;
    background: #fff;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.workspace-choice.is-active {
    border-color: #b8c9fb;
    box-shadow: 0 8px 22px rgba(48, 84, 160, .08);
}

.workspace-active-label {
    color: #315fc5;
    font-size: .8rem;
    font-weight: 600;
}

.workspace-billing-card {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    border: 1px solid #d9e3ff;
    border-radius: 16px;
    color: #21304d;
    background: linear-gradient(112deg, #eef3ff, #f8faff 68%, #f1f8ff);
}

.workspace-billing-card > div:first-child > span {
    color: #61749c;
    letter-spacing: .08em;
}

html[data-theme="dark"] .workspace-choice {
    border-color: #343746;
    background: #222531;
}

html[data-theme="dark"] .workspace-choice.is-active {
    border-color: #677db5;
}

html[data-theme="dark"] .workspace-billing-card {
    border-color: #3b496b;
    color: #e4e7ee;
    background: linear-gradient(112deg, #272f42, #252a38 68%, #222d39);
}

html[data-theme="dark"] .workspace-billing-card > div:first-child > span {
    color: #acb8d2;
}

@media (max-width: 575.98px) {
    .workspace-billing-card {
        align-items: flex-start;
        flex-direction: column;
        padding: 18px;
    }
}

.billing-page,
.admin-billing-page {
    width: min(1120px, 100%);
    min-width: 0;
    margin: 0 auto 48px;
    color: #26334a;
}

.admin-billing-page > .row {
    margin-right: 0;
    margin-left: 0;
}

.billing-intro,
.admin-billing-hero {
    margin: 12px 0 28px;
}

.billing-eyebrow,
.admin-billing-eyebrow {
    margin: 0 0 8px;
    color: #647694;
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .14em;
}

.billing-intro h1,
.admin-billing-hero h1 {
    margin: 0 0 8px;
    font-size: clamp(1.8rem, 4vw, 2.55rem);
    font-weight: 700;
    letter-spacing: -.04em;
}

.billing-intro > p:last-child,
.admin-billing-hero p:last-child {
    color: #69768b;
}

.billing-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
    padding: 24px;
    margin-bottom: 36px;
    border: 1px solid #dce5f5;
    border-radius: 18px;
    background: linear-gradient(120deg, #f4f7ff, #fff);
}

.billing-summary.is-expired {
    border-color: #f0dfce;
    background: linear-gradient(120deg, #fff8f0, #fff);
}

.billing-account-type,
.admin-billing-type {
    color: #697a98;
    font-size: .78rem;
    font-weight: 600;
}

.billing-summary h2 {
    margin: 5px 0;
    font-size: 1.45rem;
    font-weight: 700;
}

.billing-summary p {
    margin: 0;
    color: #69768b;
}

.billing-summary-status {
    display: grid;
    justify-items: end;
    gap: 9px;
    white-space: nowrap;
}

.billing-status-pill,
.billing-current-badge {
    display: inline-flex;
    padding: 6px 11px;
    border-radius: 999px;
    color: #315fc5;
    background: #e8efff;
    font-size: .78rem;
    font-weight: 700;
}

.billing-section-heading {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 18px;
    margin: 0 0 16px;
}

.billing-section-heading h2 {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 700;
}

.billing-section-heading > p {
    margin: 0;
    color: #78849a;
    font-size: .9rem;
}

.billing-plan-grid,
.admin-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
    gap: 16px;
}

.billing-plan-card,
.admin-plan-card {
    padding: 20px;
    border: 1px solid #e1e6ef;
    border-radius: 16px;
    background: #fff;
}

.billing-plan-card.is-selected {
    border-color: #aabff4;
    box-shadow: 0 8px 24px rgba(49, 95, 197, .08);
}

.billing-plan-top,
.admin-plan-card-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.billing-plan-card h3,
.admin-plan-card h3 {
    margin: 0;
    font-size: 1.05rem;
    font-weight: 700;
}

.billing-plan-price {
    margin: 18px 0 12px;
    font-size: 1.35rem;
    font-weight: 700;
}

.billing-plan-prices {
    display: flex;
    flex-wrap: wrap;
    gap: 0 18px;
}

.billing-plan-prices .billing-plan-price {
    margin-bottom: 12px;
}

.billing-plan-price span {
    color: #7b879b;
    font-size: .85rem;
    font-weight: 400;
}

.billing-plan-card ul {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    color: #65738a;
    font-size: .9rem;
    list-style: none;
}

.billing-plan-card li::before {
    content: "✓";
    margin-right: 8px;
    color: #43866b;
    font-weight: 700;
}

.billing-note {
    display: grid;
    gap: 4px;
    padding: 16px 18px;
    margin: 24px 0 36px;
    border-left: 3px solid #d0a14f;
    border-radius: 8px;
    color: #71664f;
    background: #fffaf0;
    font-size: .9rem;
}

.billing-history {
    padding: 22px;
    border: 1px solid #e5e9f0;
    border-radius: 16px;
    background: #fff;
}

.billing-empty {
    padding: 24px 0 6px;
    color: #78849a;
    text-align: center;
}

.admin-billing-hero {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    padding: 26px;
    border: 1px solid #e0e7f3;
    border-radius: 18px;
    background: linear-gradient(115deg, #f1f5ff, #fff 72%);
}

.admin-billing-hero p {
    margin-bottom: 0;
}

.admin-billing-mini-stat {
    display: grid;
    gap: 8px;
    padding: 18px;
    border: 1px solid #e4e9f1;
    border-radius: 14px;
    background: #fff;
}

.admin-billing-mini-stat span {
    color: #728097;
    font-size: .86rem;
}

.admin-billing-mini-stat strong {
    font-size: 1.7rem;
    line-height: 1;
}

.admin-billing-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    margin-bottom: 16px;
}

.admin-billing-tabs a {
    padding: 9px 14px;
    border: 1px solid #e2e7ef;
    border-radius: 999px;
    color: #64728a;
    background: #fff;
    text-decoration: none;
    white-space: nowrap;
}

.admin-billing-tabs a.is-selected {
    border-color: #315fc5;
    color: #fff;
    background: #315fc5;
}

.admin-billing-table th {
    color: #758198;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    white-space: nowrap;
}

.admin-billing-page .table-responsive {
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scrollbar-color: #697287 transparent;
}

.admin-billing-page .table-responsive::-webkit-scrollbar {
    height: 8px;
}

.admin-billing-page .table-responsive::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: #697287;
    background-clip: padding-box;
}

.admin-billing-account-name {
    display: block;
    margin-top: 3px;
}

.admin-billing-empty {
    padding: 50px 16px;
    color: #78849a;
    text-align: center;
}

.admin-billing-empty h3 {
    margin: 8px 0;
    color: #344159;
    font-size: 1.1rem;
}

.admin-billing-empty-icon {
    font-size: 1.6rem;
}

.admin-plan-settings {
    margin-top: 40px;
}

.admin-plan-card {
    display: grid;
    align-content: start;
    gap: 18px;
    box-shadow: 0 4px 18px rgba(34, 48, 77, .04);
}

.admin-plan-card-heading {
    align-items: flex-start;
}

.admin-plan-card-heading h3 {
    margin-top: 4px;
}

.admin-plan-card .form-label {
    color: #68758b;
    font-size: .8rem;
    font-weight: 600;
}

html[data-theme="dark"] .billing-page,
html[data-theme="dark"] .admin-billing-page {
    color: #e4e7ee;
}

html[data-theme="dark"] .billing-summary,
html[data-theme="dark"] .admin-billing-hero {
    border-color: #39435a;
    color: #e4e7ee;
    background: linear-gradient(120deg, #242c3e, #222531);
}

html[data-theme="dark"] .billing-summary.is-expired {
    background: linear-gradient(120deg, #332b26, #222531);
}

html[data-theme="dark"] .billing-summary p,
html[data-theme="dark"] .billing-intro > p:last-child,
html[data-theme="dark"] .admin-billing-hero p:last-child,
html[data-theme="dark"] .billing-section-heading > p {
    color: #aeb8ca;
}

html[data-theme="dark"] .billing-plan-card,
html[data-theme="dark"] .admin-plan-card,
html[data-theme="dark"] .billing-history,
html[data-theme="dark"] .admin-billing-mini-stat,
html[data-theme="dark"] .admin-billing-tabs a {
    border-color: #3a3d4a;
    color: #e4e7ee;
    background: #222531;
}

html[data-theme="dark"] .billing-plan-card ul,
html[data-theme="dark"] .billing-plan-price span,
html[data-theme="dark"] .admin-billing-mini-stat span {
    color: #aeb8ca;
}

html[data-theme="dark"] .billing-note {
    border-color: #b88d45;
    color: #dfd1b0;
    background: #302c24;
}

html[data-theme="dark"] .admin-billing-tabs a.is-selected {
    background: #315fc5;
}

@media (max-width: 575.98px) {
    .billing-summary,
    .admin-billing-hero,
    .billing-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .billing-summary-status {
        justify-items: start;
    }

    .billing-history {
        padding: 16px;
    }
}