* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: Inter, Arial, sans-serif;
    line-height: 1.5;
    color: #172033;
    background: #f6f8fb;
}

header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 960px;
    margin: 0 auto;
    padding: 18px 20px;
}

.brand-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #0b2a3a;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 800;
}

.brand-mark {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.billing-nav {
    display: flex;
    align-items: center;
    gap: 10px;
}

.nav-link,
.secondary-action,
.danger-action,
.primary-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 8px;
    border: 1px solid #c7d2dc;
    background: #ffffff;
    color: #006b8f;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.billing-shell {
    width: min(960px, calc(100% - 32px));
    margin: 24px auto 72px;
}

.billing-panel {
    margin-bottom: 18px;
    padding: 24px;
    border: 1px solid #d7e0e7;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 18px 42px rgba(34, 48, 72, 0.08);
}

.billing-notice {
    margin-bottom: 18px;
    padding: 14px 16px;
    border: 1px solid #f3c47e;
    border-radius: 8px;
    color: #6f3d08;
    background: #fff7e8;
    font-weight: 700;
}

.status-panel {
    display: grid;
    grid-template-columns: 46px 1fr;
    gap: 18px;
    align-items: center;
}

.status-panel h1 {
    margin: 0 0 8px;
    color: #0b2a3a;
}

.status-panel p {
    margin: 0;
    color: #546173;
}

.status-dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #c2410c;
    box-shadow: 0 0 0 8px #fff1e8;
    justify-self: center;
}

.status-dot.active {
    background: #12805c;
    box-shadow: 0 0 0 8px #dcf8eb;
}

.status-panel.attention .status-dot {
    animation: billingPulse 1.8s ease-out infinite;
}

@keyframes billingPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(194, 65, 12, 0.22), 0 0 0 8px #fff1e8;
    }
    70% {
        box-shadow: 0 0 0 12px rgba(194, 65, 12, 0), 0 0 0 8px #fff1e8;
    }
    100% {
        box-shadow: 0 0 0 0 rgba(194, 65, 12, 0), 0 0 0 8px #fff1e8;
    }
}

.details-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(140px, 1fr));
    gap: 14px;
    align-items: end;
}

.detail-item {
    display: grid;
    gap: 4px;
}

.detail-item span {
    color: #667085;
    font-size: 0.86rem;
}

.detail-item strong {
    color: #172033;
}

.current-plan-panel {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) minmax(320px, 1.4fr) auto;
    gap: 18px;
    align-items: center;
}

.current-plan-copy {
    display: grid;
    gap: 6px;
}

.section-label {
    color: #667085;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.current-plan-copy h2 {
    margin: 0;
    color: #0b2a3a;
    font-size: 1.35rem;
}

.current-plan-copy p {
    margin: 0;
    color: #546173;
}

.current-plan-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(90px, 1fr));
    gap: 12px;
    padding: 14px;
    border: 1px solid #d7e0e7;
    border-radius: 8px;
    background: #f8fafc;
}

.checkout-panel {
    display: grid;
    gap: 16px;
    align-items: start;
}

.plan-choice {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.plan-choice button {
    min-height: 96px;
    padding: 14px;
    border: 1px solid #c7d2dc;
    border-radius: 8px;
    background: #ffffff;
    color: #172033;
    text-align: left;
    display: grid;
    grid-template-rows: 24px 20px 20px;
    align-content: start;
    gap: 6px;
    font-weight: 700;
    cursor: pointer;
}

.plan-choice button.selected {
    border-color: #006d8f;
    color: #073346;
    background: #e8f7fb;
    box-shadow: inset 0 0 0 1px #006d8f;
}

.plan-button-heading {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.plan-choice strong {
    font-size: 0.98rem;
    line-height: 1.2;
}

.plan-button-savings {
    min-height: 22px;
    padding: 3px 8px;
    border-radius: 999px;
    color: #0c5132;
    background: #dff7e8;
    font-size: 0.72rem;
    line-height: 1.35;
    white-space: nowrap;
}

.plan-button-savings:empty {
    visibility: hidden;
}

.plan-button-detail {
    color: #596579;
    font-size: 0.82rem;
    font-weight: 600;
    line-height: 1.2;
}

.plan-button-price {
    color: #0c5132;
    font-size: 0.78rem;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.purchase-row {
    display: grid;
    grid-template-columns: 132px minmax(210px, 1fr) auto;
    gap: 14px;
    align-items: end;
}

.quantity-field {
    display: grid;
    gap: 6px;
    align-self: stretch;
    color: #3d4858;
    font-size: 0.9rem;
    font-weight: 700;
}

.quantity-field input {
    width: 100%;
    min-height: 52px;
    padding: 0 12px;
    border: 1px solid #c7d2dc;
    border-radius: 8px;
    font: inherit;
    font-size: 1.15rem;
}

.price-preview {
    min-height: 52px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    padding: 0 4px;
}

.price-preview strong {
    font-size: 2rem;
    line-height: 1;
    color: #0b2a3a;
}

.discount-badge {
    padding: 4px 8px;
    border-radius: 999px;
    color: #0c5132;
    background: #dff7e8;
    font-size: 0.78rem;
}

#billing-action-container {
    display: block;
}

.primary-action {
    min-height: 56px;
    border: 0;
    color: #ffffff;
    background: #006d8f;
}

.checkout-action {
    align-self: end;
    min-height: 52px;
    padding: 0 22px;
    white-space: nowrap;
}

.checkout-actions {
    display: flex;
    gap: 10px;
    align-items: end;
    justify-content: flex-end;
}

.checkout-actions.editing {
    flex-wrap: wrap;
}

.danger-action {
    color: #a11212;
    border-color: #f1b5b5;
}

footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #e4e9ef;
    font-size: 0.86rem;
}

footer a {
    color: #006b8f;
    text-decoration: none;
}

@media (max-width: 760px) {
    header,
    .current-plan-panel,
    .current-plan-facts,
    .purchase-row,
    .details-grid {
        grid-template-columns: 1fr;
    }

    header {
        display: grid;
    }

    .billing-nav,
    .plan-choice {
        grid-template-columns: 1fr;
    }

    .billing-nav {
        display: grid;
    }

    .checkout-action {
        width: 100%;
    }

    .checkout-actions {
        display: grid;
        justify-content: stretch;
    }
}
