.credit-balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 36px;
    padding: 0 13px;
    border: 1px solid #cfe0fa;
    border-radius: 999px;
    background: #edf5ff;
    color: #1258ba;
    font-size: .82rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
}

.credit-balance-pill::before {
    content: "◆";
    color: #ff7a1a;
    font-size: .72rem;
}

.credit-modal-open { overflow: hidden; }

.credit-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: grid;
    place-items: center;
    padding: 20px;
    background: rgba(6, 20, 52, .66);
    backdrop-filter: blur(7px);
}

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

.credit-modal {
    position: relative;
    width: min(560px, 100%);
    padding: clamp(24px, 5vw, 38px);
    border: 1px solid rgba(255, 255, 255, .65);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 28px 80px rgba(5, 20, 55, .3);
    color: #0f2046;
}

.credit-modal-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: 0;
    border-radius: 50%;
    background: #f1f5fb;
    color: #52627f;
    font: 700 1.4rem/1 system-ui, sans-serif;
    cursor: pointer;
}

.credit-modal-kicker {
    display: inline-block;
    margin-bottom: 8px;
    color: #1c65cb;
    font-size: .74rem;
    font-weight: 900;
    letter-spacing: .11em;
    text-transform: uppercase;
}

.credit-modal h2 { margin: 0; font-size: clamp(1.45rem, 4vw, 2rem); }
.credit-modal-label { margin: 10px 0 22px; color: #64718b; }

.credit-modal-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.credit-modal-metrics > div {
    padding: 15px 13px;
    border: 1px solid #dfe7f3;
    border-radius: 15px;
    background: #f8faff;
}

.credit-modal-metrics small,
.credit-modal-metrics strong { display: block; }
.credit-modal-metrics small { margin-bottom: 5px; color: #71809c; font-size: .72rem; }
.credit-modal-metrics strong { font-size: .98rem; }
.credit-modal-metrics .credit-modal-cost { border-color: #ffd2b0; background: #fff6ef; color: #b94c00; }
.credit-modal-note { margin: 20px 0 0; color: #596780; font-size: .88rem; line-height: 1.55; }

.credit-modal-actions {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.credit-pack-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.credit-pack-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 22px;
    border: 1px solid #dce6f4;
    border-radius: 18px;
    background: #fff;
}

.credit-pack-card.recommended { border: 2px solid #1e66ca; box-shadow: 0 12px 34px rgba(30, 102, 202, .14); }
.credit-pack-card h3 { margin: 0; }
.credit-pack-card .credit-pack-count { color: #1258ba; font-size: 1.8rem; font-weight: 900; }
.credit-pack-card .credit-pack-price { font-weight: 800; }
.credit-pack-card p { flex: 1; margin: 0; color: #68758e; font-size: .86rem; line-height: 1.45; }

.credit-ledger-amount { font-weight: 900; }
.credit-ledger-amount.is-positive { color: #0c8a5b; }
.credit-ledger-amount.is-negative { color: #bf4a20; }

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

@media (max-width: 620px) {
    .credit-modal-metrics { grid-template-columns: 1fr; }
    .credit-modal-actions > * { width: 100%; text-align: center; }
    .credit-pack-grid { grid-template-columns: 1fr; }
    .credit-balance-pill { padding: 0 10px; }
}
