/* The customer account page (account.html, driven by static/js/account.js):
   the storefront's column of product rows, each with a second line, a status
   badge and an action button. */

.account .product-row {
    align-items: center;
    min-height: 4.5rem;
}

.account .product-row-name,
.account .product-row-publisher {
    white-space: normal;
    overflow-wrap: anywhere;
}

.account .product-row-publisher {
    margin-top: 0.125rem;
}

/* "$5/month · Renews Dec 21": a wrap falls between the parts, never inside
   a price or a date. */
.account-meta span {
    white-space: nowrap;
}

.account .product-row .btn {
    flex-shrink: 0;
}

.account .product-row + .product-row {
    margin-top: 0.625rem;
}

.account .product-row-name:has(.account-status) {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 0.5rem;
}

/* Sections stack with a gap; hidden ones (display: none) leave none. */
.account-groups {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* The key: its own line under the row's name and button, lined up with the
   name. */
.account .product-row {
    flex-wrap: wrap;
}

.account-key {
    flex: 1 0 100%;
    order: 4;
    padding-left: 3.75rem;
}

.account-key .key-display {
    --key-pad: 0.75rem;
    --key-max: 0.9375rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    color: var(--primary);
}

.account-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 2rem 0;
    color: var(--fg-muted);
}

.account-loading .spinner {
    margin: 0;
}

.account-matched {
    margin: 1.5rem 0 0;
    color: var(--fg-muted);
    font-size: 0.875rem;
    text-align: center;
    overflow-wrap: anywhere;
}

.account-notice {
    margin: 1.25rem 0 0;
}

.account .btn[disabled] {
    cursor: progress;
}

.account-manage-row {
    margin-top: 1rem;
}

.account-signout {
    margin: 1.5rem 0 0;
    text-align: center;
}

.account-footer {
    margin-top: 1.5rem;
}

@media (max-width: 30rem) {
    /* Name beside the icon, then the key and the action under them at full
       width, so a long name or key keeps the row's width. */
    .account .product-row {
        align-items: flex-start;
    }

    .account .product-row .product-row-text {
        flex-basis: calc(100% - 3.75rem);
    }

    .account-key {
        padding-left: 0;
    }

    .account-key .key-display {
        --key-pad: 0.5rem;
    }

    .account .product-row {
        padding: 0.875rem 0.75rem;
    }

    .account .product-row > .btn {
        order: 5;
        width: 100%;
    }
}

/* Phones: slimmer page gutters, so rows and their keys get more width. */
@media (max-width: 30rem) {
    .container:has(> .account) {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
}
