/* fuobe.com/pricing and /billing (src/pay/pages.ts), on top of the contact pages' site.css. */
main .wrap:has(.pricing) { max-width: 1080px; }
main .wrap:has(.pricing.narrow) { max-width: 760px; }

.pay-top { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cur { display: inline-flex; padding: 3px; border: 1px solid var(--border); border-radius: 999px; background: var(--card); }
.cur a { padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; text-decoration: none; color: var(--muted-foreground); }
.cur a[aria-current] { background: var(--brand-faint); color: var(--brand-text); }

.pay-note { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 22px; padding: 12px 14px; border-radius: 12px; font-size: 14px;
  background: var(--brand-faint); color: var(--foreground); }
.pay-note svg { flex: none; width: 18px; height: 18px; margin-top: 2px; color: var(--brand-text); }
.pay-note.busy svg { animation: pay-spin 2s linear infinite; }
@keyframes pay-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .pay-note.busy svg { animation: none; } }
.pay-note.warn { background: color-mix(in srgb, var(--warning, #d97706) 14%, transparent); }
.pay-note.warn svg { color: var(--warning, #b45309); }
.note-box { margin-top: 18px; padding: 12px 14px; border-radius: 12px; font-size: 14px; border: 1px solid var(--destructive); color: var(--foreground); }

/* the plans: three cards whose rows (head, words, price, button, list, small print) line up across the row */
.plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; margin-top: 40px; align-items: stretch; }
.plan { position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  padding: 28px 24px 24px; box-shadow: var(--elevation-soft); }
@supports (grid-template-rows: subgrid) {
  .plan { display: grid; grid-row: span 6; grid-template-rows: subgrid; row-gap: 0; }
}
/* the plan the page steers to (Max): a primary frame and its ribbon; no shift against the others (shadow, not border width) */
.plan.top { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary), 0 18px 40px -24px color-mix(in srgb, var(--primary) 60%, transparent); }
.plan .ribbon { position: absolute; top: 0; left: 50%; transform: translate(-50%, -50%); padding: 4px 14px; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground); font-size: 12px; font-weight: 600; letter-spacing: .02em; white-space: nowrap; }
.plan-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.plan-head h2 { margin: 0; font: 30px/1.1 var(--font-heading); white-space: nowrap; }
.plan-icon { flex: none; width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-faint); color: var(--brand-text); }
.plan-icon svg { width: 18px; height: 18px; }
.badge { margin-left: auto; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; white-space: nowrap; background: var(--primary); color: var(--primary-foreground); }
.badge.soft { background: var(--brand-faint); color: var(--brand-text); }
.plan .badge { background: var(--brand-faint); color: var(--brand-text); }
.plan.top .badge { background: var(--primary); color: var(--primary-foreground); }
.blurb { margin: 14px 0 0; color: var(--muted-foreground); font-size: 14px; line-height: 1.55; }
.price { margin: 22px 0 0; display: flex; align-items: baseline; gap: 6px; white-space: nowrap; }
.price strong { font: 44px/1 var(--font-heading); letter-spacing: -.01em; }
.price span { color: var(--muted-foreground); font-size: 14px; }
.plan-cta { margin: 22px 0 0; display: flex; align-items: flex-start; }
.plan-cta .btn { width: 100%; }
.ticks { list-style: none; margin: 24px 0 0; padding: 22px 0 0; border-top: 1px solid var(--border); display: grid; gap: 12px; font-size: 14px; align-content: start; }
.ticks li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.45; }
.ticks li.ticks-lead { font-size: 13px; font-weight: 600; color: var(--foreground); }
.ticks svg { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--success); }
.plan.top .ticks svg { color: var(--brand-text); }
.ticks strong.hl, .ticks strong.x { color: var(--brand-text); font-weight: 700; }
.plan > .fine { margin: 20px 0 0; }
.plans-fine { margin: 18px 0 0; text-align: center; font-size: 13px; color: var(--muted-foreground); }
/* a button with a second line (Upgrade to Max / ₹8,350 today) */
.btn.two { height: auto; min-height: 52px; padding: 8px 18px; flex-direction: column; gap: 2px; line-height: 1.2; text-align: center; white-space: normal; }
.btn.two .b-main { font-weight: 600; }
.btn.two .b-sub { font-size: 12px; font-weight: 500; opacity: .85; }
.btn.wide { width: 100%; }
/* a button inside a section keeps its own colours (the sections colour their links) */
.sec a.btn, .plan a.btn, .packs-sec a.btn { color: var(--primary-foreground); text-decoration: none; }
.sec a.btn.ghost, .plan a.btn.ghost, .packs-sec a.btn.ghost { color: var(--foreground); }
.btn.danger { background: var(--destructive); }
.fine { margin: 12px 0 0; font-size: 12px; color: var(--muted-foreground); }
@media (max-width: 900px) {
  .plans { grid-template-columns: minmax(0, 520px); justify-content: center; gap: 28px; }
}

/* credit packs: their own row under the plans, three packs of the same shape */
.packs-sec { margin-top: 48px; padding: 28px 24px 24px; background: var(--card); border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--elevation-soft); }
.packs-intro { display: flex; gap: 12px; align-items: flex-start; }
.packs-intro h2 { margin: 0; font: 30px/1.1 var(--font-heading); }
.packs-intro p { margin: 6px 0 0; font-size: 14px; color: var(--muted-foreground); }
.packs { list-style: none; margin: 22px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.packs li { position: relative; min-width: 0; display: grid; grid-template-rows: auto auto auto; gap: 12px; padding: 22px 18px 18px; border: 1px solid var(--border); border-radius: 16px; background: var(--background); }
.packs li.star { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary); }
.packs .pk-top { display: flex; align-items: center; gap: 8px; min-height: 26px; }
/* a pack's badge sits as a tab on the card's top edge, so it never crowds the number */
.packs .pk-top .badge { position: absolute; top: 0; left: 18px; transform: translateY(-50%); margin: 0; }
.packs li.star .pk-top .badge { background: var(--primary); color: var(--primary-foreground); }
.packs .pk-n { font-size: 14px; color: var(--muted-foreground); white-space: nowrap; }
.packs .pk-n strong { font: 30px/1 var(--font-heading); color: var(--foreground); margin-right: 4px; }
.packs .pk-price { display: flex; align-items: center; gap: 8px; min-height: 24px; }
.packs .pk-price strong { font-size: 18px; font-weight: 600; }
.packs .save { padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.packs .btn { height: 42px; font-size: 14px; width: 100%; }
.packs-sec > .fine { margin-top: 16px; }
.grid > .packs-sec { grid-column: 1 / -1; margin-top: 0; padding: 24px; }
.grid > .packs-sec h2 { font-size: 24px; }

.uses { margin-top: 28px; }
.sec table { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 14px; }
.sec td { padding: 9px 0; border-top: 1px solid var(--border); }
.sec td:last-child { text-align: right; font-weight: 500; }
.sec td:nth-child(2):not(:last-child) { color: var(--muted-foreground); }
.sec p { font-size: 14px; color: var(--muted-foreground); }
.sec .head h2 { margin: 0; font: 24px/1.1 var(--font-heading); }
.sec .head .badge { margin-left: auto; }
.faq { margin-top: 16px; }
.faq .q { margin: 0; font: 22px/1.15 var(--font-heading); }
.confirm { margin-top: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); }
/* boosts on the billing page: the choice and the packs */
.boost-choice, .limit-choice { display: grid; gap: 10px; margin-top: 14px; font-size: 14px; }
.boost-choice label, .limit-choice label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.boost-choice input[type=number] { width: 4.5em; height: 34px; padding: 0 8px; border: 1px solid var(--border); border-radius: 8px; background: transparent; color: inherit; font: inherit; }
.feedback textarea { display: block; width: 100%; box-sizing: border-box; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: inherit; font: inherit; resize: vertical; }
.pay-note .keep .actions { margin-top: 10px; }

/* a renewal that didn't go through: the dialog that renews it right there */
dialog.renew { width: min(440px, calc(100vw - 32px)); padding: 28px 26px 22px; border: 1px solid var(--border); border-radius: 22px;
  background: var(--card); color: var(--foreground); box-shadow: 0 24px 80px rgb(0 0 0 / 0.28); }
dialog.renew::backdrop { background: rgb(10 10 20 / 0.55); backdrop-filter: blur(4px); }
dialog.renew[open] { animation: renew-in 0.22s ease-out; }
@keyframes renew-in { from { opacity: 0; transform: translateY(8px) scale(0.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.renew[open] { animation: none; } }
.renew-icon { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--brand-faint); color: var(--brand-text); }
.renew-icon svg { width: 22px; height: 22px; }
dialog.renew h2 { margin: 16px 0 8px; font: 30px/1.1 var(--font-heading); }
dialog.renew p { margin: 0 0 10px; font-size: 15px; color: var(--foreground); }
dialog.renew p.renew-why { font-size: 13px; color: var(--muted-foreground); }
dialog.renew .ticks { margin: 14px 0 18px; flex: none; }
dialog.renew .btn { margin-top: 8px; }

/* Fuobe's own payment form (pay.js): card, and UPI for INR; Razorpay's custom script takes the card */
dialog.payform { width: min(460px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); overflow: auto; padding: 24px 24px 18px; border: 1px solid var(--border);
  border-radius: 22px; background: var(--card); color: var(--foreground); box-shadow: 0 24px 80px rgb(0 0 0 / 0.28); }
dialog.payform::backdrop { background: rgb(10 10 20 / 0.55); backdrop-filter: blur(4px); }
dialog.payform[open] { animation: renew-in 0.22s ease-out; }
@media (prefers-reduced-motion: reduce) { dialog.payform[open] { animation: none; } }
.pf-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.pf-kicker { margin: 0; font-size: 12px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--brand-text); }
dialog.payform h2 { margin: 4px 0 0; font: 30px/1.1 var(--font-heading); }
.pf-close { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 12px;
  background: transparent; color: var(--muted-foreground); cursor: pointer; }
.pf-close svg, .pf-secure svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pf-close:hover { color: var(--foreground); }
.pf-price { display: flex; align-items: baseline; gap: 6px; margin: 12px 0 18px; }
.pf-price strong { font: 36px/1 var(--font-heading); }
.pf-price span { color: var(--muted-foreground); font-size: 14px; }
.pf-form { display: grid; gap: 12px; }
.pf-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--border); border-radius: 12px; }
.pf-tab { height: 36px; border: 0; border-radius: 9px; background: transparent; color: var(--muted-foreground); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.pf-tab[aria-selected="true"] { background: var(--brand-faint); color: var(--brand-text); }
.pf-panel { display: grid; gap: 12px; }
.pf-panel[hidden], .pf-tabs[hidden] { display: none; }
/* grid children shrink to the dialog (an input's own width would push it wider) */
.pf-form, .pf-panel, .pf-row > *, .pf-field { min-width: 0; }
.pf-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.pf-field { display: grid; gap: 6px; font-size: 13px; font-weight: 500; color: var(--muted-foreground); }
.pf-field input { width: 100%; min-width: 0; height: 44px; padding: 0 12px; border: 1px solid var(--border); border-radius: 10px; background: transparent; color: var(--foreground);
  font: inherit; font-size: 16px; font-variant-numeric: tabular-nums; }
.pf-field input:focus { outline: 2px solid var(--ring); outline-offset: 1px; border-color: transparent; }
.pf-hint, .pf-status { margin: 0; font-size: 13px; color: var(--muted-foreground); }
.pf-status { color: var(--foreground); }
.pf-form .note-box { margin-top: 0; }
.pf-form .btn { margin-top: 4px; height: 46px; }
.pf-more { display: block; margin: 12px auto 0; padding: 6px 10px; border: 0; background: transparent; color: var(--brand-text); font: inherit; font-size: 14px;
  font-weight: 600; cursor: pointer; }
.pf-more:hover { text-decoration: underline; }
.pf-more:disabled, .pf-tab:disabled { opacity: 0.5; cursor: default; }
.pf-secure { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; font-size: 12px; color: var(--muted-foreground); }
.pf-secure svg { flex: none; width: 14px; height: 14px; margin-top: 1px; }
@media (max-width: 420px) { dialog.payform { padding: 20px 18px 16px; } dialog.payform h2 { font-size: 26px; } }

/* the daily allowance's meter on the billing page: shares only, never the budget */
.meter-row { margin-top: 16px; }
.meter-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; }
.meter-head span { color: var(--muted-foreground); }
.meter-row meter { display: block; width: 100%; height: 10px; margin-top: 8px; border: 0; border-radius: 999px; background: var(--muted); overflow: hidden;
  -webkit-appearance: none; appearance: none; }
.meter-row meter::-webkit-meter-bar { background: var(--muted); border: 0; border-radius: 999px; height: 10px; }
.meter-row meter::-webkit-meter-optimum-value { background: var(--primary); border-radius: 999px; }
.meter-row meter::-webkit-meter-suboptimum-value { background: var(--warning, #d97706); border-radius: 999px; }
.meter-row meter::-webkit-meter-even-less-good-value { background: var(--destructive); border-radius: 999px; }
.meter-row meter::-moz-meter-bar { background: var(--primary); border-radius: 999px; }
.meter-row meter:-moz-meter-sub-optimum::-moz-meter-bar { background: var(--warning, #d97706); }
.meter-row meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background: var(--destructive); }
.meter-row .fine { margin-top: 6px; }
.meter-row .bar { position: relative; height: 10px; margin-top: 8px; border-radius: 999px; background: color-mix(in srgb, var(--foreground) 10%, transparent); overflow: hidden; }
.meter-row .fill { display: block; height: 100%; border-radius: 999px; background: var(--primary); transition: width .6s ease; }
.meter-row.warn .fill { background: var(--warning, #d97706); }
.meter-row.full .fill { background: var(--destructive); }
.meter-row.warn .pct { color: var(--warning, #d97706); font-weight: 600; }
.meter-row.full .pct { color: var(--destructive); font-weight: 600; }
.meter-row.relaxed .pct { color: var(--brand-text); font-weight: 600; }
/* relaxed mode: a picture of the GPU at the pool beside the words; runs keep going */
.relaxed-box { display: flex; gap: 16px; align-items: center; margin-top: 10px; padding: 12px; border-radius: 16px; background: var(--brand-faint); }
.relaxed-box strong { font-size: 15px; }
.relaxed-box p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--foreground); }
.relax-art { flex: none; width: 200px; height: auto; display: block; border-radius: 14px; }
@media (max-width: 560px) { .relaxed-box { flex-direction: column; align-items: stretch; } .relax-art { width: 100%; } }
@media (prefers-reduced-motion: reduce) { .meter-row .fill { transition: none; } }

@media (max-width: 900px) {
  .plans { grid-template-columns: 1fr; }
  .blurb { min-height: 0; }
}
@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  h1 { font-size: 36px; }
}

/* on a phone, one plan at a time: the switch above the cards picks which shows (src/pay/pages.ts planPick); the buy
   button stays in view at the bottom while the card scrolls. Without :has() the switch stays hidden and the cards stack. */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.pick { display: none; }
@supports selector(:has(a)) {
  @media (max-width: 640px) {
    .pick { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; margin: 28px 0 0; padding: 4px; border: 0; border-radius: 14px; background: var(--muted); }
    .pick label { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 56px; border-radius: 11px; cursor: pointer; color: var(--muted-foreground); text-align: center; }
    .pick input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
    .pick .pk-name { font-size: 14px; font-weight: 600; }
    .pick .pk-sub { margin-top: 2px; font-size: 11.5px; }
    .pick label:has(input:checked) { background: var(--card); color: var(--foreground); box-shadow: 0 1px 4px rgb(0 0 0 / 0.10); }
    .pick label:has(input:focus-visible) { outline: 2px solid var(--ring, var(--primary)); outline-offset: 2px; }
    .plans { margin-top: 24px; }
    .pricing:has(.pick > label:nth-of-type(1) > input:checked) .plans > .plan:not(:nth-child(1)),
    .pricing:has(.pick > label:nth-of-type(2) > input:checked) .plans > .plan:not(:nth-child(2)),
    .pricing:has(.pick > label:nth-of-type(3) > input:checked) .plans > .plan:not(:nth-child(3)),
    .pricing:has(.pick > label:nth-of-type(4) > input:checked) .plans > .plan:not(:nth-child(4)) { display: none; }
    .plan { display: flex; flex-direction: column; grid-row: auto; }
    .plan-cta { order: 10; position: sticky; bottom: 0; z-index: 1; margin: 20px -24px -24px; padding: 12px 24px calc(14px + env(safe-area-inset-bottom)); background: var(--card); border-top: 1px solid var(--border); border-radius: 0 0 20px 20px; }
    .plan > .fine { order: 9; }
  }
}
