* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: #3a3a3a;
}

* {
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #0d0d0d;
    color: #e8e8e8;
    overflow: hidden;
}

.app {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 260px;
    background-color: #141414;
    border-right: 1px solid #1f1f1f;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 4px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding-left: 0;
}

.logo svg {
    width: 24px;
    height: 24px;
}

.logo-img {
    width: 42px;
    height: 42px;
    display: block;
    object-fit: contain;
}

.logo-text {
    font-weight: 600;
    font-size: 15px;
    letter-spacing: 0.3px;
    color: #ffffff;
    margin-left: -6px;
}

.icon-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-btn:hover {
    background-color: #222;
    color: #fff;
    transform: translateY(-1px);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 8px;
    /* Reduced margin to bring history closer */
}

.nav-item {
    background-color: #1e1e1e;
    border: none;
    color: #bbb;
    cursor: pointer;
    padding: 13px 16px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 400;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
}

.nav-item:hover {
    background-color: #252525;
    color: #ffffff;
}

.task-history {
    flex: 1;
    margin-bottom: 16px;
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.task-history-header {
    font-size: 11px;
    color: #555;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

.no-history {
    font-size: 13px;
    color: #555;
    font-weight: 400;
    padding: 8px 0;
}

.history-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    flex: 1;
    padding-right: 4px;
}

/* Custom subtle scrollbar for history */
.history-list::-webkit-scrollbar {
    width: 4px;
}

.history-list::-webkit-scrollbar-track {
    background: transparent;
}

.history-list::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
}

.history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.2);
}

.history-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background-color: transparent;
}

.history-item:hover {
    background-color: #1e1e1e;
}

.history-item.active {
    background-color: #222;
}

.history-text {
    flex: 1;
    font-size: 13px;
    color: #bbb;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.delete-chat {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.2s;
}

.history-item:hover .delete-chat {
    opacity: 1;
}

.delete-chat:hover {
    background-color: #2a2a2a;
    color: #e74c3c;
}

.sidebar-footer {
    margin-top: auto;
    padding: 16px 0 0;
    border-top: 1px solid #1f1f1f;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.referral-banner {
    background: linear-gradient(135deg, rgba(122, 105, 249, 0.1), rgba(242, 99, 120, 0.1));
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.referral-banner:hover {
    background: linear-gradient(135deg, rgba(122, 105, 249, 0.15), rgba(242, 99, 120, 0.15));
    border-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.referral-banner-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.referral-banner-title {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
}

.referral-banner-desc {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

.referral-banner svg {
    color: #facc15;
    opacity: 0.8;
}

.credit-widget {
    padding: 10px 4px 0;
}

.credit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
}

.credit-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #e8e8e8;
    font-weight: 500;
}

.credit-icon {
    color: #e8e8e8;
}

.credit-upgrade {
    background: transparent;
    color: #d9d9d9;
    border: 1px solid #3a3a3a;
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 999px;
    cursor: pointer;
    line-height: 1;
}

.credit-upgrade:hover {
    border-color: #5a5a5a;
    color: #ffffff;
}

.credit-bar {
    height: 8px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 999px;
    overflow: hidden;
}

.credit-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #4ade80 0%, #22c55e 100%);
    border-radius: 999px;
    min-width: 0;
}

.credit-meta {
    margin-top: 10px;
    font-size: 11px;
    color: #9b9b9b;
}

.sidebar-user-wrap {
    position: relative;
}

.sidebar-user {
    margin-top: 14px;
    padding: 10px 4px 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    user-select: none;
}

.sidebar-user-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sidebar-user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 999px;
    background-color: #1e1e1e;
    border: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #e8e8e8;
    flex: 0 0 auto;
}

.sidebar-user-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 500;
    color: #e8e8e8;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-email {
    font-size: 11px;
    color: #7a7a7a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sidebar-user-action {
    background: transparent;
    border: none;
    color: #bdbdbd;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
}

.sidebar-user-action:hover {
    background-color: #1e1e1e;
    color: #ffffff;
}

.about {
    font-size: 13px;
    color: #888;
    margin-bottom: 16px;
    text-align: center;
    padding: 12px 0;
    cursor: pointer;
    transition: color 0.3s;
}

.about:hover {
    color: #bbb;
}

.social-icons {
    display: flex;
    gap: 4px;
    justify-content: center;
}

.social-icon {
    color: #555;
    text-decoration: none;
    transition: all 0.3s;
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.social-icon:hover {
    color: #aaa;
    background-color: #1e1e1e;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background-color: #0d0d0d;
}

.top-header {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    padding: 16px 32px;
    border-bottom: none;
}

.btn-sign-in {
    background-color: #ffffff;
    color: #000000;
    border: none;
    padding: 10px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-sign-in {
    background-color: #ffffff;
    color: #000000;
    border: none;
    padding: 10px 20px;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.btn-sign-in:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 255, 255, 0.1);
}

.top-header .icon-btn {
    color: #aaa;
    gap: 8px;
    padding: 10px 16px;
    font-size: 14px;
    border-radius: 16px;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    overflow-x: hidden;
}

.welcome-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px;
    padding-top: 180px;
}

.chat-screen {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-height: 100%;
    min-height: 0;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
    padding-top: 80px;
    padding-right: 48px;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    max-width: none;
    margin: 0;
    padding-left: max(32px, calc((100% - 900px) / 2 + 32px));
    padding-right: max(48px, calc((100% - 900px) / 2 + 48px));
    width: 100%;
}

.message {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 100%;
}

.message.user {
    align-self: flex-end;
    align-items: flex-end;
}

.message.assistant {
    align-self: flex-start;
    align-items: flex-start;
}

.message-header {
    font-size: 13px;
    color: #bbb;
    font-weight: 500;
    padding: 0;
}

.message.user .message-header {
    background-color: #1e1e1e;
    border: 1px solid #2a2a2a;
    color: #e8e8e8;
    padding: 12px 14px;
    border-radius: 6px;
    max-width: 720px;
    word-break: break-word;
}

.message.user .message-header[contenteditable="true"] {
    outline: none;
    cursor: text;
}

.message.user.editing {
    align-self: stretch;
    align-items: stretch;
}

.message.user.editing .message-header {
    max-width: none;
    width: 100%;
    border-radius: 20px;
    padding: 14px 22px 10px;
    background-color: #1f1f1f;
}

.message.user.editing .user-toolbar {
    display: none;
}

.inline-edit-textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 16px;
    font-family: inherit;
    line-height: 1.6;
    resize: none;
    outline: none;
    min-height: 56px;
}

.inline-edit-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    margin-top: 16px;
}

.inline-edit-btn {
    border: 1px solid #2a2a2a;
    background-color: #232323;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    min-width: 92px;
}

.inline-edit-btn:hover {
    background-color: #2c2c2c;
}

.inline-edit-btn.primary {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #000000;
}

.inline-edit-btn.primary:hover {
    background-color: #f0f0f0;
}

.user-toolbar {
    display: inline-flex;
    align-items: center;
    background: none;
    border: none;
    border-radius: 0;
    overflow: visible;
}

.user-toolbar-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    padding: 8px 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    position: relative;
}

.user-toolbar-btn+.user-toolbar-btn {
    border-left: none;
}

.user-toolbar-btn:hover {
    color: #e0e0e0;
}

.user-toolbar-btn::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #ffffff;
    color: #000000;
    padding: 8px 10px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
}

.user-toolbar-btn:hover::after {
    opacity: 1;
}

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9999;
}

.modal {
    width: min(920px, calc(100% - 48px));
    background: #1a1a1a;
    border: 1px solid #2a2a2a;
    border-radius: 26px;
    padding: 22px 24px 24px;
    box-shadow: 0 20px 80px rgba(0, 0, 0, 0.6);
    max-height: calc(100vh - 48px);
    overflow: auto;
}

.modal.settings-modal-shell {
    width: 1150px !important;
    height: 820px !important;
    max-width: 95vw;
    max-height: 95vh;
    overflow: hidden;
    padding: 0;
    border-radius: 12px;
}

.modal.settings-modal-shell .modal-body {
    height: 100%;
    /* Take full modal height */
    max-height: 100%;
    overflow: hidden;
    /* Inner settings-modal handles scroll */
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #777;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    background-color: #2a2a2a;
    color: #e8e8e8;
}

.modal.no-title .modal-header {
    display: none;
}

.modal.auth-modal-shell {
    width: min(560px, calc(100% - 48px));
    padding: 0;
    overflow: hidden;
    background: radial-gradient(1200px 400px at 50% -120px, rgba(255, 255, 255, 0.08), rgba(0, 0, 0, 0) 60%), #0f0f0f;
}

.modal.auth-modal-shell .modal-header {
    margin: 0;
    padding: 14px 14px 0;
    justify-content: flex-end;
}

.modal.auth-modal-shell .modal-title {
    display: none;
}

.modal.auth-modal-shell .modal-body {
    padding: 8px 42px 34px;
}

.modal.gift-credits-shell {
    width: min(560px, calc(100% - 48px));
    padding: 18px 18px 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.02)), #0b0b0b;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 20px;
    box-shadow: 0 24px 90px rgba(0, 0, 0, 0.72);
}

.modal.gift-credits-shell .modal-header {
    margin: 0;
    padding: 0;
    justify-content: flex-end;
}

.modal.gift-credits-shell .modal-title {
    display: none;
}

.modal.gift-credits-shell .modal-body {
    padding: 10px 18px 16px;
}

.modal.gift-credits-shell .modal-actions {
    display: none;
}

.modal.out-credits-shell {
    width: min(640px, calc(100% - 48px));
    padding: 18px 18px 18px;
    background: #0b0b0b;
    border: 3px solid rgba(255, 255, 255, 0.88);
    border-radius: 20px;
    box-shadow: 0 26px 110px rgba(0, 0, 0, 0.78);
}

.modal.out-credits-shell .modal-header {
    margin: 0;
    padding: 0;
    justify-content: flex-end;
}

.modal.out-credits-shell .modal-title {
    display: none;
}

.modal.out-credits-shell .modal-body {
    padding: 14px 18px 14px;
}

.modal.out-credits-shell .modal-actions {
    display: none;
}

.out-credits {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 6px 2px 2px;
}

.out-credits-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 18px;
    align-items: start;
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
}

.out-credits-hero {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    align-items: center;
    justify-content: center;
}

.out-credits-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.out-credits-title {
    font-size: 22px;
    line-height: 1.15;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.out-credits-desc {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.70);
    max-width: 520px;
}

.modal.out-credits-shell .out-credits-primary,
.modal.out-credits-shell .out-credits-link {
    width: 100%;
    max-width: 540px;
    margin: 0 auto;
    display: block;
}

.out-credits-primary {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    background: #ffffff;
    color: #000000;
}

.out-credits-primary:hover {
    background: #f1f1f1;
}

.out-credits-link {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.80);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    padding: 0;
    text-align: center;
}

.out-credits-link:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

@media (max-width: 560px) {
    .modal.out-credits-shell {
        width: min(560px, calc(100% - 32px));
        padding: 16px;
        border-width: 2px;
    }

    .modal.out-credits-shell .modal-body {
        padding: 10px 10px 12px;
    }

    .out-credits-row {
        grid-template-columns: 72px 1fr;
        gap: 14px;
    }

    .out-credits-hero {
        width: 72px;
        height: 72px;
        border-radius: 16px;
    }

    .out-credits-title {
        font-size: 18px;
    }
}

.gift-credits {
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 6px 2px 2px;
}

.gift-credits-row {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 18px;
    align-items: start;
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
}

.modal.gift-credits-shell .gift-credits-primary,
.modal.gift-credits-shell .gift-credits-link {
    width: 100%;
    max-width: 520px;
    margin: 0 auto;
    display: block;
}

.gift-credits-hero {
    width: 92px;
    height: 92px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.10);
    display: flex;
    align-items: center;
    justify-content: center;
}

.gift-credits-copy {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.gift-credits-title {
    font-size: 22px;
    line-height: 1.2;
    font-weight: 750;
    color: #ffffff;
    letter-spacing: -0.2px;
}

.gift-credits-desc {
    font-size: 13px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.68);
    max-width: 480px;
}

.gift-credits-amount {
    font-size: 16px;
    font-weight: 800;
    color: #ffffff;
    letter-spacing: 0.2px;
}

.gift-credits-primary {
    width: 100%;
    border: none;
    border-radius: 12px;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    background: linear-gradient(180deg, #4f86ff 0%, #2563eb 100%);
    color: #ffffff;
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.22);
}

.gift-credits-primary:hover {
    filter: brightness(1.03);
}

.gift-credits-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.gift-credits-link {
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.70);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-align: center;
}

.gift-credits-link:hover {
    color: #ffffff;
}

@media (max-width: 560px) {
    .modal.gift-credits-shell {
        padding: 16px;
    }

    .modal.gift-credits-shell .modal-body {
        padding: 10px 10px 12px;
    }

    .gift-credits-row {
        grid-template-columns: 72px 1fr;
        gap: 14px;
    }

    .gift-credits-hero {
        width: 72px;
        height: 72px;
        border-radius: 16px;
    }

    .gift-credits-title {
        font-size: 18px;
    }
}

.auth-modal {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.auth-logo {
    width: 54px;
    height: 54px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 10px 0 18px;
}

.auth-logo img {
    width: 34px;
    height: 34px;
    object-fit: cover;
    border-radius: 8px;
}

.auth-title {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: -0.3px;
}

.auth-subtitle {
    margin-top: 8px;
    font-size: 13px;
    color: #8a8a8a;
    line-height: 1.5;
}

.auth-error {
    margin-top: 14px;
    width: min(420px, 100%);
    background: rgba(255, 61, 0, 0.08);
    border: 1px solid rgba(255, 61, 0, 0.22);
    color: #ffb4a8;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.4;
    text-align: left;
}

.auth-provider-btn {
    margin-top: 18px;
    width: min(420px, 100%);
    border-radius: 999px;
    border: 1px solid #2a2a2a;
    background: rgba(255, 255, 255, 0.02);
    color: #ffffff;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    cursor: pointer;
}

.auth-provider-btn+.auth-provider-btn {
    margin-top: 12px;
}

.auth-provider-btn:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: #3a3a3a;
}

.auth-provider-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-divider {
    margin: 18px 0 16px;
    width: min(420px, 100%);
    display: flex;
    align-items: center;
    gap: 14px;
    color: #6f6f6f;
    font-size: 12px;
    font-weight: 600;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: #222;
}

.auth-divider span {
    padding: 0 4px;
}

.auth-field {
    width: min(420px, 100%);
}

.auth-field+.auth-field {
    margin-top: 10px;
}

.auth-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid #2a2a2a;
    border-radius: 999px;
    padding: 14px 16px;
    color: #ffffff;
    font-size: 14px;
    outline: none;
}

.auth-input::placeholder {
    color: #6f6f6f;
}

.auth-input:focus {
    border-color: #3a3a3a;
}

.auth-continue {
    margin-top: 14px;
    width: min(420px, 100%);
    border-radius: 999px;
    border: 1px solid #ffffff;
    background: #ffffff;
    color: #000000;
    padding: 14px 16px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
}

.auth-continue:hover {
    background: #f0f0f0;
    border-color: #f0f0f0;
}

.auth-footer {
    margin-top: 22px;
    font-size: 13px;
    color: #8a8a8a;
}

.auth-link {
    color: #cfcfcf;
    text-decoration: underline;
    text-underline-offset: 3px;
    font-weight: 600;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (max-width: 560px) {
    .modal.auth-modal-shell .modal-body {
        padding: 8px 18px 26px;
    }

    .auth-title {
        font-size: 24px;
    }
}

.modal-body {
    color: #8a8a8a;
}

.modal-text {
    font-size: 14px;
    line-height: 1.7;
}

.modal-actions {
    margin-top: 22px;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-btn {
    border: 1px solid #2a2a2a;
    background-color: #232323;
    color: #ffffff;
    padding: 10px 18px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}

.modal-btn:hover {
    background-color: #2c2c2c;
}

.settings-modal {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 0;
    width: 100%;
    min-height: 420px;
}

.modal.settings-modal-shell .settings-modal {
    min-height: 0;
}

.settings-nav {
    background: #141414;
    border-right: 1px solid #2a2a2a;
    border-radius: 18px 0 0 18px;
    padding: 16px 12px;
}

.settings-nav-title {
    font-size: 14px;
    font-weight: 600;
    color: #e8e8e8;
    padding: 8px 10px 14px;
}

.settings-nav-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-nav-item {
    width: 100%;
    border: none;
    background: transparent;
    color: #cfcfcf;
    padding: 10px 10px;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
}

.settings-nav-item:hover {
    background: #1e1e1e;
    color: #ffffff;
}

.settings-nav-item.active {
    background: #1e1e1e;
    color: #ffffff;
}

.settings-nav-item svg {
    color: #e8e8e8;
    opacity: 0.95;
}

.settings-content {
    padding: 18px 18px 18px;
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 14px;
    border-bottom: 1px solid #2a2a2a;
}

.settings-title {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
}

.settings-panel {
    padding-top: 16px;
}

.credits-summary {
    display: grid;
    grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
    gap: 10px;
    padding: 10px 0 14px;
}

.credits-metric {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.credits-label {
    font-size: 12px;
    color: #8a8a8a;
}

.credits-value {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
}

.credits-op {
    align-self: end;
    padding-bottom: 6px;
    color: #6f6f6f;
    font-size: 14px;
}

.credits-tabs {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 4px;
    gap: 4px;
}

.credits-tab {
    border: none;
    background: transparent;
    color: #bdbdbd;
    border-radius: 10px;
    padding: 10px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
}

.credits-tab.active {
    background: #1e1e1e;
    color: #ffffff;
}

.credits-list {
    margin-top: 14px;
    min-height: 260px;
}

.credits-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
}

.credits-item+.credits-item {
    border-top: 1px solid #1f1f1f;
}

.credits-item-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.credits-item-title {
    font-size: 13px;
    color: #e8e8e8;
}

.credits-item-date {
    font-size: 12px;
    color: #7a7a7a;
}

.credits-item-amount {
    font-size: 13px;
    font-weight: 600;
    color: #8a8a8a;
}

.credits-item-amount.pos {
    color: #e8e8e8;
}

.credits-item-amount.neg {
    color: #8a8a8a;
}

.credits-end,
.credits-empty {
    padding: 18px 0 6px;
    text-align: center;
    color: #7a7a7a;
    font-size: 12px;
}

.credits-footer {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.credits-note {
    color: #7a7a7a;
    font-size: 12px;
}

.credits-note a {
    color: #bdbdbd;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.credits-actions {
    display: flex;
    gap: 10px;
}

@media (max-width: 780px) {
    .credits-summary {
        grid-template-columns: 1fr;
    }

    .credits-op {
        display: none;
    }

    .credits-footer {
        flex-direction: column;
        align-items: stretch;
    }

    .credits-actions {
        justify-content: flex-end;
    }
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 16px 0;
}

.settings-row-left {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.settings-row-title {
    font-size: 14px;
    font-weight: 600;
    color: #e8e8e8;
}

.settings-row-desc {
    font-size: 13px;
    color: #8a8a8a;
    line-height: 1.5;
}

.settings-divider {
    height: 1px;
    background: #2a2a2a;
}

.settings-action {
    border: 1px solid #2a2a2a;
    background: #1a1a1a;
    color: #e8e8e8;
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}

.settings-action:hover {
    background: #232323;
}

.settings-action.primary {
    background: #ffffff;
    color: #000000;
    border-color: #ffffff;
}

.settings-action.primary:hover {
    background: #f0f0f0;
}

.settings-empty {
    padding: 10px 0;
}

@media (max-width: 780px) {
    .settings-modal {
        grid-template-columns: 1fr;
    }

    .settings-nav {
        border-right: none;
        border-bottom: 1px solid #2a2a2a;
        border-radius: 18px 18px 0 0;
    }
}

.modal-btn.primary {
    background-color: #ffffff;
    border-color: #ffffff;
    color: #000000;
}

.modal-btn.primary:hover {
    background-color: #f0f0f0;
}

.edit-modal-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.edit-modal-textarea {
    width: 100%;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 18px;
    padding: 16px 18px;
    color: #ffffff;
    font-size: 16px;
    line-height: 1.6;
    resize: none;
    outline: none;
    min-height: 120px;
}

.edit-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.message-content {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: #e8e8e8;
    font-size: 15px;
    line-height: 1.7;
}

.message.user .message-content {
    background: transparent;
    border-radius: 0;
}

.message.assistant .message-content {
    background: transparent;
    border-radius: 0;
}

.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 12px 0;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.image-wrapper {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-top: 12px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #000;
    /* Fallback for transparent images */
}

.image-wrapper img {
    margin: 0 !important;
    display: block;
    max-width: 100%;
    height: auto;
    border-radius: 0 !important;
    /* Wrapper handles radius */
}

.image-download-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s ease;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.image-wrapper:hover .image-download-btn {
    opacity: 1;
}

.image-download-btn:hover {
    background: rgba(0, 0, 0, 0.95);
    transform: scale(1.1);
    border-color: rgba(255, 255, 255, 0.4);
}

.image-download-btn svg {
    display: block;
}

.generating {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.generating-time {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.generating-time::after {
    content: '›';
    font-size: 14px;
}

.shimmer-text {
    position: relative;
    display: inline-block;
    background: linear-gradient(90deg,
            #666 0%,
            #666 40%,
            #fff 50%,
            #666 60%,
            #666 100%);
    background-size: 200% 100%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: shimmer 2s linear infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% center;
    }

    100% {
        background-position: -200% center;
    }
}

.message-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

.action-btn {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.action-btn:hover {
    background-color: #1e1e1e;
    color: #aaa;
}

.continue-pro {
    background-color: #ffffff;
    color: #000000;
    border: none;
    padding: 10px 16px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    transition: all 0.3s;
}

.continue-pro:hover {
    background-color: #f0f0f0;
    transform: translateY(-1px);
}

.chat-input-container {
    position: sticky;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px 32px 32px;
    background: linear-gradient(to top, #0d0d0d 80%, transparent 100%);
    display: flex;
    justify-content: center;
    z-index: 10;
}

.chat-input-container .input-wrapper {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
}

.chat-input {
    width: 100%;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 24px;
    max-height: 150px;
    margin-bottom: 12px;
}

.chat-input::placeholder {
    color: #555;
}

.send-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.send-btn:hover {
    background-color: #353535;
    border-color: #4a4a4a;
    transform: translateY(-1px);
}

.send-btn svg {
    width: 18px;
    height: 18px;
}

.greeting {
    font-size: 32px;
    font-weight: 300;
    color: #ffffff;
    margin-bottom: 40px;
    text-align: center;
    letter-spacing: -0.5px;
}

.input-container.centered {
    width: 100%;
    max-width: 700px;
}

.input-wrapper {
    background: linear-gradient(145deg, #1a1a1a, #161616);
    border: 1px solid #282828;
    border-radius: 24px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-wrapper:focus-within {
    border-color: #3a3a3a;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.4);
    transform: translateY(-2px);
}

.main-input {
    width: 100%;
    background: none;
    border: none;
    color: #e0e0e0;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    outline: none;
    min-height: 60px;
    margin-bottom: 12px;
}

.main-input::placeholder {
    color: #555;
}

.input-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.attach-btn {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 8px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.attach-btn:hover {
    background-color: #2a2a2a;
    color: #fff;
    transform: scale(1.1);
}

.input-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.model-btn {
    background: none;
    border: 1px solid #2a2a2a;
    color: #e0e0e0;
    padding: 8px 14px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.model-btn:hover {
    background-color: #2a2a2a;
    border-color: #3a3a3a;
    transform: translateY(-1px);
}

.pro-badge {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.run-btn {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 10px;
    background-color: #2a2a2a;
    border: 1px solid #3a3a3a;
    color: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.run-btn:hover {
    background-color: #353535;
    border-color: #4a4a4a;
    transform: translateY(-1px);
}

.run-btn svg {
    width: 18px;
    height: 18px;
}

.category-tabs {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
}

.category-tab {
    background: none;
    border: 1px solid #2a2a2a;
    color: #999;
    padding: 10px 18px;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.category-tab:hover {
    background-color: #1e1e1e;
    color: #e0e0e0;
    border-color: #3a3a3a;
    transform: translateY(-2px);
}

.category-tab.active {
    background-color: rgba(74, 222, 128, 0.1);
    color: #4ade80;
    border-color: #4ade80;
    box-shadow: 0 4px 16px rgba(74, 222, 128, 0.2);
}

.category-tab svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.category-tab.active svg {
    color: #4ade80;
}


.footer {
    font-size: 12px;
    color: #555;
    text-align: center;
}

.message-content h1,
.message-content h2,
.message-content h3 {
    margin: 12px 0 10px;
    color: #ffffff;
    font-weight: 600;
    line-height: 1.25;
}

.message-content h1 {
    font-size: 20px;
}

.message-content h2 {
    font-size: 18px;
}

.message-content h3 {
    font-size: 16px;
}

.message-content p {
    margin: 0 0 10px;
}

.message-content ul,
.message-content ol {
    margin: 0 0 10px 18px;
    padding: 0;
}

.message-content li {
    margin: 6px 0;
}

.message-content a {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.message-content a:hover {
    color: #e8e8e8;
}

.message-content .inline-code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 13px;
    color: #ffffff;
}

.code-block {
    position: relative;
    margin: 12px 0;
    border-radius: 16px;
    background: #000000;
    border: 1px solid #1f1f1f;
    overflow: hidden;
}

.code-block::before {
    content: none;
}

.code-block-header {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #0b0b0b;
    border-bottom: 1px solid #1f1f1f;
}

.code-lang {
    font-size: 11px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.code-copy-btn {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
}

.code-copy-btn:hover {
    background: rgba(255, 255, 255, 0.12);
}

.code-block pre {
    position: relative;
    z-index: 1;
    margin: 0;
    padding: 14px 14px 16px;
    overflow: auto;
}

.code-block code {
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #e8e8e8;
    white-space: pre;
}

.code-block code .tok-keyword {
    color: #7dd3fc;
}

.code-block code .tok-string {
    color: #a7f3d0;
}

.code-block code .tok-number {
    color: #fca5a5;
}

.code-block code .tok-comment {
    color: #9ca3af;
}

.credits-corner {
    position: fixed;
    top: 18px;
    right: 24px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 12px;
}

.plan-badge-corner {
    position: fixed;
    top: 18px;
    left: 284px;
    z-index: 50;
    transition: left 0.3s ease;
}

@media (max-width: 768px) {
    .plan-badge-corner {
        left: 20px;
        top: 12px;
        transform: scale(0.9);
        transform-origin: left top;
    }
}

.button {
    --h-button: 48px;
    --w-button: 102px;
    --round: 0.75rem;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: all 0.25s ease;
    background: #000000;
    border-radius: var(--round);
    border: none;
    outline: none;
    padding: 12px 18px;
}

.button::before,
.button::after {
    content: "";
    position: absolute;
    inset: var(--space);
    transition: all 0.5s ease-in-out;
    border-radius: calc(var(--round) - var(--space));
    z-index: 0;
}

.button::before {
    --space: 1px;
    background: linear-gradient(177.95deg,
            rgba(255, 255, 255, 0.19) 0%,
            rgba(255, 255, 255, 0) 100%);
}

.button::after {
    --space: 2px;
    background: #000000;
}

.button:active {
    transform: scale(0.95);
}

.fold {
    z-index: 1;
    position: absolute;
    top: 0;
    right: 0;
    height: 1rem;
    width: 1rem;
    display: inline-block;
    transition: all 0.5s ease-in-out;
    background: #000000;
    box-shadow: 0 0 3px black;
    border-bottom-left-radius: 0.5rem;
    border-top-right-radius: var(--round);
}

.fold::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 150%;
    height: 150%;
    transform: rotate(45deg) translateX(0%) translateY(-18px);
    background-color: #e8e8e8;
    pointer-events: none;
}

.button:hover .fold {
    margin-top: -1rem;
    margin-right: -1rem;
}

.points_wrapper {
    overflow: hidden;
    width: 100%;
    height: 100%;
    pointer-events: none;
    position: absolute;
    z-index: 1;
}

.points_wrapper .point {
    bottom: -10px;
    position: absolute;
    animation: floating-points infinite ease-in-out;
    pointer-events: none;
    width: 2px;
    height: 2px;
    background-color: #fff;
    border-radius: 9999px;
}

@keyframes floating-points {
    0% {
        transform: translateY(0);
    }

    85% {
        opacity: 0;
    }

    100% {
        transform: translateY(-55px);
        opacity: 0;
    }
}

.points_wrapper .point:nth-child(1) {
    left: 10%;
    opacity: 1;
    animation-duration: 2.35s;
    animation-delay: 0.2s;
}

.points_wrapper .point:nth-child(2) {
    left: 30%;
    opacity: 0.7;
    animation-duration: 2.5s;
    animation-delay: 0.5s;
}

.points_wrapper .point:nth-child(3) {
    left: 25%;
    opacity: 0.8;
    animation-duration: 2.2s;
    animation-delay: 0.1s;
}

.points_wrapper .point:nth-child(4) {
    left: 44%;
    opacity: 0.6;
    animation-duration: 2.05s;
}

.points_wrapper .point:nth-child(5) {
    left: 50%;
    opacity: 1;
    animation-duration: 1.9s;
}

.points_wrapper .point:nth-child(6) {
    left: 75%;
    opacity: 0.5;
    animation-duration: 1.5s;
    animation-delay: 1.5s;
}

.points_wrapper .point:nth-child(7) {
    left: 88%;
    opacity: 0.9;
    animation-duration: 2.2s;
    animation-delay: 0.2s;
}

.points_wrapper .point:nth-child(8) {
    left: 58%;
    opacity: 0.8;
    animation-duration: 2.25s;
    animation-delay: 0.2s;
}

.points_wrapper .point:nth-child(9) {
    left: 98%;
    opacity: 0.6;
    animation-duration: 2.6s;
    animation-delay: 0.1s;
}

.points_wrapper .point:nth-child(10) {
    left: 65%;
    opacity: 1;
    animation-duration: 2.5s;
    animation-delay: 0.2s;
}

.inner {
    z-index: 2;
    gap: 6px;
    position: relative;
    width: 100%;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.5;
    transition: color 0.2s ease-in-out;
}

.inner svg.icon {
    width: 18px;
    height: 18px;
    transition: fill 0.1s linear;
}

.button:focus svg.icon {
    fill: white;
}

.button:hover svg.icon {
    fill: transparent;
    animation: dasharray 1s linear forwards, filled 0.1s linear forwards 0.95s;
}

@keyframes dasharray {
    from {
        stroke-dasharray: 0 0 0 0;
    }

    to {
        stroke-dasharray: 68 68 0 0;
    }
}

@keyframes filled {
    to {
        fill: white;
    }
}

.sidebar-user-wrap {
    position: relative;
}

.profile-menu {
    position: absolute;
    left: 4px;
    right: 4px;
    bottom: calc(100% + 12px);
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 18px;
    padding: 10px;
    box-shadow: 0 18px 60px rgba(0, 0, 0, 0.7);
    z-index: 50;
}

.profile-menu-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 8px 12px;
}

.profile-menu-avatar {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background-color: #1e1e1e;
    border: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    color: #e8e8e8;
    flex: 0 0 auto;
}

.profile-menu-user {
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.profile-menu-name {
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.2;
}

.profile-menu-handle {
    font-size: 12px;
    color: #9b9b9b;
    line-height: 1.2;
}

.profile-menu-sep {
    height: 1px;
    background-color: #232323;
    margin: 8px 6px;
}

.profile-menu-item {
    width: 100%;
    background: transparent;
    border: none;
    color: #e8e8e8;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 10px;
    border-radius: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    text-align: left;
}

.profile-menu-item:hover {
    background-color: #1e1e1e;
}

.profile-menu-item svg {
    color: #cfcfcf;
    flex: 0 0 auto;
}

.profile-menu-right {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #9b9b9b;
}

.profile-menu-item-group {
    position: relative;
    width: 100%;
}

.profile-submenu-flyout {
    position: absolute;
    left: calc(100% + 12px);
    bottom: -8px;
    width: 200px;
    background-color: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    padding: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transform: translateX(-10px);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 60;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-menu-item-group:hover .profile-submenu-flyout {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Connect the hover area so mouse doesn't fall through gap */
.profile-submenu-flyout::before {
    content: '';
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 12px;
}

.sidebar-user {
    border: 1px solid #2a2a2a;
    border-radius: 14px;
    padding: 10px 10px;
    background-color: #0f0f0f;
}

.sidebar-user:hover {
    background-color: #141414;
}

.footer {
    padding: 24px 18px;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: auto;
    background: rgba(0, 0, 0, 0.2);
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 24px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.45);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s ease;
}

.footer-links a:hover {
    color: #ffffff;
}

.footer-copyright {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.25);
    letter-spacing: 0.3px;
}

.img-crop-container {
    width: 100%;
    max-width: 512px;
    aspect-ratio: 1/0.92;
    overflow: hidden;
    border-radius: 12px;
    margin-top: 10px;
    background: #1a1a1a;
}

.img-crop-container img {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: top;
    display: block;
}

/* Dynamic Plan Badge Styles */
.plan-badge-btn {
    position: relative;
    background: #262626;
    border-radius: 9999px;
    padding: 1px;
    overflow: hidden;
    border: none;
    cursor: default;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.plan-badge-bg {
    position: absolute;
    inset: 0;
    border-radius: 9999px;
    overflow: hidden;
}

.plan-badge-glow-wrap {
    position: absolute;
    inset: 0;
    pointer-events: none;
    user-select: none;
}

.plan-badge-glow-circle {
    display: block;
    width: 96px;
    height: 96px;
    filter: blur(24px);
    background: linear-gradient(135deg, rgb(122, 105, 249), rgb(242, 99, 120), rgb(245, 131, 63));
    transform: translate(-50%, -33%);
}

.plan-badge-border-glow {
    position: absolute;
    inset: 0;
    pointer-events: none;
    user-select: none;
    animation: border-glow-translate 10s ease-in-out infinite alternate;
}

.plan-badge-border-glow-line {
    display: block;
    z-index: 0;
    height: 100%;
    width: 48px;
    filter: blur(24px);
    border-radius: 9999px;
    background: linear-gradient(135deg, rgb(122, 105, 249), rgb(242, 99, 120), rgb(245, 131, 63));
    transform: translateX(-50%);
    animation: border-glow-scale 10s ease-in-out infinite alternate;
}

.plan-badge-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    position: relative;
    z-index: 1;
    background: rgba(10, 10, 10, 0.9);
    border-radius: 9999px;
    padding: 8px 16px 8px 8px;
    width: 100%;
}

.plan-badge-icon-wrap {
    position: relative;
    transition: transform 0.5s ease;
}

.plan-badge-btn:hover .plan-badge-icon-wrap {
    transform: scale(1.05) rotate(360deg);
}

.plan-badge-star {
    opacity: 1;
    animation: star-rotate 14s cubic-bezier(0.68, -0.55, 0.27, 1.55) infinite alternate;
}

.plan-badge-star-shine {
    border-radius: 9999px;
    width: 44px;
    height: 44px;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    filter: blur(20px);
    opacity: 0.3;
    animation: star-shine 14s ease-in-out infinite alternate;
    background: linear-gradient(135deg, rgb(59, 196, 242), rgb(122, 105, 249), rgb(242, 99, 120), rgb(245, 131, 63));
}

.plan-badge-text {
    background: linear-gradient(to bottom, #ffffff, rgba(255, 255, 255, 0.5));
    -webkit-background-clip: text;
    background-clip: text;
    font-size: 12px;
    font-weight: 600;
    color: transparent;
    transition: transform 0.5s ease;
}

.plan-badge-btn:hover .plan-badge-text {
    transform: scale(1.05);
}

@keyframes border-glow-translate {
    from {
        transform: translateX(0);
    }

    to {
        transform: translateX(100%);
    }
}

@keyframes border-glow-scale {
    from {
        transform: translateX(-50%) scale(1);
    }

    to {
        transform: translateX(-50%) scale(1.5);
    }
}

@keyframes star-rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

@keyframes star-shine {
    from {
        opacity: 0.2;
        transform: translate(-50%, -50%) scale(0.8);
    }

    to {
        opacity: 0.5;
        transform: translate(-50%, -50%) scale(1.2);
    }
}

/* Membership Status Box */
.membership-status-box {
    margin: 10px 14px;
    padding: 12px;
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1) 0%, rgba(234, 179, 8, 0.05) 100%);
    border: 1px solid rgba(234, 179, 8, 0.2);
    border-radius: 12px;
}

.premium-label {
    color: #facc15;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 2px;
}

.expiry-text {
    color: rgba(255, 255, 255, 0.5);
    font-size: 11px;
}

/* --- Generic Modal System --- */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    z-index: 900;
    animation: fadeIn 0.2s ease-out;
}

.modal-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 24px;
    padding: 0;
    z-index: 901;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.5);
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    width: 600px;
    /* Default width */
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #2a2a2a;
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #e8e8e8;
}

.modal-close {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #2a2a2a;
    color: #fff;
}

.modal-body {
    padding: 24px;
    overflow-y: auto;
    color: #ccc;
    font-size: 15px;
    line-height: 1.6;
}

.modal-actions {
    padding: 20px 24px;
    border-top: 1px solid #2a2a2a;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

.modal-btn {
    padding: 10px 18px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.2s;
}

.modal-btn.default {
    background: transparent;
    border: 1px solid #333;
    color: #e8e8e8;
}

.modal-btn.default:hover {
    background: #2a2a2a;
}

.modal-btn.primary {
    background: #ffffff;
    color: #000000;
}

.modal-btn.primary:hover {
    background: #e0e0e0;
}

/* Removed redundant fixed size that caused jumping */

.auth-modal-shell .modal-container {
    width: 420px;
    padding: 0;
}

/* --- Gift Credits / Bonus Popup --- */
.gift-credits {
    text-align: center;
    padding: 12px;
}

.gift-credits-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.gift-credits-hero {
    width: 96px;
    height: 96px;
    background: rgba(250, 204, 21, 0.1);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.gift-credits-hero-svg {
    width: 56px;
    height: 56px;
}

.gift-credits-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.gift-credits-amount {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #facc15 0%, #a16207 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.gift-credits-desc {
    font-size: 14px;
    color: #888;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.5;
}

.gift-credits-primary {
    width: 100%;
    padding: 14px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 12px;
}

.gift-credits-primary:hover {
    transform: translateY(-2px);
}

.gift-credits-link {
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.gift-credits-link:hover {
    color: #999;
}

/* --- Auth Modal --- */
.auth-modal {
    padding: 32px;
    text-align: center;
}

.auth-logo img {
    height: 48px;
    margin-bottom: 24px;
    border-radius: 12px;
}

.auth-title {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 8px;
}

.auth-subtitle {
    font-size: 14px;
    color: #666;
    margin-bottom: 32px;
}

.auth-provider-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 12px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 14px;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 12px;
    transition: all 0.2s;
}

.auth-provider-btn:hover {
    background: #252525;
    border-color: #444;
}

.auth-divider {
    margin: 24px 0;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    height: 1px;
    background: #2a2a2a;
}

.auth-divider span {
    background: #141414;
    padding: 0 12px;
    color: #444;
    font-size: 12px;
    position: relative;
    z-index: 1;
}

.auth-field {
    display: block;
    margin-bottom: 16px;
}

.auth-input {
    width: 100%;
    background: #0a0a0a;
    border: 1px solid #333;
    padding: 12px 16px;
    border-radius: 14px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.auth-input:focus {
    border-color: #555;
}

.auth-continue {
    width: 100%;
    padding: 12px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: opacity 0.2s;
}

.auth-continue:hover {
    opacity: 0.9;
}

.auth-footer {
    margin-top: 24px;
    font-size: 13px;
    color: #666;
}

.auth-link {
    color: #fff;
    text-decoration: underline;
    margin-left: 4px;
}

.auth-error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    margin-bottom: 20px;
    text-align: center;
}

@keyframes slideUp {
    from {
        transform: translate(-50%, -45%);
        opacity: 0;
    }

    to {
        transform: translate(-50%, -50%);
        opacity: 1;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* --- Settings Modal Styles --- */
.settings-modal-shell .modal-body {
    padding: 0;
    overflow: hidden;
}

.settings-modal {
    display: flex;
    height: 100%;
    background: #141414;
}

.settings-nav {
    width: 240px;
    background: #0f0f0f;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
    padding: 16px;
    flex-shrink: 0;
}

.settings-nav-title {
    font-size: 13px;
    font-weight: 600;
    color: #666;
    margin-bottom: 12px;
    padding-left: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-nav-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.settings-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 8px;
    color: #888;
    background: transparent;
    border: none;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s;
}

.settings-nav-item:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.05);
}

.settings-nav-item.active {
    color: #fff;
    background: #262626;
}

.settings-nav-item svg {
    opacity: 0.7;
}

.settings-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    height: 100%;
    background: #141414;
}

.settings-header {
    padding: 24px;
    border-bottom: 1px solid #2a2a2a;
}

.settings-title {
    font-size: 20px;
    font-weight: 600;
    color: #fff;
}

.settings-panel {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
    height: 100%;
}

.settings-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 0;
    gap: 16px;
}

.settings-row-left {
    flex: 1;
}

.settings-row-title {
    font-size: 15px;
    font-weight: 500;
    color: #e0e0e0;
    margin-bottom: 4px;
}

.settings-row-desc {
    font-size: 13px;
    color: #888;
}

.settings-action {
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #333;
    background: transparent;
    color: #e0e0e0;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.settings-action:hover {
    background: #2a2a2a;
    border-color: #444;
}

.settings-action.primary {
    background: #fff;
    color: #000;
    border-color: #fff;
}

.settings-action.primary:hover {
    background: #e0e0e0;
    border-color: #e0e0e0;
}

.settings-divider {
    height: 1px;
    background: #2a2a2a;
    margin: 20px 0;
}

/* Credits Tab Specifics */
.credits-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 16px 20px;
    margin-bottom: 24px;
}

.credits-metric {
    text-align: center;
}

.credits-label {
    font-size: 11px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.credits-value {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
}

.credits-op {
    color: #444;
    font-size: 18px;
    font-weight: 300;
}

.credits-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 12px;
}

.credits-tab {
    background: none;
    border: none;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 6px;
    transition: all 0.2s;
}

.credits-tab:hover {
    color: #ccc;
    background: rgba(255, 255, 255, 0.05);
}

.credits-tab.active {
    color: #fff;
    background: #262626;
    font-weight: 500;
}

.credits-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.credits-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px;
    background: #1a1a1a;
    border-radius: 10px;
    border: 1px solid #2a2a2a;
}

.credits-item-title {
    font-size: 14px;
    color: #e0e0e0;
    margin-bottom: 2px;
}

.credits-item-date {
    font-size: 12px;
    color: #666;
}

.credits-item-amount {
    font-size: 14px;
    font-weight: 600;
}

.credits-item-amount.pos {
    color: #4ade80;
}

.credits-item-amount.neg {
    color: #fff;
}

.credits-empty,
.credits-end {
    text-align: center;
    padding: 20px;
    font-size: 13px;
    color: #444;
}

.credits-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    border-top: 1px solid #2a2a2a;
    padding-top: 20px;
}

.credits-note {
    font-size: 12px;
    color: #666;
}

.credits-rules {
    color: #888;
    text-decoration: underline;
}

.credits-actions {
    display: flex;
    gap: 12px;
}

/* Auth Modal Enhancements */
.auth-modal-shell .modal-body {
    padding: 0;
}

.auth-modal {
    padding: 40px;
}

.auth-modal input:focus {
    border-color: #fff;
    background: #1a1a1a;
}

/* --- Out of Credits Modal --- */
.out-credits-shell .modal-body {
    padding: 0;
}

.out-credits {
    text-align: center;
    padding: 32px;
}

.out-credits-row {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-bottom: 32px;
}

.out-credits-hero {
    width: 96px;
    height: 96px;
    background: rgba(239, 68, 68, 0.1);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
}

.out-credits-hero svg {
    width: 64px;
    height: 64px;
}

.out-credits-title {
    font-size: 20px;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 8px;
}

.out-credits-desc {
    font-size: 14px;
    color: #888;
    max-width: 380px;
    margin: 0 auto;
    line-height: 1.5;
}

.out-credits-primary {
    width: 100%;
    padding: 14px;
    background: #ffffff;
    color: #000000;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    margin-bottom: 12px;
}

.out-credits-primary:hover {
    transform: translateY(-2px);
    background: #e0e0e0;
}

.out-credits-link {
    background: none;
    border: none;
    color: #666;
    font-size: 13px;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.out-credits-link:hover {
    color: #999;
}

/* --- Admin Dashboard --- */
.admin-login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: #000;
}

.admin-login-box {
    width: 380px;
    padding: 40px;
    background: #0f0f0f;
    border: 1px solid #2a2a2a;
    border-radius: 20px;
    text-align: center;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.admin-logo .logo-text {
    font-size: 24px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
}

.admin-logo .badge {
    font-size: 11px;
    background: #facc15;
    color: #000;
    padding: 2px 6px;
    border-radius: 4px;
    vertical-align: text-top;
}

.admin-login-title {
    font-size: 18px;
    font-weight: 600;
    color: #e0e0e0;
    margin-bottom: 8px;
}

.admin-login-desc {
    font-size: 13px;
    color: #666;
    margin-bottom: 32px;
}

.admin-field {
    text-align: left;
    margin-bottom: 16px;
}

.input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #e0e0e0;
}

.admin-field label {
    display: block;
    font-size: 12px;
    color: #888;
    margin-bottom: 6px;
}

.admin-field input {
    width: 100%;
    padding: 12px;
    padding-right: 40px;
    /* Space for eye icon */
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    color: #fff;
    font-size: 14px;
    outline: none;
    transition: all 0.2s;
}

.admin-field input:focus {
    border-color: #facc15;
    background: #202020;
}

.admin-btn {
    width: 100%;
    padding: 14px;
    background: #fff;
    color: #000;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 0.2s;
}

.admin-btn:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.admin-error {
    color: #ef4444;
    font-size: 13px;
    margin-bottom: 16px;
}

/* Dashboard Layout */
.admin-dashboard-container {
    display: flex;
    height: 100vh;
    background: #000;
}

.admin-sidebar {
    width: 260px;
    background: #0f0f0f;
    border-right: 1px solid #2a2a2a;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid #2a2a2a;
}

.admin-nav {
    flex: 1;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: #888;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    text-align: left;
}

.nav-item:hover {
    color: #e0e0e0;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    color: #fff;
    background: #262626;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid #2a2a2a;
}

.nav-item.logout:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.admin-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.topbar {
    height: 70px;
    border-bottom: 1px solid #2a2a2a;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background: #0f0f0f;
}

.breadcrumb {
    color: #666;
    font-size: 14px;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 12px;
}

.admin-avatar {
    width: 36px;
    height: 36px;
    background: #262626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #fff;
}

.admin-info .name {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
}

.admin-info .role {
    font-size: 11px;
    color: #facc15;
}

.content-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 32px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.stat-card {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.stat-icon.users {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.stat-icon.active {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.stat-icon.messages {
    background: rgba(168, 85, 247, 0.1);
    color: #a855f7;
}

.stat-icon.subs {
    background: rgba(234, 179, 8, 0.1);
    color: #eab308;
}

.stat-info {
    flex: 1;
}

.stat-label {
    font-size: 13px;
    color: #888;
    margin-bottom: 4px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}

.stat-trend {
    font-size: 12px;
    color: #666;
    margin-top: 4px;
}

.stat-trend.pos {
    color: #22c55e;
}

.dashboard-rows {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

.content-card {
    background: #141414;
    border: 1px solid #2a2a2a;
    border-radius: 16px;
    overflow: hidden;
}

.card-header {
    padding: 20px 24px;
    border-bottom: 1px solid #262626;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
}

.table-responsive {
    width: 100%;
    overflow-x: auto;
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
}

.admin-table th {
    text-align: left;
    padding: 16px 24px;
    color: #666;
    font-size: 12px;
    font-weight: 500;
    background: #1a1a1a;
    border-bottom: 1px solid #262626;
}

.admin-table td {
    padding: 16px 24px;
    color: #e0e0e0;
    font-size: 14px;
    border-bottom: 1px solid #1f1f1f;
}

.user-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-cell .user-avatar {
    width: 32px;
    height: 32px;
    background: #262626;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
}

.status-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 100px;
    background: #262626;
    color: #888;
}

.status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.mono {
    font-family: 'Geist Mono', monospace;
    font-size: 12px;
    color: #888;
}

td.pos {
    color: #facc15;
    font-weight: 600;
}

/* --- Toast Notifications --- */
.toast-container {
    position: fixed;
    bottom: 32px;
    right: 32px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 9999;
    pointer-events: none;
}

.toast {
    pointer-events: auto;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 16px 20px;
    min-width: 280px;
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    animation: toastIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.toast.hiding {
    opacity: 0;
    transform: translateX(30px) scale(0.95);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.toast-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
}

.toast.success .toast-icon {
    background: rgba(74, 222, 128, 0.15);
    color: #4ade80;
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.toast.info .toast-icon {
    background: rgba(122, 105, 249, 0.15);
    color: #7A69F9;
}

.toast-content {
    flex: 1;
}

.toast-title {
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 2px;
}

.toast-message {
    color: #888;
    font-size: 13px;
    line-height: 1.4;
}

/* --- Purchase Celebration --- */
.celebration-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
}

.celebration-modal {
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    padding: 48px;
    max-width: 480px;
    width: 100%;
    text-align: center;
    position: relative;
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.6);
    animation: celebratePop 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2;
}

@keyframes celebratePop {
    from {
        opacity: 0;
        transform: scale(0.85) translateY(40px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.success-ring {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid #4ade80;
    margin: 0 auto 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: ringGlow 2s infinite alternate;
}

@keyframes ringGlow {
    from {
        box-shadow: 0 0 0px rgba(74, 222, 128, 0);
    }

    to {
        box-shadow: 0 0 30px rgba(74, 222, 128, 0.4);
    }
}

.success-ring svg {
    color: #4ade80;
    animation: checkAnim 0.6s cubic-bezier(0.16, 1, 0.3, 1) 0.3s both;
}

@keyframes checkAnim {
    from {
        opacity: 0;
        transform: scale(0.5);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Confetti System */
.confetti-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
}

.confetti {
    position: absolute;
    width: 10px;
    height: 10px;
    background: #7A69F9;
    top: -10px;
    animation: rain linear infinite;
}

@keyframes rain {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 1;
    }

    100% {
        transform: translateY(100vh) rotate(720deg);
        opacity: 0;
    }
}

.celebration-title {
    font-size: 28px;
    font-weight: 800;
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 12px;
}

.celebration-subtitle {
    font-size: 16px;
    color: #888;
    line-height: 1.6;
    margin-bottom: 32px;
}

.celebration-plan-box {
    background: rgba(122, 105, 249, 0.1);
    border: 1px solid rgba(122, 105, 249, 0.2);
    border-radius: 20px;
    padding: 24px;
    margin-bottom: 32px;
}

.celebration-plan-name {
    color: #7A69F9;
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 4px;
}

.celebration-plan-status {
    color: #fff;
    font-size: 20px;
    font-weight: 700;
}

.celebration-btn {
    background: #fff;
    color: #000;
    border: none;
    border-radius: 16px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    width: 100%;
    transition: all 0.2s;
}

.celebration-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(255, 255, 255, 0.2);
}