/* ===================================================
   TABPIA USER SYSTEM CSS
   Version: 1.2
   For: Login/Register/Forgot/Reset/Profile/Dashboard
=================================================== */


/* ===================================================
   01. FLASH / TOAST MESSAGES
=================================================== */

.tp-toast-wrap {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 100000;
    display: grid;
    gap: 12px;
    width: min(420px, calc(100vw - 32px));
    pointer-events: none;
}

.tp-toast {
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) 34px;
    align-items: start;
    gap: 12px;

    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--tp-border);
    background: color-mix(in srgb, var(--tp-surface) 94%, transparent);
    box-shadow: 0 20px 60px rgba(15, 23, 42, .18);
    backdrop-filter: blur(16px);

    pointer-events: auto;
    animation: tpToastIn .24s ease-out both;
}

.tp-toast.is-hiding {
    animation: tpToastOut .22s ease-in both;
}

.tp-toast__icon {
    width: 38px;
    height: 38px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--tp-gradient);
    flex: 0 0 auto;
}

.tp-toast__body {
    min-width: 0;
    padding-top: 1px;
}

.tp-toast__title {
    display: block;
    margin-bottom: 3px;
    color: var(--tp-text);
    font-weight: 900;
    line-height: 1.3;
}

.tp-toast__message {
    color: var(--tp-text-soft);
    font-size: 14px;
    line-height: 1.45;
    word-break: break-word;
}

.tp-toast__close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--tp-muted);
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.tp-toast__close:hover {
    color: var(--tp-text);
    background: var(--tp-surface-soft);
}

.tp-toast--success {
    border-color: rgba(5, 150, 105, .26);
}

.tp-toast--success .tp-toast__icon {
    background: linear-gradient(135deg, #10B981, #059669);
}

.tp-toast--error {
    border-color: rgba(220, 38, 38, .28);
}

.tp-toast--error .tp-toast__icon {
    background: linear-gradient(135deg, #EF4444, #DC2626);
}

.tp-toast--warning {
    border-color: rgba(249, 115, 22, .30);
}

.tp-toast--warning .tp-toast__icon {
    background: linear-gradient(135deg, #F59E0B, #F97316);
}

.tp-toast--info {
    border-color: rgba(91, 108, 251, .28);
}

.tp-toast--info .tp-toast__icon {
    background: var(--tp-gradient);
}

@keyframes tpToastIn {
    from {
        opacity: 0;
        transform: translateY(-10px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes tpToastOut {
    from {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    to {
        opacity: 0;
        transform: translateY(-10px) scale(.98);
    }
}

@media (max-width: 680px) {
    .tp-toast-wrap {
        right: 16px;
        bottom: 16px;
        left: 16px;
        width: auto;
    }

    .tp-toast {
        grid-template-columns: 34px minmax(0, 1fr) 30px;
        border-radius: 16px;
        padding: 14px;
    }

    .tp-toast__icon {
        width: 34px;
        height: 34px;
        border-radius: 12px;
    }
}


/* ===================================================
   02. AUTH / GOOGLE LOGIN
=================================================== */

.google-btn {
    min-height: 48px;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    color: var(--tp-text);
    font-weight: 900;
    background: var(--tp-surface);
    transition: border-color .2s ease, background .2s ease, transform .2s ease;
}

.google-btn span {
    color: #4285F4;
    font-weight: 900;
}

.google-btn:hover {
    border-color: var(--tp-primary);
    background: rgba(91,108,251,.08);
    color: var(--tp-text);
    transform: translateY(-1px);
}

.dev-reset-link {
    margin-top: 16px;
    padding: 14px;
    border-radius: 14px;
    background: rgba(91,108,251,.08);
    color: var(--tp-text-soft);
    font-size: 13px;
    line-height: 1.6;
    word-break: break-all;
}

.dev-reset-link a {
    color: var(--tp-primary);
    font-weight: 800;
}

.status-card {
    text-align: center;
}

.status-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 18px;
    border-radius: 20px;
    display: grid;
    place-items: center;
    background: rgba(91,108,251,.12);
    color: var(--tp-primary);
    font-size: 30px;
    font-weight: 900;
}

.auth-actions {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}


/* ===================================================
   03. USER APP SHELL
=================================================== */

.dashboard-shell {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    min-height: calc(100vh - 72px);
    background:
        radial-gradient(circle at 84% 6%, rgba(0,194,171,.12), transparent 28%),
        radial-gradient(circle at 18% 14%, rgba(91,108,251,.12), transparent 30%),
        var(--tp-bg);
}

.dashboard-sidebar {
    position: sticky;
    top: 72px;
    height: calc(100vh - 72px);
    border-right: 1px solid var(--tp-border);
    background: color-mix(in srgb, var(--tp-surface) 94%, transparent);
    padding: 28px 18px;
    overflow-y: auto;
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--tp-text);
    font-family: var(--tp-font-heading);
    font-weight: 900;
    font-size: 22px;
    margin-bottom: 28px;
    text-decoration: none;
}

.dashboard-brand img {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    object-fit: contain;
}

.dashboard-nav {
    display: grid;
    gap: 8px;
}

.dashboard-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 14px;
    color: var(--tp-text-soft);
    font-weight: 900;
    text-decoration: none;
}

.dashboard-nav a:hover,
.dashboard-nav a.active {
    color: var(--tp-primary);
    background: rgba(91,108,251,.12);
}

.dashboard-main {
    min-width: 0;
    width: 100%;
    max-width: 2560px;
    padding: 40px;
    margin-right: auto;
}

.dashboard-topbar {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;

    gap: 24px;
    margin-bottom: 28px;
}

.dashboard-topbar h1 {
    margin: 18px 0 12px;
    font-family: var(--tp-font-heading);
    font-size: clamp(34px, 4vw, 52px);
    line-height: 1.06;
    letter-spacing: -0.045em;
}

.dashboard-topbar p {
    margin: 0;
    color: var(--tp-text-soft);
    font-size: 18px;
    line-height: 1.65;
}

.dashboard-topbar .tp-btn {
    flex: 0 0 auto;
    margin-top: 10px;
}


/* ===================================================
   04. DASHBOARD METRICS
=================================================== */

.metric-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 18px;
    margin-bottom: 24px;
}

.metric-card {
    min-height: 138px;
    padding: 24px;
    border: 1px solid var(--tp-border);
    border-radius: 24px;
    background: color-mix(in srgb, var(--tp-surface) 94%, transparent);
    box-shadow: var(--tp-shadow-sm);
}

.metric-card span {
    display: block;
    color: var(--tp-muted);
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 8px;
}

.metric-card strong {
    display: block;
    color: var(--tp-text);
    font-family: var(--tp-font-heading);
    font-size: 42px;
    line-height: 1;
    letter-spacing: -0.055em;
    margin-bottom: 12px;
}

.metric-card p {
    margin: 0;
    color: var(--tp-text-soft);
    line-height: 1.55;
}


/* ===================================================
   05. PANELS / DASHBOARD GRID
=================================================== */

.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 380px;
    gap: 24px;
    align-items: start;
}

.panel {
    border: 1px solid var(--tp-border);
    border-radius: 24px;
    background: color-mix(in srgb, var(--tp-surface) 94%, transparent);
    box-shadow: var(--tp-shadow-sm);
    padding: 28px;
}

.panel h2 {
    margin: 0 0 14px;
    font-family: var(--tp-font-heading);
    font-size: 26px;
    line-height: 1.15;
    letter-spacing: -0.035em;
}

.panel > p {
    margin-top: 0;
}


/* ===================================================
   06. TASK LIST
=================================================== */

.task-list {
    display: grid;
    gap: 14px;
    margin-top: 22px;
}

.task-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    background: var(--tp-surface-soft);
}

.task-item > span {
    width: 30px;
    height: 30px;
    border-radius: 10px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--tp-gradient);
    font-weight: 900;
}

.task-item strong {
    display: block;
    margin: 0 0 5px;
    color: var(--tp-text);
}

.task-item p {
    margin: 0;
    color: var(--tp-muted);
    line-height: 1.55;
}


/* ===================================================
   07. ACCOUNT MINI CARD
=================================================== */

.account-mini {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 20px 0 24px;
}

.account-mini img,
.account-avatar {
    width: 56px;
    height: 56px;
    border-radius: 18px;
    flex: 0 0 auto;
}

.account-mini img {
    object-fit: cover;
}

.account-avatar {
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--tp-gradient);
    font-size: 22px;
    font-weight: 900;
}

.account-mini strong {
    display: block;
    margin-bottom: 4px;
}

.account-mini p {
    margin: 0;
    color: var(--tp-muted);
    line-height: 1.45;
    word-break: break-all;
}


/* ===================================================
   08. PROFILE / SETTINGS FORM
=================================================== */

.profile-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
    gap: 24px;
    align-items: start;
}

.settings-form {
    display: grid;

    gap: 14px;
    max-width: 560px;
}

.settings-form label {
    font-weight: 900;
    color: var(--tp-text);
}

.settings-form input {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    background: var(--tp-surface-soft);
    color: var(--tp-text);
    padding: 0 14px;
}

.settings-form input:disabled {
    opacity: .88;
    cursor: not-allowed;
}

.security-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 20px;
}

.muted-text {
    color: var(--tp-muted);
    line-height: 1.7;
}


/* ===================================================
   09. RESPONSIVE
=================================================== */

@media (max-width: 1180px) {
    .metric-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-grid,
    .profile-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 980px) {
    .dashboard-shell {
        grid-template-columns: 1fr;
    }

    .dashboard-sidebar {
        position: static;
        height: auto;
        border-right: 0;
        border-bottom: 1px solid var(--tp-border);
    }

    .dashboard-nav {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .dashboard-main {
        padding: 26px 16px;
    }

    .dashboard-topbar {
        flex-direction: column;
    }

    .metric-grid,
    .dashboard-nav {
        grid-template-columns: 1fr;
    }

    .panel,
    .metric-card {
        border-radius: 20px;
        padding: 22px;
    }
}
.account-avatar-image{
    width:56px;
    height:56px;
    border-radius:50%;
    object-fit:cover;
    display:block;
    flex-shrink:0;
    border:1px solid rgba(0,0,0,.08);
}

/* ===================================================
   STAGE 6 PRICING / BILLING / CHECKOUT POLISH
=================================================== */

.billing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(400px, .85fr);
    gap: 24px;
    align-items: start;
}

.billing-upgrade-panel {
    padding: 34px;
    background:
        radial-gradient(circle at 88% 0%, rgba(0,194,171,.14), transparent 34%),
        radial-gradient(circle at 8% 0%, rgba(91,108,251,.14), transparent 34%),
        color-mix(in srgb, var(--tp-surface) 94%, transparent);
}

.billing-upgrade-head {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: flex-start;
    margin-bottom: 24px;
}

.billing-upgrade-head .section-kicker {
    margin-bottom: 14px;
}

.billing-upgrade-head h2 {
    font-size: 34px;
    margin-bottom: 10px;
}

.billing-upgrade-price {
    min-width: 170px;
    text-align: right;
    font-family: var(--tp-font-heading);
    font-size: 42px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -.05em;
    color: var(--tp-text);
}

.billing-upgrade-price span {
    font-size: 16px;
    color: var(--tp-muted);
    letter-spacing: 0;
}

.billing-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.billing-feature-item {
    display: flex;
    gap: 13px;
    padding: 16px;
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    background: var(--tp-surface-soft);
}

.billing-feature-item > span {
    width: 28px;
    height: 28px;
    border-radius: 10px;
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--tp-gradient);
    font-weight: 900;
}

.billing-feature-item strong {
    display: block;
    margin-bottom: 5px;
}

.billing-feature-item p {
    margin: 0;
    color: var(--tp-muted);
    line-height: 1.5;
}

.billing-upgrade-cta {
    width: 100%;
    margin-top: 4px;
}

.billing-cancel-subscription-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    margin-top: 12px;
    padding: 0 16px;
    border: 1px solid var(--tp-border);
    border-radius: 10px;
    background: color-mix(in srgb, var(--tp-surface) 88%, transparent);
    color: var(--tp-muted);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04);
    transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}

.billing-cancel-subscription-btn:hover {
    color: var(--tp-text);
    border-color: var(--tp-muted);
    background: var(--tp-surface);
    box-shadow: 0 2px 6px rgba(15, 23, 42, .06);
    text-decoration: none;
}

.billing-current-panel {
    position: sticky;
    top: 96px;
}
.billing-current-panel .tp-btn{
    margin-top:20px;
}
.billing-current-plan {
    padding: 18px;
    border-radius: 18px;
    background: var(--tp-surface-soft);
    border: 1px solid var(--tp-border);
    margin: 18px 0;
}

.billing-current-plan span,
.billing-current-plan small {
    display: block;
    color: var(--tp-muted);
    font-weight: 800;
}

.billing-current-plan strong {
    display: inline-block;
    margin: 8px 4px 0 0;
    font-family: var(--tp-font-heading);
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.04em;
}

.billing-mini-list .task-item {
    padding: 14px;
}

.checkout-dynamic-alerts:empty {
    display: none;
}

.checkout-dynamic-alerts .checkout-status-alert {
    margin-top: 0;
}

.checkout-status-alert {
    display: grid;
    grid-template-columns: 46px minmax(0, 1fr) 36px;
    align-items: start;
    gap: 14px;
    margin: -4px 0 24px;
    padding: 18px 18px;
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    background: var(--tp-surface);
    box-shadow: var(--tp-shadow-sm);
}

.checkout-status-alert__icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    border-radius: 14px;
    font-size: 21px;
}

.checkout-status-alert__body strong {
    display: block;
    margin: 1px 0 5px;
    color: var(--tp-text);
    font-size: 16px;
}

.checkout-status-alert__body p {
    margin: 0;
    color: var(--tp-text-soft);
    line-height: 1.55;
}

.checkout-status-alert__close {
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--tp-muted);
    cursor: pointer;
    font-size: 24px;
    line-height: 1;
}

.checkout-status-alert__close:hover {
    background: var(--tp-surface-soft);
    color: var(--tp-text);
}

.checkout-status-alert--warning {
    border-color: rgba(245, 158, 11, .34);
    background: color-mix(in srgb, #f59e0b 8%, var(--tp-surface));
}

.checkout-status-alert--warning .checkout-status-alert__icon {
    background: rgba(245, 158, 11, .16);
    color: #d97706;
}

.checkout-status-alert--info {
    border-color: rgba(91, 108, 251, .28);
    background: color-mix(in srgb, var(--tp-primary) 6%, var(--tp-surface));
}

.checkout-status-alert--info .checkout-status-alert__icon {
    background: rgba(91, 108, 251, .12);
    color: var(--tp-primary);
}

.checkout-status-alert--error {
    border-color: rgba(220, 38, 38, .30);
    background: color-mix(in srgb, #dc2626 6%, var(--tp-surface));
}

.checkout-status-alert--error .checkout-status-alert__icon {
    background: rgba(220, 38, 38, .12);
    color: #dc2626;
}

.checkout-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(430px, .85fr);
    gap: 24px;
    align-items: start;
}

.checkout-main-panel,
.checkout-payment-panel {
    padding: 34px;
}

.checkout-summary-card {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin: 24px 0;
}

.checkout-summary-card > div {
    padding: 18px;
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    background: var(--tp-surface-soft);
}

.checkout-summary-card span {
    display: block;
    color: var(--tp-muted);
    font-weight: 900;
    font-size: 13px;
    margin-bottom: 7px;
}

.checkout-summary-card strong {
    font-size: 18px;
}

.checkout-included {
    margin: 26px 0;
}

.checkout-included h3,
.checkout-payment-method h3 {
    margin: 0 0 14px;
    font-size: 20px;
}

.checkout-feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.checkout-feature-grid div {
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--tp-border);
    background: var(--tp-surface-soft);
    font-weight: 800;
}

.checkout-feature-grid span {
    color: var(--tp-primary);
    font-weight: 900;
    margin-right: 6px;
}

.checkout-payment-panel {
    position: sticky;
    top: 96px;
}

.checkout-order-row,
.checkout-order-total {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 15px 0;
    border-bottom: 1px solid var(--tp-border);
}

.checkout-order-row span,
.checkout-order-total span {
    color: var(--tp-muted);
    font-weight: 800;
}

.checkout-order-total {
    align-items: baseline;
    border-bottom: 0;
    margin-top: 6px;
    padding-top: 20px;
}

.checkout-order-total strong {
    font-family: var(--tp-font-heading);
    font-size: 34px;
    line-height: 1;
    letter-spacing: -.04em;
}

.checkout-payment-method {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--tp-border);
}

.checkout-payment-method p,
.checkout-note {
    color: var(--tp-text-soft);
    line-height: 1.6;
}

.checkout-note {
    margin: 16px 0 0;
    font-size: 14px;
}


.checkout-provider-form {
    display: grid;
    gap: 12px;
}

.checkout-provider-form [data-checkout-submit]:disabled {
    cursor: wait;
    opacity: .72;
}

.checkout-provider-loading {
    display: flex;
    align-items: center;
    gap: 11px;
    min-height: 46px;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--tp-primary) 22%, var(--tp-border));
    border-radius: 14px;
    background: color-mix(in srgb, var(--tp-primary) 6%, var(--tp-surface));
    color: var(--tp-text-soft);
}

.checkout-provider-loading[hidden] {
    display: none;
}

.checkout-provider-loading__spinner {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    border: 2px solid color-mix(in srgb, var(--tp-primary) 20%, transparent);
    border-top-color: var(--tp-primary);
    border-radius: 50%;
    animation: tpCheckoutSpin .72s linear infinite;
}

.checkout-provider-loading strong,
.checkout-provider-loading small {
    display: block;
}

.checkout-provider-loading strong {
    margin-bottom: 2px;
    color: var(--tp-text);
    font-size: 13px;
}

.checkout-provider-loading small {
    color: var(--tp-muted);
    font-size: 12px;
    line-height: 1.45;
}

@keyframes tpCheckoutSpin {
    to { transform: rotate(360deg); }
}

/* Provider-neutral subscription confirmation page */
.page-subscription-success .site-main {
    min-height: calc(100vh - 72px);
    padding: 1px 0 64px;
    background:
        radial-gradient(circle at 84% 6%, rgba(0,194,171,.10), transparent 28%),
        radial-gradient(circle at 18% 14%, rgba(91,108,251,.10), transparent 30%),
        var(--tp-bg);
}

.subscription-success-shell {
    width: min(760px, calc(100% - 32px));
    margin: 56px auto;
}

.subscription-success-card {
    padding: 38px;
    text-align: center;
}

.subscription-success-icon {
    width: 68px;
    height: 68px;
    margin: 0 auto 20px;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background: rgba(16, 185, 129, .12);
    color: #059669;
    font-size: 34px;
    font-weight: 900;
}

.subscription-success-card h1 {
    margin: 0 0 12px;
    font-family: var(--tp-font-heading);
    font-size: clamp(32px, 5vw, 46px);
    letter-spacing: -.04em;
}

.subscription-success-card > p {
    max-width: 600px;
    margin: 0 auto;
}

.subscription-success-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin: 28px 0;
    text-align: left;
}

.subscription-success-summary > div {
    padding: 15px;
    border: 1px solid var(--tp-border);
    border-radius: 16px;
    background: var(--tp-surface-soft);
}

.subscription-success-summary span,
.subscription-success-summary strong {
    display: block;
}

.subscription-success-summary span {
    margin-bottom: 6px;
    color: var(--tp-muted);
    font-size: 12px;
    font-weight: 800;
}

.subscription-success-summary strong {
    color: var(--tp-text);
    font-size: 15px;
    overflow-wrap: anywhere;
}

.subscription-success-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 900px) {
    .subscription-success-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 680px) {
    .subscription-success-card {
        padding: 28px 20px;
    }

    .subscription-success-summary {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 1180px) {
    .billing-layout,
    .checkout-layout {
        grid-template-columns: 1fr;
    }

    .billing-current-panel,
    .checkout-payment-panel {
        position: static;
    }
}

@media (max-width: 980px) {
    .billing-upgrade-head {
        flex-direction: column;
    }

    .billing-upgrade-price {
        text-align: left;
    }

    .billing-feature-grid,
    .checkout-summary-card,
    .checkout-feature-grid {
        grid-template-columns: 1fr;
    }
}

/* ===================================================
   SIDEBAR STATUS / UPGRADE CTA
=================================================== */

.sidebar-status-block {
    display: grid;
    gap: 12px;
    margin: 16px 0 18px;
}

.sidebar-sync-badge {
    min-height: 40px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 12px;
    font-weight: 900;
    display: flex;
    gap: 8px;
    align-items: center;
    border: 1px solid transparent;
}

.sidebar-sync-badge i {
    font-size: 14px;
}

.sidebar-sync--on {
    background: rgba(16,185,129,.12);
    color: #059669;
    border-color: rgba(16,185,129,.20);
}

.sidebar-sync--off {
    background: rgba(249,115,22,.10);
    color: #EA580C;
    border-color: rgba(249,115,22,.22);
}

.sidebar-upgrade-box {
    position: relative;
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 14px;
    border-radius: 18px;
    color: #fff;
    text-decoration: none;
    font-weight: 900;
    background:
        radial-gradient(circle at 92% 0%, rgba(255,255,255,.30), transparent 34%),
        linear-gradient(135deg, #5B6CFB 0%, #7D5CFA 50%, #00C2AB 100%);
    box-shadow: 0 16px 34px rgba(91,108,251,.28);
    overflow: hidden;
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.sidebar-upgrade-box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.22) 45%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .55s ease;
}

.sidebar-upgrade-box:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 44px rgba(91,108,251,.34);
    filter: saturate(1.08);
}

.sidebar-upgrade-box:hover::after {
    transform: translateX(120%);
}

.sidebar-upgrade-icon {
    width: 36px;
    height: 36px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: rgba(255,255,255,.18);
    flex: 0 0 auto;
}

.sidebar-upgrade-box span {
    position: relative;
    z-index: 1;
}

.sidebar-upgrade-box strong,
.sidebar-upgrade-box small {
    display: block;
    line-height: 1.25;
}

.sidebar-upgrade-box strong {
    font-size: 14px;
}

.sidebar-upgrade-box small {
    margin-top: 3px;
    font-size: 11px;
    opacity: .88;
}

.status-ok {
    color: #059669;
}

.status-limit {
    color: #DC2626;
}


/* ===================================================
   MOBILE DASHBOARD SIDEBAR FIX
   Prevent sidebar from creating a large blank area above dashboard content.
=================================================== */

@media (max-width: 980px) {
    .dashboard-shell {
        display: block;
        min-height: auto;
    }

    .dashboard-main {
        padding-top: 26px;
    }

    .dashboard-sidebar {
        display: none;
    }

    body.sidebar-open .dashboard-sidebar,
    body.tp-sidebar-open .dashboard-sidebar,
    .dashboard-sidebar.is-open {
        display: block;
        position: fixed;
        top: 72px;
        left: 0;
        bottom: 0;
        width: min(300px, calc(100vw - 32px));
        height: auto;
        z-index: 100010;
        border-right: 1px solid var(--tp-border);
        border-bottom: 0;
        box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
        overflow-y: auto;
        background: color-mix(in srgb, var(--tp-surface) 96%, transparent);
        backdrop-filter: blur(18px);
    }

    .dashboard-nav {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 680px) {
    .dashboard-main {
        padding-top: 22px;
    }
}\n/* ===================================================\n   STAGE 7.5 SETTINGS / THEME / LAYOUT\n=================================================== */\n.settings-page{max-width:1560px;width:100%}.settings-page-head{margin-bottom:24px}.settings-page-form{display:block}.settings-layout{display:grid;grid-template-columns:minmax(0,1.45fr) minmax(340px,.75fr);gap:24px;align-items:start}.settings-main-column,.settings-side-column{display:grid;gap:24px}.settings-side-column{position:sticky;top:96px}.settings-section{padding:28px}.settings-section-head{display:flex;align-items:flex-start;gap:14px;margin-bottom:24px}.settings-section-head h2{margin:0 0 6px;font-size:24px}.settings-section-head p{margin:0;color:var(--tp-muted);line-height:1.55}.settings-section-icon{width:42px;height:42px;flex:0 0 auto;border-radius:14px;display:grid;place-items:center;color:#fff;background:var(--tp-gradient);box-shadow:0 10px 24px rgba(91,108,251,.22)}.settings-toggle-list{display:grid;gap:12px}.settings-toggle-row{display:flex;align-items:center;justify-content:space-between;gap:20px;min-height:76px;padding:15px 16px;border:1px solid var(--tp-border);border-radius:18px;background:var(--tp-surface-soft);cursor:pointer;transition:.18s ease}.settings-toggle-row:hover{border-color:rgba(91,108,251,.35);transform:translateY(-1px)}.settings-toggle-copy{min-width:0;display:flex;align-items:center;gap:14px}.settings-toggle-copy>i{width:36px;height:36px;flex:0 0 auto;display:grid;place-items:center;border-radius:12px;color:var(--tp-primary);background:rgba(91,108,251,.11)}.settings-toggle-copy strong,.settings-toggle-copy small{display:block}.settings-toggle-copy strong{color:var(--tp-text);margin-bottom:4px;font-size:15px}.settings-toggle-copy small{color:var(--tp-muted);line-height:1.45}.settings-switch{position:relative;flex:0 0 auto}.settings-switch input{position:absolute;opacity:0;pointer-events:none}.settings-switch>span{width:50px;height:28px;display:block;border-radius:999px;background:color-mix(in srgb,var(--tp-muted) 36%,transparent);transition:background .18s ease;position:relative}.settings-switch>span:after{content:"";position:absolute;top:4px;left:4px;width:20px;height:20px;border-radius:50%;background:#fff;box-shadow:0 3px 10px rgba(15,23,42,.22);transition:transform .18s ease}.settings-switch input:checked+span{background:var(--tp-primary)}.settings-switch input:checked+span:after{transform:translateX(22px)}.settings-field-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.settings-field{display:grid;gap:8px}.settings-field>span,.settings-option-label{color:var(--tp-text);font-size:13px;font-weight:900}.settings-field select{width:100%;min-height:48px;border:1px solid var(--tp-border);border-radius:14px;background:var(--tp-surface-soft);color:var(--tp-text);padding:0 42px 0 14px;font:inherit;font-weight:700}.settings-option-group{display:grid;gap:10px;margin-bottom:20px}.settings-segmented{display:grid;gap:8px;padding:6px;border:1px solid var(--tp-border);border-radius:16px;background:var(--tp-surface-soft)}.settings-segmented--three{grid-template-columns:repeat(3,minmax(0,1fr))}.settings-segmented label{cursor:pointer}.settings-segmented input{position:absolute;opacity:0;pointer-events:none}.settings-segmented span{min-height:38px;display:grid;place-items:center;border-radius:11px;color:var(--tp-text-soft);font-size:13px;font-weight:900}.settings-segmented input:checked+span{background:var(--tp-surface);color:var(--tp-primary);box-shadow:0 5px 16px rgba(15,23,42,.10)}.settings-radio-list{display:grid;gap:10px}.settings-radio-row{display:grid;grid-template-columns:20px minmax(0,1fr);gap:12px;padding:14px;border:1px solid var(--tp-border);border-radius:16px;background:var(--tp-surface-soft);cursor:pointer}.settings-radio-row input{margin-top:3px;accent-color:var(--tp-primary)}.settings-radio-row strong,.settings-radio-row small{display:block}.settings-radio-row strong{color:var(--tp-text);margin-bottom:4px}.settings-radio-row small{color:var(--tp-muted);line-height:1.45}.settings-radio-row em{margin-left:5px;padding:3px 7px;border-radius:999px;background:rgba(91,108,251,.12);color:var(--tp-primary);font-size:10px;font-style:normal;text-transform:uppercase}.settings-radio-row.is-disabled{opacity:.58;cursor:not-allowed}.settings-save-button{min-height:52px}@media(max-width:1180px){.settings-layout{grid-template-columns:1fr}.settings-side-column{position:static}}@media(max-width:760px){.settings-field-grid{grid-template-columns:1fr}.settings-section{padding:22px}.settings-toggle-row{align-items:flex-start}.settings-toggle-copy>i{display:none}}@media(max-width:480px){.settings-segmented--three{grid-template-columns:1fr}.settings-toggle-copy small{display:none}}\n

/* ===================================================
   STAGE 7.6 PROFILE / AVATAR / SECURITY
=================================================== */

.profile-page {
    max-width: 1560px;
    width: 100%;
}

.profile-page-head {
    margin-bottom: 24px;
}

.profile-page-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(340px, .65fr);
    gap: 24px;
    align-items: start;
}

.profile-main-column,
.profile-side-column {
    display: grid;
    gap: 24px;
}

.profile-side-column {
    position: sticky;
    top: 96px;
}

.profile-card {
    padding: 28px;
}

.profile-section-head {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 24px;
}

.profile-section-head--compact {
    margin-bottom: 18px;
}

.profile-section-head h2 {
    margin: 0 0 6px;
    font-size: 24px;
}

.profile-section-head p {
    margin: 0;
    color: var(--tp-muted);
    line-height: 1.55;
}

.profile-section-icon {
    width: 42px;
    height: 42px;
    flex: 0 0 auto;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--tp-gradient);
    box-shadow: 0 10px 24px rgba(91,108,251,.22);
}

.profile-section-icon--danger {
    background: linear-gradient(135deg, #F97316, #DC2626);
}

.profile-form {
    display: grid;
    gap: 18px;
    max-width: 620px;
}

.profile-field {
    display: grid;
    gap: 8px;
}

.profile-field > span {
    color: var(--tp-text);
    font-size: 13px;
    font-weight: 900;
}

.profile-field input {
    width: 100%;
    min-height: 50px;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    background: var(--tp-surface-soft);
    color: var(--tp-text);
    padding: 0 14px;
    font: inherit;
}

.profile-field input:focus {
    outline: none;
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 4px rgba(91,108,251,.12);
}

.profile-field input:disabled {
    opacity: .78;
    cursor: not-allowed;
}

.profile-field small {
    color: var(--tp-muted);
    line-height: 1.45;
}

.profile-avatar-card {
    text-align: center;
}

.profile-avatar-preview {
    width: 126px;
    height: 126px;
    margin: 0 auto 18px;
    border-radius: 34px;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    background: var(--tp-gradient);
    box-shadow: 0 22px 48px rgba(91,108,251,.24);
    font-size: 46px;
    font-weight: 900;
}

.profile-avatar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-avatar-card > h2 {
    margin-bottom: 6px;
}

.profile-avatar-card > p {
    margin: 0 0 22px;
    color: var(--tp-muted);
    word-break: break-word;
}

.profile-avatar-form {
    display: grid;
    gap: 12px;
}

.profile-avatar-form > small {
    color: var(--tp-muted);
    line-height: 1.5;
    text-align: left;
}

.profile-avatar-upload {
    position: relative;
    cursor: pointer;
}

.profile-avatar-upload input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.profile-avatar-upload > span {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px dashed rgba(91,108,251,.46);
    border-radius: 14px;
    background: rgba(91,108,251,.08);
    color: var(--tp-primary);
    font-weight: 900;
    transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.profile-avatar-upload:hover > span {
    border-color: var(--tp-primary);
    background: rgba(91,108,251,.13);
    transform: translateY(-1px);
}

.profile-avatar-upload input:focus-visible + span {
    outline: 3px solid rgba(91,108,251,.2);
    outline-offset: 3px;
}

.profile-remove-avatar {
    margin-top: 14px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #DC2626;
    font: inherit;
    font-weight: 900;
    cursor: pointer;
}

.profile-security-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    background: var(--tp-surface-soft);
}

.profile-password-form {
    margin-top: 22px;
    padding-top: 22px;
    border-top: 1px solid var(--tp-border);
}

.profile-security-provider {
    width: 44px;
    height: 44px;
    flex: 0 0 auto;
    border-radius: 14px;
    display: grid;
    place-items: center;
    color: #fff;
    background: var(--tp-gradient);
    font-size: 18px;
}

.profile-security-card strong,
.profile-security-card small {
    display: block;
}

.profile-security-card strong {
    color: var(--tp-text);
    margin-bottom: 4px;
}

.profile-security-card small {
    color: var(--tp-muted);
    line-height: 1.45;
}

.profile-detail-list {
    margin: 0;
    display: grid;
    gap: 0;
}

.profile-detail-list > div {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding: 14px 0;
    border-bottom: 1px solid var(--tp-border);
}

.profile-detail-list > div:last-child {
    border-bottom: 0;
}

.profile-detail-list dt {
    color: var(--tp-muted);
    font-weight: 800;
}

.profile-detail-list dd {
    margin: 0;
    color: var(--tp-text);
    text-align: right;
    font-weight: 900;
}

.profile-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(16,185,129,.12);
    color: #059669;
    font-size: 12px;
    font-weight: 900;
}

.profile-status--blocked,
.profile-status--deleted {
    background: rgba(220,38,38,.10);
    color: #DC2626;
}

.profile-status--inactive {
    background: rgba(249,115,22,.10);
    color: #EA580C;
}

.profile-danger-card {
    border-color: rgba(220,38,38,.20);
}

.profile-danger-card .tp-btn:disabled {
    opacity: .58;
    cursor: not-allowed;
}

@media (max-width: 1180px) {
    .profile-page-layout {
        grid-template-columns: 1fr;
    }

    .profile-side-column {
        position: static;
    }
}

@media (max-width: 680px) {
    .profile-card {
        padding: 22px;
    }

    .profile-avatar-preview {
        width: 108px;
        height: 108px;
        border-radius: 28px;
    }

    .profile-detail-list > div {
        display: grid;
        gap: 5px;
    }

    .profile-detail-list dd {
        text-align: left;
    }
}
.auth-submit-feedback {
    margin: -4px 0 0;
    color: var(--tp-muted);
    font-size: 13px;
    line-height: 1.45;
    text-align: center;
}

.auth-form button[aria-busy="true"] {
    cursor: wait;
    opacity: .78;
}
.auth-inline-success{margin:18px 0;padding:12px 14px;border-radius:12px;background:#eaf8f0;color:#17643c;font-size:13px;font-weight:800}


/* Step 8.7L — subscription billing management */
.billing-cancel-subscription-btn[type="submit"] {
    cursor: pointer;
    font-family: inherit;
}
.billing-subscription-state {
    margin-top: 18px;
    padding: 12px 14px;
    border: 1px solid var(--border-color, #d9dee8);
    border-radius: 10px;
}
.billing-subscription-state strong,
.billing-subscription-state span {
    display: block;
}
.billing-subscription-state span {
    margin-top: 4px;
    font-size: 13px;
    opacity: .76;
}
.billing-subscription-details {
    display: grid;
    gap: 10px;
    margin: 18px 0;
}
.billing-subscription-details > div {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    padding: 9px 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.billing-subscription-details span {
    font-size: 13px;
    opacity: .72;
}
.billing-subscription-details strong {
    font-size: 13px;
    text-align: right;
}


/* Step 8.7L fix1 — Billing Subscription UX */
.billing-subscribe-again-btn {
    margin-top: 12px;
}
.billing-action-note {
    margin: 8px 0 0;
    font-size: 12px;
    line-height: 1.5;
    opacity: .7;
}
.billing-subscription-details > div strong small {
    display: block;
    margin-top: 2px;
    font-size: 11px;
    font-weight: 500;
    opacity: .65;
}
.billing-subscription-id {
    max-width: 190px;
    overflow-wrap: anywhere;
}


/* Step 8.7L fix1.1 — persistent billing lifecycle notice */
.page-billing .checkout-status-alert {
    margin-bottom: 18px;
}


/* Step 8.7L fix2 — shared Plan summary cards */
.plan-summary-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}
.plan-summary-card--plan.is-pro {
    position: relative;
}
.plan-summary-expiry {
    margin-top: 7px;
    font-weight: 600;
}
.plan-summary-expiry--finite,
.plan-summary-expiry--lifetime {
    opacity: 1;
}
.plan-summary-card--sync strong {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
@media (max-width: 980px) {
    .plan-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 620px) {
    .plan-summary-grid {
        grid-template-columns: 1fr;
    }
}


/* Step 8.7L fix3 — Dashboard Resource Statistics */
.dashboard-resource-panel {
    margin-bottom: 24px;
}
.dashboard-resource-heading {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.dashboard-resource-heading .section-kicker {
    margin-bottom: 10px;
}
.dashboard-resource-heading h2 {
    margin-bottom: 7px;
}
.dashboard-resource-heading p {
    margin: 0;
}
.dashboard-resource-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}
.dashboard-resource-item {
    min-width: 0;
    padding: 18px;
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    background: var(--tp-surface-soft);
}
.dashboard-resource-item__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
}
.dashboard-resource-item__head > div {
    min-width: 0;
}
.dashboard-resource-item__head span {
    display: block;
    margin-bottom: 7px;
    color: var(--tp-muted);
    font-size: 13px;
    font-weight: 800;
}
.dashboard-resource-item__head strong {
    display: block;
    color: var(--tp-text);
    font-family: var(--tp-font-heading);
    font-size: 24px;
    line-height: 1.15;
    overflow-wrap: anywhere;
}
.dashboard-resource-item__head i {
    flex: 0 0 auto;
    font-size: 18px;
    color: var(--tp-primary);
}
.dashboard-resource-item small {
    display: block;
    margin-top: 11px;
    color: var(--tp-muted);
    line-height: 1.45;
}
.dashboard-resource-progress {
    height: 7px;
    margin-top: 16px;
    overflow: hidden;
    border-radius: 999px;
    background: color-mix(in srgb, var(--tp-border) 75%, transparent);
}
.dashboard-resource-progress span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--tp-gradient);
}
@media (max-width: 1180px) {
    .dashboard-resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
@media (max-width: 680px) {
    .dashboard-resource-grid {
        grid-template-columns: 1fr;
    }
}


/* Step 8.7L fix5 — User Billing History */
.billing-history-panel {
    margin-top: 24px;
}
.billing-history-heading {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
}
.billing-history-heading h2 {
    margin: 8px 0 6px;
}
.billing-history-heading p {
    margin: 0;
}
.billing-history-count {
    flex: 0 0 auto;
    padding: 7px 10px;
    border: 1px solid var(--tp-border);
    border-radius: 999px;
    background: var(--tp-surface-soft);
    color: var(--tp-muted);
    font-size: 12px;
    font-weight: 800;
}
.billing-history-table-wrap {
    width: 100%;
    overflow-x: auto;
}
.billing-history-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}
.billing-history-table th,
.billing-history-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--tp-border);
    text-align: left;
    vertical-align: top;
}
.billing-history-table th {
    color: var(--tp-muted);
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .035em;
}
.billing-history-table td {
    color: var(--tp-text-soft);
    font-size: 13px;
}
.billing-history-table td strong {
    display: block;
    color: var(--tp-text);
    font-weight: 800;
}
.billing-history-table td small {
    display: block;
    margin-top: 3px;
    color: var(--tp-muted);
}
.billing-history-id {
    display: inline-block;
    max-width: 210px;
    overflow-wrap: anywhere;
    color: var(--tp-text-soft);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: 12px;
}
.billing-payment-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 9px;
    border: 1px solid var(--tp-border);
    border-radius: 999px;
    background: var(--tp-surface-soft);
    color: var(--tp-text-soft);
    font-size: 12px;
    font-weight: 800;
}
.billing-payment-status--succeeded {
    border-color: rgba(16, 185, 129, .28);
    background: rgba(16, 185, 129, .08);
    color: #059669;
}
.billing-payment-status--pending {
    border-color: rgba(245, 158, 11, .28);
    background: rgba(245, 158, 11, .08);
    color: #b45309;
}
.billing-payment-status--failed,
.billing-payment-status--cancelled {
    border-color: rgba(220, 38, 38, .24);
    background: rgba(220, 38, 38, .06);
    color: #dc2626;
}
.billing-payment-status--refunded,
.billing-payment-status--partially_refunded {
    border-color: rgba(91, 108, 251, .26);
    background: rgba(91, 108, 251, .07);
    color: var(--tp-primary);
}
.billing-history-note {
    margin: 14px 0 0;
    color: var(--tp-muted);
    font-size: 12px;
    line-height: 1.55;
}
.billing-history-empty {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px;
    border: 1px dashed var(--tp-border);
    border-radius: 18px;
    background: var(--tp-surface-soft);
}
.billing-history-empty > i {
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 13px;
    background: rgba(91, 108, 251, .10);
    color: var(--tp-primary);
}
.billing-history-empty strong {
    display: block;
    margin-bottom: 4px;
}
.billing-history-empty p {
    margin: 0;
    color: var(--tp-muted);
}
@media (max-width: 680px) {
    .billing-history-heading {
        flex-direction: column;
    }

    .billing-history-table-wrap {
        overflow: visible;
    }

    .billing-history-table {
        min-width: 0;
    }

    .billing-history-table thead {
        display: none;
    }

    .billing-history-table,
    .billing-history-table tbody,
    .billing-history-table tr,
    .billing-history-table td {
        display: block;
        width: 100%;
    }

    .billing-history-table tr {
        padding: 10px 0;
        border-bottom: 1px solid var(--tp-border);
    }

    .billing-history-table td {
        display: grid;
        grid-template-columns: 112px minmax(0, 1fr);
        gap: 12px;
        padding: 7px 0;
        border-bottom: 0;
    }

    .billing-history-table td::before {
        content: attr(data-label);
        color: var(--tp-muted);
        font-size: 12px;
        font-weight: 800;
    }

    .billing-history-id {
        max-width: 100%;
    }
}


/* Step 8.7P-A fix2 — Checkout / Billing currency selection */
.billing-topbar-actions {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
}

.billing-currency-switcher {
    display: grid;
    gap: 5px;
    min-width: 180px;
}

.billing-currency-switcher label {
    color: var(--tp-muted);
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
}

.billing-currency-switcher select {
    min-height: 42px;
    padding: 0 34px 0 12px;
    border: 1px solid var(--tp-border);
    border-radius: 12px;
    background: var(--tp-surface);
    color: var(--tp-text);
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

.billing-currency-switcher select:focus {
    outline: none;
    border-color: var(--tp-primary);
    box-shadow: 0 0 0 3px rgba(91, 108, 251, .12);
}

@media (max-width: 760px) {
    .billing-topbar-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .billing-currency-switcher {
        min-width: min(100%, 240px);
    }

    .checkout-topbar .billing-currency-switcher {
        width: 100%;
        max-width: 240px;
    }
}


/* ===================================================
   STEP 8.7R-C1 — BILLING INFORMATION ARCHITECTURE
=================================================== */

.page-billing .dashboard-topbar h1 {
    margin-bottom: 8px;
}

.billing-overview-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.55fr) minmax(300px, .65fr);
    gap: 24px;
    align-items: start;
    margin-bottom: 24px;
}

.billing-overview-card {
    padding: 30px;
}

.billing-overview-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--tp-border);
}

.billing-overview-identity {
    min-width: 0;
    display: flex;
    align-items: flex-start;
    gap: 16px;
}

.billing-overview-icon {
    width: 56px;
    height: 56px;
    flex: 0 0 56px;
    display: grid;
    place-items: center;
    border-radius: 17px;
    color: var(--tp-primary);
    background: linear-gradient(145deg, rgba(91,108,251,.14), rgba(126,86,232,.10));
    font-size: 22px;
}

.billing-overview-title-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 6px;
}

.billing-overview-title-row h2 {
    margin: 0;
    font-size: 30px;
}

.billing-overview-title-row + .muted-text {
    margin: 8px 0 0;
}

.billing-subscription-badge {
    min-height: 24px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: #475467;
    background: #f2f4f7;
    font-size: 11px;
    font-weight: 900;
}

.billing-subscription-badge--active {
    color: #067647;
    background: #ecfdf3;
}

.billing-subscription-badge--cancelled,
.billing-subscription-badge--paused {
    color: #92400e;
    background: #fff7ed;
}

.billing-subscription-badge--past_due {
    color: #b42318;
    background: #fef3f2;
}

.billing-subscription-badge--free {
    color: #475467;
    background: #f2f4f7;
}

.billing-overview-price {
    flex: 0 0 auto;
    text-align: right;
}

.billing-overview-price strong,
.billing-overview-price span {
    display: block;
}

.billing-overview-price strong {
    font-family: var(--tp-font-heading);
    font-size: 30px;
    letter-spacing: -.04em;
}

.billing-overview-price span {
    margin-top: 4px;
    color: var(--tp-muted);
    font-size: 13px;
    font-weight: 800;
}

.billing-overview-facts {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
    padding: 22px 0;
    border-bottom: 1px solid var(--tp-border);
}

.billing-overview-facts > div {
    min-width: 0;
    padding: 0 18px;
    border-right: 1px solid var(--tp-border);
}

.billing-overview-facts > div:first-child {
    padding-left: 0;
}

.billing-overview-facts > div:last-child {
    padding-right: 0;
    border-right: 0;
}

.billing-overview-facts span,
.billing-overview-facts strong {
    display: block;
}

.billing-overview-facts span {
    margin-bottom: 7px;
    color: var(--tp-muted);
    font-size: 12px;
    font-weight: 800;
}

.billing-overview-facts strong {
    color: var(--tp-text);
    font-size: 14px;
    overflow-wrap: anywhere;
}

.billing-overview-secondary-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    padding-top: 18px;
}

.billing-overview-secondary-facts > span {
    min-width: 0;
    padding: 13px 14px;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    background: var(--tp-surface-soft);
}

.billing-overview-secondary-facts small,
.billing-overview-secondary-facts strong {
    display: block;
}

.billing-overview-secondary-facts small {
    margin-bottom: 5px;
    color: var(--tp-muted);
    font-size: 11px;
    font-weight: 800;
}

.billing-overview-secondary-facts strong {
    color: var(--tp-text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.billing-overview-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.billing-overview-actions form {
    margin: 0;
}

.billing-overview-actions .billing-cancel-subscription-btn {
    margin-top: 0;
}

.billing-overview-actions .billing-subscription-state {
    margin: 0;
}

.billing-pricing-card {
    position: sticky;
    top: 96px;
}

.billing-pricing-card h2 {
    margin-top: 9px;
}

.billing-pricing-quote {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    background:
        radial-gradient(circle at 90% 0%, rgba(91,108,251,.13), transparent 42%),
        var(--tp-surface-soft);
}

.billing-pricing-quote span,
.billing-pricing-quote strong,
.billing-pricing-quote small {
    display: block;
}

.billing-pricing-quote span {
    color: var(--tp-muted);
    font-size: 12px;
    font-weight: 800;
}

.billing-pricing-quote strong {
    margin-top: 7px;
    font-family: var(--tp-font-heading);
    font-size: 31px;
    letter-spacing: -.04em;
}

.billing-pricing-quote small {
    margin-top: 5px;
    color: var(--tp-muted);
    font-size: 12px;
}

.billing-pricing-note {
    margin: 16px 0 0;
    color: var(--tp-muted);
    font-size: 12px;
    line-height: 1.6;
}

.page-billing .billing-history-panel {
    margin-top: 0;
}

@media (max-width: 1180px) {
    .billing-overview-grid {
        grid-template-columns: 1fr;
    }

    .billing-pricing-card {
        position: static;
    }
}

@media (max-width: 820px) {
    .billing-overview-head {
        flex-direction: column;
    }

    .billing-overview-price {
        text-align: left;
    }

    .billing-overview-facts {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 0;
    }

    .billing-overview-facts > div {
        padding: 0 16px;
    }

    .billing-overview-facts > div:nth-child(2) {
        border-right: 0;
    }

    .billing-overview-facts > div:nth-child(3) {
        padding-left: 0;
    }

    .billing-overview-secondary-facts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .billing-overview-card {
        padding: 22px;
    }

    .billing-overview-identity {
        align-items: center;
    }

    .billing-overview-icon {
        width: 48px;
        height: 48px;
        flex-basis: 48px;
        border-radius: 14px;
    }

    .billing-overview-title-row h2 {
        font-size: 25px;
    }

    .billing-overview-facts {
        grid-template-columns: 1fr;
        gap: 0;
    }

    .billing-overview-facts > div {
        padding: 13px 0;
        border-right: 0;
        border-bottom: 1px solid var(--tp-border);
    }

    .billing-overview-facts > div:last-child {
        border-bottom: 0;
    }
}


/* ===================================================
   STEP 8.7R-C1 fix1 — direct Upgrade conversion CTA
   Match the Chrome Extension Account Upgrade treatment.
=================================================== */

.sidebar-upgrade-box {
    color: #2d2342;
    background: linear-gradient(135deg, #ffd86b 0%, #f6bf49 54%, #e7a129 100%);
    box-shadow: 0 10px 22px rgba(231, 161, 41, .26);
}

.sidebar-upgrade-box::after {
    background: linear-gradient(
        120deg,
        transparent 0%,
        rgba(255,255,255,.28) 45%,
        transparent 70%
    );
}

.sidebar-upgrade-box:hover {
    box-shadow: 0 12px 24px rgba(231, 161, 41, .32);
    filter: brightness(1.03);
}

.sidebar-upgrade-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: #3a2a00;
    background: rgba(255,255,255,.38);
    box-shadow: inset 0 0 0 1px rgba(58,42,0,.10);
    font-size: 17px;
}

.sidebar-upgrade-box small {
    color: rgba(45, 35, 66, .84);
    opacity: 1;
}


/* ===================================================
   STEP 8.7R-C2 — SUBSCRIPTION HISTORY
=================================================== */

.billing-subscription-history-panel {
    margin-bottom: 24px;
}

.billing-subscription-history-table td:first-child strong,
.billing-subscription-history-table td:first-child small,
.billing-subscription-history-table td:nth-child(6) strong,
.billing-subscription-history-table td:nth-child(6) small {
    display: block;
}

.billing-subscription-history-table td:first-child small,
.billing-subscription-history-table td:nth-child(6) small {
    margin-top: 3px;
    color: var(--tp-muted);
    font-size: 11px;
}

.billing-subscription-badge--trialing {
    color: #6941c6;
    background: #f4f3ff;
}

.billing-subscription-badge--pending {
    color: #344054;
    background: #f2f4f7;
}

.billing-subscription-badge--expired {
    color: #475467;
    background: #eaecf0;
}

.billing-subscription-badge--past_due {
    color: #b42318;
    background: #fef3f2;
}

.billing-subscription-history-table code {
    white-space: nowrap;
}

@media (max-width: 900px) {
    .billing-subscription-history-table code {
        white-space: normal;
        overflow-wrap: anywhere;
    }
}


/* ===================================================
   STEP 8.7R-C3 — SUBSCRIPTION DETAIL + RELATED PAYMENTS
=================================================== */

.billing-subscription-view-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--tp-primary);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    white-space: nowrap;
}

.billing-subscription-view-link:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

.billing-subscription-detail-card,
.billing-related-payments-panel {
    margin-bottom: 24px;
}

.billing-subscription-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--tp-border);
}

.billing-subscription-detail-head h2 {
    margin: 0;
}

.billing-detail-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
    padding-top: 22px;
}

.billing-detail-grid > div {
    min-width: 0;
    padding: 13px 16px;
    border-right: 1px solid var(--tp-border);
    border-bottom: 1px solid var(--tp-border);
}

.billing-detail-grid > div:nth-child(5n) {
    border-right: 0;
}

.billing-detail-grid span,
.billing-detail-grid strong {
    display: block;
}

.billing-detail-grid span {
    margin-bottom: 7px;
    color: var(--tp-muted);
    font-size: 11px;
    font-weight: 800;
}

.billing-detail-grid strong {
    color: var(--tp-text);
    font-size: 13px;
    overflow-wrap: anywhere;
}

.billing-detail-grid code {
    white-space: normal;
    overflow-wrap: anywhere;
}

.billing-related-payments-table td:nth-child(3) strong,
.billing-related-payments-table td:nth-child(3) small {
    display: block;
}

.billing-related-payments-table td:nth-child(3) small {
    margin-top: 3px;
    color: var(--tp-muted);
    font-size: 11px;
}

.billing-subscription-detail-empty {
    max-width: 680px;
}

.billing-subscription-detail-empty > i {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    margin-bottom: 16px;
    border-radius: 16px;
    color: #b42318;
    background: #fef3f2;
    font-size: 22px;
}

.billing-subscription-detail-empty .tp-btn {
    margin-top: 18px;
}

@media (max-width: 1100px) {
    .billing-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .billing-detail-grid > div,
    .billing-detail-grid > div:nth-child(5n) {
        border-right: 1px solid var(--tp-border);
    }

    .billing-detail-grid > div:nth-child(2n) {
        border-right: 0;
    }
}

@media (max-width: 620px) {
    .billing-subscription-detail-head {
        flex-direction: column;
    }

    .billing-detail-grid {
        grid-template-columns: 1fr;
    }

    .billing-detail-grid > div,
    .billing-detail-grid > div:nth-child(2n),
    .billing-detail-grid > div:nth-child(5n) {
        border-right: 0;
    }
}


/* ===================================================
   STEP 8.7R-C4 — PAYMENT HISTORY / TRANSACTION DETAIL
=================================================== */


.billing-order-type {
    min-height: 23px;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
}

.billing-order-type--initial {
    color: #6941c6;
    background: #f4f3ff;
}

.billing-order-type--renewal {
    color: #047857;
    background: #ecfdf5;
}

.billing-order-type--unknown {
    color: #475467;
    background: #f2f4f7;
}

.billing-transaction-type {
    min-height: 23px;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: #344054;
    background: #f2f4f7;
    font-size: 10px;
    font-weight: 900;
}

.billing-transaction-type--refund {
    color: #6941c6;
    background: #f4f3ff;
}

.billing-transaction-type--charge {
    color: #175cd3;
    background: #eff8ff;
}

.billing-payment-detail-card,
.billing-payment-relations-card {
    margin-bottom: 24px;
}

.billing-payment-detail-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 24px;
    padding-bottom: 22px;
    border-bottom: 1px solid var(--tp-border);
}

.billing-payment-failure {
    margin-top: 20px;
    padding: 16px;
    border: 1px solid #fecdca;
    border-radius: 15px;
    color: #b42318;
    background: #fef3f2;
}

.billing-payment-failure strong,
.billing-payment-failure span {
    display: block;
}

.billing-payment-failure span {
    margin-top: 6px;
    font-size: 12px;
}

.billing-payment-failure p {
    margin: 8px 0 0;
    line-height: 1.55;
}

.billing-payment-relations {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 18px;
}

.billing-payment-relations > div {
    min-width: 0;
    padding: 16px;
    border: 1px solid var(--tp-border);
    border-radius: 16px;
    background: var(--tp-surface-soft);
}

.billing-payment-relations span,
.billing-payment-relations strong,
.billing-payment-relations small,
.billing-payment-relations a {
    display: block;
}

.billing-payment-relations span {
    margin-bottom: 7px;
    color: var(--tp-muted);
    font-size: 11px;
    font-weight: 800;
}

.billing-payment-relations strong {
    color: var(--tp-text);
    overflow-wrap: anywhere;
}

.billing-payment-relations small {
    margin-top: 5px;
    color: var(--tp-muted);
}

.billing-payment-relations a {
    margin-top: 9px;
    color: var(--tp-primary);
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.billing-payment-relations a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

@media (max-width: 720px) {
    .billing-payment-detail-head {
        flex-direction: column;
    }

    .billing-payment-relations {
        grid-template-columns: 1fr;
    }
}


/* ===================================================
   STEP 8.7R-C5 — ACCESS-STATE AUDIT
=================================================== */

.billing-subscription-badge--trialing {
    color: #6941c6;
    background: #f4f3ff;
}

.billing-subscription-badge--active {
    color: #067647;
    background: #ecfdf3;
}

.billing-subscription-badge--free {
    color: #475467;
    background: #f2f4f7;
}

.billing-subscription-badge--cancelled {
    color: #92400e;
    background: #fff7ed;
}

.billing-subscription-badge--past_due {
    color: #b42318;
    background: #fef3f2;
}

.billing-subscription-badge--paused {
    color: #6941c6;
    background: #f4f3ff;
}


/* ===================================================
   STEP 8.7R-C6 — DASHBOARD PAGE REDESIGN
=================================================== */

.page-dashboard .dashboard-topbar {
    margin-bottom: 18px;
}

.dashboard-summary-grid {
    gap: 14px;
    margin-bottom: 18px;
}

.dashboard-summary-grid .metric-card {
    min-height: 0;
    padding: 17px 18px;
    border-radius: 18px;
}

.dashboard-summary-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
}

.dashboard-summary-card-head > span {
    color: var(--tp-muted);
    font-size: 11px;
    font-weight: 900;
}

.dashboard-summary-card-head > i {
    color: var(--tp-primary);
    font-size: 13px;
}

.dashboard-summary-grid .metric-card > strong {
    display: flex;
    align-items: baseline;
    gap: 5px;
    margin: 0;
    font-size: 27px;
    line-height: 1.05;
}

.dashboard-summary-grid .metric-card > strong small {
    color: var(--tp-muted);
    font-size: 13px;
    font-weight: 800;
}

.dashboard-summary-grid .metric-card > p {
    margin: 6px 0 0;
    font-size: 11px;
    line-height: 1.4;
}

.page-dashboard .dashboard-resource-panel {
    margin-bottom: 18px;
    padding: 24px;
}

.page-dashboard .dashboard-resource-heading {
    margin-bottom: 16px;
}

.page-dashboard .dashboard-resource-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.page-dashboard .dashboard-resource-item {
    min-height: 108px;
    padding: 15px;
}

.dashboard-recent-subscriptions {
    padding: 24px;
}

.dashboard-recent-subscriptions-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 16px;
}

.dashboard-recent-subscriptions-head h2 {
    margin: 5px 0 5px;
}

.dashboard-subscription-list {
    display: grid;
    gap: 9px;
}

.dashboard-subscription-row {
    min-width: 0;
    display: grid;
    grid-template-columns: minmax(180px, 1.15fr) minmax(90px, .5fr) minmax(180px, 1fr) minmax(190px, 1fr) minmax(100px, .5fr) auto 18px;
    align-items: center;
    gap: 16px;
    padding: 14px 15px;
    border: 1px solid var(--tp-border);
    border-radius: 15px;
    color: var(--tp-text);
    background: var(--tp-surface-soft);
    text-decoration: none;
    transition:
        border-color .16s ease,
        background .16s ease,
        transform .16s ease,
        box-shadow .16s ease;
}

.dashboard-subscription-row:hover {
    border-color: color-mix(in srgb, var(--tp-primary) 30%, var(--tp-border));
    background: color-mix(in srgb, var(--tp-primary) 4%, var(--tp-surface));
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(15, 23, 42, .05);
}

.dashboard-subscription-main {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 11px;
}

.dashboard-subscription-icon {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--tp-primary);
    background: color-mix(in srgb, var(--tp-primary) 10%, var(--tp-surface));
}

.dashboard-subscription-main strong,
.dashboard-subscription-main small,
.dashboard-subscription-provider span,
.dashboard-subscription-provider strong,
.dashboard-subscription-id span,
.dashboard-subscription-id strong,
.dashboard-subscription-period span,
.dashboard-subscription-period strong,
.dashboard-subscription-amount span,
.dashboard-subscription-amount strong,
.dashboard-subscription-amount small {
    display: block;
}

.dashboard-subscription-main strong {
    font-size: 13px;
}

.dashboard-subscription-main small,
.dashboard-subscription-provider span,
.dashboard-subscription-id span,
.dashboard-subscription-period span,
.dashboard-subscription-amount span,
.dashboard-subscription-amount small {
    margin-top: 3px;
    color: var(--tp-muted);
    font-size: 10px;
}

.dashboard-subscription-provider,
.dashboard-subscription-id,
.dashboard-subscription-period,
.dashboard-subscription-amount {
    min-width: 0;
}

.dashboard-subscription-provider strong,
.dashboard-subscription-id strong,
.dashboard-subscription-period strong,
.dashboard-subscription-amount strong {
    margin-top: 4px;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.dashboard-subscription-status {
    display: flex;
    justify-content: flex-end;
}

.dashboard-subscription-arrow {
    color: var(--tp-muted);
    font-size: 11px;
}

.dashboard-subscriptions-empty {
    min-height: 96px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;
    padding: 16px;
    border: 1px dashed var(--tp-border);
    border-radius: 15px;
    background: var(--tp-surface-soft);
}

.dashboard-subscriptions-empty-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: var(--tp-primary);
    background: color-mix(in srgb, var(--tp-primary) 9%, var(--tp-surface));
}

.dashboard-subscriptions-empty strong {
    display: block;
    margin-bottom: 4px;
}

.dashboard-subscriptions-empty p {
    margin: 0;
    color: var(--tp-muted);
    font-size: 12px;
}

@media (max-width: 1180px) {
    .page-dashboard .dashboard-resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-subscription-row {
        grid-template-columns: minmax(220px, 1fr) minmax(190px, .8fr) minmax(100px, .45fr) auto 18px;
    }
}

@media (max-width: 900px) {
    .dashboard-summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .dashboard-subscription-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 10px 14px;
    }

    .dashboard-subscription-period,
    .dashboard-subscription-amount {
        grid-column: 1;
    }

    .dashboard-subscription-status,
    .dashboard-subscription-arrow {
        grid-column: 2;
    }

    .dashboard-subscription-status {
        grid-row: 1;
    }
}

@media (max-width: 620px) {
    .dashboard-summary-grid,
    .page-dashboard .dashboard-resource-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-recent-subscriptions-head {
        flex-direction: column;
    }

    .dashboard-subscription-row {
        grid-template-columns: 1fr auto;
    }

    .dashboard-subscriptions-empty {
        grid-template-columns: auto 1fr;
    }

    .dashboard-subscriptions-empty .tp-btn {
        grid-column: 1 / -1;
    }
}


/* ===================================================
   STEP 8.7R-C7 — PROFILE PAGE REDESIGN
=================================================== */

.profile-redesign-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(300px, .55fr);
    gap: 22px;
    align-items: start;
}

.profile-redesign-main {
    min-width: 0;
    display: grid;
    gap: 22px;
}

.profile-redesign-side {
    min-width: 0;
    position: sticky;
    top: 92px;
}

.profile-page-head {
    margin-bottom: 20px;
}

.profile-page-head h1 {
    margin-bottom: 8px;
}

.profile-identity-card,
.profile-security-section,
.profile-account-card {
    padding: 26px;
}

.profile-identity-layout {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    margin-top: 22px;
}

.profile-photo-column {
    min-width: 0;
    text-align: center;
}

.profile-avatar-preview--compact {
    width: 104px;
    height: 104px;
    margin: 0 auto 13px;
    border-radius: 28px;
    font-size: 38px;
    box-shadow: 0 14px 30px rgba(91,108,251,.18);
}

.profile-photo-name,
.profile-photo-email {
    display: block;
}

.profile-photo-name {
    color: var(--tp-text);
    font-size: 14px;
}

.profile-photo-email {
    margin-top: 4px;
    color: var(--tp-muted);
    font-size: 11px;
    overflow-wrap: anywhere;
}

.profile-avatar-form--compact {
    margin-top: 15px;
    gap: 8px;
}

.profile-avatar-form--compact .profile-avatar-upload > span {
    min-height: 40px;
    font-size: 12px;
}

.profile-avatar-form--compact > small {
    text-align: center;
    font-size: 10px;
}

.profile-avatar-form--compact .tp-btn {
    min-height: 38px;
    font-size: 12px;
}

.profile-photo-column .profile-remove-avatar {
    margin-top: 10px;
    font-size: 11px;
}

.profile-information-form {
    max-width: none;
    gap: 15px;
}

.profile-information-form .tp-btn {
    width: fit-content;
    min-width: 170px;
}

.profile-security-subsection {
    margin-top: 22px;
}

.profile-security-subsection + .profile-security-subsection {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid var(--tp-border);
}

.profile-security-subsection-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 13px;
}

.profile-security-subsection-head h3 {
    margin: 0;
    font-family: var(--tp-font-heading);
    font-size: 18px;
    letter-spacing: -.02em;
}

.profile-security-subsection-head p {
    margin: 4px 0 0;
    color: var(--tp-muted);
    font-size: 12px;
    line-height: 1.5;
}

.profile-login-methods {
    display: grid;
    gap: 9px;
}

.profile-login-method {
    min-width: 0;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr) auto;
    align-items: center;
    gap: 12px;
    padding: 13px 14px;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    background: var(--tp-surface-soft);
}

.profile-login-method-icon {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    color: #fff;
    background: var(--tp-gradient);
}

.profile-login-method-icon--google {
    color: var(--tp-text);
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    font-size: 17px;
    font-weight: 900;
}

.profile-login-method strong,
.profile-login-method small {
    display: block;
}

.profile-login-method strong {
    font-size: 13px;
}

.profile-login-method small {
    margin-top: 3px;
    color: var(--tp-muted);
    font-size: 11px;
    line-height: 1.4;
}

.profile-method-status {
    min-height: 25px;
    padding: 4px 8px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 900;
    white-space: nowrap;
}

.profile-method-status.is-active {
    color: #067647;
    background: #ecfdf3;
}

.profile-method-status.is-inactive {
    color: #667085;
    background: #f2f4f7;
}

.profile-password-disclosure {
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    background: var(--tp-surface-soft);
    overflow: hidden;
}

.profile-password-disclosure > summary {
    min-height: 48px;
    padding: 0 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    color: var(--tp-text);
    cursor: pointer;
    font-size: 13px;
    font-weight: 900;
    list-style: none;
}

.profile-password-disclosure > summary::-webkit-details-marker {
    display: none;
}

.profile-password-disclosure > summary span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.profile-password-chevron {
    color: var(--tp-muted);
    transition: transform .15s ease;
}

.profile-password-disclosure[open] .profile-password-chevron {
    transform: rotate(180deg);
}

.profile-password-form--collapsed {
    max-width: none;
    margin: 0;
    padding: 16px;
    border-top: 1px solid var(--tp-border);
    background: var(--tp-surface);
}

.profile-password-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.profile-password-form--collapsed .profile-field input {
    min-height: 44px;
}

.profile-password-form--collapsed .tp-btn {
    width: fit-content;
    min-width: 170px;
    margin-top: 2px;
}

.profile-password-unavailable {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    border: 1px solid var(--tp-border);
    border-radius: 14px;
    background: var(--tp-surface-soft);
}

.profile-password-unavailable > i {
    font-size: 20px;
}

.profile-password-unavailable strong,
.profile-password-unavailable small {
    display: block;
}

.profile-password-unavailable small {
    margin-top: 3px;
    color: var(--tp-muted);
    font-size: 11px;
}

.profile-account-card {
    overflow: hidden;
}

.profile-account-plan {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin: 20px 0 8px;
    padding: 16px;
    border: 1px solid var(--tp-border);
    border-radius: 16px;
    background:
        radial-gradient(circle at 100% 0%, rgba(91,108,251,.10), transparent 45%),
        var(--tp-surface-soft);
}

.profile-account-plan span,
.profile-account-plan strong,
.profile-account-plan small {
    display: block;
}

.profile-account-plan > div > span {
    margin-bottom: 5px;
    color: var(--tp-muted);
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.profile-account-plan strong {
    font-family: var(--tp-font-heading);
    font-size: 20px;
    line-height: 1.2;
}

.profile-account-plan small {
    margin-top: 5px;
    color: var(--tp-muted);
    font-size: 11px;
}

.profile-plan-badge {
    min-height: 25px;
    padding: 4px 9px;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    color: #475467;
    background: #f2f4f7;
    font-size: 10px;
    font-weight: 900;
}

.profile-plan-badge--pro {
    color: #6941c6;
    background: #f4f3ff;
}

.profile-manage-billing {
    margin-top: 18px;
}

@media (max-width: 1180px) {
    .profile-redesign-layout {
        grid-template-columns: 1fr;
    }

    .profile-redesign-side {
        position: static;
    }
}

@media (max-width: 800px) {
    .profile-identity-layout {
        grid-template-columns: 1fr;
    }

    .profile-photo-column {
        max-width: 320px;
    }

    .profile-password-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .profile-identity-card,
    .profile-security-section,
    .profile-account-card {
        padding: 21px;
    }

    .profile-login-method {
        grid-template-columns: 38px minmax(0, 1fr);
    }

    .profile-method-status {
        grid-column: 2;
        justify-self: start;
    }

    .profile-information-form .tp-btn,
    .profile-password-form--collapsed .tp-btn {
        width: 100%;
    }

    .profile-account-plan {
        align-items: center;
    }
}


/* ===================================================
   STEP 8.7R-C8 — FINAL PROFILE CSS
   Consolidated from C7 fix1/fix2/fix3
=================================================== */

.profile-information-form {
    width: 100%;
    max-width: 520px;
    justify-self: start;
    align-self: start;
}

.profile-information-grid,
.profile-information-grid--vertical {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
    justify-content: start;
}

.profile-information-grid .profile-field,
.profile-information-grid--vertical .profile-field {
    min-width: 0;
}

.profile-information-grid .profile-field input,
.profile-information-grid--vertical .profile-field input {
    width: 100%;
    max-width: 520px;
}

.profile-field {
    align-content: start;
}

.profile-field > span {
    min-height: 18px;
    display: flex;
    align-items: center;
}

.profile-field input {
    height: 46px;
    min-height: 46px;
    box-sizing: border-box;
}

.profile-field-hint {
    min-height: 18px;
    display: block;
    margin-top: 0;
    color: var(--tp-muted);
    font-size: 10px;
    line-height: 18px;
}

.profile-field-hint--placeholder {
    visibility: hidden;
}

.profile-information-form > .tp-btn,
.profile-password-form--collapsed > .tp-btn {
    width: auto !important;
    min-width: 0 !important;
    min-height: 40px;
    height: 40px;
    padding: 0 16px;
    justify-self: start;
    border-radius: 10px;
    font-size: 12px;
    line-height: 1;
}

.profile-photo-column {
    width: 200px;
    max-width: 200px;
}

.profile-avatar-preview--compact {
    width: 118px;
    height: 118px;
    border-radius: 31px;
    font-size: 42px;
}

.profile-avatar-form--compact {
    max-width: 200px;
    margin-left: auto;
    margin-right: auto;
}

.profile-avatar-form--compact .tp-btn {
    width: 100%;
    min-width: 0;
    min-height: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 10px;
}

.profile-avatar-form--compact .profile-avatar-upload > span {
    min-height: 36px;
    padding: 0 10px;
    border-radius: 10px;
}

.profile-identity-layout {
    grid-template-columns: 200px minmax(320px, 520px);
    justify-content: start;
    gap: 28px;
}

.profile-password-grid {
    align-items: start;
}

.profile-password-grid .profile-field {
    grid-template-rows: 18px 46px 18px;
    gap: 7px;
}

.profile-password-grid .profile-field input {
    width: 100%;
    height: 46px;
    min-height: 46px;
    padding-top: 0;
    padding-bottom: 0;
}

.profile-password-grid .profile-field-hint {
    min-height: 18px;
    line-height: 18px;
}

.profile-account-plan strong {
    text-transform: uppercase;
}

@media (max-width: 1100px) {
    .profile-identity-layout {
        grid-template-columns: 190px minmax(300px, 500px);
        gap: 24px;
    }

    .profile-photo-column {
        width: 190px;
        max-width: 190px;
    }

    .profile-information-form,
    .profile-information-grid .profile-field input,
    .profile-information-grid--vertical .profile-field input {
        max-width: 500px;
    }
}

@media (max-width: 900px) {
    .profile-identity-layout {
        grid-template-columns: 1fr;
    }

    .profile-photo-column {
        width: 200px;
        max-width: 200px;
    }

    .profile-information-form,
    .profile-information-grid .profile-field input,
    .profile-information-grid--vertical .profile-field input {
        max-width: 560px;
    }
}

@media (max-width: 800px) {
    .profile-password-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    .profile-photo-column {
        width: 100%;
        max-width: 240px;
    }

    .profile-information-form,
    .profile-information-grid .profile-field input,
    .profile-information-grid--vertical .profile-field input {
        max-width: 100%;
    }

    .profile-information-form > .tp-btn,
    .profile-password-form--collapsed > .tp-btn {
        width: 100% !important;
        justify-self: stretch;
    }
}


/* Step 8.9I fix1 — Paddle payment-confirmed pending state */
.subscription-success-pending {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    width: 100%;
    box-sizing: border-box;
    margin: 0 0 22px;
    padding: 14px 16px;
    border: 1px solid #d8e6dc;
    border-radius: 12px;
    background: #f6fbf7;
}

.subscription-success-pending__icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: #e4f4e8;
    color: #27683a;
    font-size: 14px;
    font-weight: 900;
    line-height: 1;
}

.subscription-success-pending__content {
    min-width: 0;
    flex: 1;
}

.subscription-success-pending__content strong {
    display: block;
    margin: 1px 0 4px;
    color: #26364b;
    font-size: 14px;
    line-height: 1.35;
}

.subscription-success-pending__content p {
    margin: 0;
    color: #66748a;
    font-size: 13px;
    line-height: 1.55;
}

@media (max-width: 560px) {
    .subscription-success-pending {
        padding: 13px 14px;
    }
}


/* Step 8.9I fix2 — Current Subscription automatic-renewal status */
.billing-auto-renew-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: max-content;
    flex: 0 0 auto;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    white-space: nowrap;
}

.billing-auto-renew-badge.is-on {
    color: #25633a;
    background: #eaf7ee;
    border-color: #cce9d4;
}

.billing-auto-renew-badge.is-off {
    color: #9a4a16;
    background: #fff3e8;
    border-color: #f1d4bc;
}

.billing-auto-renew-badge.is-inactive {
    color: #657084;
    background: #f2f4f7;
    border-color: #dde2e8;
}


.dashboard-subscription-id code {
    font: inherit;
    font-size: 11px;
    white-space: normal;
    overflow-wrap: anywhere;
}

.billing-subscription-list {
    margin-top: 2px;
}

.billing-subscription-row {
    width: 100%;
}

@media (max-width: 1180px) {
    .dashboard-subscription-row {
        grid-template-columns: minmax(180px, 1.2fr) minmax(90px, .55fr) minmax(170px, 1fr) minmax(180px, 1fr) auto 18px;
    }

    .dashboard-subscription-amount {
        display: none;
    }
}

@media (max-width: 900px) {
    .dashboard-subscription-row {
        grid-template-columns: minmax(0, 1fr) auto 18px;
        gap: 10px 14px;
    }

    .dashboard-subscription-provider,
    .dashboard-subscription-id,
    .dashboard-subscription-period {
        grid-column: 1 / -1;
    }

    .dashboard-subscription-status {
        grid-column: 2;
        grid-row: 1;
    }

    .dashboard-subscription-arrow {
        grid-column: 3;
        grid-row: 1;
    }

    .dashboard-subscription-provider,
    .dashboard-subscription-id,
    .dashboard-subscription-period {
        padding-left: 49px;
    }
}

@media (max-width: 560px) {
    .dashboard-subscription-provider,
    .dashboard-subscription-id,
    .dashboard-subscription-period {
        padding-left: 0;
    }

    .dashboard-subscription-main {
        align-items: flex-start;
    }
}


/* ===================================================
   STEP 8.10E — CHECKOUT PAYMENT METHOD CONSOLIDATION
=================================================== */

.checkout-payment-method__head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.checkout-payment-method__head h3 {
    margin-bottom: 7px;
}

.checkout-payment-method__head p {
    margin: 0;
    max-width: 560px;
}

.checkout-secure-badge {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 32px;
    padding: 7px 10px;
    border: 1px solid color-mix(in srgb, #10b981 24%, var(--tp-border));
    border-radius: 999px;
    background: color-mix(in srgb, #10b981 8%, var(--tp-surface));
    color: #059669;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

.checkout-unified-provider-form {
    display: grid;
    gap: 14px;
}

.checkout-provider-options {
    display: grid;
    gap: 10px;
}

.checkout-provider-choice {
    position: relative;
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr) 32px;
    align-items: center;
    gap: 14px;
    min-height: 82px;
    padding: 12px 14px;
    border: 1px solid var(--tp-border);
    border-radius: 18px;
    background: var(--tp-surface-soft);
    cursor: pointer;
    transition:
        border-color .18s ease,
        background .18s ease,
        box-shadow .18s ease,
        transform .18s ease;
}

.checkout-provider-choice:hover {
    border-color: color-mix(in srgb, var(--tp-primary) 34%, var(--tp-border));
    transform: translateY(-1px);
}

.checkout-provider-choice.is-selected {
    border-color: color-mix(in srgb, var(--tp-primary) 58%, var(--tp-border));
    background: color-mix(in srgb, var(--tp-primary) 7%, var(--tp-surface));
    box-shadow:
        0 0 0 3px color-mix(in srgb, var(--tp-primary) 10%, transparent),
        0 10px 28px rgba(15, 23, 42, .06);
}

.checkout-provider-choice > input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.checkout-provider-choice:focus-within {
    outline: 3px solid color-mix(in srgb, var(--tp-primary) 20%, transparent);
    outline-offset: 2px;
}

.checkout-provider-choice__visual {
    width: 76px;
    height: 52px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--tp-border) 82%, transparent);
    border-radius: 13px;
    background: #fff;
}

.checkout-provider-choice__visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.checkout-provider-choice__fallback {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 12px;
    background: var(--tp-gradient);
    color: #fff;
    font-weight: 950;
}

.checkout-provider-choice__copy {
    min-width: 0;
}

.checkout-provider-choice__copy strong,
.checkout-provider-choice__copy small {
    display: block;
}

.checkout-provider-choice__copy strong {
    margin-bottom: 4px;
    color: var(--tp-text);
    font-size: 15px;
}

.checkout-provider-choice__copy small {
    color: var(--tp-muted);
    font-size: 12px;
    line-height: 1.45;
}

.checkout-provider-choice__check {
    width: 26px;
    height: 26px;
    display: grid;
    place-items: center;
    border: 1px solid var(--tp-border);
    border-radius: 50%;
    color: transparent;
    background: var(--tp-surface);
    font-size: 11px;
    transition: .18s ease;
}

.checkout-provider-choice.is-selected .checkout-provider-choice__check {
    border-color: var(--tp-primary);
    background: var(--tp-primary);
    color: #fff;
    box-shadow: 0 5px 14px rgba(91, 108, 251, .24);
}

.checkout-payment-submit {
    min-height: 54px;
    margin-top: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
}

.checkout-payment-submit:disabled {
    cursor: wait;
    opacity: .72;
}

@media (max-width: 560px) {
    .checkout-payment-method__head {
        display: block;
    }

    .checkout-secure-badge {
        margin-top: 10px;
    }

    .checkout-provider-choice {
        grid-template-columns: 58px minmax(0, 1fr) 26px;
        gap: 11px;
        min-height: 76px;
        padding: 11px;
    }

    .checkout-provider-choice__visual {
        width: 58px;
        height: 44px;
        border-radius: 11px;
    }

    .checkout-provider-choice__copy small {
        font-size: 11px;
    }
}


/* ===================================================
   STEP 8.10E fix1 — PROVIDER SWITCH + LOGO SLOT FIX
=================================================== */

.checkout-provider-choice__visual {
    padding: 9px 12px;
    background: #fff;
}

.checkout-provider-choice__visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

.checkout-provider-choice__visual.is-missing-logo {
    display: none;
}

.checkout-provider-choice__fallback {
    display: none !important;
}

.checkout-provider-choice {
    cursor: pointer;
}

.checkout-provider-choice > input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    pointer-events: none;
}


/* ===================================================
   STEP 8.10F-1 — PROVIDER BRAND WORDMARK SUPPORT
=================================================== */

.checkout-provider-choice__visual {
    width: 92px;
    height: 48px;
    padding: 6px 8px;
    border: 0;
    border-radius: 10px;
    background: #fff;
}

.checkout-provider-choice__visual img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

@media (max-width: 560px) {
    .checkout-provider-choice {
        grid-template-columns: 72px minmax(0, 1fr) 26px;
    }

    .checkout-provider-choice__visual {
        width: 72px;
        height: 42px;
        padding: 5px 6px;
    }
}


/* ===================================================
   STEP 8.10F-1 fix1 — USER-SUPPLIED SQUARE PROVIDER LOGOS
=================================================== */

.checkout-provider-choice {
    grid-template-columns: 64px minmax(0, 1fr) 32px;
    gap: 12px;
}

.checkout-provider-choice__visual {
    width: 56px;
    height: 56px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--tp-border) 82%, transparent);
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    display: grid;
    place-items: center;
}

.checkout-provider-choice__visual img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
    object-position: center;
}

@media (max-width: 560px) {
    .checkout-provider-choice {
        grid-template-columns: 58px minmax(0, 1fr) 26px;
        gap: 10px;
    }

    .checkout-provider-choice__visual {
        width: 48px;
        height: 48px;
        border-radius: 7px;
    }
}


/* ===================================================
   STEP 8.10F-2 — CHECKOUT UI POLISH
=================================================== */

.page-checkout .checkout-payment-panel {
    border-radius: 24px;
    overflow: hidden;
}

.page-checkout .checkout-payment-panel > h2 {
    margin: 0 0 6px;
    font-size: 21px;
    letter-spacing: -.02em;
}

.checkout-order-row {
    padding: 13px 0;
}

.checkout-order-row strong {
    color: var(--tp-text);
    font-weight: 900;
}

.checkout-order-total {
    margin-top: 2px;
    padding-top: 18px;
}

.checkout-order-total span {
    color: var(--tp-text);
}

.checkout-payment-method {
    margin-top: 20px;
    padding-top: 24px;
}

.checkout-payment-method__head {
    margin-bottom: 14px;
}

.checkout-payment-method__head h3 {
    font-size: 18px;
    letter-spacing: -.015em;
}

.checkout-payment-method__head p {
    color: var(--tp-muted);
    font-size: 13px;
    line-height: 1.55;
}

.checkout-secure-badge {
    min-height: 30px;
    padding: 6px 9px;
    border-radius: 999px;
    font-size: 10px;
    letter-spacing: .01em;
}

.checkout-unified-provider-form {
    gap: 12px;
}

.checkout-provider-options {
    gap: 9px;
}

.checkout-provider-choice {
    min-height: 72px;
    padding: 10px 12px;
    border-radius: 16px;
    background: var(--tp-surface);
    box-shadow: 0 1px 0 rgba(15, 23, 42, .02);
}

.checkout-provider-choice:hover {
    transform: none;
    border-color: color-mix(
        in srgb,
        var(--tp-primary) 32%,
        var(--tp-border)
    );
    background: color-mix(
        in srgb,
        var(--tp-primary) 2.5%,
        var(--tp-surface)
    );
}

.checkout-provider-choice.is-selected {
    border-color: color-mix(
        in srgb,
        var(--tp-primary) 58%,
        var(--tp-border)
    );
    background: color-mix(
        in srgb,
        var(--tp-primary) 5%,
        var(--tp-surface)
    );
    box-shadow:
        0 0 0 2px color-mix(
            in srgb,
            var(--tp-primary) 8%,
            transparent
        ),
        0 6px 20px rgba(15, 23, 42, .045);
}

.checkout-provider-choice__visual {
    width: 52px;
    height: 52px;
    border-radius: 9px;
    border-color: color-mix(
        in srgb,
        var(--tp-border) 78%,
        transparent
    );
    flex: 0 0 auto;
}

.checkout-provider-choice__copy strong {
    margin-bottom: 3px;
    font-size: 14px;
    line-height: 1.25;
}

.checkout-provider-choice__copy small {
    color: var(--tp-muted);
    font-size: 11.5px;
    line-height: 1.4;
}

.checkout-provider-choice__check {
    width: 24px;
    height: 24px;
    font-size: 10px;
}

.checkout-payment-submit {
    min-height: 52px;
    margin-top: 3px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 900;
    box-shadow: 0 10px 24px rgba(91, 108, 251, .18);
    transition:
        transform .16s ease,
        box-shadow .16s ease,
        opacity .16s ease;
}

.checkout-payment-submit:not(:disabled):hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(91, 108, 251, .24);
}

.checkout-payment-submit:not(:disabled):active {
    transform: translateY(0);
}

.checkout-payment-assurance {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin: -2px 0 0 !important;
    color: var(--tp-muted) !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    text-align: center;
}

.checkout-payment-assurance i {
    color: #059669;
}

.checkout-provider-loading {
    min-height: 52px;
    padding: 11px 13px;
    border-radius: 14px;
}

.checkout-provider-loading strong {
    font-size: 12.5px;
}

.checkout-provider-loading small {
    font-size: 11px;
}

.checkout-status-alert {
    border-radius: 16px;
}

.checkout-note {
    margin-top: 14px;
    font-size: 12px;
    line-height: 1.5;
}

/* Single-provider state: it should feel like the chosen method, not a list. */
.checkout-provider-options:has(
    .checkout-provider-choice:only-child
) .checkout-provider-choice {
    cursor: default;
}

.checkout-provider-options:has(
    .checkout-provider-choice:only-child
) .checkout-provider-choice:hover {
    border-color: color-mix(
        in srgb,
        var(--tp-primary) 58%,
        var(--tp-border)
    );
    background: color-mix(
        in srgb,
        var(--tp-primary) 5%,
        var(--tp-surface)
    );
}

/* Desktop fine tuning */
@media (min-width: 1181px) {
    .checkout-payment-panel {
        max-width: 520px;
        justify-self: end;
    }
}

/* Tablet / mobile polish */
@media (max-width: 680px) {
    .checkout-main-panel,
    .checkout-payment-panel {
        padding: 24px 20px;
    }

    .checkout-payment-method {
        margin-top: 18px;
        padding-top: 20px;
    }

    .checkout-payment-method__head {
        display: block;
    }

    .checkout-payment-method__head p {
        font-size: 12px;
    }

    .checkout-secure-badge {
        margin-top: 9px;
    }

    .checkout-provider-choice {
        grid-template-columns: 52px minmax(0, 1fr) 24px;
        min-height: 68px;
        padding: 9px 10px;
        gap: 10px;
        border-radius: 14px;
    }

    .checkout-provider-choice__visual {
        width: 46px;
        height: 46px;
        border-radius: 8px;
    }

    .checkout-provider-choice__copy strong {
        font-size: 13.5px;
    }

    .checkout-provider-choice__copy small {
        font-size: 10.5px;
    }

    .checkout-payment-submit {
        min-height: 50px;
        border-radius: 13px;
    }

    .checkout-payment-assurance {
        font-size: 10.5px !important;
    }
}

@media (max-width: 420px) {
    .checkout-main-panel,
    .checkout-payment-panel {
        padding: 20px 16px;
    }

    .checkout-provider-choice {
        grid-template-columns: 48px minmax(0, 1fr) 22px;
        gap: 9px;
        padding: 8px 9px;
    }

    .checkout-provider-choice__visual {
        width: 42px;
        height: 42px;
    }

    .checkout-provider-choice__copy small {
        display: none;
    }

    .checkout-provider-choice__check {
        width: 22px;
        height: 22px;
    }
}


/* ===================================================
   STEP 8.10F-2 fix1 — CHECKOUT / BILLING WIDTH ALIGNMENT
=================================================== */

/*
 * Match the visual proportion used by Billing's Current Plan / Plans & Pricing
 * cards. Let the checkout grid consume the full available content width and
 * remove the narrow max-width that created the large empty center gap.
 */
.page-checkout .checkout-layout {
    grid-template-columns: minmax(0, 2.35fr) minmax(360px, 1fr);
    gap: 24px;
    width: 100%;
}

.page-checkout .checkout-main-panel,
.page-checkout .checkout-payment-panel {
    width: 100%;
    max-width: none;
}

.page-checkout .checkout-payment-panel {
    justify-self: stretch;
}

/*
 * Keep the same responsive collapse point already used by Billing/Checkout.
 */
@media (max-width: 1180px) {
    .page-checkout .checkout-layout {
        grid-template-columns: 1fr;
    }

    .page-checkout .checkout-payment-panel {
        max-width: none;
        justify-self: stretch;
    }
}

/* Step 8.12L-1 fix1 — checkout.php shared layout width */
.page-checkout .dashboard-main {
    min-width: 0;
    width: 100%;
    max-width: 2560px;
    padding: 40px;
    margin-right: auto;
}


/* ===================================================
   Step 8.12L-2 — PROFILE THREE-CARD RESPONSIVE LAYOUT
=================================================== */

/*
 * Desktop:
 * Account | Profile Information | Security
 *
 * Keep the existing PHP/forms intact and flatten only the two structural
 * wrappers so the three existing cards participate in one shared grid.
 */
@media (min-width: 1281px) {
    .page-profile .profile-redesign-layout {
        display: grid;
        grid-template-columns:
            minmax(280px, .82fr)
            minmax(420px, 1.08fr)
            minmax(420px, 1.1fr);
        gap: 24px;
        align-items: start;
    }

    .page-profile .profile-redesign-main,
    .page-profile .profile-redesign-side {
        display: contents;
    }

    .page-profile .profile-account-card {
        order: 1;
        min-width: 0;
    }

    .page-profile .profile-identity-card {
        order: 2;
        min-width: 0;
    }

    .page-profile .profile-security-section {
        order: 3;
        min-width: 0;
    }

    /*
     * Profile Information itself becomes vertical inside its column so its
     * avatar/form controls do not become cramped in the three-column layout.
     */
    .page-profile .profile-identity-layout {
        grid-template-columns: 1fr;
    }

    .page-profile .profile-photo-column {
        width: 100%;
    }

    .page-profile .profile-information-form {
        width: 100%;
        max-width: none;
    }
}

/*
 * Smaller desktop/tablet/mobile:
 * Account
 * Profile Information
 * Security
 */
@media (max-width: 1280px) {
    .page-profile .profile-redesign-layout {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .page-profile .profile-redesign-main,
    .page-profile .profile-redesign-side {
        display: contents;
    }

    .page-profile .profile-account-card {
        order: 1;
        width: 100%;
    }

    .page-profile .profile-identity-card {
        order: 2;
        width: 100%;
    }

    .page-profile .profile-security-section {
        order: 3;
        width: 100%;
    }
}


/* ===================================================
   Step 8.12L-2 fix1 — equal-height desktop profile cards
=================================================== */

@media (min-width: 1281px) {
    /*
     * The three cards share one grid row. Stretch them to the height of the
     * tallest card instead of giving each card a hard-coded pixel height.
     */
    .page-profile .profile-redesign-layout {
        align-items: stretch;
    }

    .page-profile .profile-account-card,
    .page-profile .profile-identity-card,
    .page-profile .profile-security-section {
        height: 100%;
        align-self: stretch;
    }

    /*
     * Keep card internals natural. The extra height stays as visual breathing
     * room rather than stretching form fields or security controls.
     */
    .page-profile .profile-account-card,
    .page-profile .profile-identity-card,
    .page-profile .profile-security-section {
        display: flex;
        flex-direction: column;
    }

    .page-profile .profile-account-card .profile-manage-billing {
        margin-top: auto;
    }
}

@media (max-width: 1280px) {
    /*
     * Once cards stack vertically, each card returns to its natural content
     * height so no unnecessary blank vertical space remains.
     */
    .page-profile .profile-account-card,
    .page-profile .profile-identity-card,
    .page-profile .profile-security-section {
        height: auto;
        min-height: 0;
        align-self: auto;
    }
}


/* ===================================================
   Step 8.12L-2 fix2 — Profile Information two-column layout
=================================================== */

@media (min-width: 1281px) {
    /*
     * In the three-card desktop layout keep Profile Information compact:
     * photo/upload controls on the left, profile fields on the right.
     */
    .page-profile .profile-identity-layout {
        display: grid;
        grid-template-columns: minmax(145px, 170px) minmax(0, 1fr);
        gap: 22px;
        align-items: start;
    }

    .page-profile .profile-photo-column {
        width: auto;
        min-width: 0;
    }

    .page-profile .profile-information-form {
        width: 100%;
        max-width: none;
        align-self: start;
    }

    .page-profile .profile-information-grid--vertical {
        grid-template-columns: 1fr;
    }

    .page-profile .profile-avatar-preview--compact {
        width: 92px;
        height: 92px;
        border-radius: 24px;
        font-size: 34px;
    }

    .page-profile .profile-avatar-form--compact {
        width: 100%;
    }
}

@media (max-width: 1280px) {
    /*
     * When the three main cards stack, restore natural Profile Information
     * behavior without forcing a desktop two-column arrangement.
     */
    .page-profile .profile-identity-layout {
        grid-template-columns: 210px minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .page-profile .profile-identity-layout {
        grid-template-columns: 1fr;
    }
}


/* Step 8.12N-1 fix1 — Contact inline alert */
.page-contact .contact-alert {
    margin: 18px 0;
    padding: 14px 16px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid transparent;
    border-radius: 14px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}
.page-contact .contact-alert__icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
}
.page-contact .contact-alert__body { min-width: 0; }
.page-contact .contact-alert__body strong {
    display: block;
    margin-bottom: 3px;
    font-size: 14px;
}
.page-contact .contact-alert__body p {
    margin: 0;
    font-size: 13px;
    line-height: 1.55;
}
.page-contact .contact-alert--error {
    color: #9f1239;
    border-color: #fecdd3;
    background: #fff1f2;
}
.page-contact .contact-alert--error .contact-alert__icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}
.page-contact .contact-alert--success {
    color: #166534;
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.page-contact .contact-alert--success .contact-alert__icon {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}


/* Step 8.12N-1 fix3 — Contact uses Checkout status alerts */
.page-contact .contact-status-alert {
    margin: 20px 0 24px;
}

.checkout-status-alert--success {
    border-color: rgba(5, 150, 105, .30);
    background: color-mix(in srgb, #059669 6%, var(--tp-surface));
}

.checkout-status-alert--success .checkout-status-alert__icon {
    background: rgba(5, 150, 105, .12);
    color: #059669;
}
