/* Plan & billing, four cards (plan-billing.js; Primy CEO, 10 October 2026): Your plan, Credits, Spending money for agents,
   Billing. What there is first, then one or two actions; every choice in a sheet (billing-sheet.js). */
.billing-page{display:grid;gap:16px;min-width:0;overflow-wrap:anywhere}
.billing-page>div:empty{display:none}
.billing-page .card.billing-card{margin:0;padding:22px;display:grid;gap:14px;min-width:0}
.billing-card>h2{margin:0;font-size:1.0625rem}
.billing-card p{margin:0}
.billing-card [role=status]:empty{display:none}
.billing-card .btn{min-height:44px}
.billing-card .text-button,.billing-page .text-button{min-height:40px;padding:4px 2px;border:0;background:none;color:var(--purple);font:inherit;font-size:.875rem;font-weight:600;cursor:pointer;white-space:nowrap}
.billing-label{margin:0;font-size:.875rem;font-weight:600}

/* Your plan: the name, large; one line; one action. */
.billing-plan-head{display:flex;justify-content:space-between;align-items:center;gap:12px 16px;flex-wrap:wrap}
.billing-plan-what{display:grid;gap:4px;flex:1 1 220px;min-width:0}
.billing-plan-name,.billing-figure{margin:0;font-size:1.75rem;font-weight:650;letter-spacing:-.03em;line-height:1.2}
.billing-plan-line{color:var(--muted);font-size:.9375rem}

/* Credits: the figure and its month's bar, Top up beside them. */
.credits-now{display:flex;justify-content:space-between;align-items:flex-end;gap:14px 16px;flex-wrap:wrap}
.credits-figure{display:grid;gap:8px;flex:1 1 220px;min-width:0}
.billing-meter{-webkit-appearance:none;appearance:none;display:block;width:100%;max-width:380px;height:6px;border:0;border-radius:3px;background:var(--soft);color:var(--purple);overflow:hidden}
.billing-meter::-webkit-progress-bar{background:var(--soft);border-radius:3px}
.billing-meter::-webkit-progress-value{background:var(--purple);border-radius:3px}
.billing-meter::-moz-progress-bar{background:var(--purple);border-radius:3px}
.billing-low{padding:10px 14px;border-radius:10px;background:#fff0db;color:var(--amber);font-weight:600}

/* A setting row, a group with its own small head, and one-line lists. */
.billing-row{display:flex;align-items:center;gap:12px;padding-top:14px;border-top:1px solid var(--line);min-width:0}
.billing-row .grow{flex:1;min-width:0}
.billing-row small,.billing-line small{display:block;margin-top:2px;color:var(--muted);font-size:.8125rem;font-weight:400}
.billing-select:focus{outline:none;border-color:var(--purple,#6d28b5);box-shadow:inset 0 0 0 1px var(--purple,#6d28b5)}.billing-select{min-height:42px;max-width:100%;padding:6px 10px;border:1px solid var(--line);border-radius:9px;background:var(--surface,#fff);color:inherit;font:inherit;font-weight:600}
.billing-group{display:grid;gap:2px;padding-top:14px;border-top:1px solid var(--line);min-width:0}
.billing-card>.billing-group:first-of-type:is(:first-child){border-top:0;padding-top:0}
.billing-group-head{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:36px}
.billing-group>.meta{padding:4px 0}
.billing-lines{margin:0;padding:0;list-style:none;min-width:0}
.billing-line{display:flex;align-items:center;gap:12px;width:100%;min-height:46px;padding:8px 0;border:0;border-bottom:1px solid var(--line);background:none;color:inherit;font:inherit;text-align:start;min-width:0}
.billing-lines>li:last-child>.billing-line,.billing-lines>li.billing-line:last-child{border-bottom:0}
.billing-line .grow{flex:1;min-width:0}
.billing-line-value{flex:none;font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
button.billing-line{cursor:pointer}
button.billing-line .icon{width:18px;height:18px;color:var(--muted)}
.billing-item .badge{flex:none}
.billing-actions{display:flex;gap:10px;flex-wrap:wrap}

/* The sheet: from the bottom on a phone, in the middle on a computer. */
html.billing-sheet-open{overflow:hidden}
.billing-scrim{position:fixed;inset:0;z-index:1100;display:flex;align-items:center;justify-content:center;padding:24px;background:rgba(24,18,36,.42)}
.billing-sheet{display:flex;flex-direction:column;width:min(460px,100%);max-height:calc(100vh - 48px);overflow:auto;overscroll-behavior:contain;border-radius:18px;background:var(--surface,#fff);color:var(--ink,#24212d);box-shadow:0 24px 60px rgba(30,16,52,.25);text-align:start}
.billing-sheet-head{display:flex;align-items:center;gap:8px;padding:12px 10px 4px 22px}
.billing-sheet-head h3{flex:1;margin:0;font-size:1.0625rem;line-height:1.35}
.billing-sheet-close{flex:none;display:grid;place-items:center;width:44px;height:44px;border-radius:50%;color:var(--muted)}
.billing-sheet-close:hover{background:var(--soft)}
.billing-sheet-body{display:grid;gap:14px;padding:6px 22px 22px;min-width:0}
.billing-sheet-body p{margin:0}
.billing-sheet-body .billing-group{border-top:1px solid var(--line)}
.billing-choices{display:grid;gap:8px}
.billing-choice{display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:10px 14px;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff);color:inherit;font:inherit;text-align:start;cursor:pointer}
.billing-choice:has(input:checked),.billing-choice.on{border-color:var(--purple);box-shadow:inset 0 0 0 1px var(--purple);background:var(--soft)}
.billing-choice input{flex:none;width:18px;height:18px;margin:0;accent-color:var(--purple)}
.billing-choice .grow{flex:1;min-width:0;font-weight:600}
.billing-choice-value{flex:none;white-space:nowrap}
.billing-field{display:grid;gap:6px;font-size:.875rem;font-weight:600;min-width:0}
.billing-field .billing-select,.billing-field .input{width:100%}
.billing-fee{font-size:.9375rem}
.billing-sheet-actions{display:flex;gap:10px;flex-wrap:wrap}
.billing-sheet-actions .btn{flex:1 1 auto;min-height:48px}
.billing-sheet .notice{display:grid;gap:12px}
.billing-sheet .notice .actions{display:flex;gap:10px;flex-wrap:wrap;margin:0}
.capacity-confirm,.billing-sheet form{display:grid;gap:14px;min-width:0}
.billing-choice input:focus-visible{outline-offset:2px}
.billing-card>h2+.billing-row,.billing-card>h2+.billing-group{border-top:0;padding-top:0}

/* A Studio builder's preview of a credits account: marked, and the notice as the bell shows it. */
.billing-preview{display:grid;gap:10px;padding:16px;border:2px dashed var(--purple);border-radius:var(--radius,14px);background:var(--soft)}
.billing-preview-head{display:flex;align-items:center;justify-content:space-between;gap:10px 12px;flex-wrap:wrap}
.billing-preview-head p{margin:0;flex:1 1 220px}
.billing-preview-bell{margin:0;padding:0;list-style:none;border:1px solid var(--line);border-radius:12px;background:var(--surface,#fff);overflow:hidden}
.billing-preview-offer{display:flex;justify-content:center}
.billing-preview-bell .bell-title,.billing-preview-bell .bell-line{white-space:normal}

@media (max-width:700px){
 .billing-page{gap:12px}
 .billing-page .card.billing-card{padding:18px 16px}
 .billing-plan-name,.billing-figure{font-size:1.5rem}
 .billing-plan-head>.btn,.billing-plan-head [data-interval-host],.billing-plan-head [data-interval-host] .btn,.credits-now>.btn,.billing-actions .btn{width:100%}
 .billing-scrim{align-items:flex-end;padding:0}
 .billing-sheet{width:100%;max-height:90vh;border-radius:18px 18px 0 0;padding-bottom:env(safe-area-inset-bottom)}
 .billing-sheet-body{padding:6px 16px 20px}
 .billing-sheet-head{padding-inline-start:16px}
}
[data-theme=dark] .billing-low{background:#3a2a12;color:#f3c37c}
[data-theme=dark] .billing-scrim{background:rgba(0,0,0,.6)}
