/* Paid cloud: account, pricing, sign-in pages, nav pill and the paid parts of the tool.
   Loaded only when the paywall is on for the request (account.js adds it at run time; /account/ and /pricing/ link it),
   so public pages with PAYWALL=off are untouched. Mobile first: the base rules are the 390 px phone, min-width goes up.
   参考：refs/amie（窄版心、三层 6% 投影的白卡、12px 圆角按钮、灰色说明）、
         refs/aboard（浅灰白底、品牌淡色 --brand-soft、实心主按钮 + 淡色次按钮）。
   Colours come from style.css (--brand); inputs 16 px; primary buttons 48 px and full width on phones. */

/* ---------- buttons, fields ---------- */
.pbtn { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; padding: 0 20px; border: 0; border-radius: 12px; background: var(--brand); color: #fff; font: 600 16px/1.2 var(--font); text-align: center; cursor: pointer; transition: background-color .15s, transform .1s; }
.pbtn:hover { background: var(--brand-ink); }
.pbtn:active { transform: scale(.98); }
.pbtn:disabled { opacity: .6; cursor: default; transform: none; }
.pbtn--soft { background: var(--brand-soft); color: var(--brand); }
.pbtn--soft:hover { background: color-mix(in srgb, var(--brand) 16%, #fff); }
.pbtn--plain { background: #fff; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }
.pbtn--plain:hover { background: var(--bg-subtle); }
.gbtn { display: flex; align-items: center; justify-content: center; gap: 12px; width: 100%; min-height: 48px; border-radius: 12px; background: #fff; color: #1F1F1F; border: 1px solid #747775; font: 600 16px/1 var(--font); cursor: pointer; transition: background-color .15s, transform .1s; }
.gbtn:hover { background: #F7F8FA; }
.gbtn:active { transform: scale(.98); }
.gbtn svg { width: 20px; height: 20px; flex: none; }
.field { display: grid; gap: 6px; }
.field label { font-size: 14px; font-weight: 600; }
.field input { box-sizing: border-box; width: 100%; height: 48px; padding: 0 14px; border-radius: 12px; border: 1px solid var(--line-strong); background: #fff; color: var(--text); font: 400 16px var(--font); }
.field input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }
.field input.is-bad { border-color: #D92D20; box-shadow: 0 0 0 3px rgba(217,45,32,.12); }
.field__err { font-size: 14px; line-height: 1.45; color: #B42318; }
.or { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 13px; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fine { margin: 0; font-size: 13px; line-height: 1.5; color: var(--text-3); }
.fine a, .textlink { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.linkish { background: none; border: 0; padding: 0; font: inherit; color: var(--brand); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish:disabled { color: var(--text-3); text-decoration: none; cursor: default; }
.mtag { font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 13px; font-weight: 600; white-space: nowrap; }
.pill--ok { background: #E7F6EC; color: #157F3B; }
.pill--warn { background: #FFF4E0; color: #93500B; }
.alert { display: grid; grid-template-columns: 20px 1fr; gap: 10px; padding: 12px 14px; border-radius: 12px; background: #FEF3F2; color: #7A271A; font-size: 14px; line-height: 1.45; text-align: left; }
.alert svg { width: 20px; height: 20px; }
.alert--ok { background: #E7F6EC; color: #0E5E2C; }

/* ---------- nav: logo + site name + balance pill (+ "Clean a file" from 640 px; on phones the pill takes its place) ---------- */
@media (max-width: 639px) { [data-pw=on] .nav .acct + .btn { display: none; } }
[data-pw=on] .nav .logo { min-width: 0; }
[data-pw=on] .nav .logo span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-pw=on] .nav .acct { flex: none; }
@media (max-width: 399px) { [data-pw=on] .nav .logo { font-size: 14px; } }
[data-pw=on] .nav .acct { display: inline-flex; align-items: center; height: 36px; padding: 0 14px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); font-size: 14px; font-weight: 600; white-space: nowrap; margin-left: auto; transition: background-color .15s, transform .1s; }
[data-pw=on] .nav .acct:active { transform: scale(.97); }
[data-pw=on] .nav .acct--out { background: var(--bg-subtle); color: var(--text); box-shadow: inset 0 0 0 1px var(--line); }
[data-pw=on] .nav .acct[hidden] { display: none; }
[data-pw=on] .nav .acct + .btn { margin-left: 0; }
@media (min-width: 901px) { [data-pw=on] .nav .acct { margin-left: 0; } }

/* ---------- toast (payment received, signed in) ---------- */
.toast { position: fixed; z-index: 40; left: 16px; right: 16px; top: 68px; margin: 0 auto; max-width: 440px; display: grid; grid-template-columns: 24px 1fr; gap: 10px; align-items: center; padding: 14px 16px; border-radius: 14px; background: #fff; color: var(--text); box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1); font-size: 15px; font-weight: 600; animation: toast-in .25s ease-out; }
.toast i { width: 24px; height: 24px; border-radius: 999px; background: #16A34A; color: #fff; display: grid; place-items: center; }
.toast i svg { width: 14px; height: 14px; }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px); } }

/* ---------- standalone pages (sign-in link, payment still processing) ---------- */
.solo { min-height: 100vh; background: var(--bg-subtle); }
.solo__main { box-sizing: border-box; max-width: 480px; margin: 0 auto; padding: 32px 16px 64px; }
.sheet { background: #fff; border-radius: 16px; box-shadow: var(--shadow-card); padding: 24px 20px; display: grid; gap: 16px; text-align: center; }
.sheet h1 { margin: 0; font-size: 26px; line-height: 1.15; letter-spacing: -.02em; font-weight: 650; }
.sheet p { margin: 0; color: var(--text-2); line-height: 1.5; }
.sheet__icon { justify-self: center; width: 56px; height: 56px; border-radius: 999px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 24px; font-weight: 700; }
.sheet__icon svg { width: 28px; height: 28px; }
.sheet__icon--warn { background: #FFF4E0; color: #93500B; }
.sheet__actions { display: grid; gap: 8px; }
.spin { width: 24px; height: 24px; border-radius: 999px; border: 3px solid color-mix(in srgb, var(--brand) 20%, transparent); border-top-color: var(--brand); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spin, .toast { animation: none; } }

/* ---------- /account/ ---------- */
.acctpage { box-sizing: border-box; max-width: 480px; margin: 0 auto; padding: 24px 0 64px; }
.acctpage .sheet { text-align: left; }
.acctpage .sheet__head { display: grid; gap: 8px; text-align: center; }
.benefits { list-style: none; margin: 16px 0 0; padding: 16px; display: grid; gap: 10px; border-radius: 12px; background: var(--bg-subtle); }
.benefits li { display: grid; grid-template-columns: 20px 1fr; gap: 10px; color: var(--text-2); font-size: 15px; line-height: 1.45; }
.benefits svg { width: 20px; height: 20px; color: var(--brand); margin-top: 1px; }
.freeline { margin: 16px 0 0; text-align: center; font-size: 14px; color: var(--text-2); }
.sent { text-align: center; }
.sent .sheet__actions { margin-top: 4px; }
/* grouped lists (signed in) */
.gtitle { margin: 24px 4px 8px; font-family: var(--mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.gtitle:first-child { margin-top: 0; }
.glist { background: #fff; border-radius: 16px; box-shadow: var(--shadow-card); overflow: hidden; }
.gli { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 16px; font-size: 16px; color: var(--text); text-decoration: none; background: #fff; width: 100%; box-sizing: border-box; border: 0; font-family: inherit; text-align: left; }
.gli + .gli, .gbig + .gli { border-top: 1px solid var(--line); }
.gli__main { flex: 1; min-width: 0; }
.gli__main small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-3); }
.gli__val { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.gli__val small { display: block; font-weight: 400; font-size: 13px; color: var(--text-3); }
.gli__go { color: var(--text-3); display: grid; }
.gli--link { color: var(--brand); font-weight: 600; cursor: pointer; }
.gli--link:active, .gli--danger:active { background: var(--bg-subtle); }
.gli--danger { color: #B42318; font-weight: 600; cursor: pointer; }
.gli--back .gli__val { color: #157F3B; }
.gli__val--wrap { white-space: normal; overflow-wrap: anywhere; font-weight: 500; min-width: 0; }
.gli--fail .gli__val { color: #B42318; }
.gbig { display: grid; gap: 4px; padding: 20px 16px 16px; }
.gbig__num { font-size: 44px; line-height: 1; font-weight: 700; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.gbig__unit { color: var(--text-2); font-size: 15px; }
.meter { height: 6px; margin-top: 8px; border-radius: 999px; background: color-mix(in srgb, var(--brand) 15%, transparent); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 999px; background: var(--brand); }
.gnote { margin: 12px 4px 0; }
.gempty { padding: 16px; color: var(--text-3); font-size: 15px; }
.stickybar { position: sticky; bottom: 0; z-index: 5; margin: 24px -16px 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: rgba(255,255,255,.94); backdrop-filter: blur(12px); border-top: 1px solid var(--line); display: grid; gap: 8px; }
@media (min-width: 768px) {
  .acctpage { max-width: 560px; padding-top: 48px; }
  .sheet { padding: 32px; }
  .stickybar { position: static; margin: 24px 0 0; padding: 0; background: none; border: 0; backdrop-filter: none; }
}

/* ---------- plan picker (pricing page and the offer in the tool) ---------- */
.plist { display: grid; gap: 8px; margin: 0; padding: 0; }
.prow { display: grid; grid-template-columns: 22px 1fr auto; gap: 4px 12px; align-items: center; width: 100%; box-sizing: border-box; padding: 14px 16px; border: 0; border-radius: 14px; background: #fff; box-shadow: inset 0 0 0 1px var(--line-strong); font-family: inherit; text-align: left; color: var(--text); cursor: pointer; transition: box-shadow .15s, background-color .15s; }
.prow__dot { width: 20px; height: 20px; border-radius: 999px; box-shadow: inset 0 0 0 2px var(--line-strong); }
.prow__name { font-size: 16px; font-weight: 650; }
.prow__price { font-size: 17px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.prow__price small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.prow__facts { grid-column: 2 / 4; font-size: 14px; line-height: 1.4; color: var(--text-2); }
.prow__tag { grid-column: 2 / 4; justify-self: start; font-family: var(--mono); font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.prow--hi .prow__tag { color: var(--brand); }
.prow[aria-checked=true] { background: var(--brand-soft); box-shadow: inset 0 0 0 2px var(--brand); }
.prow[aria-checked=true] .prow__dot { box-shadow: inset 0 0 0 6px var(--brand); background: #fff; }
.payarea { display: grid; gap: 8px; }
.payarea__note { text-align: center; }
.payerr { margin: 0; }

/* ---------- /pricing/ ---------- */
.pricing { box-sizing: border-box; max-width: 560px; margin: 0 auto; padding: 24px 0 0; }
.pricing h1 { margin: 0; font-size: 32px; line-height: 1.1; letter-spacing: -.02em; font-weight: 650; }
.pricing h1 span { color: var(--text-3); }
.pricing__lead { margin: 12px 0 0; color: var(--text-2); font-size: 16px; line-height: 1.5; }
.freeband { display: flex; align-items: center; gap: 12px; margin: 16px 0 16px; padding: 12px 16px; border-radius: 14px; background: var(--bg-subtle); font-size: 15px; color: var(--text-2); }
.freeband b { color: var(--text); }
.freeband a { margin-left: auto; white-space: nowrap; color: var(--brand); font-weight: 600; min-height: 44px; display: inline-flex; align-items: center; }
.pricing .stickybar { gap: 8px; }
.pricing__fine { margin-top: 12px; }
@media (min-width: 768px) {
  .pricing { padding-top: 56px; }
  .pricing h1 { font-size: 44px; }
}

/* ---------- the tool (paid parts) ---------- */
.where__price { max-width: 560px; margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.where__price a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px; vertical-align: middle; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; }
body[data-preview] [data-dl], body[data-preview] [data-mailme=now], body[data-preview] #srvMeta, body[data-preview] .srvres .dl, body[data-preview] .mobilebar, body[data-preview] .only-server-result.lead { display: none !important; }
.srvres__ab { display: flex; justify-content: center; margin-top: 12px; }
/* "process the whole file?" (signed in, before the run) */
.pwbox { margin-top: 16px; padding: 20px; text-align: left; display: grid; gap: 12px; }
.pwbox__title { margin: 0; font-size: 18px; font-weight: 650; }
.pwbox__text { margin: 0; color: var(--text-2); }
/* the offer after a free preview: a bottom sheet on phones, a card next to the result from 768 px */
.pwsheet { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto; overscroll-behavior: contain; padding: 8px 16px calc(16px + env(safe-area-inset-bottom)); background: #fff; border-radius: 20px 20px 0 0; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 -10px 30px -12px rgba(0,0,0,.15); display: grid; gap: 12px; text-align: left; }
.pwsheet__grip { justify-self: center; width: 36px; height: 4px; border-radius: 999px; background: rgba(0,0,0,.15); margin-bottom: 4px; }
.pwsheet__title { margin: 0; font-size: 18px; font-weight: 650; letter-spacing: -.01em; }
.pwsheet__text { margin: 0; color: var(--text-2); font-size: 15px; line-height: 1.45; }
.pwsheet__body { display: grid; gap: 12px; }
.pwsheet:not(.is-open) .pwsheet__body { display: none; }
.pwsheet:not(.is-open) .pwsheet__close { display: none; }
.pwsheet.is-open .pwsheet__more { display: none; }
.pwsheet__close { justify-self: end; margin-top: -4px; }
body.has-sheet { padding-bottom: 220px; }
@media (min-width: 768px) {
  .pwsheet { position: static; max-height: none; overflow: visible; margin-top: 16px; padding: 24px; border-radius: 16px; box-shadow: var(--shadow-card); }
  .pwsheet__grip, .pwsheet__more, .pwsheet__close { display: none !important; }
  .pwsheet .pwsheet__body { display: grid !important; }
  body.has-sheet { padding-bottom: 0; }
}
/* email me when it's done (cloud, waiting or processing) */
[data-pw=on] [data-mailme=later] { background: var(--brand-soft); box-shadow: none; padding: 20px; }
[data-pw=on] [data-mailme=later] .mailme__title { font-size: 18px; font-weight: 650; }
[data-pw=on] [data-mailme=later] .mailme__row { display: grid; gap: 8px; }
[data-pw=on] [data-mailme=later] .mailme__row input { height: 48px; font-size: 16px; }
[data-pw=on] [data-mailme=later] .mailme__row .btn { height: 48px; width: 100%; }
.buybox { display: grid; gap: 12px; margin-top: 12px; }
.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; }
