
body {
    background-color: #0f1419;
    color: #e3ddd3;
}

.main-content {
    padding: 2.5rem 20px;
    min-height: 70vh;
}

.container {
    max-width: 900px;
    margin: 0 auto;
}

/* Page header */
.account-header {
    margin-bottom: 2.5rem;
}

.account-header h1 {
    font-family: var(--font-display);
    font-size: 2.2rem;
    font-weight: 700;
    color: #ff6b4a;
    margin-bottom: 0.25rem;
}

.account-header .welcome-sub {
    color: #99a2b0;
    font-size: 1rem;
}

.account-header .welcome-sub span {
    color: #e3ddd3;
    font-weight: 500;
}

/* Stat hero: Total Profit */
.stat-hero {
    background: #1a2332;
    border: 2px solid rgba(255, 107, 74, 0.25);
    border-radius: var(--r-md);
    padding: 2.25rem 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    overflow: hidden;
}

.stat-hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 60%;
    height: 200%;
    background: transparent;
    pointer-events: none;
}

.stat-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.stat-hero-label {
    color: #99a2b0;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    margin: 0 0 0.4rem 0;
}

.stat-hero-value {
    font-family: var(--font-display);
    font-size: clamp(2.5rem, 6vw, 3.5rem);
    font-weight: 700;
    color: #ff6b4a;
    line-height: 1;
    margin: 0;
    letter-spacing: -0.02em;
}

.stat-hero-value.is-loss {
    color: #a83a2c;
}

.stat-hero-meta {
    color: #99a2b0;
    font-size: 0.9rem;
    margin: 0.65rem 0 0;
}

.stat-hero-meta strong {
    color: #e3ddd3;
    font-weight: 600;
}

.stat-hero-cta {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    background: rgba(255, 107, 74, 0.12);
    border: 1.5px solid rgba(255, 107, 74, 0.4);
    color: #ff6b4a;
    text-decoration: none;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.stat-hero-cta:hover {
    background: rgba(255, 107, 74, 0.2);
    border-color: #ff6b4a;
}

.stat-hero-empty {
    color: #99a2b0;
    font-size: 0.95rem;
    margin: 0.65rem 0 0;
    line-height: 1.5;
    max-width: 380px;
}

/* Cards */
.account-card {
    background-color: #1a2332;
    border-radius: var(--r-md);
    padding: 2rem;
    box-shadow: var(--shadow-1);
    margin-bottom: 1.5rem;
}

.account-card h2 {
    font-family: var(--font-display);
    font-size: 1.3rem;
    color: #ff6b4a;
    margin-bottom: 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #48536a;
}

/* Subscription status */
.status-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1rem;
    border-radius: var(--r-md);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

.status-badge.active {
    background-color: var(--positive-05);
    color: var(--positive-deep);
    border: 1px solid var(--positive);
}

.status-badge.inactive {
    background-color: rgba(168, 58, 44, 0.15);
    color: #a83a2c;
    border: 1px solid #a83a2c;
}

.status-badge.pending {
    background-color: rgba(217, 164, 65, 0.15);
    color: #d9a441;
    border: 1px solid #d9a441;
}

.status-detail {
    color: #99a2b0;
    font-size: 0.9rem;
}

.upgrade-btn {
    display: inline-block;
    padding: 0.65rem 1.5rem;
    background-color: #ff6b4a;
    color: white;
    text-decoration: none;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 0.95rem;
    transition: background-color 0.3s ease;
}

.upgrade-btn:hover {
    background-color: #ff5533;
}

/* Quick links grid */
.links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.quick-link {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    background-color: #0f1419;
    border-radius: var(--r-md);
    text-decoration: none;
    border: 2px solid #48536a;
    transition: all 0.3s ease;
}

.quick-link:hover {
    border-color: #ff6b4a;
    transform: translateY(-2px);
}

.quick-link .link-icon {
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.quick-link .link-title {
    color: #e3ddd3;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.quick-link .link-desc {
    color: #99a2b0;
    font-size: 0.8rem;
    line-height: 1.4;
}

.quick-link.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Email hint (below email detail row) */
.email-hint {
    color: #68717f;
    font-size: 0.78rem;
    margin: 0.2rem 0 0;
    line-height: 1.4;
}

.email-hint strong {
    color: #99a2b0;
}

/* Subscription status inside Account Details */
.sub-status {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.5rem;
}

/* Account details */
.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid #48536a;
}

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

.detail-label {
    color: #99a2b0;
    font-size: 0.9rem;
}

.detail-value {
    color: #e3ddd3;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Sign out */
.signout-btn {
    background: transparent;
    border: 2px solid #48536a;
    color: #99a2b0;
    padding: 0.65rem 1.5rem;
    border-radius: var(--r-md);
    font-family: var(--font-body);
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.signout-btn:hover {
    border-color: #a83a2c;
    color: #a83a2c;
}

/* Not logged in state */
.not-logged-in {
    display: none;
    text-align: center;
    padding: 4rem 2rem;
}

.not-logged-in h2 {
    font-family: var(--font-display);
    color: #ff6b4a;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.not-logged-in p {
    color: #99a2b0;
    margin-bottom: 2rem;
}

.not-logged-in a {
    display: inline-block;
    padding: 0.75rem 2rem;
    background-color: #ff6b4a;
    color: white;
    text-decoration: none;
    border-radius: var(--r-md);
    font-weight: 600;
    transition: background-color 0.3s ease;
}

.not-logged-in a:hover {
    background-color: #ff5533;
}

/* Loading state */
.loading-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #99a2b0;
}

/* Discord prompt banner (shown once to existing members) */
.discord-prompt {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: rgba(88, 101, 242, 0.14);
    border: 1.5px solid rgba(88, 101, 242, 0.45);
    border-radius: var(--r-md);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.discord-prompt-icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    line-height: 1.3;
}

.discord-prompt-text {
    flex: 1;
    min-width: 220px;
}

.discord-prompt-text strong {
    display: block;
    color: #e3ddd3;
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.discord-prompt-text p {
    color: #99a2b0;
    font-size: 0.9rem;
    margin: 0;
    line-height: 1.45;
}

.discord-prompt-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.discord-prompt-cta {
    background: #5865F2;
    color: white;
    border: none;
    padding: 0.55rem 1.1rem;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.discord-prompt-cta:hover {
    background: #4752c4;
}

.discord-prompt-dismiss {
    background: transparent;
    border: 1.5px solid #48536a;
    color: #99a2b0;
    padding: 0.55rem 1.1rem;
    border-radius: var(--r-md);
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.discord-prompt-dismiss:hover {
    border-color: #68717f;
    color: #e3ddd3;
}

/* Discord handle field inside Account Details */
.discord-row .detail-value {
    /* Override the default right-aligned text value */
    flex: 0 0 auto;
}

.discord-edit {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.discord-input-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.discord-at {
    position: absolute;
    left: 0.65rem;
    color: #68717f;
    font-size: 0.9rem;
    pointer-events: none;
    user-select: none;
    font-weight: 500;
}

.discord-input-wrap input {
    background: #0f1419;
    border: 1.5px solid #48536a;
    color: #e3ddd3;
    padding: 0.45rem 0.7rem 0.45rem 1.6rem;
    border-radius: var(--r-md);
    font-family: inherit;
    font-size: 0.9rem;
    width: 200px;
    transition: border-color 0.2s ease;
}

.discord-input-wrap input:focus {
    outline: none;
    border-color: #5865F2;
}

.discord-input-wrap input.invalid {
    border-color: #a83a2c;
}

.discord-save {
    background: #5865F2;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: var(--r-md);
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    transition: background 0.2s ease;
    font-family: inherit;
}

.discord-save:hover:not(:disabled) {
    background: #4752c4;
}

.discord-save:disabled {
    background: #48536a;
    color: #68717f;
    cursor: not-allowed;
}

.discord-status {
    font-size: 0.8rem;
    color: #99a2b0;
    min-height: 1.1em;
}

.discord-status.success {
    color: #1f7a5c;
}

.discord-status.error {
    color: #a83a2c;
}

/* Email preference field inside Account Details */
.email-preference-row {
    align-items: flex-start;
}

.email-preference-copy {
    max-width: 520px;
    color: #99a2b0;
    font-size: 0.85rem;
    line-height: 1.45;
    text-align: right;
}

.email-preference-toggle {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.6rem;
    color: #e3ddd3;
    cursor: pointer;
    text-align: left;
}

.email-preference-toggle input {
    accent-color: #ff6b4a;
    margin-top: 0.2rem;
}

.email-preference-status {
    display: block;
    min-height: 1.1em;
    margin-top: 0.35rem;
    color: #99a2b0;
}

.email-preference-status.success { color: #1f7a5c; }
.email-preference-status.error { color: #a83a2c; }

@media (max-width: 640px) {
    .account-header h1 {
        font-size: 1.8rem;
    }

    .account-card {
        padding: 1.5rem;
    }

    .links-grid {
        grid-template-columns: 1fr 1fr;
    }

    .status-row {
        flex-direction: column;
        align-items: flex-start;
    }

    .discord-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }

    .discord-input-wrap input {
        width: 100%;
        min-width: 0;
    }

    .discord-edit {
        width: 100%;
    }
}
.account-retry { font: 600 .76rem var(--font-body); border: 1px solid var(--keyline); border-radius: var(--r-sm); padding: .55rem .75rem; background: var(--surface); color: var(--ink); cursor: pointer; min-height: 40px; }
.account-retry:hover { background: var(--wash-2); }
.account-retry:disabled { opacity: .6; cursor: wait; }
.account-retry[hidden], #accountLoadRecovery[hidden], #billingSignIn[hidden] { display: none !important; }
.account-state-message { font-size: .76rem; line-height: 1.6; color: var(--ink-70); margin: .35rem 0 0; max-width: 440px; }
.account-state-message:empty { display: none; }
.sub-status .account-state-message { text-align: right; }
.account-signout { text-align: right; }
#billingStatus, #signOutStatus, #discordPromptStatus { color: var(--negative-deep); }
.account-support-notice { display: flex; align-items: flex-start; gap: .85rem; margin: 0 0 1.5rem; padding: 1.1rem 1.25rem; background: var(--caution-05); border: var(--keyline-w-sm) solid var(--caution-20); border-radius: var(--r-sm); color: var(--ink); }
.account-support-notice > .product-icon { color: var(--caution-deep); margin-top: .1rem; flex: none; }
.account-support-notice .account-support-notice-title { margin: 0 0 .4rem; font-size: 1rem; font-weight: 700; line-height: 1.4; }
.account-support-notice p { margin: 0; max-width: 80ch; font-size: .87rem; line-height: 1.65; color: var(--ink-70); }
.account-support-notice p + p { margin-top: .5rem; }
@media (max-width: 600px) { .account-support-notice { padding: 1rem; gap: .65rem; } }
#accountLoadRecovery { font-size: .85rem; line-height: 1.8; }
#accountLoadRecovery a { color: var(--info-strong); }
.discord-edit .account-retry { flex-basis: auto; }
@media(max-width:600px) { .sub-status .account-state-message, .account-signout { text-align: left; } }
