/* Account: Billing, Usage, Plans, and the account card at the foot of the sidebar.
   The pages are their own dark room, like the Explore library: the same tokens,
   scoped to this pane so nothing else in the app moves. */

/* ---- sidebar: the account card (name + plan) and its menu ---- */
.usercard {
  width: 100%; border: 0; background: transparent; font: inherit; color: var(--rail-text);
  text-align: left; cursor: pointer; transition: background-color .12s ease;
}
.usercard:hover, .usercard[aria-expanded="true"] { background: var(--rail-2); }
.usercard:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.usercard-av {
  width: 30px; height: 30px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--rail-text); color: var(--rail-bg);
  font-size: 13px; font-weight: 700; text-transform: uppercase;
}
.usercard-txt { display: flex; align-items: baseline; gap: 6px; min-width: 0; }
.usercard-name { flex: 0 1 auto; font-size: 13px; }
.usercard-mail { flex: 0 0 auto; font-size: 12px; color: var(--rail-muted); }
.usercard-mail:not(:empty)::before { content: '\00b7\00a0'; }
.usercard-chev { flex: none; margin-left: auto; color: var(--rail-muted); width: 16px; height: 16px; }
.usercard .build-stamp { display: none; }
.usercard-anchor .menu-up { min-width: 250px; left: 0; right: auto; }
#userMenu { left: 0; right: auto; }
.menu-who { padding: 8px 8px 6px; display: flex; flex-direction: column; gap: 6px; }
/* Light / Dark / System, inside the account menu */
.menu-theme { display: flex; flex-direction: column; gap: 6px; padding: 4px 8px 8px; }
.menu-theme-label { font-size: 12px; color: var(--muted); }
.menu-theme .theme-seg { margin-top: 0; }
.menu-who-mail { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; }
.menu-who-credits {
  align-self: flex-start; border: 0; background: transparent; padding: 0;
  font: inherit; font-size: 12.5px; color: var(--text-2); cursor: pointer;
}
.menu-who-credits:hover { color: var(--text); text-decoration: underline; text-underline-offset: 2px; }

/* ---- the pages ---- */
:root { --good: var(--ok); }
.acct-pane {
  --xdisplay: 'Bricolage Grotesque', 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
}
.acct-inner { max-width: 960px; margin: 0 auto; padding: 44px var(--s6) 96px; }
.acct-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px 24px; }
.acct-h1 { margin: 0; font: 800 38px/1.05 var(--xdisplay); letter-spacing: -.025em; word-spacing: .1em; }
.acct-sub { margin: 8px 0 0; color: var(--text-2); font-size: 14.5px; max-width: 52ch; }

.acct-tabs { position: relative; display: inline-flex; padding: 3px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--border); }
.acct-tab {
  position: relative; z-index: 1; border: 0; background: transparent; color: var(--text-2);
  font: inherit; font-size: 13.5px; font-weight: 500; padding: 7px 16px; border-radius: var(--r-sm); cursor: pointer;
  transition: color .18s ease;
}
.acct-tab:hover { color: var(--text); }
.acct-tab[aria-selected="true"] { color: var(--text); }
.acct-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.acct-note {
  margin: 26px 0 0; padding: 11px 14px; border-radius: var(--r-sm);
  background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent);
  color: var(--text); font-size: 13.5px; line-height: 1.5;
}
.acct-note b { font-weight: 600; }

/* The renewal notice: words on the left, a small receipt on the right, as the welcome
   screen lays them out (welcome.css: same paper, ink, rule, rows, torn edge and stamp). */
.acct-stub {
  display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: center;
  margin: 26px 0 0; padding: 22px 26px; background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg);
}
.acct-stub p { margin: 0; }
.acct-stub-kicker { color: var(--text-2); font-size: 13px; font-weight: 500; }
.acct-stub-text { margin-top: 6px !important; font: 600 17px/1.45 var(--font); color: var(--text); max-width: 46ch; }
.acct-stub-act { margin-top: 16px !important; }
.acct-stub-slip { filter: drop-shadow(0 0 1px rgba(18, 22, 33, .22)) drop-shadow(0 10px 14px rgba(18, 22, 33, .12)); }
.acct-stub-paper {
  --paper: #FFFFFF; --ink: #1A1A19; --ink-2: #45453F; --stamp: #2E4BDB; /* ink-2: AA on both papers */
  padding: 18px 20px 24px; background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: 13px; line-height: 22px;
  -webkit-mask: linear-gradient(#000 0 0) top / 100% calc(100% - 7px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 7px repeat-x;
  mask: linear-gradient(#000 0 0) top / 100% calc(100% - 7px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom / 14px 7px repeat-x;
}
.acct-stub-shop { text-align: center; font-family: 'Satoshi', var(--font); font-weight: 700; font-size: 15px; letter-spacing: .02em; }
.acct-stub-meta { text-align: center; color: var(--ink-2); }
.acct-stub-rule { overflow: hidden; white-space: nowrap; color: #A9A9A3; margin: 8px 0 !important; line-height: 12px; }
.acct-stub-row { display: flex; justify-content: space-between; gap: var(--s3); }
.acct-stub-row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.acct-stub-row.is-quiet { color: var(--ink-2); }
.acct-stub-row.is-total { margin-top: 4px; font-weight: 600; }
.acct-stub-foot { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-top: 16px; }
.acct-stub-kept { color: var(--ink-2); }
.acct-stub-stamp {
  flex: none; display: grid; justify-items: center; margin: 0 6px 0 0;
  padding: 7px 13px 6px; color: var(--stamp); border: 2px solid var(--stamp); border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px var(--stamp);
  transform: rotate(-7deg); opacity: .92; mix-blend-mode: multiply; pointer-events: none;
}
.acct-stub-stamp b { font-family: 'Satoshi', var(--font); font-weight: 800; font-size: 16px; line-height: 1; }
:root[data-theme="dark"] .acct-stub-paper { --paper: #ECECE7; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .acct-stub-paper { --paper: #ECECE7; } }
@media (max-width: 720px) {
  .acct-stub { grid-template-columns: minmax(0, 1fr); gap: 20px; padding: 20px; }
  .acct-stub-slip { width: 100%; max-width: 320px; justify-self: center; }
}

.acct-grid { display: grid; gap: 14px; margin-top: 26px; }
.acct-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px 26px; }
.acct-card h2 { margin: 0; font: 700 19px/1.2 var(--xdisplay); letter-spacing: -.01em; word-spacing: .1em; }
.acct-card p { margin: 6px 0 0; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; }
.acct-row + .acct-row { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--border); }
.acct-row > div { min-width: 0; }
.acct-rowt { font-size: 15px; font-weight: 600; }
.acct-rows { margin-top: 3px; color: var(--text-2); font-size: 13.5px; }

.acct-btn {
  border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text);
  font: inherit; font-size: 13.5px; font-weight: 500; padding: 8px 15px; border-radius: var(--r-sm); cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
a.acct-btn { text-decoration: none; display: inline-flex; align-items: center; }
.acct-btn:hover:not(:disabled) { background: var(--panel-3); border-color: var(--accent-line); }
.acct-btn:active:not(:disabled) { transform: translateY(1px); }
.acct-btn:disabled { opacity: .5; cursor: not-allowed; }
.acct-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acct-btn.is-primary { background: var(--text); color: var(--bg); border-color: var(--text); font-weight: 600; }
.acct-btn.is-primary:hover:not(:disabled) { background: color-mix(in srgb, var(--text) 86%, var(--bg)); }

/* the balance: a ring that empties as the month is used */
.acct-balance { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; }
.acct-ring { width: 132px; height: 132px; flex: none; position: relative; }
.acct-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.acct-ring circle { fill: none; stroke-width: 9; }
.acct-ring .track { stroke: var(--panel-3); }
.acct-ring .arc { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.acct-ring.is-low .arc { stroke: var(--warn); }
.acct-ring-n { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font: 800 26px/1 var(--xdisplay); letter-spacing: -.03em; }
.acct-ring-n small { display: block; margin-top: 4px; font: 500 12.5px system-ui, sans-serif; letter-spacing: 0; color: var(--text-2); }
.acct-balance-txt { min-width: 220px; flex: 1 1 260px; }
.acct-big { font: 800 44px/1 var(--xdisplay); letter-spacing: -.025em; word-spacing: .08em; }
.acct-big small { font-size: 17px; font-weight: 600; color: var(--text-2); letter-spacing: 0; word-spacing: .1em; margin-left: 8px; }
.acct-split { margin-top: 10px; color: var(--text-2); font-size: 13.5px; line-height: 1.6; }

.acct-packs { margin-top: 16px; display: grid; gap: 8px; }
.acct-pack {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 13px 16px; border-radius: var(--r); background: var(--panel-2); border: 1px solid var(--border);
  animation: acct-in .3s cubic-bezier(.2,.8,.2,1) both;
}
.acct-pack:nth-child(2) { animation-delay: .05s; }
.acct-pack:nth-child(3) { animation-delay: .1s; }
.acct-pack b { font: 700 16px var(--xdisplay); }
.acct-pack span { color: var(--text-2); font-size: 13.5px; margin-left: 10px; }
@keyframes acct-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.acct-switch {
  position: relative; width: 44px; height: 26px; flex: none; border-radius: var(--r-pill); cursor: pointer;
  background: var(--panel-3); border: 1px solid var(--border-2); transition: background-color .2s ease, border-color .2s ease;
}
.acct-switch::after { content: ''; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: var(--text-2); transition: transform .22s cubic-bezier(.2,.8,.2,1), background-color .2s; }
.acct-switch[aria-checked="true"] { background: var(--accent); border-color: var(--accent); }
.acct-switch[aria-checked="true"]::after { transform: translateX(18px); background: #fff; }
.acct-switch:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.acct-auto { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; color: var(--text-2); font-size: 13.5px; }
.acct-select, .acct-input {
  background: var(--panel-2); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--r-sm);
  font: inherit; font-size: 13.5px; padding: 7px 10px;
}
.acct-input { width: 92px; }
.acct-select:focus-visible, .acct-input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.acct-hist { list-style: none; margin: 14px 0 0; padding: 0; }
.acct-hist li { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-top: 1px solid var(--border); font-size: 14px; }
.acct-hist li:first-child { border-top: 0; }
.acct-hist .when { color: var(--text-2); }
.acct-empty { color: var(--muted); font-size: 14px; margin: 12px 0 0; }

/* usage */
.acct-usage-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; }
.acct-meter { height: 8px; border-radius: var(--r-pill); background: var(--panel-3); margin-top: 16px; overflow: hidden; }
.acct-meter i { display: block; height: 100%; width: 0; border-radius: var(--r-pill); background: var(--accent); transition: width 1s cubic-bezier(.2,.8,.2,1); }
.acct-meter.is-low i { background: var(--warn); }
.acct-bars { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); align-items: end; gap: 4px; height: 170px; margin-top: 22px; }
.acct-bar { position: relative; height: 100%; display: flex; align-items: flex-end; }
.acct-bar i {
  display: block; width: 100%; min-height: 3px; height: 3px; border-radius: 3px 3px 1px 1px; background: var(--panel-3);
  transition: height .7s cubic-bezier(.2,.8,.2,1), background-color .15s ease;
}
.acct-bar.has i { background: var(--accent-line); }
.acct-bar:hover i, .acct-bar:focus-visible i { filter: brightness(1.7); box-shadow: 0 0 0 1px var(--accent-line); }
.acct-bar:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
.acct-tip {
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%); z-index: 3;
  background: var(--panel-3); border: 1px solid var(--border-2); border-radius: var(--r-sm); padding: 6px 10px;
  font-size: 12.5px; white-space: nowrap; pointer-events: none; opacity: 0; transition: opacity .12s ease;
}
.acct-bar:hover .acct-tip, .acct-bar:focus-visible .acct-tip { opacity: 1; }
.acct-axis { display: flex; justify-content: space-between; margin-top: 8px; color: var(--muted); font-size: 12.5px; }
.acct-kinds { display: grid; gap: 16px; margin-top: 18px; }
.acct-kind-top { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; }
.acct-kind-top span:last-child { color: var(--text-2); }
.acct-kind .acct-meter { margin-top: 8px; height: 6px; }

/* the credits pie */
.acct-pie {
  --pie-0: #5b6280; --pie-1: #3987e5; --pie-2: #d95926; --pie-3: #199e70; --pie-4: #c98500;
  --pie-5: #d55181; --pie-6: #2f9d2f; --pie-7: #9085e9; --pie-8: #e66767; --pie-9: #3cc0d6;
  --pie-10: #b0739b; --pie-11: #8c9a2b;
  display: flex; flex-wrap: wrap; align-items: center; gap: 28px 44px; margin-top: 20px;
}
.acct-pie-chart { position: relative; width: 224px; height: 224px; flex: none; }
.acct-pie-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.acct-pie-arc { fill: none; cursor: pointer; transition: opacity .2s ease; }
.acct-pie-arc.is-dim { opacity: .22; }
circle.pie-0 { stroke: var(--pie-0); } circle.pie-1 { stroke: var(--pie-1); } circle.pie-2 { stroke: var(--pie-2); }
circle.pie-3 { stroke: var(--pie-3); } circle.pie-4 { stroke: var(--pie-4); } circle.pie-5 { stroke: var(--pie-5); }
circle.pie-6 { stroke: var(--pie-6); } circle.pie-7 { stroke: var(--pie-7); } circle.pie-8 { stroke: var(--pie-8); }
circle.pie-9 { stroke: var(--pie-9); } circle.pie-10 { stroke: var(--pie-10); } circle.pie-11 { stroke: var(--pie-11); }
.acct-pie-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; padding: 0 44px; }
.acct-pie-center b { font: 800 34px/1 var(--xdisplay); letter-spacing: -.03em; }
.acct-pie-center span { margin-top: 6px; font-size: 13px; color: var(--text-2); }
.acct-pie-legend { list-style: none; margin: 0; padding: 0; flex: 1 1 280px; min-width: 0; display: grid; gap: 2px; }
.acct-pie-row {
  width: 100%; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 56px; align-items: center; gap: 12px;
  padding: 9px 10px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text);
  font: inherit; font-size: 14px; text-align: left; cursor: pointer; transition: background-color .15s ease, opacity .2s ease;
}
.acct-pie-row:hover, .acct-pie-row.is-on { background: var(--panel-2); }
.acct-pie-row.is-dim { opacity: .45; }
.acct-pie-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.acct-pie-row i { width: 12px; height: 12px; border-radius: 3px; }
.acct-pie-row i.pie-0 { background: var(--pie-0); } .acct-pie-row i.pie-1 { background: var(--pie-1); }
.acct-pie-row i.pie-2 { background: var(--pie-2); } .acct-pie-row i.pie-3 { background: var(--pie-3); }
.acct-pie-row i.pie-4 { background: var(--pie-4); } .acct-pie-row i.pie-5 { background: var(--pie-5); }
.acct-pie-row i.pie-6 { background: var(--pie-6); } .acct-pie-row i.pie-7 { background: var(--pie-7); }
.acct-pie-row i.pie-8 { background: var(--pie-8); } .acct-pie-row i.pie-9 { background: var(--pie-9); }
.acct-pie-row i.pie-10 { background: var(--pie-10); } .acct-pie-row i.pie-11 { background: var(--pie-11); }
.acct-pie-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-pie-val { color: var(--text-2); font-variant-numeric: tabular-nums; }
.acct-pie-pct { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
@media (max-width: 600px) { .acct-pie { justify-content: center; } .acct-pie-chart { width: 200px; height: 200px; } }
@media (prefers-reduced-motion: reduce) { .acct-pie-arc, .acct-pie-row { transition: none; } }

/* plans */
/* Account › Plans: the shared cards (plans.css) in this page's colours */
.acct-plans-ui { margin-top: 26px; }
/* the plans want room: three cards side by side need wider than the other account pages */
.acct-inner:has(.acct-plans-ui) { max-width: 1200px; }
.acct-plans-ui .pl {
  --pl-card: var(--panel); --pl-line: var(--border); --pl-ink: var(--text); --pl-body: var(--text-2); --pl-muted: var(--muted);
  --pl-band: var(--panel-3); --pl-thumb: var(--panel); --pl-blue: var(--accent); --pl-blue-ink: var(--accent); --pl-blue-soft: var(--accent-soft);
}
.acct-plans-ui .pl-cta .acct-btn { width: 100%; padding: 12px 15px; }
/* the recommended card carries the strongest button; the others stay quiet */
.acct-plans-ui .pl-card:not(.is-featured) .acct-btn { background: var(--panel-3); border-color: var(--border); color: var(--text); font-weight: 600; }
.acct-plans-ui .pl-card:not(.is-featured) .acct-btn:hover:not(:disabled) { border-color: var(--border-2); }
.acct-plans-ui .pl-card.is-featured .acct-btn { background: #FFFFFF; border-color: #FFFFFF; color: #151E4A; font-weight: 600; }
.acct-plans-ui .pl-card.is-featured .acct-btn:hover:not(:disabled) { background: #E6EAFF; }
.acct-fine { margin: 22px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; max-width: 70ch; }

.acct-skel { height: 132px; border-radius: var(--r-lg); background: linear-gradient(100deg, var(--panel) 30%, var(--panel-2) 50%, var(--panel) 70%); background-size: 240% 100%; animation: acct-sh 1.2s linear infinite; margin-top: 14px; }
@keyframes acct-sh { to { background-position: -140% 0; } }

@media (max-width: 860px) {
  .acct-h1 { font-size: 30px; }
}
@media (max-width: 600px) {
  .acct-inner { padding: 28px var(--s4) 72px; }
  .acct-card { padding: 20px 18px; }
  .acct-big { font-size: 36px; }
  .acct-bars { gap: 2px; height: 130px; }
  .acct-tab { padding: 7px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .acct-ring .arc, .acct-meter i, .acct-bar i, .acct-pack, .acct-switch::after, .acct-skel { transition: none; animation: none; }
}

/* ---- paying by hand (public/payments.js): the window, and the status of each payment ---- */
.pay-back { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: var(--s4); background: var(--scrim); backdrop-filter: blur(3px); animation: pay-fade .18s ease-out; }
.pay {
  width: min(480px, 100%); max-height: min(760px, calc(100dvh - 32px)); display: flex; flex-direction: column;
  background: var(--panel); color: var(--text); border: 1px solid var(--border-2); border-radius: var(--r-xl);
  box-shadow: 0 28px 90px rgb(0 0 0 / .6); overflow: hidden; animation: pay-rise .22s cubic-bezier(.2, .8, .2, 1);
}
.pay > div { display: flex; flex-direction: column; min-height: 0; flex: 1; }
@keyframes pay-fade { from { opacity: 0; } }
@keyframes pay-rise { from { opacity: 0; transform: translateY(10px) scale(.985); } }

.pay-head { padding: 14px 16px 0; border-bottom: 1px solid var(--border); }
.pay-head-row { display: flex; align-items: center; gap: 10px; }
.pay-head h2 { flex: 1; min-width: 0; margin: 0; text-align: center; font: 700 17px/1.25 var(--xdisplay); letter-spacing: -.01em; overflow-wrap: anywhere; }
.pay-x, .pay-x-gap { width: 34px; height: 34px; flex: none; }
.pay-x { display: grid; place-items: center; border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--panel-2); color: var(--text-2); cursor: pointer; }
.pay-x:hover { color: var(--text); border-color: var(--border-2); }
.pay-x:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-x .ico { width: 16px; height: 16px; }
.pay-head:not(:has(.pay-steps)) { padding-bottom: 14px; }

.pay-steps { display: flex; margin: 14px 0 0; padding: 0; list-style: none; }
.pay-steps li { position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; padding-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.pay-steps li::before { content: ''; position: absolute; top: 11px; right: 50%; width: 100%; height: 2px; background: var(--border-2); }
.pay-steps li:first-child::before { display: none; }
.pay-steps li.is-done::before, .pay-steps li.is-now::before { background: var(--accent); }
.pay-step-dot { position: relative; z-index: 1; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-2); border: 1.5px solid var(--border-2); font-size: 12px; font-family: 'IBM Plex Mono', ui-monospace, monospace; }
.pay-step-dot .ico { width: 13px; height: 13px; }
.pay-steps li.is-now { color: var(--text); }
.pay-steps li.is-now .pay-step-dot { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); box-shadow: 0 0 0 4px var(--accent-soft); }
.pay-steps li.is-done .pay-step-dot { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }
.pay-steps li.is-done { color: var(--text-2); }

.pay-body { flex: 1; overflow-y: auto; padding: 18px 20px 6px; display: flex; flex-direction: column; }
.pay-foot { padding: 14px 20px calc(18px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--border); background: var(--panel); }
/* Step 1: a soft fade over the bottom of the list says "there is more, scroll". */
.pay-foot { position: relative; }
.pay-foot.has-more::before { content: ''; position: absolute; left: 0; right: 0; bottom: 100%; height: 36px; pointer-events: none; background: linear-gradient(to bottom, transparent, var(--panel)); }
.pay-cta { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; font-size: 14.5px; font-weight: 600; }
.pay-cta .ico { width: 16px; height: 16px; }
.pay-lead { margin: 0 0 6px; color: var(--text-2); font-size: 14px; line-height: 1.55; }
.pay-fine { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; line-height: 1.5; }
.pay-hint { margin: 0 0 4px; color: var(--muted); font-size: 12.5px; }
.pay-num { font-family: 'IBM Plex Mono', ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.pay-label { display: block; margin: 16px 0 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pay-preview { display: flex; align-items: center; gap: 8px; margin: 0 0 14px; padding: 8px 12px; border-radius: var(--r-sm); background: color-mix(in srgb, var(--warn) 10%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 32%, transparent); color: var(--text-2); font-size: 12.5px; }
.pay-preview .ico { width: 15px; height: 15px; flex: none; color: var(--warn); }

.pay-order { display: flex; align-items: baseline; gap: 6px; margin: 0 0 14px; padding: 14px 16px; border: 1px solid var(--border); border-radius: var(--r); background: linear-gradient(180deg, var(--panel-2), var(--panel)); }
.pay-order-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; align-self: center; }
.pay-order-txt b { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.pay-order-txt span { font-size: 12.5px; color: var(--muted); }
.pay-order-price { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1; }
.pay-order-cur { font-size: 12.5px; font-weight: 600; color: var(--muted); }

.pay-methods { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 12px; }
.pay-group { margin: 10px 0 0; font-size: 12px; font-weight: 600; color: var(--muted); }
.pay-group:first-child { margin-top: 0; }
.pay-method {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 10px 14px 10px 10px; text-align: left; font: inherit; color: var(--text);
  background: var(--panel-2); border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; transition: border-color .12s ease, background-color .12s ease, transform .12s ease;
}
.pay-method:hover { border-color: var(--border-2); background: var(--panel-3); }
.pay-method:active { transform: scale(.992); }
.pay-method[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); box-shadow: 0 0 0 3px var(--accent-soft); }
.pay-method:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-method-name { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.pay-method-name b { font-weight: 600; font-size: 14.5px; }
.pay-method-name small { font-size: 12px; color: var(--muted); }
.pay-method:hover .pay-method-name small, .pay-method[aria-checked="true"] .pay-method-name small { color: var(--text-2); }
.pay-method.is-soon, .pay-method.is-soon:hover { cursor: not-allowed; background: var(--panel); border-style: dashed; transform: none; }
.pay-method.is-soon .pay-logo { filter: grayscale(1); opacity: .55; }
.pay-method.is-soon .pay-method-name b { color: var(--text-2); }
.pay-soon { flex: none; padding: 3px 10px; border-radius: var(--r-pill); border: 1px solid var(--border-2); background: var(--panel-2); color: var(--text-2); font-size: 11.5px; font-weight: 600; }
.pay-accept li.is-soon { border-style: dashed; color: var(--muted); }
.pay-accept li.is-soon .pay-logo { filter: grayscale(1); opacity: .55; }
.pay-accept li.is-soon .pay-soon { padding: 1px 7px; font-size: 10.5px; }
.pay-radio { width: 22px; height: 22px; flex: none; border-radius: 50%; border: 1.5px solid var(--border-2); display: grid; place-items: center; color: transparent; transition: background-color .12s ease, border-color .12s ease; }
.pay-radio .ico { width: 13px; height: 13px; }
.pay-method[aria-checked="true"] .pay-radio { border-color: var(--accent); background: var(--accent); color: var(--accent-fg); }
.pay-logo { width: var(--logo, 44px); height: var(--logo, 44px); flex: none; border-radius: 12px; object-fit: contain; background: #fff; box-shadow: 0 0 0 1px rgb(255 255 255 / .08); }
.pay-logo.is-initials { display: grid; place-items: center; background: var(--panel-3); color: var(--text-2); font: 700 13px var(--xdisplay); letter-spacing: .02em; }

.pay-amount { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 16px; border: 1px solid var(--accent-line); border-radius: var(--r); background: var(--accent-soft); }
.pay-amount .pay-label { margin: 0 0 4px; color: var(--accent-ink); }
.pay-amount-val { display: block; font-size: 30px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; }
.pay-fee { margin-top: 8px; }
.pay-dest { margin-top: 12px; padding: 14px; border: 1px solid var(--border); border-radius: var(--r); background: var(--panel-2); }
.pay-dest-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.pay-dest-top div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.pay-dest-top b { font-size: 14.5px; font-weight: 600; overflow-wrap: anywhere; }
.pay-dest-top span { font-size: 12.5px; color: var(--muted); }
.pay-dest-row { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: var(--r-sm); background: var(--bg); border: 1px solid var(--border); }
.pay-dest-val { flex: 1; min-width: 0; font: 600 15px 'IBM Plex Mono', ui-monospace, monospace; overflow-wrap: anywhere; user-select: all; }
.pay-copy { flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; font: inherit; font-size: 12.5px; font-weight: 600; color: var(--text); background: var(--panel-3); border: 1px solid var(--border-2); border-radius: var(--r-sm); cursor: pointer; transition: border-color .12s ease, color .12s ease; }
.pay-copy:hover { border-color: var(--accent-line); }
.pay-copy.is-ok { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.pay-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-copy .ico { width: 14px; height: 14px; }
.pay-note-owner { margin: 12px 0 0; padding: 10px 12px; border-left: 2px solid var(--accent); background: var(--panel-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text-2); font-size: 13px; line-height: 1.5; }
.pay-how { counter-reset: how; margin: 14px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 10px; }
.pay-how li { counter-increment: how; display: flex; gap: 10px; align-items: flex-start; font-size: 13px; line-height: 1.5; color: var(--text-2); }
.pay-how li::before { content: counter(how); flex: none; width: 20px; height: 20px; margin-top: 1px; display: grid; place-items: center; border-radius: 50%; background: var(--panel-3); color: var(--text); font: 600 11.5px 'IBM Plex Mono', ui-monospace, monospace; }

.pay-recap { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--panel-2); }
.pay-recap div { display: flex; flex-direction: column; gap: 1px; min-width: 0; overflow-wrap: anywhere; }
.pay-recap b { font: 600 16px 'IBM Plex Mono', ui-monospace, monospace; }
.pay-recap span { font-size: 12.5px; color: var(--muted); }
.pay-recap .pay-label { margin: 0; }
.pay-input { width: 100%; box-sizing: border-box; padding: 12px; font-size: 16px; }
.pay-input[aria-invalid="true"] { border-color: var(--danger); }
.pay-drop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; width: 100%; padding: 22px 14px; font: inherit; color: var(--text);
  background: transparent; border: 1.5px dashed var(--border-2); border-radius: var(--r); cursor: pointer; transition: border-color .12s ease, background-color .12s ease;
}
.pay-drop:hover { border-color: var(--accent-line); background: var(--panel-2); }
.pay-drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-drop-ico { width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: 4px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-ink); }
.pay-drop-ico .ico { width: 19px; height: 19px; }
.pay-drop b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.pay-drop small { font-size: 12px; color: var(--muted); }
.pay-drop.has-file { flex-direction: row; text-align: left; gap: 12px; padding: 10px; border-style: solid; border-color: var(--accent-line); }
.pay-drop-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay-thumb { width: 56px; height: 56px; flex: none; object-fit: cover; border-radius: var(--r-sm); background: var(--panel-3); }
.pay-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.pay-err { margin: 12px 0 0; padding: 9px 12px; border-radius: var(--r-sm); background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger); font-size: 13px; }
.pay-err[hidden] { display: none; }
.pay-body > :last-child { margin-bottom: 14px; }

.pay-done { align-items: center; text-align: center; padding-top: 26px; padding-bottom: 14px; }
.pay-tick { width: 60px; height: 60px; display: grid; place-items: center; margin-bottom: 16px; border-radius: 50%; background: var(--ok-soft); color: var(--good); box-shadow: 0 0 0 8px color-mix(in srgb, var(--ok-soft) 50%, transparent); animation: pay-pop .4s cubic-bezier(.2, 1.4, .4, 1); }
.pay-tick .ico { width: 28px; height: 28px; }
@keyframes pay-pop { from { transform: scale(.6); opacity: 0; } }
.pay-done .pay-lead { color: var(--text); font-weight: 600; font-size: 16px; margin-bottom: 2px; }
.pay-tl { align-self: stretch; margin: 22px 0 0; padding: 0; list-style: none; text-align: left; }
.pay-tl li { position: relative; display: flex; gap: 12px; padding-bottom: 16px; }
.pay-tl li:last-child { padding-bottom: 0; }
.pay-tl li:not(:last-child)::before { content: ''; position: absolute; left: 10px; top: 24px; bottom: 2px; width: 2px; background: var(--border-2); }
.pay-tl li.is-done:not(:last-child)::before { background: var(--good); }
.pay-tl-dot { width: 22px; height: 22px; flex: none; display: grid; place-items: center; border-radius: 50%; border: 2px solid var(--border-2); background: var(--panel); }
.pay-tl-dot .ico { width: 12px; height: 12px; }
.pay-tl li.is-done .pay-tl-dot { background: var(--good); border-color: var(--good); color: var(--ok-ink); }
.pay-tl li.is-now .pay-tl-dot { border-color: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 18%, transparent); }
.pay-tl div { display: flex; flex-direction: column; gap: 1px; padding-top: 1px; }
.pay-tl b { font-size: 14px; font-weight: 600; }
.pay-tl span { font-size: 12.5px; color: var(--muted); }

.pay-status { font-size: 12px; font-weight: 600; }
.pay-status.is-pending { color: var(--warn); }
.pay-status.is-approved { color: var(--good); }
.pay-status.is-rejected { color: var(--danger); }
.pay-note { display: block; margin-top: 2px; font-size: 12.5px; color: var(--text-2); font-weight: 400; }

/* Billing > Payment: the methods you can pay with, as logos */
.pay-accept { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 0; padding: 0; list-style: none; }
.pay-accept li { display: inline-flex; align-items: center; gap: 10px; padding: 5px 14px 5px 5px; border: 1px solid var(--border); border-radius: var(--r-pill); background: var(--panel-2); font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.pay-accept .pay-logo { border-radius: 10px; }
.pay-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

@media (max-width: 520px) {
  .pay-x { width: 44px; height: 44px; }
  .pay-x-gap { width: 44px; }
  .pay-copy { padding: 13px 14px; min-height: 44px; }
  .pay-back { padding: 0; align-items: end; }
  .pay { width: 100%; max-height: 94dvh; border-radius: var(--r-xl) var(--r-xl) 0 0; }
  .pay-amount-val { font-size: 26px; }
}
@media (prefers-reduced-motion: reduce) {
  .pay-back, .pay, .pay-tick { animation: none; }
  .pay-method, .pay-drop, .pay-copy, .pay-radio { transition: none; }
}
