/* Tariffs share the app's existing colours and narrow mobile canvas. */
.billing-intro { margin:0 0 24px; color:var(--muted); font-size:14px; }
html[data-billing-mode="partner"] .model-specs b { display:none; }
.control-billing { margin:18px 0; padding-top:16px; border-top:1px solid var(--line); }
.control-billing p { color:var(--muted); font-size:12px; line-height:1.5; }
.control-billing select { width:100%; margin:10px 0; font:inherit; padding:12px; background:var(--panel); color:var(--text); border:1px solid var(--line); border-radius:12px; }
.billing-tabs { display:grid; grid-template-columns:1fr 1fr; gap:4px; margin-bottom:20px; border:1px solid var(--line); border-radius:16px; padding:4px; background:var(--panel); }
.billing-tabs button { min-height:43px; border:0; border-radius:11px; background:transparent; color:var(--muted); font-size:13px; font-weight:650; }
.billing-tabs button.active { background:var(--text); color:var(--ink); }
.plan-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; }
.plan-card { position:relative; min-width:0; border:1px solid var(--line); border-radius:21px; padding:17px 15px 15px; background:var(--panel); }
.plan-card.is-selected { border-color:var(--text); background:linear-gradient(150deg,var(--panel2),var(--panel)); box-shadow:inset 0 0 0 1px var(--text); }
.plan-card-select { position:absolute; z-index:1; inset:0; width:100%; height:100%; border:0; border-radius:inherit; padding:0; background:transparent; cursor:pointer; }
.plan-card > :not(.plan-card-select) { pointer-events:none; }
.plan-card .plan-choose { position:relative; z-index:2; pointer-events:auto; }
.plan-selection-mark { position:absolute; z-index:3; top:-7px; left:14px; display:grid; width:22px; height:22px; place-items:center; border:2px solid var(--bg); border-radius:50%; background:var(--text); color:var(--ink); font-size:13px; font-weight:750; opacity:0; }
.plan-card.is-selected .plan-selection-mark { opacity:1; }
.plan-card-select:focus-visible { outline:2px solid var(--text); outline-offset:4px; }
.plan-card-top { display:flex; align-items:center; justify-content:space-between; gap:7px; }
.plan-card h2 { margin:0; font-size:18px; font-weight:650; letter-spacing:-.045em; }
.plan-discount { display:inline-flex; align-items:center; justify-content:center; min-width:38px; border:1px solid #45454b; border-radius:8px; padding:4px 6px; color:var(--text); font-size:11px; font-weight:650; }
.plan-card.is-selected .plan-discount { background:var(--text); border-color:var(--text); color:var(--ink); }
.plan-description { min-height:30px; margin:9px 0 14px; color:var(--muted); font-size:11px; line-height:1.35; }
.plan-price { display:flex; align-items:baseline; flex-wrap:wrap; gap:4px; }
.plan-price b { font-size:27px; font-weight:680; line-height:1; letter-spacing:-.065em; white-space:nowrap; }
.plan-price small { color:var(--muted); font-size:11px; }
.plan-tokens { display:flex; align-items:baseline; gap:5px; margin:17px 0; padding-top:16px; border-top:1px solid var(--line); }
.plan-tokens b { font-size:24px; font-weight:600; line-height:1; letter-spacing:-.045em; white-space:nowrap; }
.plan-tokens span { color:var(--muted); font-size:11px; }
.plan-choose { width:100%; min-height:40px; border:1px solid #4a4a50; border-radius:11px; padding:8px 5px; background:transparent; color:var(--text); font-size:12px; font-weight:650; }
.plan-card.is-selected .plan-choose { border-color:var(--text); background:var(--text); color:var(--ink); }
.plan-custom { grid-column:1 / -1; padding:19px; }
.plan-custom h2 { font-size:21px; }
.custom-plan-arrow { color:var(--muted); font-size:23px; line-height:1; }
.custom-plan-description { margin:7px 0 18px; color:var(--muted); font-size:13px; }
.custom-plan-details { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); align-items:end; gap:15px; }
.custom-plan-details b { display:block; font-size:24px; font-weight:650; letter-spacing:-.055em; }
.custom-plan-details small { display:block; max-width:180px; margin-top:6px; color:var(--muted); font-size:10px; line-height:1.4; }
.custom-plan-details .plan-choose { align-self:end; }
.billing-terms { display:flex; align-items:flex-start; gap:12px; margin-top:20px; border:1px solid var(--line); border-radius:17px; padding:16px; background:var(--panel); }
.billing-terms-icon { flex:0 0 26px; font-size:26px; line-height:1; color:var(--muted); }
.billing-terms b { font-size:13px; font-weight:600; }
.billing-terms p { margin:6px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
.billing-features { display:flex; flex-wrap:wrap; gap:9px 15px; margin:18px 3px; color:var(--muted); font-size:11px; }
.billing-features span::before { content:'✓'; padding-right:5px; color:var(--text); }
.billing-status { margin:16px 0 0; text-align:center; color:var(--muted); font-size:11px; }
.billing-profile-entry { display:flex; align-items:center; justify-content:space-between; gap:12px; width:100%; border:1px solid var(--line); border-radius:20px; padding:18px; background:var(--panel); color:var(--text); text-align:left; }
.billing-profile-entry strong, .billing-profile-entry small { display:block; }
.billing-profile-entry strong { font-size:17px; font-weight:650; letter-spacing:-.035em; }
.billing-profile-entry small { margin-top:6px; color:var(--muted); font-size:12px; }
.billing-profile-entry > span:last-child { color:var(--muted); font-size:23px; }
.profile-action.billing-topup-entry { background:var(--text); color:var(--ink); }
button.balance { padding:0; background:transparent; text-align:left; }
button.balance span { min-width:30px; padding:0 9px; font-size:19px; }
button.balance:focus-visible, .plan-choose:focus-visible, .billing-tabs button:focus-visible { outline:2px solid var(--text); outline-offset:3px; }
.topup-picker { border:1px solid var(--line); border-radius:22px; padding:22px 20px; background:var(--panel); }
.topup-picker-heading { display:flex; justify-content:space-between; align-items:center; gap:10px; font-size:12px; }
.topup-picker-heading label { color:var(--muted); }
.topup-current-discount { display:flex; align-items:center; gap:6px; white-space:nowrap; color:var(--muted); font-size:11px; }
.topup-current-discount b { border:1px solid var(--line); border-radius:8px; padding:5px 7px; background:var(--panel2); color:var(--text); font-size:12px; font-weight:650; }
.topup-counter { display:grid; grid-template-columns:42px minmax(0,1fr) 42px; align-items:center; gap:12px; margin:27px 0 30px; }
.topup-counter button { width:42px; height:42px; border:1px solid var(--line); border-radius:13px; background:var(--panel2); color:var(--text); font-size:25px; cursor:pointer; }
.topup-counter button:disabled { opacity:.3; cursor:default; }
.topup-counter > div { text-align:center; }
.topup-counter output { display:block; color:var(--text); font-size:44px; font-weight:650; line-height:1.1; letter-spacing:-.055em; font-variant-numeric:tabular-nums; }
.topup-counter > div > span { display:block; margin-top:7px; color:var(--muted); font-size:11px; }
.topup-slider { position:relative; }
.topup-scale { position:relative; height:26px; margin:0 8px; pointer-events:none; }
.topup-milestone { position:absolute; top:0; left:var(--mark-position); width:0; color:var(--muted); }
.topup-milestone b { position:absolute; transform:translateX(-50%); font-size:11px; font-weight:600; white-space:nowrap; }
.topup-milestone::after { content:''; position:absolute; top:19px; left:-.5px; width:1px; height:7px; background:var(--line); }
.topup-milestone.is-reached { color:var(--text); }
.topup-milestone.is-reached::after { background:var(--text); }
#topup-range { display:block; margin:0; cursor:pointer; }
.topup-range-limits { display:flex; justify-content:space-between; margin:11px 2px 0; color:var(--muted); font-size:11px; font-variant-numeric:tabular-nums; }
.topup-range-hint { margin:13px 0 0; text-align:center; color:var(--muted); font-size:10px; }
.topup-next { min-height:16px; margin:9px 0 25px; text-align:center; color:var(--text); font-size:11px; }
.topup-checkout { border-top:1px solid var(--line); padding-top:21px; }
.topup-total { display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:baseline; gap:7px 12px; margin-bottom:20px; }
.topup-total > span { color:var(--muted); font-size:12px; }
.topup-total > b { font-size:29px; font-weight:650; letter-spacing:-.05em; white-space:nowrap; font-variant-numeric:tabular-nums; }
.topup-total > small { grid-column:1 / -1; color:var(--muted); font-size:10px; }
.topup-counter button:focus-visible, #topup-range:focus-visible { outline:2px solid var(--text); outline-offset:3px; }
.billing-sr-only { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
.billing-primary { width:100%; min-height:46px; border:0; border-radius:13px; padding:12px; background:var(--text); color:var(--ink); font:inherit; font-size:14px; font-weight:650; }
.billing-primary:disabled { opacity:.5; cursor:default; }
.billing-notice { margin:0; color:var(--muted); font-size:12px; line-height:1.5; }
.billing-modal { position:fixed; z-index:40; inset:0; display:grid; align-items:end; background:#000b; backdrop-filter:blur(7px); }
.billing-modal-backdrop { position:absolute; inset:0; border:0; background:transparent; }
.billing-sheet { position:relative; z-index:1; width:min(100%,510px); max-height:calc(var(--ms-viewport-height) - 24px); overflow-y:auto; margin:0 auto; border:1px solid var(--line); border-radius:27px 27px 0 0; padding:24px 22px calc(24px + var(--ms-content-bottom) + var(--ms-safe-bottom)); background:var(--panel); }
.billing-sheet-head { display:flex; justify-content:space-between; align-items:center; gap:16px; }
.billing-sheet h2 { margin:0; font-size:25px; letter-spacing:-.05em; }
.billing-sheet-close { width:35px; height:35px; border:1px solid var(--line); border-radius:50%; background:var(--panel2); color:var(--text); font-size:23px; }
.billing-sheet-price { margin:25px 0; font-size:36px; letter-spacing:-.06em; font-weight:650; }
.billing-sheet-price small { font-size:14px; font-weight:400; letter-spacing:0; color:var(--muted); }
.billing-sheet-line { display:flex; justify-content:space-between; gap:15px; margin:13px 0; color:var(--muted); font-size:14px; }
.billing-sheet-line b { color:var(--text); font-weight:550; }
.billing-sheet .billing-primary { margin-top:20px; }
.billing-sheet .billing-notice { margin-top:14px; }
.billing-sheet .billing-payment-hint { margin-top:8px; text-align:center; font-size:13px; }
.billing-sheet .billing-status { text-align:left; }
#billing-loading, #billing-error { padding:24px 10px; color:var(--muted); font-size:14px; text-align:center; }
#billing-error button { border:0; padding:10px; color:var(--text); background:transparent; text-decoration:underline; }
html[data-theme="light"] .plan-discount, html[data-theme="light"] .plan-choose { border-color:#c8c8cb; }
html[data-theme="light"] .plan-card.is-selected .plan-discount { border-color:var(--text); }
@media (max-width:360px) {
  /* One shared narrow header for every screen; logo sizes stay unchanged. */
  .top { padding-right:12px; padding-left:12px; column-gap:8px; }
  .header-actions { gap:6px; }
  button.balance span { min-width:26px; padding:0 7px; }
  button.balance b { padding:10px 5px; font-size:14px; }
  .plan-grid { gap:9px; }
  .plan-card { border-radius:18px; padding:15px 11px 12px; }
  .plan-card h2 { font-size:16px; }
  .plan-custom h2 { font-size:20px; }
  .plan-custom { padding:16px; }
  .custom-plan-details { gap:10px; }
  .custom-plan-details b { font-size:22px; }
  .custom-plan-details .plan-choose { font-size:11px; }
  .plan-price b { font-size:24px; }
  .plan-tokens b { font-size:22px; }
  .plan-tokens { gap:4px; }
  .plan-tokens span { font-size:10px; }
  .topup-picker { padding:20px 15px; }
  .topup-picker-heading { font-size:11px; }
  .topup-counter { gap:8px; }
  .topup-counter output { font-size:39px; }
  .topup-total > b { font-size:27px; }
}

.billing-consent { display:flex; align-items:flex-start; gap:10px; margin:16px 0; font-size:13px; line-height:1.5; color:var(--muted); }
.billing-consent input { flex:0 0 20px; width:20px; height:20px; margin:1px 0 0; accent-color:var(--text); }
.billing-consent a { color:var(--text); }
.billing-check { display:block; width:100%; margin:12px 0; padding:10px; border:1px solid var(--line); border-radius:12px; color:var(--text); background:transparent; font:inherit; font-size:13px; }
.billing-subscription-state { margin:0 0 16px; padding:16px; border:1px solid var(--line); border-radius:16px; font-size:13px; line-height:1.5; }
.billing-subscription-state p { margin:0 0 8px; }
.billing-subscription-state button { margin-bottom:0; }

.topup-subscription-notice { margin:0 0 22px; border:1px solid var(--line); border-radius:13px; padding:15px; background:var(--panel2); }
.topup-subscription-notice b { display:block; color:var(--text); font-size:13px; font-weight:600; }
.topup-subscription-notice p { margin:7px 0 0; color:var(--muted); font-size:12px; line-height:1.5; }
