/* Hallmark · reference-led authentication · YOUMAN palette
 * Pre-emit critique: P4 H5 E4 S5 R4 V4. Existing account/billing styling stays scoped outside auth. */
:root {
  --auth-paper: #fafaf7;
  --auth-ink: #20211e;
  --auth-muted: #565c4d;
  --auth-lime: #e7f55a;
  --auth-focus: #536318;
  --auth-olive: #7e8a65;
  --auth-lime-soft: #e7efaa;
  --auth-white: #fff;
  --auth-line: #aeb6a0;
  --auth-error: #922b23;
  --auth-error-bg: #fff3ed;
  --auth-success-bg: #f4f8e6;
  --auth-glass: rgb(255 255 255 / 45%);
  --auth-shine: rgb(255 255 255 / 85%);
  --auth-shadow: rgb(32 33 30 / 12%);
  --auth-body: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --auth-display: Georgia, 'Times New Roman', serif;
  --auth-ease: cubic-bezier(.16, 1, .3, 1);
}
html, body { overflow-x: clip; }
body:has(#auth:not([hidden])) { background: var(--auth-paper); color: var(--auth-ink); color-scheme: light; }
body:has(#auth:not([hidden])) main { max-width: none; margin: 0; padding: 20px; }
body:has(#auth:not([hidden])) main > :not(#auth):not(#message) { display: none; }
body:has(#auth:not([hidden])) main > #message { position: relative; z-index: 1; max-width: 460px; margin: 16px auto; }
#auth {
  box-sizing: border-box;
  isolation: isolate;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100svh - 40px);
  margin: 0;
  padding: 38px 40px 24px;
  border: 1px solid var(--auth-white);
  border-radius: 28px;
  background: var(--auth-paper);
  color: var(--auth-ink);
  font-family: var(--auth-body);
  overflow: clip;
}
#auth::before {
  content: '';
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    radial-gradient(ellipse 48% 69% at 9% 108%, var(--auth-olive) 0%, transparent 100%),
    radial-gradient(ellipse 38% 55% at 94% 88%, var(--auth-lime) 0%, transparent 100%),
    radial-gradient(ellipse 35% 47% at 83% 0%, var(--auth-lime-soft) 0%, transparent 100%);
  pointer-events: none;
}
#auth a { color: inherit; text-underline-offset: 4px; }
#auth .auth-home { display: inline-flex; gap: 10px; align-items: center; text-decoration: none; font-size: 23px; font-weight: 750; letter-spacing: -1px; }
#auth .auth-home sup { font-size: 10px; margin-left: 3px; vertical-align: top; line-height: 2; }
#auth .auth-mark { display: grid; place-items: center; width: 38px; height: 42px; border: 1px solid var(--auth-ink); border-radius: 9px; background: var(--auth-lime); transform: rotate(-6deg); font-size: 29px; }
#auth .auth-exit { position: absolute; top: 32px; right: 32px; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; text-decoration: none; font-size: 24px; }
.auth-content { width: 100%; max-width: 1040px; text-align: center; margin: auto 0; padding: 52px 0 48px; }
#auth .auth-eyebrow { margin: 0 0 20px; color: var(--auth-muted); font-size: 10px; font-weight: 600; letter-spacing: 2px; }
#auth h2 { margin: 0; font-family: var(--auth-display); font-size: clamp(44px, 6.8vw, 92px); font-weight: 400; font-style: normal; line-height: 1.08; letter-spacing: -.055em; overflow-wrap: anywhere; min-width: 0; }
#authdescription { margin: 24px 0 36px; font-size: 15px; line-height: 1.6; color: var(--auth-muted); }
#authform { width: 100%; max-width: 384px; margin: 0 auto; text-align: left; }
#auth label:not(.auth-consent) { display: block; margin: 20px 20px 8px; font-size: 12px; font-weight: 550; color: var(--auth-muted); }
#auth input:not([type=checkbox]) {
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  min-height: 54px;
  padding: 14px 22px;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  background: var(--auth-glass);
  color: var(--auth-ink);
  box-shadow: inset 0 2px 3px var(--auth-shine), inset 0 -2px 3px var(--auth-shadow), 0 3px 4px var(--auth-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font: 16px var(--auth-body);
}
#auth input::placeholder { color: var(--auth-muted); opacity: 1; }
#auth input:-webkit-autofill { -webkit-text-fill-color: var(--auth-ink); box-shadow: inset 0 0 0 100px var(--auth-paper); }
#auth .auth-email-wrap { position: relative; }
#auth .auth-email-wrap svg { position: absolute; z-index: 1; top: 17px; left: 20px; width: 21px; height: 21px; pointer-events: none; }
#auth #email { padding-left: 54px; }
#auth .auth-code-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
#auth .auth-optional { font-weight: 400; }
#auth button { color: var(--auth-ink); font: 500 14px var(--auth-body); white-space: nowrap; touch-action: manipulation; min-height: 44px; margin: 0; transition: transform 140ms var(--auth-ease); }
#auth #sendcode { border: 1px solid var(--auth-line); background: var(--auth-glass); padding: 10px 16px; box-shadow: inset 0 2px 3px var(--auth-shine), 0 2px 3px var(--auth-shadow); }
#auth #submit { display: block; width: 100%; min-height: 54px; border: 1px solid var(--auth-line); border-radius: 999px; padding: 14px 24px; margin-top: 24px; background: var(--auth-lime); color: var(--auth-ink); box-shadow: inset 0 2px 3px var(--auth-shine), inset 0 -2px 3px var(--auth-shadow), 0 3px 4px var(--auth-shadow); font-size: 15px; font-weight: 650; }
#auth button:disabled { opacity: .6; cursor: not-allowed; transform: none; }
#auth button[aria-busy=true] { cursor: wait; }
#auth button:not(:disabled):active { transform: translateY(1px); }
#auth :is(a, button, input[type=checkbox]):focus-visible { outline: 2px solid var(--auth-focus); outline-offset: 4px; }
#auth input:not([type=checkbox]):focus { outline: none; }
#auth input:not([type=checkbox]):focus-visible { background: var(--auth-shine); }
#auth input[aria-invalid=true] { border-color: var(--auth-error); }
#auth .auth-consent { display: flex; align-items: flex-start; gap: 10px; margin: 22px 4px 12px; font-size: 12px; line-height: 1.8; color: var(--auth-muted); }
#auth #consent { flex-shrink: 0; width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--auth-focus); }
#auth .auth-consent a { display: inline-block; }
#auth .auth-switch-row { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; column-gap: 5px; margin-top: 20px; font-size: 13px; color: var(--auth-muted); }
#auth :is(#toggle, #forgot, #editEmail) { background: transparent; border: 0; padding: 10px 5px; box-shadow: none; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }
#auth #forgot { display: block; margin: 0 auto; color: var(--auth-muted); }
#auth #editEmail { margin-top: 8px; }
#auth #message { font-size: 13px; padding: 12px 16px; border: 1px solid var(--auth-line); border-radius: 14px; background: var(--auth-success-bg); color: var(--auth-ink); margin: 16px 0 0; }
#auth #message:empty { display: none; }
#auth #message[data-error=true] { color: var(--auth-error); background: var(--auth-error-bg); }
#auth #challenge:not(:empty) { margin-top: 20px; }
#auth .auth-footer { display: flex; justify-content: space-between; align-items: center; gap: 16px; width: 100%; font-size: 11px; line-height: 1.6; color: var(--auth-muted); }
#auth .auth-footer a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; }
@media (hover:hover) {
  #auth button:not(:disabled):hover { transform: translateY(-1px); }
  #auth :is(.auth-exit, #toggle, #forgot, #editEmail):hover { color: var(--auth-focus); }
}
@media (max-width:600px) {
  body:has(#auth:not([hidden])) main { padding: 8px; }
  #auth { min-height: calc(100svh - 16px); padding: 28px 20px 12px; border-radius: 22px; }
  #auth .auth-home { font-size: 20px; }
  #auth .auth-mark { width: 31px; height: 35px; font-size: 25px; }
  #auth .auth-exit { top: 20px; right: 16px; }
  .auth-content { padding: 44px 0 32px; }
  #auth h2 { font-size: clamp(42px, 10vw, 58px); }
  #authdescription { font-size: 14px; margin: 20px auto 28px; max-width: 28ch; }
  #auth .auth-eyebrow { font-size: 9px; letter-spacing: 1.4px; }
  #auth .auth-footer { font-size: 10px; gap: 8px; }
  #auth::before { opacity: .7; }
}
@media (prefers-reduced-motion:reduce) { #auth button { transition: none; } }
/* Brand mark: the YOUMAN "U" logo replaces the lime letter tile. */
#auth .auth-home .auth-mark { display: block; width: auto; height: 40px; border: 0; border-radius: 0; background: none; transform: none; object-fit: contain; }
@media (max-width: 640px) { #auth .auth-home .auth-mark { height: 34px; } }

/* Session check: hide the sign-in form until /api/auth/me answers, so a signed-in visitor
 * landing on /account.html#membership from the studio never sees a login page flash.
 * .auth-loading lives inside #auth; the inline critical rule in account.html is not needed
 * because this stylesheet is render-blocking. */
.auth-loading { display: none; }
body.auth-pending #auth > *:not(.auth-loading) { visibility: hidden; }
body.auth-pending .auth-loading {
  display: grid;
  position: absolute;
  inset: 0;
  place-items: center;
  margin: 0;
  color: var(--auth-muted);
  font: 600 12px/1.6 var(--auth-body);
  letter-spacing: .18em;
  text-transform: uppercase;
}

/* ── Membership & credits (recharge) ────────────────────────────────────────────────────────
 * Layout follows the domestic recharge panel: the mode switch sits top-right, a monthly/quarterly
 * switch sits under the title, and three tier cards fit on one screen so nothing needs scrolling.
 * Rebuilt in plain CSS in the YOUMAN paper/olive/lime palette — no React/Tailwind toolchain here. */
body {
  --rc-paper: #fbfbf6;
  --rc-card: #fff;
  --rc-ink: #20211e;
  --rc-muted: #5f6752;
  --rc-line: #d8ddc6;
  --rc-line-strong: #c3caae;
  --rc-lime: #e7f55a;
  --rc-lime-soft: #f2f8c9;
  --rc-olive: #55611b;
  --rc-olive-soft: #eef1e0;
  --rc-accent-line: #b9c95a;
  --rc-shadow: 0 22px 45px rgb(32 33 30 / 10%);
  --rc-display: Georgia, "Times New Roman", serif;
}

:root[data-theme=dark] body {
  --rc-paper: #1b1f17;
  --rc-card: #232920;
  --rc-ink: #f0f3e9;
  --rc-muted: #b3bca6;
  --rc-line: #3d4634;
  --rc-line-strong: #4d5942;
  --rc-lime-soft: #313a20;
  --rc-olive: #cbd97c;
  --rc-olive-soft: #2a3122;
  --rc-accent-line: #7f8d43;
  --rc-shadow: 0 22px 45px rgb(0 0 0 / 45%);
}

body:has(#account:not([hidden])) main { max-width: 1120px; margin: 0 auto; padding: 14px clamp(14px, 3vw, 26px) 48px; }
#account { margin: 0; padding: 0; border: 0; border-radius: 0; background: transparent; box-shadow: none; }

.acct-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.acct-brand { font-weight: 750; text-decoration: none; }
body:has(#account:not([hidden])) nav { gap: 8px; margin: 8px 0 12px; }
body:has(#account:not([hidden])) nav a,
body:has(#account:not([hidden])) nav button { margin: 0; padding: 7px 14px; border: 1px solid var(--rc-line); border-radius: 999px; background: transparent; color: var(--rc-ink); font-size: 12.5px; font-weight: 650; text-decoration: none; }
body:has(#account:not([hidden])) nav a:hover,
body:has(#account:not([hidden])) nav button:hover { border-color: var(--rc-line-strong); background: var(--rc-olive-soft); }

.acct-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--rc-line); }
.acct-top h2 { margin: 0; font-size: clamp(20px, 2vw, 24px); letter-spacing: -.02em; }
.acct-eyebrow { margin: 0 0 5px; color: var(--rc-olive); font-size: 10.5px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.acct-top-actions { display: flex; align-items: center; gap: 10px; }
.acct-top-actions #logout { margin: 0; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--rc-line); background: transparent; color: var(--rc-ink); font-size: 12.5px; font-weight: 650; }
.acct-top-actions #logout:hover { border-color: var(--rc-line-strong); background: var(--rc-olive-soft); }
.credit-chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 15px 6px 8px; border: 1px solid var(--rc-line); border-radius: 999px; background: var(--rc-card); color: var(--rc-muted); font-size: 13px; font-weight: 600; }
.credit-chip b { color: var(--rc-ink); font-size: 16px; }
.credit-orb { width: 18px; height: 18px; border-radius: 50%; background: radial-gradient(circle at 32% 28%, #f6ffb0, #e7f55a 45%, #c2e233); box-shadow: inset 0 -2px 5px rgb(85 97 27 / 30%); }

/* Mode switch — top right, mirroring the domestic recharge panel. */
.recharge-top { display: flex; justify-content: flex-end; margin: 10px 0 0; }
.segmented { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--rc-line); border-radius: 999px; background: var(--rc-card); box-shadow: 0 3px 12px rgb(32 33 30 / 6%); }
.segmented button { margin: 0; padding: 8px 16px; border: 0; border-radius: 999px; background: transparent; color: var(--rc-muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: background .18s, color .18s; }
.segmented button[aria-selected=true] { background: var(--rc-lime); color: #20211e; }
.segmented button:focus-visible, .cycle-switch button:focus-visible { outline: 3px solid var(--rc-olive); outline-offset: 2px; }

.recharge-hero { max-width: 780px; margin: 6px auto 0; text-align: center; }
.recharge-title { margin: 0 0 6px; font-family: var(--rc-display); font-size: clamp(26px, 3vw, 38px); font-weight: 400; line-height: 1.1; letter-spacing: -.02em; color: var(--rc-ink); }
.recharge-lead { max-width: 620px; margin: 0 auto; color: var(--rc-muted); font-size: 14px; line-height: 1.6; }
.cycle-switch { display: inline-flex; gap: 2px; margin-top: 10px; padding: 3px; border: 1px solid var(--rc-line); border-radius: 999px; background: var(--rc-card); }
.cycle-switch button { margin: 0; padding: 8px 18px; border: 0; border-radius: 999px; background: transparent; color: var(--rc-muted); font-size: 13px; font-weight: 700; cursor: pointer; transition: background .18s, color .18s; }
.cycle-switch button.is-active { background: var(--rc-ink); color: var(--rc-paper); }
.cycle-switch button em { font-style: normal; font-weight: 700; color: var(--rc-olive); }
.cycle-switch button.is-active em { color: var(--rc-lime); }
.member-status { margin: 6px 0 0; color: var(--rc-muted); font-size: 12.5px; }

.plans { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; align-items: stretch; margin-top: 12px; }
.plan { display: flex; flex-direction: column; gap: 8px; padding: 16px; border: 1px solid var(--rc-line); border-radius: 18px; background: var(--rc-card); box-shadow: 0 3px 14px rgb(32 33 30 / 4%); cursor: pointer; transition: transform .18s var(--auth-ease), border-color .18s, box-shadow .18s; }
.plan:hover { transform: translateY(-2px); border-color: var(--rc-line-strong); box-shadow: var(--rc-shadow); }
.plan.is-popular { border-color: var(--rc-accent-line); background: linear-gradient(180deg, var(--rc-lime-soft), var(--rc-card) 55%); }
.plan.is-selected { border-color: var(--rc-accent-line); box-shadow: 0 0 0 2px var(--rc-lime) inset, 0 14px 30px rgb(150 170 60 / 16%); }
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.plan h3 { margin: 0; font-family: var(--rc-display); font-size: 22px; font-weight: 400; letter-spacing: -.01em; color: var(--rc-ink); }
.plan-badge { flex: 0 0 auto; padding: 4px 10px; border-radius: 999px; background: var(--rc-lime); color: #20211e; font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.plan-price { display: flex; align-items: baseline; gap: 5px; margin: 0; }
.plan-amount { font-family: var(--rc-display); font-size: 28px; line-height: 1; letter-spacing: -.02em; color: var(--rc-ink); }
.plan-per { color: var(--rc-muted); font-size: 13px; }
.plan-credits { margin: 0; padding: 7px 11px; border-radius: 10px; background: var(--rc-olive-soft); color: var(--rc-ink); font-size: 13px; font-weight: 700; }
.plan-cta { width: 100%; margin: 0; padding: 11px 15px; border: 0; border-radius: 12px; background: var(--rc-ink); color: var(--rc-paper); font-size: 14px; font-weight: 750; cursor: pointer; transition: filter .18s, transform .18s; }
.plan-cta:hover { filter: brightness(1.14); }
.plan-cta:active { transform: translateY(1px); }
.plan-cta:disabled { opacity: .45; cursor: not-allowed; filter: none; transform: none; }
.plan.is-popular .plan-cta, .plan.is-selected .plan-cta { background: var(--rc-lime); color: #20211e; }
.plan-list { display: grid; gap: 6px; margin: 2px 0 0; padding: 0; list-style: none; }
.plan-list li { display: flex; align-items: flex-start; gap: 8px; padding: 0; border: 0; color: var(--rc-muted); font-size: 12.5px; line-height: 1.45; }
.plan-list .check { display: grid; flex: 0 0 auto; width: 18px; height: 18px; place-items: center; border-radius: 50%; background: var(--rc-lime-soft); color: var(--rc-olive); }
.plan-list .check svg { width: 11px; height: 11px; }

.packs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 12px; }
.pack { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--rc-line); border-radius: 16px; background: var(--rc-card); cursor: pointer; transition: transform .18s var(--auth-ease), border-color .18s, box-shadow .18s; }
.pack:hover { transform: translateY(-2px); border-color: var(--rc-line-strong); }
.pack.is-selected { border-color: var(--rc-accent-line); box-shadow: 0 0 0 2px var(--rc-lime) inset, 0 14px 30px rgb(150 170 60 / 16%); }
.pack-credits { margin: 0; font-family: var(--rc-display); font-size: 26px; line-height: 1; color: var(--rc-ink); }
.pack-credits span { margin-left: 6px; font-family: system-ui, sans-serif; font-size: 12px; font-weight: 600; color: var(--rc-muted); }
.pack-price { margin: 0; font-size: 19px; font-weight: 800; color: var(--rc-ink); }
.pack-meta { margin: 0; color: var(--rc-muted); font-size: 12px; line-height: 1.5; }
.pack .plan-cta { margin-top: auto; padding: 11px; border: 1px solid var(--rc-line-strong); border-radius: 11px; background: transparent; color: var(--rc-ink); font-size: 13px; }
.pack.is-selected .plan-cta { border-color: var(--rc-lime); background: var(--rc-lime); color: #20211e; }

.checkout-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; margin-top: 12px; padding: 14px 18px; border: 1px solid var(--rc-line); border-radius: 16px; background: var(--rc-card); }
.checkout-pick { display: flex; flex-direction: column; gap: 3px; }
.checkout-pick .acct-eyebrow { margin: 0; }
.checkout-pick strong { font-size: 15px; color: var(--rc-ink); }
.checkout-bar #paypal-buttons { min-width: 220px; margin: 0; }
.acct-note { margin: 12px 0 0; color: var(--rc-muted); font-size: 12.5px; line-height: 1.6; }
.consent { display: flex; gap: 10px; align-items: flex-start; margin: 16px 0 0; padding: 12px 15px; border: 1px solid var(--rc-line); border-radius: 13px; background: var(--rc-card); color: var(--rc-muted); font-size: 13px; line-height: 1.5; }
.consent input { flex: 0 0 auto; margin: 3px 0 0; accent-color: #8ba01f; }

.record-list { margin: 14px 0 0; padding: 0; list-style: none; }
.acct-subhead { margin: 16px 0 0; font-size: 13px; font-weight: 800; letter-spacing: .02em; color: var(--rc-ink); }
.record-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--rc-line); color: var(--rc-muted); font-size: 13.5px; }
.record-list li:last-child { border-bottom: 0; }
.record-list li button { margin: 0; padding: 7px 13px; border-radius: 999px; font-size: 12.5px; }
.record-list li a { color: var(--rc-olive); font-weight: 700; }

.acct-block { margin-top: 26px; padding: 20px 22px; border: 1px solid var(--rc-line); border-radius: 18px; background: var(--rc-card); }
.acct-block-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.acct-block h3 { margin: 0; font-size: 16px; color: var(--rc-ink); }
.acct-block-head button { margin: 0; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--rc-line); background: transparent; color: var(--rc-ink); font-size: 12.5px; }
.acct-block-head button:hover { border-color: var(--rc-line-strong); background: var(--rc-olive-soft); }
.acct-danger { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding: 18px 22px; border: 1px dashed var(--rc-line); border-radius: 18px; }
.acct-danger h3 { margin: 0 0 5px; font-size: 15px; color: var(--rc-ink); }
.acct-danger p { max-width: 520px; margin: 0; font-size: 12.5px; }
.acct-danger button { margin: 0; padding: 10px 17px; border-radius: 999px; }

@media (max-width: 860px) {
  .plans, .packs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .plans, .packs { grid-template-columns: minmax(0, 1fr); }
  .acct-top { align-items: flex-start; }
  .recharge-title { font-size: 26px; }
  .segmented { display: flex; width: 100%; }
  .segmented button { flex: 1 1 0; padding: 9px 8px; white-space: nowrap; }
  .cycle-switch { display: flex; width: 100%; }
  .cycle-switch button { flex: 1 1 0; padding: 9px 6px; font-size: 12.5px; white-space: nowrap; }
  .checkout-bar #paypal-buttons { width: 100%; min-width: 0; }
}

/* Order history is adjacent to the plan switch; account actions live in the studio avatar menu. */
.recharge-top{align-items:center;flex-wrap:wrap;gap:10px}
.orders-trigger{margin:0;padding:10px 16px;border:1px solid var(--rc-line);border-radius:999px;background:var(--rc-card);color:var(--rc-ink);font-size:13px;font-weight:650;white-space:nowrap}
.orders-trigger:hover{background:var(--rc-olive-soft);border-color:var(--rc-line-strong)}
.orders-trigger:focus-visible,#ordersdialog button:focus-visible{outline:2px solid var(--rc-olive);outline-offset:3px}
#ordersdialog{box-sizing:border-box;width:min(680px,calc(100% - 32px));max-height:85dvh;overflow:auto;background:var(--rc-card);color:var(--rc-ink);padding:24px;border-color:var(--rc-line);box-shadow:var(--rc-shadow)}
.orders-dialog-head{gap:16px}.orders-dialog-head h2{margin:0;font-size:22px;letter-spacing:-.02em}.orders-dialog-head button{margin:0;padding:0;width:34px;height:34px;flex:none;border:1px solid var(--rc-line);border-radius:50%;background:transparent;color:var(--rc-ink);font-size:24px;line-height:1}
#ordersstatus{font-size:13px;line-height:1.6}#ordersstatus:empty{display:none}#ordersdialog .record-list{overflow-wrap:anywhere}#ordersdialog .record-list li{gap:10px}
.orders-dialog-footer{display:flex;justify-content:flex-end;padding-top:12px;border-top:1px solid var(--rc-line)}.orders-dialog-footer button{margin:0;background:var(--rc-olive-soft);color:var(--rc-ink);font-size:13px}
@media(max-width:600px){.recharge-top{justify-content:flex-start;gap:8px}.orders-trigger{padding:9px 12px;font-size:12px}.segmented button{padding:8px 12px;font-size:12px}#ordersdialog{padding:18px}}

/* Optional Google/X entry points share the existing sign-in width and palette. */
#auth .social-auth{width:100%;max-width:384px;margin:22px auto 0;text-align:left}
#auth .social-divider{display:flex;align-items:center;gap:12px;margin:0 0 16px;color:var(--auth-muted);font-size:12px;text-align:center;white-space:nowrap}
#auth .social-divider::before,#auth .social-divider::after{content:"";height:1px;flex:1;background:var(--auth-line)}
#auth .social-registration{margin-bottom:14px}
#auth .social-registration .social-consent{display:flex;align-items:flex-start;gap:10px;margin:0 4px 12px;color:var(--auth-muted);font-size:12px;line-height:1.6}
#auth #social-consent{flex:none;width:18px;height:18px;margin:1px 0 0;accent-color:var(--auth-focus)}
#auth .social-registration .social-invite-label{margin:12px 4px 7px;font-size:12px}
#auth .social-registration #social-invite{min-height:46px;margin-bottom:9px}
#auth .social-provider{display:flex;justify-content:center;width:100%;min-height:44px;margin-bottom:10px}
#auth .social-provider[aria-disabled="true"],#deletedialog .delete-provider[aria-disabled="true"]{opacity:.45}
#auth .social-provider>div,#deletedialog .delete-provider>div{width:100%;display:flex;justify-content:center}
#auth .social-x,#deletedialog .social-x{box-sizing:border-box;display:flex;align-items:center;justify-content:center;gap:12px;width:100%;min-height:44px;margin:0;padding:9px 18px;border:1px solid var(--auth-line);border-radius:999px;background:var(--auth-white);color:var(--auth-ink);font:600 14px var(--auth-body);box-shadow:0 2px 4px var(--auth-shadow)}
#auth .social-x-mark{font-size:20px;line-height:1}
#auth .social-status,#deletedialog .social-status{min-height:1em;margin:8px 2px 0;color:var(--auth-muted);font-size:12px;line-height:1.5;text-align:center}
#auth .social-status:empty,#deletedialog .social-status:empty{display:none}
#auth .social-x:focus-visible,#deletedialog .social-x:focus-visible,#deletedialog input:focus-visible{outline:2px solid var(--auth-focus);outline-offset:3px}
#deletedialog .delete-consent-label{display:flex;align-items:flex-start;gap:9px;line-height:1.5}
#deletedialog .delete-consent-label input{flex:none;margin-top:4px}
#deletedialog .delete-provider{display:flex;flex-direction:column;align-items:center;width:100%;margin:18px 0 8px}
#deletedialog .delete-provider p{margin:0 0 12px;color:var(--auth-muted);font-size:13px;line-height:1.5;text-align:center}
#deletedialog .delete-x{margin:18px 0 8px}
#deletedialog .social-x:disabled{opacity:.5;cursor:not-allowed}
@media(max-width:600px){#auth .social-auth{margin-top:18px}#auth .social-divider{margin-bottom:13px}}

.plan-billing { margin: 5px 0 0; font-size: 13px; line-height: 1.5; font-weight: 650; color: var(--rc-ink); }
@media (max-width: 600px) { .cycle-switch { flex-wrap: wrap; border-radius: 18px; box-sizing: border-box; } .cycle-switch button { flex: 1 1 auto; } }

/* Checkout stays next to the user's selected plan instead of below the pricing grid. */
#checkoutdialog{box-sizing:border-box;width:min(480px,calc(100% - 32px));max-height:90dvh;overflow:auto;padding:24px;background:var(--rc-card);color:var(--rc-ink);border:1px solid var(--rc-line);border-radius:20px;box-shadow:var(--rc-shadow)}
#checkoutdialog::backdrop{background:rgb(20 24 16 / 48%)}
.checkout-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:16px}
.checkout-dialog-head h2{margin:0;font-size:22px;letter-spacing:-.03em}
#checkoutclose{flex:none;width:36px;height:36px;padding:0;margin:0;border:1px solid var(--rc-line);border-radius:50%;background:transparent;color:var(--rc-ink);font-size:25px;line-height:1}
#checkoutproduct{margin:24px 0 10px;color:var(--rc-muted);font-size:14px}
.checkout-total{display:flex;justify-content:space-between;align-items:baseline;gap:12px;margin:0 0 12px;font-size:14px}
.checkout-total strong{font-size:28px;letter-spacing:-.04em;white-space:nowrap}
#checkoutterms{margin:0 0 16px;font-size:13px;line-height:1.6}
#checkoutstatus{font-size:14px;line-height:1.5;margin:12px 0;overflow-wrap:anywhere}
#checkoutdialog #paypal-buttons{width:100%;max-width:none;margin:16px 0 0;min-height:44px}
#checkoutsubscribe,.checkout-done{box-sizing:border-box;display:block;width:100%;margin:12px 0 0;padding:13px 18px;border:0;border-radius:12px;background:var(--rc-lime);color:#20211e;font:700 14px system-ui;text-align:center;text-decoration:none}
#checkoutcheck{display:block;margin:16px auto 0;padding:6px 10px;background:transparent;color:var(--rc-muted);border:0;text-decoration:underline;font-size:13px}
.checkout-provider-note{margin:16px 0 0;color:var(--rc-muted);font-size:12px;line-height:1.5}
#checkoutopen{margin:0;border-radius:12px;background:var(--rc-lime);color:#20211e;font-size:14px;font-weight:700}
#checkoutdialog .consent{display:flex;align-items:flex-start;gap:8px;font-size:13px;line-height:1.5;margin:16px 0}
#checkoutdialog .consent input{flex:none;margin-top:3px}
#checkoutdialog button:focus-visible,#checkoutdialog a:focus-visible,#checkoutopen:focus-visible{outline:2px solid var(--rc-olive);outline-offset:3px}
@media(max-width:600px){#checkoutdialog{padding:20px}.checkout-dialog-head h2{font-size:20px}.checkout-total strong{font-size:26px}.checkout-bar{align-items:stretch}.checkout-bar #checkoutopen{width:100%}}

/* Compact recharge surface; keep the existing auth and checkout rules. */
body:has(#account:not([hidden])) main { max-width: 1040px; margin: 0 auto; padding: 0; }
body:has(#account:not([hidden])) main > :is(.acct-bar,nav) { display: none; }
body:has(#account:not([hidden])) { background: var(--rc-paper); }
#account { padding: 0; background: var(--rc-paper); }
.recharge-head { position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 24px 28px; border-bottom: 1px solid var(--rc-line); background: var(--rc-card); }
.recharge-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.recharge-avatar { width: 44px; height: 44px; flex: none; border-radius: 50%; border: 1px solid var(--rc-line); object-fit: cover; background: var(--rc-olive-soft); }
.recharge-user-info { min-width: 0; }
.recharge-user-info #identity { max-width: 250px; margin: 0 0 5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--rc-ink); font: 650 15px/1.3 var(--auth-body); }
.recharge-user-meta { display: flex; flex-wrap: wrap; align-items: center; column-gap: 10px; row-gap: 4px; font-size: 12px; color: var(--rc-muted); }
.recharge-user-meta #memberstatus { margin: 0; color: var(--rc-muted); text-align: left; font-size: 12px; }
.recharge-user-meta .credit-chip { padding: 0; border: 0; background: none; gap: 4px; font-size: 12px; color: var(--rc-olive); }
.recharge-user-meta .credit-orb { width: 8px; height: 8px; background: var(--rc-olive); box-shadow: none; }
.recharge-head-actions { display: flex; align-items: center; gap: 16px; flex: none; }
.recharge-head .segmented { display: flex; width: auto; margin: 0; padding: 4px; border: 0; border-radius: 12px; background: var(--rc-olive-soft); }
.recharge-head .segmented button { min-height: 40px; padding: 9px 16px; font-size: 13px; font-weight: 600; border-radius: 9px; color: var(--rc-muted); white-space: nowrap; transition: none; }
.recharge-head .segmented button[aria-selected=true] { background: var(--rc-card); color: var(--rc-ink); box-shadow: 0 1px 5px rgb(32 33 30 / 8%); }
#rechargeclose { display: grid; place-items: center; width: 44px; height: 44px; margin: 0; padding: 0; border: 0; border-radius: 10px; background: transparent; color: var(--rc-muted); font-size: 27px; line-height: 1; }
.recharge-content { padding: 28px; }
.recharge-content .recharge-hero { margin: 0 auto 24px; max-width: 760px; }
.recharge-content .recharge-title { margin: 0 0 8px; font: 400 32px/1.2 var(--rc-display); letter-spacing: -.025em; }
.recharge-content .recharge-lead { max-width: 600px; font-size: 13px; line-height: 1.55; }
.recharge-content .cycle-switch { margin-top: 18px; padding: 4px; border: 0; border-radius: 12px; background: var(--rc-olive-soft); }
.recharge-content .cycle-switch button { min-height: 40px; padding: 9px 18px; border-radius: 9px; color: var(--rc-muted); font-size: 13px; transition: none; }
.recharge-content .cycle-switch button.is-active { background: var(--rc-card); color: var(--rc-ink); box-shadow: 0 1px 5px rgb(32 33 30 / 8%); }
.recharge-content .cycle-switch em, .recharge-content .cycle-switch .is-active em { display: inline-block; font-size: 10px; font-style: normal; color: var(--rc-olive); background: none; margin-left: 6px; }
.recharge-content .plans { gap: 14px; margin: 0; grid-template-columns: repeat(3,minmax(0,1fr)); }
.recharge-content .plan { box-sizing: border-box; min-width: 0; min-height: 0; gap: 0; padding: 22px; border: 1px solid var(--rc-line); border-radius: 16px; background: var(--rc-card); box-shadow: none; cursor: default; transition: none; transform: none; }
.recharge-content .plan.is-popular { border-color: var(--rc-accent-line); background: var(--rc-lime-soft); }
.recharge-content .plan.is-selected { box-shadow: none; }
.recharge-content .plan-head { min-height: 28px; }
.recharge-content .plan h3 { font: 650 18px/1.4 var(--auth-body); letter-spacing: -.02em; }
.recharge-content .plan-badge { padding: 4px 7px; font-size: 9px; letter-spacing: 0; text-transform: none; }
.plan-description { min-height: 20px; margin: 6px 0 22px; font-size: 12px; line-height: 1.6; color: var(--rc-muted); }
.recharge-content .plan-amount { font: 600 38px/1.1 var(--auth-body); letter-spacing: -.045em; font-variant-numeric: tabular-nums; }
.recharge-content .plan-per { font-size: 12px; }
.recharge-content .plan-billing { min-height: 20px; margin: 6px 0 16px; color: var(--rc-muted); font-size: 12px; font-weight: 400; }
.recharge-content .plan-credits { padding: 0; margin: 0 0 16px; border-radius: 0; background: transparent; color: var(--rc-olive); font-size: 13px; font-weight: 650; }
.recharge-content .plan-cta { min-height: 44px; padding: 12px; margin: 0 0 20px; border-radius: 10px; background: var(--rc-ink); color: var(--rc-card); font-size: 13px; font-weight: 600; white-space: nowrap; transition: none; }
.recharge-content .plan.is-popular .plan-cta { background: var(--rc-lime); color: #20211e; }
.recharge-content .plan:not(.is-popular) .plan-cta { background: var(--rc-ink); color: var(--rc-card); }
.recharge-content .plan-list { gap: 10px; padding-top: 18px; margin: auto 0 0; border-top: 1px solid var(--rc-line); }
.recharge-content .plan-list li { font-size: 12px; line-height: 1.5; color: var(--rc-muted); }
.recharge-content .plan-list .check { background: transparent; color: var(--rc-olive); width: 16px; height: 18px; }
.recharge-content .plan-list .check svg { width: 13px; height: 13px; }
.recharge-content .packs { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 14px; margin: 0; }
.recharge-content .pack { padding: 20px; gap: 10px; cursor: default; transform: none; box-shadow: none; transition: none; }
.recharge-content .pack.is-selected { box-shadow: none; border-color: var(--rc-line); }
.recharge-content .pack-credits { font: 600 28px/1.2 var(--auth-body); letter-spacing: -.04em; }
.recharge-content .pack-price { font-size: 20px; font-weight: 600; }
.recharge-content .pack .plan-cta { margin: 8px 0 0; background: var(--rc-ink); color: var(--rc-card); border: 0; }
#checkoutbar { display: none; }
#cyclenote { margin: 18px 0 0; font-size: 12px; }
.recharge-footer { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--rc-line); color: var(--rc-muted); }
.recharge-footer .orders-trigger { min-height: 44px; padding: 8px 0; border: 0; background: none; font-size: 12px; color: var(--rc-muted); text-decoration: underline; text-underline-offset: 3px; }
.recharge-footer p { margin: 0; max-width: 560px; text-align: right; font-size: 11px; line-height: 1.5; }
body:has(#account:not([hidden])) #message:not(:empty) { margin: 0; padding: 12px 28px; background: var(--rc-olive-soft); color: var(--rc-ink); font-size: 13px; }
body:has(#account:not([hidden])) #message:empty { display: none; }
body:has(#account:not([hidden])) #message[data-error] { background: var(--auth-error-bg); color: var(--auth-error); }
body.recharge-embedded:has(#auth:not([hidden])) main { padding: 0; }
body.recharge-embedded #auth { min-height: 100dvh; padding: 32px 24px 20px; border: 0; border-radius: 0; }
body.recharge-embedded #auth h2 { font-size: 48px; }
body.recharge-embedded #auth .auth-content { padding: 24px 0; }
body.recharge-embedded #auth::before { opacity: .5; }
#account :is(button,a):focus-visible { outline: 2px solid var(--rc-olive); outline-offset: 3px; }
#account button:disabled { opacity: .5; cursor: not-allowed; }
#account button[aria-busy=true] { cursor: wait; }
#account button:active:not(:disabled) { transform: scale(.98); }
@media (hover:hover) and (pointer:fine) { #account .plan:hover, #account .pack:hover { transform: none; box-shadow: none; } #account button:hover:not(:disabled) { filter: none; } #account .plan-cta:hover:not(:disabled) { opacity: .9; } #account #rechargeclose:hover { background: var(--rc-olive-soft); } }
@media (max-width: 760px) { .recharge-head { flex-wrap: wrap; gap: 16px; padding: 18px 20px; } .recharge-head-actions { flex: 1; } .recharge-head .segmented { flex: 1; } .recharge-head .segmented button { flex: 1; } #rechargeclose { margin-left: auto; } .recharge-content { padding: 24px 20px; } .recharge-content .plans { grid-template-columns: minmax(0,1fr); } .recharge-content .packs { grid-template-columns: repeat(2,minmax(0,1fr)); } .recharge-content .plan-description { margin-bottom: 16px; } }
@media (max-width: 480px) { .recharge-head { gap: 12px; padding: 16px; } .recharge-user { width: calc(100% - 44px); } .recharge-head-actions { width: 100%; gap: 8px; } .recharge-head .segmented button { padding: 9px 8px; font-size: 12px; } #rechargeclose { position: absolute; top: 16px; right: 12px; } .recharge-content { padding: 24px 16px 16px; } .recharge-content .recharge-title { font-size: 28px; } .recharge-content .cycle-switch { display: flex; width: 100%; box-sizing: border-box; flex-wrap: nowrap; } .recharge-content .cycle-switch button { flex: 1; padding: 8px 6px; font-size: 12px; } .cycle-switch em { display: block; margin: 2px 0 0; font-size: 9px; } .recharge-content .packs { grid-template-columns: minmax(0,1fr); } .recharge-footer { align-items: flex-start; } .recharge-footer p { max-width: 200px; } .recharge-user-info #identity { max-width: 225px; } }
@media (prefers-reduced-motion:reduce) { #account button { transition: none; } }
.recharge-head { padding: 18px 24px; }
.recharge-content { padding: 24px; }
.recharge-content .recharge-hero { margin-bottom: 20px; }
.recharge-content .plan { padding: 20px; }
.recharge-content .plan-head { min-height: 26px; }
.recharge-content .plan-description { margin: 4px 0 16px; }
.recharge-content .plan-amount { font-size: 36px; }
.recharge-content .plan-billing { min-height: 18px; margin: 4px 0 12px; }
.recharge-content .plan-credits { margin-bottom: 12px; }
.recharge-content .plan-cta { margin-bottom: 16px; }
.recharge-content .plan-list { gap: 8px; padding-top: 12px; }
.recharge-terms { margin-top: 12px; font-size: 12px; color: var(--rc-muted); }
.recharge-terms summary { display: list-item; cursor: pointer; width: fit-content; min-height: 24px; line-height: 24px; }
.recharge-terms summary:focus-visible { outline: 2px solid var(--rc-olive); outline-offset: 3px; }
.recharge-terms #cyclenote { margin: 6px 0 0; }
.recharge-footer { margin-top: 12px; padding-top: 8px; }
@media (max-width:480px) { .recharge-head { padding:16px; } .recharge-content { padding:24px 16px 16px; } .recharge-content .cycle-switch em { display:block; margin:2px 0 0; } }

/* Hide the visual scrollbar while retaining document, touch and keyboard scrolling. */
html:has(body.recharge-embedded), body.recharge-embedded { scrollbar-width: none; }
html:has(body.recharge-embedded)::-webkit-scrollbar,
body.recharge-embedded::-webkit-scrollbar { display: none; width: 0; height: 0; }

/* The QR uses a white quiet zone in both site themes. */
#checkoutscan { width: 100%; margin: 12px 0 0; padding: 13px 16px; border: 1px solid var(--rc-line); border-radius: 8px; background: var(--rc-card); color: var(--rc-ink); font: inherit; font-weight: 600; cursor: pointer; }
#checkoutscan:disabled { cursor: default; opacity: .5; }
#checkoutqr { text-align: center; padding: 0; margin: 18px 0 0; border: 0; background: transparent; }
#checkoutqrimage { display: block; width: 208px; height: 208px; max-width: 100%; margin: 8px auto 16px; background: #fff; border-radius: 8px; }
#checkoutqr p { max-width: 320px; margin: 0 auto 12px; color: var(--rc-muted); font-size: 14px; line-height: 1.5; }
#checkoutqrlink { display: block; color: var(--rc-ink); text-decoration: underline; text-underline-offset: 3px; font-size: 14px; }
#checkoutonline { display: block; margin: 16px auto 0; border: 0; background: none; color: var(--rc-muted); font: inherit; font-size: 14px; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
#checkoutscan:focus-visible, #checkoutonline:focus-visible, #checkoutqrlink:focus-visible { outline: 2px solid var(--rc-olive); outline-offset: 3px; }
