/* The purchase page: the home page's tokens; one column, grouped like Settings. */
:root {
  --bg: #F5F5F7; --card: #FFFFFF; --label: #1D1D1F; --secondary: #6E6E73; --separator: rgba(0, 0, 0, .1);
  --fill: rgba(118, 118, 128, .12); --accent: #0071E3; --accent-text: #0066CC; --bar: rgba(245, 245, 247, .8);
  --red: #D70015; --green: #248A3D;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #000000; --card: #1C1C1E; --label: #F5F5F7; --secondary: #98989D; --separator: rgba(255, 255, 255, .14);
          --fill: rgba(118, 118, 128, .24); --accent: #0A84FF; --accent-text: #2997FF; --bar: rgba(0, 0, 0, .72);
          --red: #FF6961; --green: #30D158; }
}
@media (prefers-contrast: more) { :root { --secondary: #3A3A3C; --separator: rgba(0, 0, 0, .35); } }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100dvh; display: flex; flex-direction: column; background: var(--bg); color: var(--label);
  font: 1.0625rem/1.47 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  letter-spacing: -.022em; -webkit-font-smoothing: antialiased;
}
a { color: var(--accent-text); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.wrap { width: min(640px, 100% - 32px); margin: 0 auto; }

.nav { position: sticky; top: 0; z-index: 10; height: 52px; background: var(--bar);
  -webkit-backdrop-filter: saturate(180%) blur(20px); backdrop-filter: saturate(180%) blur(20px); border-bottom: .5px solid var(--separator); }
.nav .wrap { height: 100%; display: flex; align-items: center; justify-content: space-between; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--label); text-decoration: none; }
.brand img { width: 26px; height: 26px; border-radius: 6px; }
@media (prefers-reduced-transparency: reduce) { .nav { background: var(--bg); -webkit-backdrop-filter: none; backdrop-filter: none; } }

main { flex: 1; padding: 44px 0 56px; }
h1 { font-size: clamp(2rem, 6vw, 2.75rem); line-height: 1.08; letter-spacing: -.03em; margin: 0; }
.lead { color: var(--secondary); font-size: 1.1875rem; margin: 8px 0 0; }

.group { margin-top: 36px; }
.group h2 { font-size: 1.1875rem; letter-spacing: -.02em; margin: 0 0 10px; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.group-head h2 { margin: 0; }
.card { background: var(--card); border-radius: 14px; padding: 18px 20px; }
.card p { margin: 0 0 14px; color: var(--secondary); }
.hint { color: var(--secondary); font-size: .875rem; margin: 10px 4px 0; }

.account { display: flex; align-items: center; gap: 14px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--fill); object-fit: cover; flex: none; }
.who { flex: 1; min-width: 0; }
.name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.email { color: var(--secondary); font-size: .9375rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Choices: an inset grouped list of radio rows. */
.choices { background: var(--card); border-radius: 14px; overflow: hidden; }
.choice {
  width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; font: inherit; color: inherit;
  background: none; border: 0; padding: 14px 20px 14px 52px; min-height: 64px; position: relative; cursor: pointer;
}
.choice + .choice { border-top: .5px solid var(--separator); }
.choice::before { content: ""; position: absolute; left: 18px; top: 50%; width: 20px; height: 20px; margin-top: -10px;
  border-radius: 50%; border: 1.5px solid var(--secondary); transition: border-color .15s, border-width .15s; }
.choice[aria-checked="true"]::before { border: 6px solid var(--accent); }
.choice:hover { background: var(--fill); }
.choice:active { background: var(--fill); }
.choice-main { flex: 1; min-width: 0; display: grid; gap: 2px; }
.choice-title { font-weight: 600; }
.choice-detail { color: var(--secondary); font-size: .9375rem; line-height: 1.35; }
.choice-price { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.choice-price small { color: var(--secondary); font-weight: 400; font-size: .875rem; margin-left: 2px; }

.segmented { display: inline-grid; grid-auto-flow: column; padding: 2px; border-radius: 9px; background: var(--fill); }
.segmented button { font: inherit; font-size: .875rem; font-weight: 500; color: var(--label); background: transparent; border: 0;
  min-height: 32px; padding: 0 16px; border-radius: 7px; cursor: pointer; }
.segmented button[aria-checked="true"] { background: var(--card); box-shadow: 0 3px 8px rgba(0, 0, 0, .12), 0 3px 1px rgba(0, 0, 0, .04); }
@media (prefers-color-scheme: dark) { .segmented button[aria-checked="true"] { background: #636366; } }

.notice ul { background: var(--card); border-radius: 14px; margin: 0; padding: 16px 20px 16px 38px; display: grid; gap: 6px; }
.check { display: flex; gap: 10px; align-items: flex-start; margin: 12px 4px 0; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }

.summary { margin: 0; display: grid; gap: 10px; }
.summary div { display: flex; justify-content: space-between; gap: 16px; }
.summary dt { color: var(--secondary); }
.summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary .total { border-top: .5px solid var(--separator); padding-top: 12px; font-weight: 600; }
.summary .total dt { color: var(--label); }
.summary .total dd { font-size: 1.25rem; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 50px; padding: 0 24px;
  border: 0; border-radius: 980px; font: inherit; font-weight: 500; text-decoration: none; cursor: pointer;
  transition: transform 100ms ease-out, opacity 100ms;
}
.button:active { transform: scale(.97); }
.button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.button svg { width: 18px; height: 18px; }
.prominent { background: var(--accent); color: #fff; }
.tinted { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent-text); }
.wide { width: 100%; margin-top: 28px; }
.link-button { font: inherit; font-size: .9375rem; color: var(--accent-text); background: none; border: 0; padding: 8px 0; cursor: pointer; }

.error { margin-top: 24px; padding: 12px 16px; border-radius: 12px; color: var(--red); background: color-mix(in srgb, var(--red) 10%, transparent); }
.fine { color: var(--secondary); font-size: .8125rem; text-align: center; margin: 14px 8px 0; line-height: 1.5; }

.done { text-align: center; padding-top: 12vh; }
.done-icon { width: 72px; height: 72px; margin-bottom: 18px; }
.done-icon circle { fill: color-mix(in srgb, var(--green) 14%, transparent); }
.done-icon path { fill: none; stroke: var(--green); stroke-width: 4.5; stroke-linecap: round; stroke-linejoin: round; }
.done .lead { max-width: 420px; margin: 10px auto 28px; }

footer { border-top: .5px solid var(--separator); padding: 24px 0 36px; font-size: .8125rem; }
.foot-links { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 0; padding: 0; list-style: none; }
.foot-links a { color: var(--label); text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) { .button, .choice::before { transition: none; } }

/* Current plan, upgrades, turning Autopay off. */
.current-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.current-name { font-size: 1.375rem; font-weight: 700; letter-spacing: -.022em; }
.current-detail { color: var(--secondary); font-size: .9375rem; margin-top: 2px; }
.current-note { margin: 12px 0 0 !important; color: var(--secondary); font-size: .9375rem; }
.badge { font-size: .8125rem; font-weight: 600; padding: 3px 10px; border-radius: 980px; white-space: nowrap;
  background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }
.badge.off { background: var(--fill); color: var(--secondary); }
h2.sub { font-size: 1.0625rem; margin: 24px 0 10px; }
.choice .action { font-weight: 600; color: var(--accent-text); white-space: nowrap; }
.destructive { background: transparent; color: var(--red); border: 1px solid color-mix(in srgb, var(--red) 40%, transparent); }
.destructive-fill { background: var(--red); color: #fff; }
.link-button.inline { padding: 0; font-size: inherit; }

dialog.sheet { border: 0; border-radius: 18px; padding: 24px; width: min(420px, calc(100% - 32px)); background: var(--card); color: var(--label);
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .4); }
dialog.sheet h2 { margin: 0 0 8px; font-size: 1.25rem; }
dialog.sheet p { margin: 0; color: var(--secondary); }
.sheet-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; flex-wrap: wrap; }
.sheet-actions .button { min-height: 44px; }
@media (max-width: 480px) { .sheet-actions .button { flex: 1; } }
.link-button.danger { color: var(--red); margin-top: 8px; padding: 6px 0; }
