/* Pro paywall (/pro) and account (/account). Tokens come from style.css. */
:root {
  --raspberry: #C2185B;
  --coral: #FF6F61;
  --plum: #3B1E3F;
  --star: #F5A623;
  --card-radius: 24px;
  --surface-glass: color-mix(in srgb, var(--surface) 82%, transparent);
  --font-round: var(--font-head);
}
@media (prefers-color-scheme: dark) {
  :root { --raspberry: #FF7AA8; --plum: #2A1630; }
}

/* The page scrolls normally (the guest page's body is a full-height flex column). */
body.page-pro, body.page-account { display: block; min-height: 100vh; }
body.page-pro {
  background:
    radial-gradient(900px 520px at 100% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%),
    radial-gradient(700px 480px at -10% 20%, color-mix(in srgb, var(--raspberry) 9%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
.topbar.wide { max-width: 1040px; }
.wordmark { display: inline-flex; text-decoration: none; color: inherit; }
.nav-link {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 0;
  background: var(--surface-glass); color: var(--ink); font: 600 15px/1 var(--font-round); text-decoration: none; cursor: pointer;
  box-shadow: 0 0 0 1px var(--line);
}

main.pro, main.account { display: block; max-width: 1040px; width: 100%; margin: 0 auto; padding: 4px var(--gutter) 24px; }

.banner {
  margin: 4px 0 12px; padding: 12px 16px; border-radius: 16px; font-size: 15px; font-weight: 600; line-height: 1.4;
  background: color-mix(in srgb, var(--done) 14%, var(--surface)); color: var(--ink);
}
.banner[data-kind="cancel"] { background: var(--surface-2); color: var(--ink-2); }
.banner[data-kind="error"] { background: color-mix(in srgb, var(--nope) 14%, var(--surface)); }

.pro-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
@media (min-width: 900px) {
  .pro-grid { grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr); gap: 48px; align-items: start; }
  .pro-buy { position: sticky; top: 16px; padding-top: 40px; }
}

/* Hero: a sample Pro card, two jelly dishes behind it, the mascot in front. Calm motion only. */
.hero { position: relative; height: 262px; margin: 4px auto 8px; max-width: 420px; }
.hero > * { position: absolute; left: 50%; top: 50%; }
.dish { width: var(--w); height: var(--w); object-fit: cover; object-position: 50% 55%; }
.dish-a { --w: 108px; transform: translate(calc(-50% - 126px), calc(-50% - 44px)); animation: bob 7s ease-in-out infinite alternate; }
.dish-b { --w: 104px; transform: translate(calc(-50% + 118px), calc(-50% - 62px)); animation: bob 7s ease-in-out -3.5s infinite alternate; }
.pro-card {
  width: 150px; height: 222px; border-radius: var(--card-radius); overflow: hidden;
  transform: translate(calc(-50% - 26px), -50%) rotate(-4deg);
  box-shadow: 0 0 0 2.5px rgba(255, 255, 255, 0.8), 0 12px 36px color-mix(in srgb, var(--raspberry) 22%, transparent);
  animation: drift 9s ease-in-out infinite alternate;
}
.pro-card > img { width: 100%; height: 100%; object-fit: cover; transform: translateY(-18px) scale(1.08); display: block; }
.pro-tag {
  position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 999px;
  background: linear-gradient(180deg, var(--coral), var(--raspberry)); color: #fff; font: 800 12px/1 var(--font-round); letter-spacing: .04em;
}
.pro-card-panel {
  position: absolute; left: 7px; right: 7px; bottom: 7px; padding: 9px 10px; border-radius: 14px;
  background: rgba(255, 255, 255, 0.92); display: grid; gap: 5px; font-family: var(--font-round);
}
.pro-card-panel .pick { display: flex; align-items: center; gap: 4px; color: #C2185B; font-size: 10.5px; font-weight: 700; white-space: nowrap; }
.pro-card-panel .meta { display: flex; align-items: center; gap: 4px; color: #6B5A70; font-size: 11px; font-weight: 600; white-space: nowrap; }
.pro-card-panel .meta b { color: #3B1E3F; }
.pro-card-panel svg { width: 11px; height: 11px; flex: none; fill: currentColor; }
.pro-card-panel .meta svg { fill: var(--star); }
.mascot { width: 104px; height: auto; transform: translate(calc(-50% + 116px), calc(-50% + 88px)); }
@keyframes bob { to { translate: 0 -4px; } }
@keyframes drift { to { translate: 0 -2px; } }
@media (prefers-reduced-motion: reduce) { .dish, .pro-card { animation: none; } }
@media (max-width: 360px) { .hero { transform: scale(.88); transform-origin: 50% 50%; } }

.pro-story h1 { margin-top: 6px; }
.pro-story .lede { margin-bottom: 20px; }

.features {
  list-style: none; margin: 0; padding: 18px; border-radius: 24px; display: grid; gap: 16px;
  background: var(--surface-glass); box-shadow: 0 0 0 1px var(--line), var(--shadow);
  -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px);
}
.features li { display: flex; gap: 12px; align-items: flex-start; }
.features img { width: 44px; height: 44px; object-fit: contain; flex: none; }
.features strong { display: block; font: 700 17px/1.25 var(--font-round); letter-spacing: -0.01em; }
.features span { display: block; color: var(--ink-2); font-size: 15px; line-height: 1.4; margin-top: 2px; }
.features .credit { margin: -10px 0 0 56px; font-size: 12px; color: var(--ink-3); }

/* Plans */
.plans { display: grid; gap: 12px; }
.plan {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px; border-radius: 20px; text-align: left; cursor: pointer;
  border: 0; background: var(--surface); box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s ease, background .2s ease;
}
.plan[aria-checked="true"] { background: color-mix(in srgb, var(--accent) 10%, var(--surface)); box-shadow: 0 0 0 1.5px var(--accent); }
.plan .radio { width: 24px; height: 24px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 2px var(--ink-3); display: grid; place-items: center; }
.plan[aria-checked="true"] .radio { box-shadow: none; background: var(--accent); }
.plan[aria-checked="true"] .radio::after { content: ""; width: 10px; height: 6px; border: solid #fff; border-width: 0 0 2.5px 2.5px; transform: translateY(-1px) rotate(-45deg); }
.plan-text { display: grid; gap: 2px; min-width: 0; }
.plan-title { display: flex; align-items: center; gap: 8px; font: 700 17px/1.25 var(--font-round); }
.plan-detail { color: var(--ink-2); font-size: 15px; }
.badge { padding: 3px 8px; border-radius: 999px; background: #D2401F; color: #fff; font: 800 11px/1.2 var(--font-round); letter-spacing: .02em; }

.buy-bar { margin-top: 16px; display: grid; gap: 10px; text-align: center; }
.trial-line { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink-2); line-height: 1.4; }
.btn-cta { min-height: 56px; font: 800 18px/1 var(--font-round); box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn[aria-busy="true"]::before {
  content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255,255,255,.45); border-top-color: #fff; animation: spin .8s linear infinite;
}
.buy-bar .error, .status-card .error { margin: 0; }
/* Phones: the button stays in reach at the bottom, like the app's purchase bar. */
@media (max-width: 899px) {
  body.page-pro:not([data-state="pro"]) main.pro { padding-bottom: calc(150px + env(safe-area-inset-bottom)); }
  .buy-bar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; margin: 0;
    padding: 12px max(var(--gutter), calc((100vw - 480px) / 2)) calc(12px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--bg) 86%, transparent); -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    box-shadow: 0 -1px 0 var(--line);
  }
}

.status-card {
  padding: 18px; border-radius: 22px; display: grid; gap: 12px;
  background: var(--surface-glass); box-shadow: 0 0 0 1px var(--line), var(--shadow);
}
.status-line { display: flex; gap: 10px; align-items: center; margin: 0; font: 700 17px/1.3 var(--font-round); }
.status-line svg { width: 26px; height: 26px; flex: none; fill: var(--accent); }
.status-line .tick { fill: none; stroke: #fff; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.status-note { margin: 0; color: var(--ink-2); font-size: 14px; line-height: 1.45; }

.legal-fine { font-size: 12px; margin-top: 16px; }
.legal-links { display: flex; gap: 8px; justify-content: center; font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }
.legal-links a { color: var(--ink-2); font-weight: 600; text-decoration: none; }

body[data-state="loading"] .pro-buy { opacity: .6; pointer-events: none; }

/* Sign-in sheet */
.sheet {
  width: min(440px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); border: 0; border-radius: 28px; padding: 28px 22px 22px;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
}
.sheet::backdrop { background: rgba(15, 12, 18, 0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
@media (max-width: 520px) {
  .sheet { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 28px 28px 0 0; padding-bottom: calc(22px + env(safe-area-inset-bottom)); }
}
.sheet-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0; cursor: pointer;
  background: var(--surface-2); display: grid; place-items: center;
}
.sheet-close svg { width: 18px; height: 18px; stroke: var(--ink-2); stroke-width: 2.4; stroke-linecap: round; fill: none; }
.signin { display: grid; gap: 4px; }
.signin-title { margin: 0 44px 6px 0; }
.signin-lede { margin: 0 0 14px; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.signin .btn-ghost { margin-top: 2px; }

/* Account page */
main.account { max-width: 560px; }
.account h1 { margin: 12px 0 18px; }
.account-card { padding: 4px 18px; border-radius: 22px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.account-row { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; font-size: 16px; }
.account-row + .account-row { border-top: 1px solid var(--line); }
.account-row dt { color: var(--ink-2); flex: none; }
.account-row dd { margin: 0; text-align: right; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.account-actions { display: grid; gap: 10px; margin-top: 18px; }
.account .signin-wrap { padding: 22px 18px; border-radius: 22px; background: var(--surface); box-shadow: 0 0 0 1px var(--line), var(--shadow); }

/* Delete account (/account) */
.delete-zone { margin-top: 36px; padding-top: 20px; border-top: 1px solid var(--line); }
.delete-zone h2 { font-size: 20px; margin: 0 0 6px; }
.delete-zone .fine { text-align: left; margin: 0 0 12px; }
.btn.danger { color: #B42318; }
.btn.danger-fill { background: #B42318; box-shadow: none; }
.confirm-dialog { width: min(440px, calc(100% - 32px)); padding: 22px 22px 18px; border: 1px solid var(--line); border-radius: 26px;
  background: var(--surface-solid); color: var(--ink); box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(20, 12, 16, .45); }
.confirm-dialog h2 { font-size: 22px; margin: 0 0 8px; }
.confirm-dialog p { color: var(--ink-2); line-height: 1.5; margin: 0 0 10px; }
.confirm-actions { display: grid; gap: 10px; margin-top: 14px; }
@media (min-width: 520px) { .confirm-actions { grid-template-columns: 1fr 1fr; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn.danger { color: #FF9C8F; } }
