/* Billing period switch above the plan cards */
.pricing-period { display: flex; justify-content: center; margin: 2px 0 8px; }
.pricing-vat { margin: 0 0 20px; text-align: center; color: var(--text-secondary); font-size: 13px; }
.pricing-period .pro-billing-toggle { display: inline-flex; width: auto; margin: 0; gap: 2px; padding: 3px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); box-shadow: var(--shadow-card); }
.pricing-period .pro-billing-toggle button { flex: none; display: inline-flex; align-items: center; gap: 8px; min-height: 36px; padding: 6px 18px; border: 1px solid transparent; border-radius: calc(var(--radius-md) - 2px); background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 500; box-shadow: none; }
.pricing-period .pro-billing-toggle button:hover:not([aria-pressed="true"]) { background: var(--bg-page); color: var(--text-primary); }
body .pricing-period .pro-billing-toggle button[aria-pressed="true"] { color: var(--brand-tint-fg) !important; font-weight: 600; }
.pricing-period .pro-billing-toggle button span { display: inline; padding: 2px 7px; border-radius: var(--radius-sm, 6px); background: var(--brand-tint); color: var(--brand-tint-fg); font-size: 11px; font-weight: 600; line-height: 1.4; }
.pricing-period .pro-billing-toggle button[aria-pressed="true"] span { background: var(--bg-surface); }

/* Shared card layout: header, price, description, action, features */
.pricing-grid .plan-description { min-height: 3.4em; margin-bottom: 0; }
.pricing-grid .plan-footer { order: 3; margin: 14px 0 0; min-height: 76px; }

@media (min-width: 1000px) {
  .pricing-grid .pricing-card {
    display: grid;
    grid-template-rows: subgrid;
    grid-row: span 5;
    row-gap: 0;
  }
  .pricing-grid .account-subtitle { align-self: start; }
}

/* Symmetric feature lists */
.pricing-grid .account-features li > span { display: block; line-height: 1.45; }
.pricing-grid .account-features .plan-sub { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; opacity: .72; }
.pricing-grid .plan-ratio { display: inline-block; padding: 1px 8px; border-radius: var(--radius-md); background: var(--brand-tint); color: var(--brand-tint-fg); font-size: 11.5px; font-weight: 500; }
.pricing-grid .pro-card .account-features .plan-sub { color: var(--text-muted); }
.pricing-grid .redeem-details { margin-top: 14px; }
.redeem-footer { max-width: 480px; margin: 14px auto 0; text-align: center; font-size: 13px; color: var(--text-secondary); }
.redeem-footer summary { font-weight: 500; font-size: 13px; }
.redeem-footer[open] { text-align: left; }

/* Credit packs: what the same pack costs with Pro */

/* How credits are spent: four cards first, the detailed rules in a spoiler */
.credit-rules { margin: 28px 0 0; padding: 24px; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); }
.credit-rules h2 { margin: 4px 0 6px; font-size: 22px; letter-spacing: -.4px; }
.credit-rules-lead { margin: 0 0 18px; color: var(--text-secondary); font-size: 14px; line-height: 1.55; }
.payg-panel {
  max-width: 980px;
  margin: 28px auto;
  padding: clamp(16px, 3.5vw, 30px);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  scroll-margin-top: 100px;
}
.payg-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
}
.payg-intro h2 {
  margin: 0 0 6px;
  font-size: 24px;
  line-height: 1.25;
  letter-spacing: -.025em;
  color: var(--text-primary);
}
.payg-intro p, .topup-plan {
  margin: 0;
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.5;
}
.payg-intro .payg-status {
  padding: 6px 10px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  font-size: 13px;
  font-weight: 500;
}
.topup-plan { margin-top: 20px; }
.topup-packs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0;
  padding: 0;
  list-style: none;
}
.topup-plan + .topup-packs { margin-top: 8px; }
.topup-pack {
  display: grid;
  grid-template-rows: auto auto 1fr;
  align-items: start;
  gap: 6px 12px;
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  background: var(--bg-page);
  color: var(--text-primary);
}
.topup-quantity { font-size: 18px; line-height: 1.3; }
.topup-price {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.03em;
  font-variant-numeric: tabular-nums;
}
.topup-pack small { color: var(--brand-tint-fg); font-size: 13px; }
.topup-comparison {
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
}
.topup-comparison summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}
.topup-comparison summary::-webkit-details-marker { display: none; }
.topup-comparison summary::after {
  content: "";
  flex: 0 0 7px;
  height: 7px;
  margin: 0 3px 3px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}
.topup-comparison[open] summary::after { transform: rotate(225deg); margin-bottom: 0; }
.topup-comparison summary:hover { background: var(--bg-subtle); }
.topup-comparison :is(summary, a):focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 2px; }
.topup-comparison-body { padding: 0 14px 14px; }
.topup-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--text-primary);
  font-size: 14px;
  line-height: 1.4;
  font-variant-numeric: tabular-nums;
}
.topup-table :is(th, td) {
  width: 25%;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-default);
  text-align: start;
  vertical-align: top;
}
.topup-table thead { background: var(--bg-subtle); }
.topup-table span { display: block; color: var(--text-secondary); font-weight: 400; }
.topup-table td strong { white-space: nowrap; }
.topup-comparison-body p { margin: 12px 0 8px; color: var(--text-secondary); font-size: 13px; line-height: 1.5; }
.topup-comparison-body a { color: var(--text-primary); font-size: 14px; font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }
.pricing-scroll-hint { display: none; }
@media (max-width: 760px) {
  .credit-rules { padding: 18px 14px; }
}
@media (max-width: 700px) {
  .account-heading.pricing-heading { margin-bottom: 18px; }
  .pricing-jump { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pricing-period .pro-billing-toggle button { min-height: 44px; }
  .pricing-grid .pricing-card, .payg-panel { scroll-margin-top: 12px; }
  .pricing-grid .pricing-card { padding: 20px; }
  .pricing-grid .plan-description, .pricing-grid .plan-footer { min-height: 0; }
  .pricing-grid .plan-footer { margin-top: 8px; }
  .pricing-grid .plan-list-block { margin-top: 16px; }
  .business-panel { padding: 18px; }
  .pricing-scroll-hint { display: block; margin: 0 0 12px; color: var(--text-secondary); font-size: 13px; }
  .pricing-compare-details .pricing-compare-table tr > :first-child {
    position: sticky;
    left: 0;
    width: 120px;
    background: var(--bg-surface);
    box-shadow: 1px 0 var(--border-default);
  }
}
@media (max-width: 560px) {
  .topup-packs { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .topup-pack {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    padding: 12px;
  }
  .topup-price { font-size: 22px; }
  .topup-pack small { grid-column: 1 / -1; }
  .topup-comparison-body { padding-inline: 8px; }
  .topup-table { table-layout: fixed; font-size: 12px; }
  .topup-table :is(th, td) { width: auto; padding-inline: 4px; }
  .topup-table thead th:first-child { width: 19%; }
  .topup-table td span { overflow-wrap: anywhere; }
}

/* Four plans side by side need more room than the 1200px page shell: on wide screens the row
   breaks out of it (centred), and below 1280px the cards stay two by two instead of squeezing. */
@media (min-width: 1200px) and (max-width: 1279px) {
  .account-grid.pricing-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 980px; }
}
/* Every block under the cards shares their width, so the page has one straight edge. */
.account-shell :is(.account-grid.pricing-grid, .credit-estimate-note,
  .payg-panel, .credit-rules, .business-panel, .pricing-compare-details, .pricing-faq) {
  box-sizing: border-box;
  max-width: 980px;
  margin-inline: auto;
}
@media (min-width: 1280px) {
  .account-shell :is(.account-grid.pricing-grid, .credit-estimate-note, .payg-panel, .credit-rules,
    .business-panel, .pricing-compare-details, .pricing-faq) {
    --pricing-row: min(1400px, calc(100vw - 72px));
    width: var(--pricing-row);
    max-width: none;
    margin-inline: calc((100% - var(--pricing-row)) / 2);
  }
  .account-grid.pricing-grid { gap: 18px; }
  .pricing-grid .pricing-card { padding: 30px 26px 28px; }
  .pricing-grid .account-price strong { font-size: clamp(48px, 4vw, 58px); }
}

/* FAQ answers: links must look like links (global `a` resets colour and underline) */
.pricing-faq .faq-item a { color: var(--brand-tint-fg); text-decoration: underline; text-underline-offset: 3px; }
.pricing-faq .faq-item a:hover { text-decoration-thickness: 2px; }

/* Business: the contact toggle is a normal secondary button */
.business-details > summary.secondary { display: inline-flex; padding: 10px 18px; border: 1px solid var(--border-strong); background: var(--bg-surface); color: var(--text-primary); font-size: 14px; }
.business-details > summary.secondary:hover { background: var(--bg-page); }
.business-panel .business-features { align-self: center; margin: 0; padding-left: 20px; }

/* The storage footnote belongs to the Studio, not to content pages like /pricing */
body.page-route #storage-policy { display: none !important; }
