/* [r51 Web checkout] + [r51 Account] scrimpl.com/upgrade and /account, on top of site.css (its tokens, nav, buttons,
   cards and type): the site's warm paper, white hairline cards, Geist, ink text and the pink action colour. Light only,
   like the site. Phones first: one column, 16 px gutters; two columns from 900 px. */

.w-page { min-height: 100vh; display: flex; flex-direction: column; }
.w-main { flex: 1 0 auto; padding: calc(var(--nav-h) + 40px) 0 72px; }
.w-wrap { max-width: 1080px; }
.w-narrow { max-width: 560px; }
.w-h1 { font-size: clamp(30px, 3.2vw, 42px); line-height: 1.08; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); text-wrap: balance; }
.w-lede { margin-top: 10px; font-size: 17px; line-height: 1.5; color: var(--body); max-width: 620px; }
.w-back { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; margin-bottom: 14px; font-size: 14.5px; font-weight: 500; color: var(--muted); transition: color var(--ease); }
.w-back:hover { color: var(--ink); }
.w-back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.w-h2 { font-size: 19px; line-height: 1.3; font-weight: 600; letter-spacing: -0.015em; color: var(--ink); }
.w-h3 { font-size: 15px; line-height: 1.35; font-weight: 600; color: var(--ink); }
.w-small { margin-top: 14px; font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.w-small a, .w-prose a, .w-foot a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; transition: text-decoration-color var(--ease); }
.w-small a:hover, .w-prose a:hover, .w-foot a:hover { text-decoration-color: currentColor; }
.w-prose { font-size: 15px; line-height: 1.55; color: var(--body); }
.w-prose + .w-prose { margin-top: 10px; }
.w-prose b { color: var(--ink); }
.w-card { padding: 28px; border-radius: 16px; }
.w-card + .w-card { margin-top: 16px; }
.w-wide { width: 100%; }
.w-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 14px; }
.w-acts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.w-acts .btn { flex: 0 0 auto; }
.btn[disabled] { opacity: .6; cursor: default; transform: none; }
.btn-line { background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-2); }
.btn-line:hover { background: #FAFAF9; }
.btn-danger { background: #B4232A; color: #fff; }
.btn-danger:hover { background: #9C1C22; }
.w-link { display: inline-flex; align-items: center; min-height: 32px; font-size: 14px; font-weight: 500; color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.w-link:hover { text-decoration-color: currentColor; }
.w-link[disabled] { color: var(--muted); text-decoration: none; cursor: default; }
.w-link.danger { color: #B4232A; }

/* the sandbox note: a quiet butter strip, never mistaken for an error */
.w-test { display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; margin-top: 16px; padding: 10px 14px; border-radius: 10px; background: var(--tone-butter); color: #5B4A12; font-size: 13.5px; line-height: 1.45; }
.w-test b { font-weight: 600; color: #3F330B; }
.w-test[hidden] { display: none; }

/* the spinner inside a busy button */
.w-spin { width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: w-spin 700ms linear infinite; flex: 0 0 auto; }
@keyframes w-spin { to { transform: rotate(360deg); } }

/* ── Sign in ───────────────────────────────────────────────────────────────────────────────────────────────────────── */
.w-form { display: grid; gap: 12px; margin-top: 18px; }
.w-field { display: grid; gap: 6px; }
.w-label { font-size: 13.5px; font-weight: 500; color: var(--ink-2); }
.w-field input {
  width: 100%; height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line-2); background: #fff;
  font: 500 16px/1 var(--font); color: var(--ink); transition: border-color var(--ease), box-shadow var(--ease);
}
.w-field input::placeholder { color: rgba(0, 0, 0, .32); font-weight: 400; }
.w-field input:focus { outline: none; border-color: var(--cta); box-shadow: 0 0 0 3px var(--cta-tint); }
.w-field input[aria-invalid='true'] { border-color: #C4323A; box-shadow: 0 0 0 3px #FBE3E4; }
.w-field input[name='code'] { letter-spacing: 0.24em; font-variant-numeric: tabular-nums; font-size: 20px; }
.w-err { min-height: 0; font-size: 14px; line-height: 1.4; color: #B4232A; }
.w-err:empty { display: none; }
.w-sent { font-size: 15px; line-height: 1.5; color: var(--body); }
.w-sent b { color: var(--ink); font-weight: 600; word-break: break-all; }
.w-form .w-row { margin-top: 0; }
.w-oauth { display: grid; gap: 10px; margin-top: 18px; }
.w-obtn {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 46px; border-radius: 10px;
  background: #fff; box-shadow: inset 0 0 0 1px var(--line-2); font-size: 15.5px; font-weight: 600; color: var(--ink);
  transition: background-color var(--ease);
}
.w-obtn:hover { background: #FAFAF9; }
.w-obtn svg { width: 18px; height: 18px; }
.w-or { display: flex; align-items: center; gap: 12px; margin: 18px 0 -4px; font-size: 13px; color: var(--muted); }
.w-or::before, .w-or::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ── Checkout (upgrade.html): the steps, and the order beside them ─────────────────────────────────────────────────── */
.co { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.co-head { grid-column: 1 / -1; }
.co-foot { grid-column: 1 / -1; }
@media (min-width: 900px) {
  .co { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: 24px 40px; align-items: start; }
  .co-sum { grid-column: 2; grid-row: 2; position: sticky; top: calc(var(--nav-h) + 24px); }
  .co-flow { grid-column: 1; grid-row: 2; }
}
.co-step { display: flex; align-items: center; gap: 10px; }
.co-num { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 13px; font-weight: 600; flex: 0 0 auto; }
.co-num.done { background: var(--cta-tint); color: var(--cta-tint-ink); }
.co-num.done svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.co-who { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; font-size: 15px; color: var(--body); }
.co-who b { color: var(--ink); word-break: break-all; }
.co-pay { margin-top: 20px; }
.co-pay .btn { width: 100%; }
.co-note { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--slot); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.co-note.err { background: #FBE9EA; color: #8E1C22; }
.co-note:empty { display: none; }
.co-muted { opacity: .55; }

/* the order: plan, period, price, what it includes */
.co-sum { padding: 24px; }
.sum-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.sum-pick button, .seg button {
  min-height: 36px; padding: 0 12px; border-radius: 9px; font-size: 14.5px; font-weight: 500; color: var(--muted);
  transition: background-color var(--ease), color var(--ease), box-shadow var(--ease);
}
.sum-pick button { box-shadow: inset 0 0 0 1px var(--line); }
.sum-pick button:hover:not([disabled]), .seg button:hover:not([disabled]) { color: var(--ink); }
.sum-pick button[aria-checked='true'] { background: var(--ink); color: #fff; box-shadow: none; }
.sum-pick button[disabled], .seg button[disabled] { opacity: .45; cursor: default; }
.seg { display: inline-flex; gap: 2px; margin-top: 14px; padding: 3px; border-radius: 11px; background: var(--slot); }
.seg button[aria-checked='true'] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(0, 0, 0, .08); }
.seg button span { margin-left: 6px; font-size: 12.5px; color: var(--cta-tint-ink); }
.sum-price { display: flex; align-items: baseline; gap: 8px; margin-top: 20px; }
.sum-price .amount { font-size: 44px; line-height: 1; font-weight: 600; letter-spacing: -0.035em; color: var(--ink); font-variant-numeric: tabular-nums; }
.sum-price .per { font-size: 15px; color: var(--muted); }
.sum-sub { margin-top: 8px; font-size: 14px; color: var(--muted); }
.sum-sub b { color: var(--cta-tint-ink); font-weight: 600; }
.sum-list { display: grid; gap: 9px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.sum-list li { display: grid; grid-template-columns: 16px minmax(0, 1fr); gap: 10px; font-size: 14.5px; line-height: 1.45; color: var(--body); }
.sum-list svg { width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: var(--cta); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sum-tax { margin-top: 16px; font-size: 13px; line-height: 1.45; color: var(--muted); }

/* done */
.co-done { text-align: left; }
.co-done-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--cta-tint); color: var(--cta-tint-ink); margin-bottom: 16px; }
.co-done-ic svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.co-live { display: flex; align-items: center; gap: 10px; margin-top: 16px; padding: 12px 14px; border-radius: 10px; background: var(--slot); font-size: 14.5px; color: var(--ink-2); }
.co-live.ok { background: #E4F1E6; color: #1F5130; }
.co-live svg { width: 16px; height: 16px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.co-dl { margin-top: 22px; }
.co-dl .btn { gap: 8px; }

/* the compliance lines under both pages */
.w-foot { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 13px; line-height: 1.55; color: var(--muted); }
.w-foot p + p { margin-top: 8px; }
.w-foot nav { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 12px; }
.w-foot nav a { display: inline-flex; align-items: center; min-height: 32px; text-decoration: none; color: var(--muted); }
.w-foot nav a:hover { color: var(--ink); }

/* skeleton while the cloud answers */
.w-skel { display: grid; gap: 10px; }
.w-skel i { display: block; height: 14px; border-radius: 6px; background: linear-gradient(90deg, var(--slot), #F5F3F0, var(--slot)); background-size: 200% 100%; animation: w-shine 1.2s ease-in-out infinite; }
.w-skel i:nth-child(1) { width: 40%; height: 20px; }
.w-skel i:nth-child(3) { width: 70%; }
@keyframes w-shine { to { background-position: -200% 0; } }

/* ── Account (index.html) ──────────────────────────────────────────────────────────────────────────────────────────── */
.ac-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.ac-who { margin-top: 8px; font-size: 15.5px; color: var(--body); word-break: break-all; }
.ac-who b { color: var(--ink); font-weight: 600; }
.ac-priv { display: flex; align-items: center; gap: 10px; margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--line); font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.ac-priv svg { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: var(--ink-2); stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.ac-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-top: 24px; }
@media (min-width: 900px) {
  .ac-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
  .ac-span { grid-column: 1 / -1; }
}
.ac-grid > .card { padding: 24px; border-radius: 16px; }
.ac-cardhead { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.ac-badge { display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 999px; background: var(--slot); font-size: 12.5px; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ac-badge.pink { background: var(--cta-tint); color: var(--cta-tint-ink); }
.ac-badge.warn { background: #FBE9EA; color: #8E1C22; }
.ac-plan { font-size: 28px; line-height: 1.1; font-weight: 600; letter-spacing: -0.025em; color: var(--ink); }
.ac-big { display: flex; align-items: baseline; gap: 8px; margin-top: 18px; }
.ac-big b { font-size: 40px; line-height: 1; font-weight: 600; letter-spacing: -0.03em; color: var(--ink); font-variant-numeric: tabular-nums; }
.ac-big span { font-size: 15px; color: var(--muted); }
.ac-meter { height: 8px; margin-top: 14px; border-radius: 999px; background: var(--slot); overflow: hidden; }
.ac-meter i { display: block; height: 100%; border-radius: inherit; background: var(--cta); transition: width 600ms cubic-bezier(0.16, 1, 0.3, 1); }
.ac-lines { display: grid; gap: 8px; margin-top: 16px; }
.ac-lines li { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; color: var(--body); }
.ac-lines li b { color: var(--ink); font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ac-note { margin-top: 14px; padding: 12px 14px; border-radius: 10px; background: var(--slot); font-size: 14px; line-height: 1.5; color: var(--ink-2); }
.ac-note.warn { background: #FBE9EA; color: #8E1C22; }
.ac-tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ac-tile { padding: 14px; border-radius: 12px; background: var(--canvas); }
.ac-tile b { display: block; font-size: 26px; line-height: 1.1; font-weight: 600; letter-spacing: -0.02em; color: var(--ink); font-variant-numeric: tabular-nums; }
.ac-tile span { display: block; margin-top: 4px; font-size: 13px; line-height: 1.35; color: var(--muted); }
@media (max-width: 480px) {
  .ac-tiles { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .ac-tile:first-child { grid-column: 1 / -1; }
}
.ac-bars { display: flex; align-items: flex-end; gap: 3px; height: 96px; margin-top: 20px; }
.ac-bars i { flex: 1 1 0; min-width: 2px; height: max(2px, calc(var(--h) * 1%)); border-radius: 3px 3px 1px 1px; background: rgba(0, 0, 0, .14); }
.ac-bars i.on { background: var(--cta); }
.ac-bars i.zero { background: rgba(0, 0, 0, .06); }
.ac-axis { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: var(--muted); }
.ac-kinds { display: grid; gap: 8px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.ac-kinds li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; font-size: 14px; color: var(--body); }
.ac-kinds li b { color: var(--ink); font-weight: 500; }
.ac-kinds li span { font-variant-numeric: tabular-nums; color: var(--muted); white-space: nowrap; }
.ac-kinds li s { grid-column: 1 / -1; display: block; height: 4px; border-radius: 4px; background: var(--slot); text-decoration: none; overflow: hidden; }
.ac-kinds li s::before { content: ''; display: block; height: 100%; width: calc(var(--w) * 1%); background: rgba(0, 0, 0, .28); border-radius: inherit; }
.ac-hist { display: grid; }
.ac-hist li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 16px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.ac-hist li:first-child { border-top: 0; padding-top: 0; }
.ac-hist b { grid-column: 1; grid-row: 1; font-weight: 500; color: var(--ink); overflow-wrap: anywhere; }
.ac-hist time { grid-column: 1; grid-row: 2; font-size: 12.5px; color: var(--muted); }
.ac-hist .amt { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-variant-numeric: tabular-nums; font-weight: 600; color: var(--ink-2); white-space: nowrap; }
.ac-hist .amt.plus { color: #1F7A3E; }
.ac-empty { font-size: 14.5px; color: var(--muted); }
@media (min-width: 700px) {
  /* the full-width history: one line per entry (what, when, how many credits) */
  .ac-span .ac-hist li { grid-template-columns: minmax(0, 1fr) 190px 90px; align-items: baseline; }
  .ac-span .ac-hist time { grid-column: 2; grid-row: 1; font-size: 13.5px; }
  .ac-span .ac-hist .amt { grid-column: 3; grid-row: 1; text-align: right; }
}
.ac-hist li:focus { outline: none; }
.ac-dl { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.ac-kv { display: grid; gap: 0; }
.ac-kv div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.ac-kv div:first-child { border-top: 0; padding-top: 0; }
.ac-kv dt { color: var(--muted); }
.ac-kv dd { margin: 0; color: var(--ink); overflow-wrap: anywhere; }
@media (max-width: 480px) { .ac-kv div { grid-template-columns: minmax(0, 1fr); gap: 2px; } }
.ac-confirm { margin-top: 14px; padding: 14px; border-radius: 12px; background: var(--slot); font-size: 14.5px; line-height: 1.5; color: var(--ink-2); }
.ac-confirm .w-acts { margin-top: 12px; }

/* the delete dialog */
.w-dialog { width: min(480px, calc(100vw - 32px)); padding: 0; border: 0; border-radius: 18px; background: var(--card); color: var(--body); box-shadow: 0 24px 64px rgba(20, 20, 19, .28); }
.w-dialog::backdrop { background: rgba(20, 20, 19, .4); }
.w-dialog form { padding: 26px; }
.w-dialog .w-prose { margin-top: 10px; }

@media (max-width: 699.98px) {
  .w-main { padding-top: calc(var(--nav-h) + 24px); }
  .w-card, .co-sum, .ac-grid > .card { padding: 20px; }
  .sum-price .amount { font-size: 38px; }
  .ac-big b { font-size: 34px; }
}
@media (prefers-reduced-motion: reduce) {
  .w-spin, .w-skel i { animation: none; }
}
