{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "checkout-billing-settings",
  "type": "registry:component",
  "title": "Checkout Billing Settings",
  "description": "A light billing settings page with the current plan, saved payment methods that can be made default or removed after an inline confirm, billing email and tax ID fields with format checks, usage meters and the next invoice.",
  "author": "Hyperblur <hello@hyperblur.dev>",
  "dependencies": [],
  "registryDependencies": [],
  "categories": [
    "checkout",
    "billing",
    "settings",
    "payment methods",
    "usage meter",
    "tax id",
    "section"
  ],
  "docs": "https://hyperblur.dev/effects/checkout-billing-settings",
  "files": [
    {
      "path": "registry/hyperblur/checkout-billing-settings.tsx",
      "type": "registry:component",
      "target": "components/hyperblur/checkout-billing-settings.tsx",
      "content": "\"use client\";\n\nimport * as React from \"react\";\n\nexport interface BillingMethod {\n  id: string;\n  kind: \"visa\" | \"mastercard\" | \"amex\" | \"bank\";\n  label: string;\n  detail: string;\n}\n\nexport interface BillingUsage {\n  label: string;\n  used: number;\n  limit: number;\n  unit?: string;\n}\n\nexport interface BillingPlanInfo {\n  name: string;\n  price: number;\n  period: string;\n  renews: string;\n  seats: string;\n}\n\nexport interface BillingTaxId {\n  type: string;\n  value: string;\n}\n\nexport interface CheckoutBillingSettingsProps extends Omit<React.HTMLAttributes<HTMLElement>, \"title\"> {\n  title?: string;\n  subtitle?: string;\n  plan?: BillingPlanInfo;\n  methods?: BillingMethod[];\n  defaultMethodId?: string;\n  usage?: BillingUsage[];\n  billingEmail?: string;\n  taxId?: BillingTaxId;\n  currency?: string;\n  onChangePlan?: () => void;\n  onCancelPlan?: () => void;\n  onAddMethod?: () => void;\n  onDefaultChange?: (id: string) => void;\n  onRemoveMethod?: (id: string) => void;\n  onEmailSave?: (email: string) => void;\n  onTaxIdSave?: (taxId: BillingTaxId) => void;\n  accent?: string;\n}\n\nconst defaultPlan: BillingPlanInfo = { name: \"Team\", price: 96, period: \"month\", renews: \"Dec 1, 2026\", seats: \"8 of 10 seats\" };\n\nconst defaultMethods: BillingMethod[] = [\n  { id: \"pm_visa\", kind: \"visa\", label: \"Visa ending 4242\", detail: \"Expires 08 / 28\" },\n  { id: \"pm_mc\", kind: \"mastercard\", label: \"Mastercard ending 4444\", detail: \"Expires 03 / 27\" },\n  { id: \"pm_bank\", kind: \"bank\", label: \"Harbor Point Bank\", detail: \"Checking ending 6789\" },\n];\n\nconst defaultUsage: BillingUsage[] = [\n  { label: \"Seats\", used: 8, limit: 10 },\n  { label: \"Build minutes\", used: 3240, limit: 5000 },\n  { label: \"Storage\", used: 42, limit: 100, unit: \"GB\" },\n  { label: \"Bandwidth\", used: 912, limit: 1000, unit: \"GB\" },\n];\n\nconst taxTypes: { id: string; label: string; placeholder: string; pattern: RegExp }[] = [\n  { id: \"eu_vat\", label: \"EU VAT\", placeholder: \"DE123456789\", pattern: /^[A-Z]{2}[0-9A-Z]{8,12}$/ },\n  { id: \"gb_vat\", label: \"GB VAT\", placeholder: \"GB123456789\", pattern: /^GB\\d{9}$/ },\n  { id: \"us_ein\", label: \"US EIN\", placeholder: \"12-3456789\", pattern: /^\\d{2}-\\d{7}$/ },\n  { id: \"au_abn\", label: \"AU ABN\", placeholder: \"12 345 678 901\", pattern: /^\\d{2} \\d{3} \\d{3} \\d{3}$/ },\n];\n\nconst num = (n: number) => String(n).replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\");\n\nconst css = `\n.hb-qg8 {\n  --hb-qg8-accent: #7c3aed;\n  container-type: inline-size;\n  position: relative;\n  box-sizing: border-box;\n  width: 100%;\n  overflow: hidden;\n  background: #fafafa;\n  color: #18181b;\n  font-family: inherit;\n  -webkit-font-smoothing: antialiased;\n}\n.hb-qg8 *, .hb-qg8 *::before, .hb-qg8 *::after { box-sizing: border-box; }\n.hb-qg8-inner { max-width: 1120px; margin: 0 auto; padding: clamp(40px, 6cqw, 88px) clamp(16px, 4cqw, 32px); }\n.hb-qg8-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 20px; border-bottom: 1px solid #e4e4e7; }\n.hb-qg8-title { margin: 0; font-size: clamp(26px, 3.6cqw, 34px); letter-spacing: -0.03em; font-weight: 600; }\n.hb-qg8-sub { margin: 6px 0 0; font-size: 14px; color: #71717a; }\n.hb-qg8-tabs { display: flex; gap: 4px; padding: 4px; background: #f0f0f2; border-radius: 10px; }\n.hb-qg8-tabs span { font-size: 13px; padding: 6px 12px; border-radius: 7px; color: #71717a; }\n.hb-qg8-tabs span[data-on=\"true\"] { background: #fff; color: #18181b; box-shadow: 0 1px 2px rgba(0,0,0,.08); font-weight: 500; }\n.hb-qg8-grid { display: grid; gap: 16px; margin-top: 24px; align-items: start; }\n@container (min-width: 860px) { .hb-qg8-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; } }\n.hb-qg8-col { display: grid; gap: 16px; min-width: 0; }\n.hb-qg8-card { background: #fff; border: 1px solid #e4e4e7; border-radius: 16px; padding: 20px; box-shadow: 0 1px 2px rgba(0,0,0,.03); }\n.hb-qg8-ch { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }\n.hb-qg8-ch h3 { margin: 0; font-size: 15px; font-weight: 600; }\n.hb-qg8-ch p { margin: 2px 0 0; font-size: 12px; color: #71717a; }\n.hb-qg8-plan { position: relative; overflow: hidden; border-color: color-mix(in srgb, var(--hb-qg8-accent) 30%, #e4e4e7); background: radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--hb-qg8-accent) 10%, #fff), #fff 60%); }\n.hb-qg8-plan::after { content: \"\"; position: absolute; right: -40px; top: -40px; width: 160px; height: 160px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--hb-qg8-accent) 22%, transparent); box-shadow: 0 0 0 24px color-mix(in srgb, var(--hb-qg8-accent) 4%, transparent), 0 0 0 48px color-mix(in srgb, var(--hb-qg8-accent) 3%, transparent); pointer-events: none; }\n.hb-qg8-pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 3px 8px; border-radius: 999px; background: #ecfdf5; color: #047857; }\n.hb-qg8-pill::before { content: \"\"; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }\n.hb-qg8-pname { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 20px; font-weight: 600; letter-spacing: -0.02em; }\n.hb-qg8-price { margin: 10px 0 0; font-size: 13px; color: #71717a; }\n.hb-qg8-price b { font-size: 34px; color: #18181b; letter-spacing: -0.04em; font-weight: 600; margin-right: 4px; }\n.hb-qg8-pmeta { display: flex; gap: 18px; flex-wrap: wrap; margin: 14px 0 0; font-size: 13px; color: #52525b; }\n.hb-qg8-pmeta span { display: inline-flex; align-items: center; gap: 6px; }\n.hb-qg8-pmeta svg { width: 14px; height: 14px; color: #a1a1aa; }\n.hb-qg8-pact { display: flex; gap: 8px; margin-top: 18px; position: relative; z-index: 1; }\n.hb-qg8-btn { height: 36px; padding: 0 14px; border-radius: 9px; font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .2s, border-color .2s, filter .2s; }\n.hb-qg8-primary { border: 0; background: var(--hb-qg8-accent); color: #fff; box-shadow: inset 0 1px 0 rgba(255,255,255,.2); }\n.hb-qg8-primary:hover { filter: brightness(1.1); }\n.hb-qg8-sec { border: 1px solid #e4e4e7; background: #fff; color: #18181b; }\n.hb-qg8-sec:hover { background: #f4f4f5; }\n.hb-qg8-danger { border: 0; background: #dc2626; color: #fff; }\n.hb-qg8-danger:hover { filter: brightness(1.08); }\n.hb-qg8-text { border: 0; background: none; color: #71717a; padding: 0 8px; }\n.hb-qg8-text:hover { color: #18181b; }\n.hb-qg8-btn:focus-visible, .hb-qg8-link:focus-visible { outline: 2px solid var(--hb-qg8-accent); outline-offset: 2px; }\n.hb-qg8-btn[disabled] { opacity: .45; cursor: not-allowed; }\n.hb-qg8-btn svg { width: 14px; height: 14px; }\n.hb-qg8-methods { list-style: none; margin: 0; padding: 0; border: 1px solid #e4e4e7; border-radius: 12px; overflow: hidden; }\n.hb-qg8-m { display: grid; grid-template-columns: 46px 1fr auto; gap: 12px; align-items: center; padding: 12px 14px; transition: background .2s; animation: hb-qg8-in .35s ease both; }\n@keyframes hb-qg8-in { from { opacity: 0; transform: translateY(4px); } }\n.hb-qg8-m + .hb-qg8-m, .hb-qg8-confirm { border-top: 1px solid #f0f0f2; }\n.hb-qg8-m:hover { background: #fafafa; }\n.hb-qg8-brand { width: 46px; height: 30px; border-radius: 6px; display: grid; place-items: center; font-size: 9px; font-weight: 800; letter-spacing: .04em; color: #fff; }\n.hb-qg8-brand[data-kind=\"visa\"] { background: linear-gradient(135deg, #1e3a8a, #2563eb); font-style: italic; }\n.hb-qg8-brand[data-kind=\"mastercard\"] { background: #18181b; }\n.hb-qg8-brand[data-kind=\"amex\"] { background: linear-gradient(135deg, #0e7490, #22d3ee); }\n.hb-qg8-brand[data-kind=\"bank\"] { background: #f4f4f5; color: #52525b; border: 1px solid #e4e4e7; }\n.hb-qg8-brand svg { width: 16px; height: 16px; }\n.hb-qg8-mc { position: relative; width: 22px; height: 14px; }\n.hb-qg8-mc::before, .hb-qg8-mc::after { content: \"\"; position: absolute; top: 0; width: 14px; height: 14px; border-radius: 50%; }\n.hb-qg8-mc::before { left: 0; background: #ef4444; }\n.hb-qg8-mc::after { right: 0; background: #f59e0b; mix-blend-mode: screen; opacity: .9; }\n.hb-qg8-mname { font-size: 14px; font-weight: 500; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }\n.hb-qg8-def { font-size: 11px; font-weight: 600; color: var(--hb-qg8-accent); background: color-mix(in srgb, var(--hb-qg8-accent) 10%, #fff); padding: 2px 7px; border-radius: 999px; }\n.hb-qg8-mdet { font-size: 12px; color: #71717a; }\n.hb-qg8-macts { display: flex; gap: 2px; }\n.hb-qg8-link { border: 0; background: none; font: inherit; font-size: 12px; color: #52525b; padding: 6px 8px; border-radius: 6px; cursor: pointer; }\n.hb-qg8-link:hover { background: #f4f4f5; color: #18181b; }\n.hb-qg8-link[data-danger=\"true\"]:hover { color: #dc2626; background: #fef2f2; }\n.hb-qg8-link[disabled] { opacity: .4; cursor: not-allowed; }\n.hb-qg8-confirm { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 12px 14px; background: #fef2f2; font-size: 13px; color: #7f1d1d; animation: hb-qg8-in .25s ease; }\n.hb-qg8-confirm div { display: flex; gap: 6px; }\n.hb-qg8-form { display: grid; gap: 16px; }\n@container (min-width: 560px) { .hb-qg8-form { grid-template-columns: 1fr 1fr; } }\n.hb-qg8-field { display: grid; gap: 6px; min-width: 0; }\n.hb-qg8-label { font-size: 13px; font-weight: 500; }\n.hb-qg8-help { font-size: 12px; color: #71717a; }\n.hb-qg8-help[data-err=\"true\"] { color: #dc2626; }\n.hb-qg8-help[data-ok=\"true\"] { color: #047857; }\n.hb-qg8-inrow { display: flex; gap: 8px; }\n.hb-qg8-input, .hb-qg8-select { height: 38px; border-radius: 9px; border: 1px solid #e4e4e7; background: #fff; color: #18181b; font: inherit; font-size: 14px; padding: 0 11px; outline: none; min-width: 0; transition: border-color .2s, box-shadow .2s; }\n.hb-qg8-input { flex: 1; }\n.hb-qg8-input::placeholder { color: #a1a1aa; }\n.hb-qg8-input:focus, .hb-qg8-select:focus { border-color: var(--hb-qg8-accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hb-qg8-accent) 15%, transparent); }\n.hb-qg8-input[aria-invalid=\"true\"] { border-color: #dc2626; }\n.hb-qg8-select { flex: none; width: 104px; }\n.hb-qg8-meter { display: grid; gap: 14px; list-style: none; margin: 0; padding: 0; }\n.hb-qg8-mrow { display: grid; gap: 7px; }\n.hb-qg8-mtop { display: flex; justify-content: space-between; font-size: 13px; }\n.hb-qg8-mtop span:last-child { color: #71717a; font-variant-numeric: tabular-nums; }\n.hb-qg8-track { height: 7px; border-radius: 4px; background: #f0f0f2; overflow: hidden; }\n.hb-qg8-fill { height: 100%; border-radius: 4px; background: var(--hb-qg8-accent); transform-origin: left; animation: hb-qg8-grow 1.1s cubic-bezier(.2,.8,.2,1) both; }\n.hb-qg8-fill[data-warn=\"true\"] { background: #f59e0b; }\n@keyframes hb-qg8-grow { from { transform: scaleX(0); } }\n.hb-qg8-warn { margin: 14px 0 0; display: flex; gap: 8px; padding: 10px 12px; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: 12px; line-height: 1.45; }\n.hb-qg8-warn svg { width: 14px; height: 14px; flex: none; margin-top: 1px; }\n.hb-qg8-inv { display: flex; justify-content: space-between; align-items: baseline; }\n.hb-qg8-inv b { font-size: 26px; letter-spacing: -0.03em; font-weight: 600; }\n.hb-qg8-inv span { font-size: 12px; color: #71717a; }\n.hb-qg8-invl { list-style: none; margin: 12px 0 0; padding: 12px 0 0; border-top: 1px dashed #e4e4e7; display: grid; gap: 8px; font-size: 13px; color: #52525b; }\n.hb-qg8-invl li { display: flex; justify-content: space-between; font-variant-numeric: tabular-nums; }\n@media (prefers-reduced-motion: reduce) {\n  .hb-qg8 *, .hb-qg8 *::before, .hb-qg8 *::after { animation: none !important; transition: none !important; }\n}\n`;\n\nfunction BrandMark({ kind }: { kind: BillingMethod[\"kind\"] }) {\n  if (kind === \"visa\") return <>VISA</>;\n  if (kind === \"amex\") return <>AMEX</>;\n  if (kind === \"mastercard\") return <span className=\"hb-qg8-mc\" />;\n  return <svg viewBox=\"0 0 16 16\" fill=\"none\" aria-hidden=\"true\"><path d=\"M2 6.5L8 2.5l6 4M3 7v5M6.3 7v5M9.7 7v5M13 7v5M2 13.5h12\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinecap=\"round\" strokeLinejoin=\"round\" /></svg>;\n}\n\nexport function CheckoutBillingSettings({\n  title = \"Billing\",\n  subtitle = \"Manage the plan, payment methods and invoices for Halcyon Labs.\",\n  plan = defaultPlan,\n  methods = defaultMethods,\n  defaultMethodId,\n  usage = defaultUsage,\n  billingEmail = \"finance@halcyon.io\",\n  taxId = { type: \"eu_vat\", value: \"DE287634519\" },\n  currency = \"USD\",\n  onChangePlan,\n  onCancelPlan,\n  onAddMethod,\n  onDefaultChange,\n  onRemoveMethod,\n  onEmailSave,\n  onTaxIdSave,\n  accent = \"#7c3aed\",\n  className = \"\",\n  style,\n  ...rest\n}: CheckoutBillingSettingsProps) {\n  const uid = React.useId();\n  const money = React.useMemo(() => new Intl.NumberFormat(\"en-US\", { style: \"currency\", currency }), [currency]);\n  const [list, setList] = React.useState(methods);\n  const [def, setDef] = React.useState(defaultMethodId ?? methods[0]?.id ?? \"\");\n  const [confirming, setConfirming] = React.useState<string | null>(null);\n  const [email, setEmail] = React.useState(billingEmail);\n  const [emailState, setEmailState] = React.useState<\"idle\" | \"error\" | \"saved\">(\"idle\");\n  const [taxType, setTaxType] = React.useState(taxId.type);\n  const [taxValue, setTaxValue] = React.useState(taxId.value);\n  const [taxState, setTaxState] = React.useState<\"idle\" | \"error\" | \"saved\">(\"idle\");\n\n  const tax = taxTypes.find((t) => t.id === taxType) ?? taxTypes[0];\n\n  const makeDefault = (id: string) => {\n    setDef(id);\n    onDefaultChange?.(id);\n  };\n  const remove = (id: string) => {\n    setList((l) => l.filter((m) => m.id !== id));\n    setConfirming(null);\n    onRemoveMethod?.(id);\n  };\n  const saveEmail = (e: React.FormEvent) => {\n    e.preventDefault();\n    if (!/^[^\\s@]+@[^\\s@]+\\.[^\\s@]{2,}$/.test(email.trim())) {\n      setEmailState(\"error\");\n      return;\n    }\n    setEmailState(\"saved\");\n    onEmailSave?.(email.trim());\n  };\n  const saveTax = (e: React.FormEvent) => {\n    e.preventDefault();\n    const v = taxValue.trim().toUpperCase();\n    if (!tax.pattern.test(v)) {\n      setTaxState(\"error\");\n      return;\n    }\n    setTaxValue(v);\n    setTaxState(\"saved\");\n    onTaxIdSave?.({ type: tax.id, value: v });\n  };\n\n  const hot = usage.find((u) => u.used / u.limit >= 0.85);\n  const vars = { \"--hb-qg8-accent\": accent, ...style } as React.CSSProperties;\n\n  return (\n    <section className={`hb-qg8 ${className}`} style={vars} {...rest}>\n      <style href=\"hb-checkout-billing-settings\" precedence=\"default\">{css}</style>\n      <div className=\"hb-qg8-inner\">\n        <div className=\"hb-qg8-head\">\n          <div>\n            <h2 className=\"hb-qg8-title\">{title}</h2>\n            {subtitle ? <p className=\"hb-qg8-sub\">{subtitle}</p> : null}\n          </div>\n          <div className=\"hb-qg8-tabs\" aria-hidden=\"true\">\n            <span>General</span>\n            <span>Members</span>\n            <span data-on=\"true\">Billing</span>\n            <span>Security</span>\n          </div>\n        </div>\n        <div className=\"hb-qg8-grid\">\n          <div className=\"hb-qg8-col\">\n            <div className=\"hb-qg8-card hb-qg8-plan\">\n              <h3 className=\"hb-qg8-pname\">{plan.name} plan <span className=\"hb-qg8-pill\">Active</span></h3>\n              <p className=\"hb-qg8-price\"><b>{money.format(plan.price)}</b>per {plan.period}</p>\n              <div className=\"hb-qg8-pmeta\">\n                <span><svg viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\"><rect x=\"1.5\" y=\"2.5\" width=\"11\" height=\"10\" rx=\"2\" stroke=\"currentColor\" strokeWidth=\"1.3\" /><path d=\"M1.5 5.5h11M4.5 1v3M9.5 1v3\" stroke=\"currentColor\" strokeWidth=\"1.3\" strokeLinecap=\"round\" /></svg>Renews {plan.renews}</span>\n                <span><svg viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\"><circle cx=\"5\" cy=\"4.5\" r=\"2\" stroke=\"currentColor\" strokeWidth=\"1.3\" /><path d=\"M1.5 12c.5-2 1.8-3 3.5-3s3 1 3.5 3M9.5 2.6a2 2 0 010 3.8M10.8 8.8c.9.4 1.4 1.4 1.7 2.7\" stroke=\"currentColor\" strokeWidth=\"1.3\" strokeLinecap=\"round\" /></svg>{plan.seats}</span>\n              </div>\n              <div className=\"hb-qg8-pact\">\n                <button type=\"button\" className=\"hb-qg8-btn hb-qg8-primary\" onClick={() => onChangePlan?.()}>Change plan</button>\n                <button type=\"button\" className=\"hb-qg8-btn hb-qg8-text\" onClick={() => onCancelPlan?.()}>Cancel subscription</button>\n              </div>\n            </div>\n            <div className=\"hb-qg8-card\">\n              <div className=\"hb-qg8-ch\">\n                <div>\n                  <h3>Payment methods</h3>\n                  <p>The default method is charged on each renewal.</p>\n                </div>\n                <button type=\"button\" className=\"hb-qg8-btn hb-qg8-sec\" onClick={() => onAddMethod?.()}>\n                  <svg viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\"><path d=\"M7 2.5v9M2.5 7h9\" stroke=\"currentColor\" strokeWidth=\"1.6\" strokeLinecap=\"round\" /></svg>\n                  Add\n                </button>\n              </div>\n              <ul className=\"hb-qg8-methods\">\n                {list.map((m) => (\n                  <React.Fragment key={m.id}>\n                    <li className=\"hb-qg8-m\">\n                      <span className=\"hb-qg8-brand\" data-kind={m.kind} aria-hidden=\"true\"><BrandMark kind={m.kind} /></span>\n                      <span>\n                        <span className=\"hb-qg8-mname\">{m.label}{m.id === def ? <span className=\"hb-qg8-def\">Default</span> : null}</span>\n                        <span className=\"hb-qg8-mdet\">{m.detail}</span>\n                      </span>\n                      <span className=\"hb-qg8-macts\">\n                        {m.id !== def ? <button type=\"button\" className=\"hb-qg8-link\" onClick={() => makeDefault(m.id)}>Make default</button> : null}\n                        <button\n                          type=\"button\"\n                          className=\"hb-qg8-link\"\n                          data-danger=\"true\"\n                          disabled={m.id === def}\n                          title={m.id === def ? \"Choose another default before removing this one\" : undefined}\n                          aria-label={`Remove ${m.label}`}\n                          aria-expanded={confirming === m.id}\n                          onClick={() => setConfirming(m.id)}\n                        >\n                          Remove\n                        </button>\n                      </span>\n                    </li>\n                    {confirming === m.id ? (\n                      <li className=\"hb-qg8-confirm\" role=\"alert\">\n                        <span>Remove {m.label}? Future invoices will not use it.</span>\n                        <div>\n                          <button type=\"button\" className=\"hb-qg8-btn hb-qg8-sec\" onClick={() => setConfirming(null)}>Keep</button>\n                          <button type=\"button\" className=\"hb-qg8-btn hb-qg8-danger\" onClick={() => remove(m.id)}>Remove</button>\n                        </div>\n                      </li>\n                    ) : null}\n                  </React.Fragment>\n                ))}\n              </ul>\n            </div>\n            <div className=\"hb-qg8-card\">\n              <div className=\"hb-qg8-ch\">\n                <div>\n                  <h3>Billing details</h3>\n                  <p>Shown on every invoice we send.</p>\n                </div>\n              </div>\n              <div className=\"hb-qg8-form\">\n                <form className=\"hb-qg8-field\" onSubmit={saveEmail} noValidate>\n                  <label className=\"hb-qg8-label\" htmlFor={`${uid}-email`}>Billing email</label>\n                  <div className=\"hb-qg8-inrow\">\n                    <input id={`${uid}-email`} className=\"hb-qg8-input\" type=\"email\" value={email} aria-invalid={emailState === \"error\" ? \"true\" : undefined} aria-describedby={`${uid}-email-h`} onChange={(e) => { setEmail(e.target.value); setEmailState(\"idle\"); }} />\n                    <button type=\"submit\" className=\"hb-qg8-btn hb-qg8-sec\">Save</button>\n                  </div>\n                  <span id={`${uid}-email-h`} className=\"hb-qg8-help\" data-err={emailState === \"error\" ? \"true\" : undefined} data-ok={emailState === \"saved\" ? \"true\" : undefined} aria-live=\"polite\">\n                    {emailState === \"error\" ? \"Enter a valid email address.\" : emailState === \"saved\" ? \"Saved. Invoices go here from now on.\" : \"Receipts and invoices are sent here.\"}\n                  </span>\n                </form>\n                <form className=\"hb-qg8-field\" onSubmit={saveTax} noValidate>\n                  <label className=\"hb-qg8-label\" htmlFor={`${uid}-tax`}>Tax ID</label>\n                  <div className=\"hb-qg8-inrow\">\n                    <select aria-label=\"Tax ID type\" className=\"hb-qg8-select\" value={taxType} onChange={(e) => { setTaxType(e.target.value); setTaxState(\"idle\"); }}>\n                      {taxTypes.map((t) => <option key={t.id} value={t.id}>{t.label}</option>)}\n                    </select>\n                    <input id={`${uid}-tax`} className=\"hb-qg8-input\" value={taxValue} placeholder={tax.placeholder} aria-invalid={taxState === \"error\" ? \"true\" : undefined} aria-describedby={`${uid}-tax-h`} onChange={(e) => { setTaxValue(e.target.value); setTaxState(\"idle\"); }} />\n                    <button type=\"submit\" className=\"hb-qg8-btn hb-qg8-sec\">Save</button>\n                  </div>\n                  <span id={`${uid}-tax-h`} className=\"hb-qg8-help\" data-err={taxState === \"error\" ? \"true\" : undefined} data-ok={taxState === \"saved\" ? \"true\" : undefined} aria-live=\"polite\">\n                    {taxState === \"error\" ? `Format for ${tax.label}: ${tax.placeholder}` : taxState === \"saved\" ? \"Tax ID saved and added to invoices.\" : \"Needed for reverse charge in the EU and UK.\"}\n                  </span>\n                </form>\n              </div>\n            </div>\n          </div>\n          <div className=\"hb-qg8-col\">\n            <div className=\"hb-qg8-card\">\n              <div className=\"hb-qg8-ch\">\n                <div>\n                  <h3>Usage this cycle</h3>\n                  <p>Nov 1 to Nov 30</p>\n                </div>\n              </div>\n              <ul className=\"hb-qg8-meter\">\n                {usage.map((u, i) => {\n                  const pct = Math.min(1, u.used / u.limit);\n                  return (\n                    <li key={u.label} className=\"hb-qg8-mrow\">\n                      <div className=\"hb-qg8-mtop\">\n                        <span>{u.label}</span>\n                        <span>{num(u.used)} / {num(u.limit)}{u.unit ? ` ${u.unit}` : \"\"}</span>\n                      </div>\n                      <div className=\"hb-qg8-track\" role=\"progressbar\" aria-label={u.label} aria-valuemin={0} aria-valuemax={u.limit} aria-valuenow={u.used}>\n                        <div className=\"hb-qg8-fill\" data-warn={pct >= 0.85 ? \"true\" : undefined} style={{ width: `${(pct * 100).toFixed(1)}%`, animationDelay: `${(i * 0.12).toFixed(2)}s` }} />\n                      </div>\n                    </li>\n                  );\n                })}\n              </ul>\n              {hot ? (\n                <p className=\"hb-qg8-warn\">\n                  <svg viewBox=\"0 0 14 14\" fill=\"none\" aria-hidden=\"true\"><path d=\"M7 1.5l6 11H1z\" stroke=\"currentColor\" strokeWidth=\"1.3\" strokeLinejoin=\"round\" /><path d=\"M7 5.5v3M7 10.4v.1\" stroke=\"currentColor\" strokeWidth=\"1.4\" strokeLinecap=\"round\" /></svg>\n                  {hot.label} is at {Math.round((hot.used / hot.limit) * 100)}%. Extra usage is billed at the end of the cycle.\n                </p>\n              ) : null}\n            </div>\n            <div className=\"hb-qg8-card\">\n              <div className=\"hb-qg8-ch\"><div><h3>Next invoice</h3><p>Charged to the default method</p></div></div>\n              <div className=\"hb-qg8-inv\"><b>{money.format(plan.price + 14)}</b><span>{plan.renews}</span></div>\n              <ul className=\"hb-qg8-invl\">\n                <li><span>{plan.name} plan</span><span>{money.format(plan.price)}</span></li>\n                <li><span>Extra bandwidth</span><span>{money.format(14)}</span></li>\n              </ul>\n            </div>\n          </div>\n        </div>\n      </div>\n    </section>\n  );\n}\n"
    }
  ]
}