/* ============================================================
   Account pages
   ============================================================ */

.account-main {
    flex: 1;
    padding: 7rem 1.5rem 4rem;
    background:
        radial-gradient(circle at 18% 18%, rgba(105, 172, 128, 0.16) 0%, transparent 55%),
        radial-gradient(circle at 82% 72%, rgba(176, 120, 87, 0.14) 0%, transparent 55%),
        var(--dark);
    min-height: 100vh;
}

.account-shell {
    margin: 0 auto;
}

.account-shell--narrow {
    max-width: 560px;
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    padding: 2.5rem;
    backdrop-filter: blur(10px);
}

.account-shell--wide {
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.account-card {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.account-card--form {
    max-width: 560px;
    margin: 0 auto;
}

/* ---------- Login / register typography ---------- */
.account-title {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.account-meta {
    color: var(--muted);
    margin: 1rem 0 0;
}

/* ---------- Forms ---------- */
.account-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.account-form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    font-size: 0.95rem;
    color: var(--muted);
}

.account-form input {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--stroke);
    color: var(--light);
    padding: 0.75rem 1rem;
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s ease;
}

.account-form input:focus {
    border-color: var(--primary);
}

.account-form button {
    margin-top: 0.25rem;
    width: 100%;
    justify-content: center;
}

.inline-form {
    margin: 0;
    display: inline-flex;
}

/* ---------- Flash messages ---------- */
.account-error,
.account-flash {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.account-flash-msg {
    flex: 1;
}

.account-flash-dismiss {
    flex-shrink: 0;
    margin: -0.4rem -0.3rem -0.4rem 0;
    padding: 0 0.35rem;
    background: none;
    border: none;
    color: inherit;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.account-flash-dismiss:hover {
    opacity: 1;
}

.account-error,
.account-flash--err {
    background: rgba(220, 80, 80, 0.15);
    border: 1px solid rgba(220, 80, 80, 0.4);
    color: #ffb3b3;
}

.account-flash--ok {
    background: rgba(105, 172, 128, 0.15);
    border: 1px solid rgba(105, 172, 128, 0.4);
    color: #c8efd5;
}

.account-flash--warn {
    background: rgba(230, 180, 90, 0.15);
    border: 1px solid rgba(230, 180, 90, 0.4);
    color: #f1d9a7;
}

/* ============================================================
   Hero
   ============================================================ */
.account-hero {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem 2rem;
    background:
        linear-gradient(135deg, rgba(105, 172, 128, 0.18), rgba(176, 120, 87, 0.12)),
        var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 22px;
    backdrop-filter: blur(10px);
    flex-wrap: wrap;
}

.avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 700;
    flex-shrink: 0;
    overflow: hidden;
    box-shadow: 0 8px 22px rgba(0, 0, 0, 0.35);
}

.avatar--initials,
.avatar--preset {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.avatar--image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.avatar--lg { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar--lg .fas { font-size: 1.4rem; }
.avatar--xl { width: 84px; height: 84px; font-size: 2rem; letter-spacing: 1px; }
.avatar--xl .fas { font-size: 1.7rem; }

.account-hero-text {
    flex: 1;
    min-width: 220px;
}

.account-hero-eyebrow {
    color: var(--muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    margin: 0;
}

.account-hero-name {
    font-size: 2rem;
    margin: 0.15rem 0 0.35rem;
}

.account-hero-meta {
    color: var(--muted);
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
}

.account-hero-meta i {
    margin-right: 0.35rem;
    opacity: 0.85;
}

.account-hero-sep {
    opacity: 0.5;
}

.account-hero-actions {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.account-hero-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--stroke);
    color: var(--light);
    padding: 0.65rem 1.1rem;
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.2s ease;
}

.account-hero-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: var(--primary);
}

.account-hero-btn--ghost {
    background: transparent;
}

/* ============================================================
   Sections
   ============================================================ */
.account-section {
    background: var(--surface);
    border: 1px solid var(--stroke);
    border-radius: 22px;
    padding: 2rem;
    backdrop-filter: blur(10px);
}

.account-section-head {
    margin-bottom: 1.5rem;
}

.account-section-head h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.account-section-head h2 i {
    color: var(--primary);
    font-size: 1.1rem;
}

.account-section-head p {
    color: var(--muted);
    margin-top: 0.4rem;
    font-size: 0.95rem;
}

/* ============================================================
   Product cards
   ============================================================ */
.pcard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.pcard {
    position: relative;
    background: var(--surface-2);
    border: 1px solid var(--stroke);
    border-radius: 18px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.pcard:hover {
    transform: translateY(-3px);
    border-color: rgba(255, 255, 255, 0.18);
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

.pcard-banner {
    position: relative;
    height: 110px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcard-banner-glow {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 70% 30%, rgba(255, 255, 255, 0.22), transparent 60%);
    pointer-events: none;
}

.pcard-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.7rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.18);
}

.pcard-badge {
    position: absolute;
    top: 0.75rem;
    right: 0.85rem;
    background: rgba(0, 0, 0, 0.45);
    color: #fff;
    padding: 0.2rem 0.65rem;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pcard-body {
    padding: 1.25rem 1.25rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    flex: 1;
}

.pcard-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.pcard-title {
    font-size: 1.25rem;
    margin: 0;
}

.pcard-status {
    font-size: 0.8rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

.pcard-status--owned {
    background: rgba(105, 172, 128, 0.22);
    color: #b4e8c3;
    border: 1px solid rgba(105, 172, 128, 0.35);
}

.pcard-status--available {
    background: rgba(255, 200, 120, 0.18);
    color: #ffd7a1;
    border: 1px solid rgba(255, 200, 120, 0.32);
}

.pcard-status--pending {
    background: rgba(230, 200, 90, 0.22);
    color: #ffe294;
    border: 1px solid rgba(230, 200, 90, 0.45);
    animation: pcard-pending-pulse 2s ease-in-out infinite;
}

@keyframes pcard-pending-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(230, 200, 90, 0.18); }
    50% { box-shadow: 0 0 0 6px rgba(230, 200, 90, 0); }
}

.pcard-status--soon {
    background: rgba(140, 140, 140, 0.18);
    color: #d6d6d6;
    border: 1px solid rgba(180, 180, 180, 0.3);
}

.pcard--soon { opacity: 0.78; }
.pcard--pending .pcard-banner { filter: saturate(0.85); }

.pcard-dep-notice {
    background: rgba(95, 168, 211, 0.12);
    border: 1px solid rgba(95, 168, 211, 0.32);
    color: #aad7ef;
    border-radius: 10px;
    padding: 0.5rem 0.75rem;
    margin: 0;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.pcard-dep-notice i { font-size: 0.8rem; opacity: 0.8; }

.pcard-tagline {
    color: var(--muted);
    font-size: 0.9rem;
    font-style: italic;
    margin: 0;
}

.pcard-desc {
    color: var(--muted);
    font-size: 0.95rem;
    margin: 0;
}

.pcard-features {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.pcard-features li {
    display: flex;
    gap: 0.55rem;
    align-items: center;
}

.pcard-features i {
    color: var(--primary);
    font-size: 0.75rem;
}

.pcard-actions {
    margin-top: auto;
    padding-top: 0.5rem;
}

.pcard-cta {
    width: 100%;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.pcard-buy {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
}

.pcard-buy:has(.inline-form:only-child) {
    grid-template-columns: 1fr;
}

.pcard-buy .inline-form {
    display: contents;
}

.pcard-buy button.payment-method-link {
    width: 100%;
    cursor: pointer;
    font-family: inherit;
}

/* "Cancel & try again" link shown under a pending purchase. */
.pcard-cancel {
    margin-top: 0.5rem;
    text-align: center;
}

.pcard-cancel-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    font: inherit;
    font-size: 0.85rem;
    color: var(--text-muted, #9aa0a6);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    opacity: 0.85;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.pcard-cancel-btn:hover {
    opacity: 1;
    color: var(--text, #e8eaed);
    text-decoration: underline;
}

/* Bundle card: list of included plugins. */
.pcard-bundle-items {
    list-style: none;
    padding: 0;
    margin: 0.25rem 0 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.pcard-bundle-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.75;
}

.pcard-bundle-item.is-owned {
    opacity: 1;
}

.pcard-bundle-item i {
    color: var(--product-accent, #69ac80);
}

/* ============================================================
   Bundles: "Show bundles" button + overlay
   ============================================================ */
.account-section-head--row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.bundles-toggle {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.1rem;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: var(--surface-2);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.bundles-toggle:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.bundles-toggle i { color: var(--primary); }

/* Per-buyer price summary shown on a bundle card. */
.pcard-bundle-price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0 0 0.75rem;
}

.pcard-bundle-total {
    font-size: 1.35rem;
    font-weight: 700;
    color: #fff;
}

.pcard-bundle-was {
    text-decoration: line-through;
    color: var(--muted);
    font-size: 0.95rem;
}

.pcard-bundle-save {
    font-size: 0.8rem;
    font-weight: 600;
    color: #c8efd5;
    background: rgba(105, 172, 128, 0.15);
    border: 1px solid rgba(105, 172, 128, 0.4);
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
}

.bundle-overlay {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.bundle-overlay[hidden] { display: none; }

.bundle-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(3px);
}

.bundle-overlay-panel {
    position: relative;
    /* Size to the cards inside (one bundle shouldn't float in a huge box),
       capped so many bundles wrap instead of stretching. */
    width: fit-content;
    max-width: min(900px, 100%);
    min-width: min(340px, 100%);
    max-height: 90vh;
    overflow-y: auto;
    background: var(--dark);
    border: 1px solid var(--stroke);
    border-radius: 20px;
    padding: 1.5rem 1.6rem 1.8rem;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.5);
}

.bundle-overlay-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.bundle-overlay-head h2 {
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
}

.bundle-overlay-head h2 i { color: var(--primary); }

.bundle-overlay-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.9rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.4rem;
    transition: color 0.15s ease;
}

.bundle-overlay-close:hover { color: #fff; }

.bundle-overlay-sub {
    color: var(--muted);
    margin: 0.4rem 0 1.2rem;
    font-size: 0.95rem;
    max-width: 42ch;
}

/* Flex (not grid) so the panel's fit-content width tracks the cards: one card
   sits at roughly the same width as the plugin cards behind the modal;
   multiple bundles wrap into rows. */
.bundle-overlay-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.5rem;
}

.bundle-overlay-grid > .pcard {
    flex: 1 1 360px;
    max-width: 400px;
}

body.bundle-overlay-open { overflow: hidden; }

/* ============================================================
   Version history modal (owned product card)
   ============================================================ */
.version-history-btn {
    margin-top: 0.5rem;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.5rem 0.85rem;
    border-radius: 10px;
    border: 1px solid var(--stroke);
    background: var(--surface);
    color: var(--muted);
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.version-history-btn:hover {
    color: var(--light);
    background: var(--surface-2);
    border-color: rgba(105, 172, 128, 0.35);
}

/* The modal is anchored to its .pcard (position: relative) and clipped to the
   card's rounded corners, so it opens *over that card* rather than floating in
   the viewport. It scrolls internally when the version list is long. */
.vh-modal {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: flex;
    /* Panel sizes to its content and hugs the bottom, so it folds up from the
       card's bottom edge; a long list is capped at the card height and scrolls. */
    align-items: flex-end;
    justify-content: center;
    padding: 8px;
    border-radius: inherit;
    overflow: hidden;
}

.vh-modal[hidden] { display: none; }

.vh-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
    animation: vh-fade 0.2s ease both;
}

.vh-modal-panel {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-height: 100%;
    background: var(--dark);
    border: 1px solid var(--stroke);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.5);
    /* Fold up from the bottom edge of the card. */
    transform-origin: bottom center;
    animation: vh-foldup 0.28s cubic-bezier(0.16, 0.84, 0.3, 1) both;
}

@keyframes vh-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes vh-foldup {
    from { opacity: 0; transform: translateY(100%) scaleY(0.85); }
    to { opacity: 1; transform: translateY(0) scaleY(1); }
}

.vh-modal-head {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}

.vh-modal-head h2 {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.vh-modal-head h2 i { color: var(--primary); }

.vh-modal-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.7rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.4rem;
    transition: color 0.15s ease;
}

.vh-modal-close:hover { color: #fff; }

/* The list is the scrollable region; the header stays pinned above it. */
.vh-modal .version-history__list {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    border: 1px solid var(--stroke);
    border-radius: 12px;
}

/* ============================================================
   Purchase history table
   ============================================================ */
.hist-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--stroke);
    border-radius: 14px;
}

.hist-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.95rem;
}

.hist-table thead {
    background: rgba(0, 0, 0, 0.25);
}

.hist-table th {
    text-align: left;
    padding: 0.85rem 1rem;
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    border-bottom: 1px solid var(--stroke);
}

.hist-table td {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    vertical-align: middle;
}

.hist-table tr:last-child td {
    border-bottom: none;
}

.hist-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.hist-provider {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    text-transform: capitalize;
}

.hist-ref code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.18rem 0.4rem;
    border-radius: 6px;
    font-size: 0.8rem;
    color: var(--muted);
}

.hist-amount {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
}

.hist-status {
    text-transform: capitalize;
    font-size: 0.8rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-weight: 600;
    display: inline-block;
}

.hist-status--ok {
    background: rgba(105, 172, 128, 0.2);
    color: #b4e8c3;
    border: 1px solid rgba(105, 172, 128, 0.32);
}

.hist-status--warn {
    background: rgba(255, 200, 120, 0.16);
    color: #ffd7a1;
    border: 1px solid rgba(255, 200, 120, 0.3);
}

.hist-status--err {
    background: rgba(220, 80, 80, 0.18);
    color: #ffb3b3;
    border: 1px solid rgba(220, 80, 80, 0.35);
}

.hist-link {
    color: var(--primary);
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 600;
}

.hist-link:hover {
    color: var(--light);
}

/* "Cancel" action shown next to a pending purchase in the history table. */
.hist-cancel-btn {
    background: none;
    border: none;
    padding: 0.25rem;
    font: inherit;
    font-weight: 600;
    color: #ffb3b3;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    opacity: 0.85;
    transition: opacity 0.15s ease, color 0.15s ease;
}

.hist-cancel-btn:hover {
    opacity: 1;
    color: #ff8080;
    text-decoration: underline;
}

.hist-empty {
    text-align: center;
    color: var(--muted);
    padding: 2rem 1rem;
    font-style: italic;
}

/* ============================================================
   Settings grid
   ============================================================ */
.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 1.25rem;
}

.settings-card {
    background: var(--surface-2);
    border: 1px solid var(--stroke);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-card h3 {
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0;
}

.settings-card h3 i {
    color: var(--primary);
    font-size: 0.95rem;
}

.settings-help {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0;
}

.settings-help code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.1rem 0.4rem;
    border-radius: 5px;
    font-size: 0.85em;
}

.cta-button--ghost {
    background: transparent;
    border: 1px solid var(--stroke);
    color: var(--light);
}

.cta-button--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
}

.cta-button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

/* ============================================================
   Receipt page
   ============================================================ */
.receipt {
    max-width: 720px;
    margin: 0 auto;
}

.receipt-head {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--stroke);
    margin-bottom: 1.5rem;
}

.receipt-logo {
    height: 56px;
    width: auto;
}

.receipt-head h1 {
    font-size: 1.75rem;
    margin: 0;
}

.receipt-meta {
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0.3rem 0 0;
}

.receipt-grid {
    display: grid;
    grid-template-columns: minmax(150px, max-content) 1fr;
    gap: 0.85rem 1.5rem;
    margin-bottom: 1.5rem;
}

.receipt-grid dt {
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.receipt-grid dd {
    margin: 0;
    font-size: 1rem;
}

.receipt-grid code {
    background: rgba(0, 0, 0, 0.3);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    font-size: 0.85em;
}

.receipt-amount {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.receipt-footer {
    color: var(--muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--stroke);
    padding-top: 1.25rem;
    margin: 1rem 0 1.5rem;
}

.receipt-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

@media print {
    .glass-nav, .receipt-actions { display: none !important; }
    .account-main { background: #fff !important; color: #000 !important; padding: 0 !important; }
    .account-card, .receipt-grid dd, .receipt-grid dt, .receipt-meta, .receipt-footer {
        background: #fff !important;
        color: #000 !important;
        border-color: #ccc !important;
    }
    .receipt-amount { color: #000 !important; }
}

/* ============================================================
   Verification banner + pill
   ============================================================ */
.verify-pill {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.18rem 0.6rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-left: 0.6rem;
    vertical-align: middle;
}

.verify-pill--ok {
    background: rgba(105, 172, 128, 0.22);
    color: #b4e8c3;
    border: 1px solid rgba(105, 172, 128, 0.4);
}

.verify-pill--warn {
    background: rgba(230, 180, 90, 0.18);
    color: #ffd7a1;
    border: 1px solid rgba(230, 180, 90, 0.4);
}

.verify-banner {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(230, 180, 90, 0.15), rgba(176, 120, 87, 0.1));
    border: 1px solid rgba(230, 180, 90, 0.32);
    flex-wrap: wrap;
}

.verify-banner--pending {
    background: linear-gradient(135deg, rgba(95, 168, 211, 0.15), rgba(95, 130, 211, 0.08));
    border-color: rgba(95, 168, 211, 0.35);
}

.verify-banner-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffd7a1;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.verify-banner--pending .verify-banner-icon {
    color: #aad7ef;
}

.verify-banner-text {
    flex: 1;
    min-width: 200px;
}

.verify-banner-text p {
    margin: 0.2rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.verify-banner-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.verify-result-icon {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    margin: 0 auto 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.4rem;
}

.verify-result-icon.is-ok {
    background: rgba(105, 172, 128, 0.18);
    color: #b4e8c3;
}

.verify-result-icon.is-err {
    background: rgba(220, 80, 80, 0.18);
    color: #ffb3b3;
}

/* ============================================================
   Avatar settings card
   ============================================================ */
.settings-card--avatar { gap: 1.1rem; }

.avatar-preview-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.avatar-current-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    font-size: 0.95rem;
}

.avatar-current-meta small {
    color: var(--muted);
    font-size: 0.8rem;
}

.avatar-upload-form {
    flex-direction: row;
    align-items: stretch;
    gap: 0.5rem;
}

.avatar-upload-label {
    flex: 1;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.35);
    border: 1px dashed var(--stroke);
    color: var(--muted);
    padding: 0.7rem 1rem;
    border-radius: 10px;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.avatar-upload-label:hover {
    border-color: var(--primary);
    color: var(--light);
}

.avatar-upload-label input[type=file] {
    display: none;
}

.avatar-upload-trigger {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.avatar-upload-form .cta-button {
    width: auto;
    flex: 0 0 auto;
}

.avatar-presets-block summary {
    cursor: pointer;
    color: var(--muted);
    font-size: 0.9rem;
    list-style: revert;
}

.avatar-presets-block summary:hover {
    color: var(--light);
}

.avatar-presets {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(46px, 1fr));
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.avatar-preset-btn {
    width: 100%;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    border: 2px solid transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1rem;
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.2s ease;
}

.avatar-preset-btn:hover {
    transform: scale(1.06);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.45);
}

.avatar-preset-btn.is-selected {
    border-color: #fff;
}

/* ============================================================
   Discord settings card
   ============================================================ */
.discord-linked {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem;
    background: rgba(88, 101, 242, 0.10);
    border: 1px solid rgba(88, 101, 242, 0.3);
    border-radius: 12px;
}

.discord-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    background: rgba(88, 101, 242, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
}

.discord-avatar--fallback i { font-size: 1.2rem; }

.discord-linked-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-width: 0;
}

.discord-username {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.discord-linked-text small {
    color: var(--muted);
    font-size: 0.8rem;
}

.discord-connect-btn {
    background: #5865f2 !important;
    border-color: #5865f2 !important;
    color: #fff !important;
    width: auto;
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.discord-connect-btn:hover {
    background: #4752c4 !important;
    border-color: #4752c4 !important;
}

/* ============================================================
   Product icon (image variant)
   ============================================================ */
.pcard-icon--image {
    background: rgba(0, 0, 0, 0.45);
    padding: 8px;
}

.pcard-icon--image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* ============================================================
   Nav helpers (kept)
   ============================================================ */
.nav-link--button {
    background: none;
    border: none;
    cursor: pointer;
    font: inherit;
    color: inherit;
    padding: 0;
}

.nav-logout-form {
    display: inline-flex;
    margin: 0;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 720px) {
    .account-main { padding: 6rem 1rem 3rem; }
    .account-shell--narrow { padding: 1.75rem 1.25rem; }
    .account-section { padding: 1.5rem 1.25rem; }
    .account-hero { padding: 1.5rem; }
    .account-hero-name { font-size: 1.5rem; }
    .account-avatar { width: 64px; height: 64px; font-size: 1.5rem; }
    .pcard-grid { grid-template-columns: 1fr; }
    .hist-table th, .hist-table td { padding: 0.7rem 0.75rem; }
}
