/* Plan & billing: one flow — where you are, what to do next, the plan choice, the review. */
.plan-flow { display: grid; gap: 20px; }
.plan-flow [hidden] { display: none; }
.plan-flow h2, .plan-flow h3 { margin: 0; }
.plan-flow p { margin: 0; }

.plan-summary { padding: 28px 32px; border: 1px solid rgb(29 29 31 / 8%); border-radius: 24px; background: #fff; box-shadow: var(--portal-shadow); }
.plan-summary-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.plan-summary h2 { margin-top: 10px; font-size: clamp(30px, 3.2vw, 40px); line-height: 1.05; letter-spacing: -.03em; }
.plan-summary-head p { margin-top: 8px; color: var(--portal-muted); font-size: 14px; }
.plan-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 11px; border-radius: 999px; background: #f0f0f2; color: #555560; font-size: 12px; font-weight: 650; }
.plan-chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.plan-chip.is-violet { background: #efebff; color: #4f35c4; }
.plan-chip.is-green { background: #e2f4dc; color: #1f6a3d; }
.plan-chip.is-amber { background: #fff1d6; color: #8a5a00; }
.plan-chip.is-red { background: #fde7e7; color: #a4262c; }
.plan-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 24px 0 0; }
.plan-facts > div { display: grid; gap: 4px; padding: 16px 18px; border-radius: 16px; background: #f6f6f8; }
.plan-facts dt { color: var(--portal-muted); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.plan-facts dd { margin: 0; font-size: 24px; font-weight: 650; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.plan-facts dd span { color: var(--portal-muted); font-size: 13px; font-weight: 500; letter-spacing: 0; }
.plan-facts small { color: var(--portal-muted); font-size: 12px; }
.plan-progress { height: 6px; margin-top: 16px; overflow: hidden; border-radius: 99px; background: #e8e8ee; }
.plan-progress span { display: block; height: 100%; border-radius: inherit; background: var(--portal-violet-dark); }

.plan-callout { display: grid; gap: 8px; padding: 18px 22px; border: 1px solid rgb(104 78 232 / 14%); border-radius: 18px; background: #f6f5fd; color: #3b3b44; font-size: 14px; line-height: 1.55; }
.plan-callout h3 { font-size: 17px; letter-spacing: -.01em; color: var(--portal-ink); }
.plan-callout strong { color: var(--portal-ink); }
.plan-callout.is-action { border-color: rgb(104 78 232 / 32%); background: #efebff; }
.plan-callout.is-danger { border-color: #e6b3b3; background: #fdeeee; color: #7a1f1f; }
.plan-callout.is-pending { background: #fff8e6; border-color: #ecd9a3; }
.plan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 6px; }

.plan-picker { display: grid; gap: 20px; padding: 28px 32px; border: 1px solid rgb(29 29 31 / 8%); border-radius: 24px; background: #fff; box-shadow: var(--portal-shadow); }
.plan-picker-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.plan-picker-head h3 { font-size: 22px; letter-spacing: -.02em; }
.plan-picker-head p { margin-top: 4px; color: var(--portal-muted); font-size: 14px; }
.plan-picker fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
.plan-period { display: inline-flex; padding: 4px; border-radius: 999px; background: #f0f0f3; }
.plan-period label { position: relative; cursor: pointer; }
.plan-period input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.plan-period span { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 16px; border-radius: 999px; color: #555560; font-size: 13px; font-weight: 650; transition: background 140ms ease, color 140ms ease; }
.plan-period small { color: #1f6a3d; font-size: 11px; font-weight: 650; }
.plan-period input:checked + span { background: #fff; color: var(--portal-ink); box-shadow: 0 1px 4px rgb(20 20 24 / 14%); }
.plan-period input:focus-visible + span { outline: 3px solid rgb(104 78 232 / 45%); outline-offset: 1px; }
.plan-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.plan-option { position: relative; display: block; cursor: pointer; }
.plan-option input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.plan-option-card { display: grid; align-content: start; gap: 10px; height: 100%; padding: 22px; border: 1.5px solid rgb(29 29 31 / 12%); border-radius: 20px; background: #fff; transition: border-color 140ms ease, box-shadow 140ms ease, background 140ms ease; }
.plan-option:hover .plan-option-card { border-color: rgb(29 29 31 / 28%); }
.plan-option input:checked + .plan-option-card { border-color: var(--portal-violet-dark); background: #faf9ff; box-shadow: 0 0 0 3px rgb(104 78 232 / 16%); }
.plan-option input:focus-visible + .plan-option-card { outline: 3px solid rgb(104 78 232 / 45%); outline-offset: 2px; }
.plan-option-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.plan-option-top strong { font-size: 18px; letter-spacing: -.01em; }
.plan-option-top em { padding: 3px 9px; border-radius: 999px; background: #efebff; color: #4f35c4; font-size: 11px; font-style: normal; font-weight: 650; }
.plan-option-blurb { color: var(--portal-muted); font-size: 13px; }
.plan-option-price { display: flex; align-items: baseline; gap: 4px; }
.plan-option-price b { font-size: 32px; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.plan-option-price span { color: var(--portal-muted); font-size: 13px; }
.plan-option ul { display: grid; gap: 7px; margin: 6px 0 0; padding: 0; list-style: none; }
.plan-option li { position: relative; padding-left: 22px; color: #4b4b52; font-size: 13px; line-height: 1.4; }
.plan-option li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 5px; height: 9px; border: solid #6a4fe0; border-width: 0 2px 2px 0; transform: rotate(40deg) scale(.9); }
.plan-option--scale { cursor: default; }
.plan-option--scale .plan-option-card { background: #fafaf9; border-style: dashed; }
.plan-option--scale .portal-button-secondary { margin-top: auto; }
.plan-picker-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 18px; border-radius: 16px; background: #f6f6f8; }
.plan-picker-foot p { font-size: 15px; color: #3b3b44; }
.plan-picker-foot strong { margin-right: 8px; color: var(--portal-ink); }
.plan-picker-foot .portal-button { min-width: 180px; }
.plan-note { color: var(--portal-muted); font-size: 13px; line-height: 1.55; max-width: 72ch; }
.plan-change > summary { display: inline-flex; align-items: center; gap: 8px; padding: 10px 4px; color: #4f35c4; font-size: 14px; font-weight: 650; cursor: pointer; }
.plan-change[open] > summary { margin-bottom: 12px; }

.plan-review { display: grid; gap: 16px; padding: 28px 32px; border: 1.5px solid var(--portal-violet-dark); border-radius: 24px; background: #fff; box-shadow: 0 0 0 4px rgb(104 78 232 / 10%); }
.plan-review h3 { font-size: 22px; letter-spacing: -.02em; }
.plan-review dl { display: grid; margin: 0; border: 1px solid rgb(29 29 31 / 9%); border-radius: 16px; overflow: hidden; }
.plan-review dl > div { display: grid; grid-template-columns: 160px 1fr; gap: 16px; padding: 14px 18px; }
.plan-review dl > div + div { border-top: 1px solid rgb(29 29 31 / 9%); }
.plan-review dt { color: var(--portal-muted); font-size: 13px; }
.plan-review dd { margin: 0; font-size: 15px; font-weight: 600; }
.plan-review dd small { color: var(--portal-muted); font-weight: 500; }

.plan-cancel { padding: 4px 8px; font-size: 14px; }
.plan-cancel summary { color: #62626b; cursor: pointer; padding: 6px 0; }
.plan-cancel p { margin: 10px 0 14px; color: var(--portal-muted); line-height: 1.6; max-width: 70ch; }
.plan-cancel form { display: grid; gap: 14px; justify-items: start; }

@media (max-width: 900px) {
  .plan-options { grid-template-columns: 1fr; }
}
@media (max-width: 700px) {
  .plan-summary, .plan-picker, .plan-review { padding: 22px 18px; border-radius: 20px; }
  .plan-summary-head { flex-direction: column; }
  .plan-picker-foot { align-items: stretch; flex-direction: column; }
  .plan-picker-foot .portal-button { width: 100%; }
  .plan-review dl > div { grid-template-columns: 1fr; gap: 4px; }
}

/* Legacy extra-activation panel (account-extras.js) */
.billing-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.billing-card {
  padding: 23px;
}
.billing-card h3 {
  margin-top: 13px;
  font-size: 21px;
}
.billing-card p {
  margin: 7px 0 16px;
  color: var(--portal-muted);
  font-size: 11px;
}
.extra-activations {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(240px, 1fr);
  gap: 28px;
  margin: 24px 0;
  padding: 28px;
}
.extra-activations h2 { margin: 8px 0 12px; font-size: 32px; line-height: 1.15; }
.extra-activations p { line-height: 1.6; }
.extra-activations form { display: grid; align-content: start; gap: 12px; }
.extra-activations input { width: 100%; min-width: 0; padding: 12px; font: inherit; border: 1px solid #ccc; border-radius: 10px; }
.extra-total { margin: 0; }
.extra-total span { display: block; font-size: 13px; }
.extra-activations [data-extra-return] { grid-column: 1 / -1; }
@media (max-width: 700px) {
  .extra-activations { grid-template-columns: minmax(0, 1fr); padding: 20px; }
}

.subscription-consent label { display: flex; align-items: flex-start; gap: 12px; min-height: 44px; font-size: 14px; line-height: 1.5; cursor: pointer; }
.subscription-consent input { width: 20px; height: 20px; flex: 0 0 20px; margin: 2px 0 0; accent-color: #6640be; }
.subscription-consent input[aria-invalid="true"] { outline: 2px solid #b42318; outline-offset: 2px; }
