/* Pricing, purchases, checkout result and legal pages. Loaded after graphite.css; uses its tokens. */
[data-surface=production] [data-dev-hide] { display: none !important; }
html[lang=en] [data-lang=zh], html:not([lang=en]) [data-lang=en] { display: none !important; }

.commerce-page main { max-width: 1240px; padding: 24px var(--gutter) 64px; }
.commerce-page .site-header .main-nav a[aria-current=page] { color: var(--ink); text-decoration: underline; text-underline-offset: 8px; text-decoration-thickness: 1px; }
.commerce-page .main-nav a { color: var(--muted); }
.commerce-page .main-nav a:hover { color: var(--ink); }
.commerce-page .site-menu summary span { background: var(--ink); }
.commerce-page .site-menu nav { background: var(--panel); border-color: var(--line); }
.commerce-page .header-link { font-size: 14px; color: var(--muted); text-decoration: none; }
.commerce-page .header-link:hover { color: var(--ink); }
.commerce-page .language { color: var(--muted); background: none; border: 0; cursor: pointer; }

.commerce-hero { padding: 56px 0 44px; text-align: center; }
.commerce-hero .eyebrow { color: var(--faint); font-size: 12px; letter-spacing: 1.6px; }
.commerce-hero h1 { font-size: clamp(36px, 4.4vw, 58px); line-height: 1.18; letter-spacing: -2px; font-weight: 750; margin: 18px auto 18px; max-width: 16ch; }
.commerce-hero p { color: var(--muted); font-size: 17px; line-height: 1.8; max-width: 560px; margin: 0 auto; }

.price-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: stretch; }
.price-card { position: relative; display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 32px 28px 28px; }
.price-card.featured { border-color: var(--accent); background: linear-gradient(180deg, #232830 0%, var(--panel) 46%); }
.price-badge { position: absolute; top: -12px; left: 28px; background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 700; letter-spacing: .6px; padding: 5px 10px; border-radius: 20px; }
.price-card h2 { font-size: 20px; font-weight: 650; margin: 0; }
.price-card .tagline { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 8px 0 0; min-height: 48px; }
.price { display: flex; align-items: baseline; gap: 8px; margin: 22px 0 24px; }
.price strong { font-size: 46px; font-weight: 750; letter-spacing: -1.5px; color: var(--ink); }
.price span { color: var(--muted); font-size: 14px; }
.price-card ul { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 12px; }
.price-card li { position: relative; padding-left: 26px; color: var(--ink); font-size: 14px; line-height: 1.6; }
.price-card li::before { content: ""; position: absolute; left: 2px; top: 6px; width: 11px; height: 6px; border-left: 1.5px solid var(--good); border-bottom: 1.5px solid var(--good); transform: rotate(-45deg); }
.price-card li.no { color: var(--muted); }
.price-card li.no::before { border: 0; width: 10px; height: 1.5px; top: 10px; background: var(--faint); transform: none; }
.price-card .billing-button, .price-card .ghost-button { margin-top: auto; width: 100%; min-height: 50px; font-size: 15px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; cursor: pointer; }
.ghost-button { background: transparent; color: var(--ink); border: 1px solid var(--control); border-radius: 4px; padding: 0 18px; min-height: 46px; font-size: 14px; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.ghost-button:hover:not(:disabled) { border-color: var(--accent); }
.billing-button:disabled, .ghost-button:disabled { opacity: .55; cursor: not-allowed; }
.price-note { color: var(--faint); font-size: 13px; line-height: 1.8; text-align: center; margin: 26px auto 0; max-width: 720px; }
.price-note a, .commerce-page .inline-link { color: var(--ink); text-decoration: underline; text-underline-offset: 4px; }

.commerce-status { min-height: 24px; margin: 14px 0 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.commerce-status.error { color: var(--danger); }
.commerce-status.good { color: var(--good); }

.restore-strip { margin: 56px 0 0; padding: 26px 30px; border: 1px solid var(--line); border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: 24px; background: var(--panel); }
.restore-strip p { margin: 0; color: var(--muted); font-size: 15px; line-height: 1.7; }
.restore-strip strong { color: var(--ink); font-weight: 600; }

.commerce-faq { display: grid; grid-template-columns: 1fr 1.5fr; gap: 72px; padding: 88px 0 24px; }
.commerce-faq h2 { font-size: 34px; line-height: 1.35; letter-spacing: -1px; margin: 0; }
.commerce-faq details { border-bottom: 1px solid var(--line); }
.commerce-faq summary { cursor: pointer; list-style: none; padding: 22px 0; font-size: 16px; display: flex; justify-content: space-between; gap: 18px; }
.commerce-faq summary::-webkit-details-marker { display: none; }
.commerce-faq summary::after { content: "+"; color: var(--muted); }
.commerce-faq details[open] summary::after { content: "–"; }
.commerce-faq details p { color: var(--muted); font-size: 14px; line-height: 1.9; margin: 0 0 22px; }

/* Purchases and checkout result */
.panel-stack { display: grid; gap: 20px; max-width: 760px; margin: 0 auto; }
.commerce-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 30px; }
.commerce-panel h2 { font-size: 20px; font-weight: 650; margin: 0 0 6px; }
.commerce-panel > p { color: var(--muted); font-size: 14px; line-height: 1.8; margin: 6px 0 0; }
.plan-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: 5px; overflow: hidden; margin: 22px 0; }
.plan-summary > div { background: var(--page); padding: 18px 20px; }
.plan-summary dt { color: var(--faint); font-size: 12px; letter-spacing: .4px; }
.plan-summary dd { margin: 6px 0 0; font-size: 18px; font-weight: 600; color: var(--ink); }
.panel-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 20px; }
.panel-actions .billing-button { min-height: 46px; padding: 0 22px; display: inline-flex; align-items: center; text-decoration: none; font-size: 14px; }
.commerce-form { display: grid; gap: 14px; margin-top: 20px; }
.commerce-form label { display: grid; gap: 8px; font-size: 13px; color: var(--muted); }
.commerce-form input { background: var(--page); color: var(--ink); border: 1px solid var(--control); border-radius: 4px; min-height: 48px; padding: 0 14px; font-size: 15px; }
.commerce-form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.commerce-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.commerce-form button { justify-self: start; min-height: 46px; padding: 0 24px; font-size: 14px; }
.hint { color: var(--faint); font-size: 13px; line-height: 1.7; }
.order-code { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 18px; padding: 14px 16px; border: 1px dashed var(--control); border-radius: 5px; }
.order-code code { font-size: 14px; color: var(--ink); word-break: break-all; }
.success-mark { width: 52px; height: 52px; border-radius: 50%; border: 1.5px solid var(--good); display: grid; place-items: center; margin-bottom: 20px; }
.success-mark::before { content: ""; width: 18px; height: 9px; border-left: 2px solid var(--good); border-bottom: 2px solid var(--good); transform: rotate(-45deg) translate(2px, -2px); }
.commerce-page [hidden] { display: none !important; }

/* Legal pages reuse .support-* from platinum/graphite; keep long text readable on graphite. */
.legal-article h2 { color: var(--ink); }
.legal-article p, .legal-article li { color: var(--muted); }
.legal-article strong { color: var(--ink); font-weight: 600; }
.legal-updated { color: var(--faint); font-size: 13px; margin-top: 14px; }
.commerce-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 28px; border-top: 1px solid var(--line); margin-top: 72px; padding: 28px 0 0; color: var(--faint); font-size: 13px; }
.commerce-footer nav { display: flex; flex-wrap: wrap; gap: 20px; }
.commerce-footer a { color: var(--muted); text-decoration: none; }
.commerce-footer a:hover { color: var(--ink); }

/* Workbench purchase panel (export locked) */
.export-credit-note .buy-row { display: grid; gap: 10px; margin-top: 14px; }
.export-credit-note .buy-option { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 10px 16px; text-align: left; border-radius: 4px; cursor: pointer; font-size: 14px; }
.export-credit-note .buy-option small { display: block; font-size: 12px; font-weight: 400; opacity: .75; margin-top: 2px; }
.export-credit-note .buy-option b { font-size: 15px; white-space: nowrap; }
.export-credit-note .buy-links { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 12px; font-size: 13px; }
.export-credit-note .buy-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }

@media (max-width: 900px) {
  .price-grid { grid-template-columns: 1fr; max-width: 520px; margin: 0 auto; gap: 26px; }
  .price-card .tagline { min-height: 0; }
  .commerce-faq { grid-template-columns: 1fr; gap: 24px; padding-top: 64px; }
}
@media (max-width: 760px) {
  .commerce-page main { padding: 12px 20px 40px; }
  .commerce-hero { padding: 30px 0 30px; }
  .commerce-hero h1 { font-size: 31px; letter-spacing: -1px; max-width: none; }
  .commerce-hero p { font-size: 15px; }
  .price-card { padding: 28px 22px 22px; }
  .price strong { font-size: 40px; }
  .restore-strip { flex-direction: column; align-items: stretch; padding: 22px; }
  .commerce-faq h2 { font-size: 26px; }
  .commerce-panel { padding: 22px 18px; }
  .plan-summary { grid-template-columns: 1fr; }
  .commerce-form .form-row { grid-template-columns: 1fr; }
  .commerce-form button, .panel-actions .billing-button, .panel-actions .ghost-button { width: 100%; justify-content: center; }
  .commerce-page .header-link.optional { display: none; }
  .commerce-page .site-header .header-cta { display: none; }
  .commerce-page .header-right { gap: 14px; }
}
.legal-article p + p { margin-top: 14px; }

/* Homepage proof hero: actual conversion, 4x crop, draggable divider. */
.proof-title { white-space: normal !important; font-size: clamp(44px, 4.4vw, 70px) !important; letter-spacing: -2px !important; line-height: 1.08 !important; }
.proof-title .h1-main { display: block; }
.proof-title .h1-sub { display: block; margin-top: 18px; font-size: .4em; line-height: 1.35; letter-spacing: -.3px; font-weight: 600; color: var(--ink); max-width: 18em; }
.landing .hero-description { max-width: 30em; }
.proof-hero { margin: 0; align-self: center; min-width: 0; padding-left: clamp(0px, 3vw, 48px); }
.proof-stage { --split: 49%; position: relative; aspect-ratio: 1 / 1; width: 100%; max-height: min(640px, calc(100vh - 220px)); max-width: min(640px, calc(100vh - 220px)); margin-left: auto; overflow: hidden; border-radius: 6px; border: 1px solid var(--line); background: #fbf3e6; touch-action: pan-y; user-select: none; }
.proof-layer { position: absolute; inset: 0; overflow: hidden; }
.proof-layer img { position: absolute; display: block; max-width: none; width: 384.6%; height: 384.6%; left: -230.8%; top: -113.5%; }
.proof-raster img { image-rendering: pixelated; }
.proof-vector { clip-path: inset(0 0 0 var(--split)); }
.proof-divider { position: absolute; top: 0; bottom: 0; left: var(--split); width: 2px; margin-left: -1px; background: #14171b; box-shadow: 0 0 0 1px #ffffff99; pointer-events: none; z-index: 3; }
.proof-divider span { position: absolute; top: 50%; left: 50%; width: 40px; height: 40px; transform: translate(-50%, -50%); border-radius: 50%; background: #14171b; border: 1.5px solid #e7e9ed; display: grid; place-items: center; }
.proof-divider svg { width: 18px; height: 18px; fill: none; stroke: #e7e9ed; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.proof-tag { position: absolute; z-index: 4; top: 14px; padding: 6px 10px; border-radius: 4px; background: #14171bd9; color: #e7e9ed; font-size: 12px; line-height: 1.3; letter-spacing: .2px; pointer-events: none; }
.proof-tag-raster { left: 14px; }
.proof-tag-vector { right: 14px; }
.proof-map { position: absolute; z-index: 4; right: 14px; bottom: 14px; width: 88px; height: 88px; border-radius: 4px; overflow: hidden; border: 1px solid #ffffffb3; box-shadow: 0 6px 18px #0006; pointer-events: none; }
.proof-map img { width: 100%; height: 100%; display: block; }
.proof-map i { position: absolute; left: 60%; top: 29.5%; width: 26%; height: 26%; border: 1.5px solid #14171b; box-shadow: 0 0 0 1px #fff; }
.proof-range { position: absolute; inset: 0; z-index: 5; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.proof-range:focus-visible + * , .proof-stage:has(.proof-range:focus-visible) { outline: 2px solid var(--accent); outline-offset: 3px; }
.proof-caption { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 14px; color: var(--muted); font-size: 13px; max-width: min(640px, calc(100vh - 220px)); margin-left: auto; }
.proof-caption .text-link { color: var(--ink); background: none; border: 0; padding: 6px 0; font-size: 13px; cursor: pointer; text-decoration: underline; text-underline-offset: 4px; }
@media (max-width: 760px) {
  .proof-title { font-size: 44px !important; letter-spacing: -1.5px !important; }
  .proof-title .h1-sub { font-size: 19px; margin-top: 14px; }
  .proof-hero { padding: 0; margin-top: 30px; width: 100%; }
  .proof-stage, .proof-caption { max-width: none; max-height: none; }
  .proof-tag { top: 10px; font-size: 11px; padding: 5px 8px; }
  .proof-tag-raster { left: 10px; } .proof-tag-vector { right: 10px; }
  .proof-map { width: 64px; height: 64px; right: 10px; bottom: 10px; }
  .proof-caption { font-size: 12px; }
}
