/* SwapDT.
 *
 * A dark trading surface with one cyan accent. The ground is near-black but not
 * black: pure #000 under white text haloes on OLED, and every card would need a
 * border to separate from it. Cards sit one step lighter than the page and carry
 * a hairline, because on a dark ground a drop shadow is close to invisible —
 * depth here comes from lightness steps, not from shadow.
 *
 * Cyan does double duty. It is the accent and it is the buy side, which removes
 * the collision an accent-plus-green palette creates; sell is the only other
 * hue that means anything, and it is red. Nothing else is coloured for
 * decoration.
 *
 * Every colour is a token on :root. Redefine tokens, never components — a
 * colour whose only definition sits behind a media query renders one theme's
 * text on the other theme's ground. There is one theme here and it is painted
 * explicitly, so the page holds whatever the host is doing.
 *
 * Contrast is not eyeballed. scripts/check_contrast.py holds the same values and
 * asserts every pair that carries text. Change a colour here, change it there,
 * and run it.
 */

/* ---------------------------------------------------------------- fonts
 *
 * Self-hosted, and subsetted with U+20B9 kept in. Google's default Inter subset
 * drops the rupee sign, which renders it in a fallback face at a different
 * weight from the digits beside it — on a site made entirely of prices. The
 * subsetting script keeps the currency block for exactly this reason.
 */
@font-face {
  font-family: "Inter Variable";
  src: url("../fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Bricolage";
  src: url("../fonts/bricolage-variable.woff2") format("woff2");
  font-weight: 200 800;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: dark;

  --sans: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Bricolage", "Inter Variable", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Roboto Mono", Menlo, monospace;

  --ground: #0a0f12;
  --surface: #121a1f;
  --surface-2: #18232a;
  --surface-3: #1e2b33;
  --line: #24333c;
  --line-strong: #5c7787;

  --text: #eaf2f6;
  --text-2: #a8bcc7;
  --text-3: #8399a5;

  --accent: #00d1c7;
  --accent-hover: #4ce6de;
  --accent-quiet: #0d4a4a;
  --accent-wash: #0c2b2e;
  --on-accent: #04211f;

  --sell: #ff6b78;
  --sell-wash: #35161c;
  --ok: #3ddc97;
  --ok-wash: #0f2b22;
  --warn: #ffb020;
  --warn-wash: #2f2409;
  --bad: #ff6b78;
  --bad-wash: #35161c;

  /* VIP levels. Each is bright enough to be text on the card surfaces; the
   * washes are the fills behind a level's own card and tag. */
  --bronze: #f0975a;
  --bronze-wash: #33200f;
  --silver: #d3dde6;
  --silver-wash: #232b33;
  --gold: #ffc940;
  --gold-wash: #33290a;
  --on-gold: #2a1d00;
  --platinum: #7cc0ff;
  --platinum-wash: #0f2436;
  --diamond: #6af3ff;
  --diamond-wash: #0b2e33;

  /* One page width and one gutter, shared by the bar and the content under it.
   * They used to be set separately, which put the topbar and every h1 on
   * different left edges. */
  --page: 1180px;
  --gutter: 24px;

  --radius: 14px;
  --radius-sm: 10px;
  --lift: 0 18px 40px rgba(0, 0, 0, .45);
}

/* ---------------------------------------------------------------- base */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* Money is compared column to column and copied into a bank app. Proportional
 * digits make that harder than it needs to be, so every element that can hold an
 * amount gets tabular figures — including the buttons and the prose, which is
 * where amounts kept slipping through. */
.num,
.mono,
.breakdown td,
.breakdown th,
.facts dd,
.pay-fields dd,
.ledger td,
.btn,
.pay-title,
.quote-sub,
.quote-figure,
.hint,
.fineprint,
.breakdown-foot,
.next p,
.aside {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.mono {
  font-family: var(--mono);
  font-size: .94em;
  letter-spacing: .01em;
}

a {
  color: var(--accent);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--accent-hover);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Windows High Contrast drops box-shadow, which is what most of the focus
 * styling below is built from. Put a real outline back for those users. */
@media (forced-colors: active) {
  .btn:focus-visible,
  .field input:focus-visible,
  .field select:focus-visible,
  .field textarea:focus-visible,
  .input:focus-visible {
    outline: 3px solid Highlight;
    outline-offset: 2px;
  }
}

/* ---------------------------------------------------------------- frame */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  max-width: var(--page);
  margin: 0 auto;
  padding: 14px var(--gutter);
  border-bottom: 1px solid var(--line);
  background: var(--ground);
}

.topbar-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--display);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.015em;
  color: var(--text);
  text-decoration: none;
}

.topbar-logo {
  display: block;
  height: 26px;
  width: auto;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}

.topbar-links a,
.topbar-links button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  text-decoration: none;
}

.topbar-links button {
  border: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.topbar-links a:hover,
.topbar-links button:hover {
  background: var(--surface-2);
  color: var(--text);
}

.topbar-links form {
  display: contents;
}

/* The one link in the bar that is an action, not navigation. */
.topbar-buy {
  background: var(--accent);
  color: var(--on-accent) !important;
  font-weight: 650;
}

.topbar-buy:hover {
  background: var(--accent-hover) !important;
  color: var(--on-accent) !important;
}

/* Responsive navigation. On a phone the links collapse behind a hamburger; the
 * toggle is a hidden checkbox so it needs no JavaScript, which also lets the
 * operator surface use it under its no-inline-script policy. */
.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

/* Above the breakpoint the links are always shown, so the toggle has nothing
   to do and should not be a stop in the tab order. */
@media (min-width: 720px) {
  .nav-toggle {
    display: none;
  }
}

.nav-burger {
  display: none;
}

.wrap {
  max-width: var(--page);
  margin: 0 auto;
  padding: 30px var(--gutter) 80px;
}

/* Two columns once there is room for them. The decision the page is asking for
 * goes on the left; the terms and the small print that support it go on the
 * right, where they stop pushing the action below the fold. */
.split {
  display: grid;
  gap: 28px;
}

/* A grid item's minimum width is its content's, so a wide table inside a
   .scroll region stretched the column instead of scrolling within it and the
   whole page scrolled sideways on a phone. Zero lets the scroller do its job. */
.split > * {
  min-width: 0;
}

@media (min-width: 940px) {
  .split {
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
    align-items: start;
  }

  .split-side {
    position: sticky;
    top: 24px;
  }

  /* The confirmation screen is three things, not two: the figure, the terms,
   * and the button that accepts both. On a wide screen the figure and the
   * button stack in the first column and the terms sit beside them. */
  .split-decide > .quote,
  .split-decide > .split-act {
    grid-column: 1;
  }

  .split-decide > .split-side {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

/* ---------------------------------------------------------------- headings */

.head {
  margin: 0 0 26px;
}

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(27px, 4vw, 38px);
  line-height: 1.12;
  letter-spacing: -.025em;
  margin: 0 0 8px;
}

h2 {
  font-family: var(--display);
  font-weight: 650;
  font-size: 20px;
  letter-spacing: -.015em;
  margin: 32px 0 14px;
}

h3 {
  font-size: 15px;
  font-weight: 650;
  margin: 22px 0 8px;
}

.eyebrow {
  margin: 0;
  color: var(--text-3);
  font-size: 14px;
}

.lead {
  margin: 0 0 22px;
  max-width: 62ch;
  color: var(--text-2);
  font-size: 17px;
}

p {
  max-width: 68ch;
}

/* ---------------------------------------------------------------- cards
 *
 * One card. Everything that was a .panel, a .quote, a .pay, a hero or a gate is
 * the same object at a different size — there were five of them with four
 * different corner radii, which is the sort of thing that reads as unfinished
 * without anyone being able to say why.
 */

.quote,
.pay,
.panel,
.trade-hero,
.gate,
.thread {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
}

.panel,
.pay,
.thread {
  margin: 0 0 24px;
}

/* The quote card. The figure is the largest thing on the page because it is the
 * one number the customer came to see. */
.quote {
  padding: 0;
  overflow: hidden;
}

.quote-head {
  padding: 24px 24px 22px;
  background:
    radial-gradient(120% 140% at 0% 0%, var(--accent-wash) 0%, transparent 62%),
    var(--surface-2);
  border-bottom: 1px solid var(--line);
}

.quote-label {
  margin: 0 0 4px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.quote-figure {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(34px, 6vw, 48px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.03em;
  color: var(--text);
}

.quote-figure span {
  font-size: .42em;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-3);
  margin-left: 6px;
}

.quote-sub {
  margin: 8px 0 0;
  color: var(--text-2);
  font-size: 15px;
}

/* ---------------------------------------------------------------- breakdown
 *
 * A label/value table, and the one place the customer can check the desk's
 * arithmetic. Every row has to follow from the one above it with a single
 * operation, so the deduction row and the total row are marked and the rest are
 * plain. The labels are th; they used to be styled as td and got no padding,
 * no gutter and UA bold, which inverted the emphasis against the values.
 */

.breakdown {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.breakdown th,
.breakdown td {
  padding: 13px 24px;
  border-top: 1px solid var(--line);
  vertical-align: baseline;
}

.breakdown tr:first-child th,
.breakdown tr:first-child td {
  border-top: 0;
}

.breakdown th {
  text-align: left;
  font-weight: 400;
  color: var(--text-2);
  padding-right: 16px;
  white-space: nowrap;
}

.breakdown td {
  text-align: right;
  color: var(--text);
  overflow-wrap: anywhere;
}

.breakdown .unit {
  color: var(--text-3);
  font-size: .88em;
  margin-left: 3px;
}

.breakdown .aside {
  display: block;
  color: var(--text-3);
  font-size: 13px;
}

.breakdown-deduct td {
  color: var(--sell);
}

.breakdown-total th,
.breakdown-total td {
  border-top: 1px solid var(--line-strong);
  font-weight: 650;
  color: var(--text);
  padding-top: 15px;
  padding-bottom: 17px;
}

.breakdown-total td {
  font-size: 17px;
}

.breakdown-foot {
  margin: 0;
  padding: 16px 24px 20px;
  max-width: none;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13.5px;
  line-height: 1.6;
}

/* A table caption is a real label, not a stray centred word above a borderless
 * table, which is what the UA default produced on three operator screens. */
.breakdown caption,
.ledger caption {
  caption-side: top;
  text-align: left;
  padding: 0 24px 12px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------- facts */

.facts {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(140px, 240px) minmax(0, 1fr);
  gap: 0;
  font-size: 15px;
}

.facts dt,
.facts dd {
  margin: 0;
  padding: 13px 0;
  border-top: 1px solid var(--line);
}

.facts dt {
  color: var(--text-2);
  padding-right: 20px;
}

.facts dd {
  color: var(--text);
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- payment
 *
 * Enclosed on purpose. Users read a bordered payment block as more secure than
 * the same fields loose on the page, and it is the strongest measured trust
 * intervention available (BLUEPRINT.md section 17). The accent edge marks it as
 * the one block on the page that carries an account number.
 */

.pay {
  border-left: 3px solid var(--accent);
}

.pay-stopped {
  border-left-color: var(--warn);
}

.pay-title {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.pay-deadline {
  margin: 0 0 18px;
  color: var(--text-2);
  font-size: 14px;
}

.pay-fields {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(150px, 260px) minmax(0, 1fr);
  font-size: 15px;
}

.pay-fields dt,
.pay-fields dd {
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.pay-fields dt {
  color: var(--text-2);
  padding-right: 20px;
}

.pay-fields dd {
  color: var(--text);
  overflow-wrap: anywhere;
}

.pay-note {
  margin: 18px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-wash);
  color: var(--text-2);
  font-size: 14px;
  max-width: none;
}

/* ---------------------------------------------------------------- states
 *
 * A pill says what is true now. The colours mean one thing each: cyan is the
 * desk's own colour and marks the live, expected path; amber is waiting on
 * somebody; green is done; red is stopped. A state that is merely resting gets
 * no colour at all, so the coloured ones keep their meaning.
 */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.pill-quoted,
.pill-awaiting_inr,
.pill-awaiting_usdt,
.pill-open {
  border-color: var(--warn);
  background: var(--warn-wash);
  color: var(--warn);
}

.pill-inr_confirmed,
.pill-usdt_sent,
.pill-usdt_received,
.pill-inr_sent,
.pill-answered {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
}

.pill-settled,
.pill-verified,
.pill-pan-verified {
  border-color: var(--ok);
  background: var(--ok-wash);
  color: var(--ok);
}

.pill-held,
.pill-expired,
.pill-refused,
.pill-cancelled,
.pill-terminated,
.pill-pan-not_verified {
  border-color: var(--bad);
  background: var(--bad-wash);
  color: var(--bad);
}

/* The account and the PAN are two decisions, and their pills carry the same
 * three colours: waiting is amber on both, good is green, stopped is red. The
 * word on the pill is what tells them apart, so it is never left off. */
.pill-review,
.pill-bank_given,
.pill-pan_given,
.pill-not_started,
.pill-pan-pending {
  border-color: var(--warn);
  background: var(--warn-wash);
  color: var(--warn);
}

/* A status with a sentence under it: the pill on its own line, the note below,
 * so the note reads as belonging to the pill rather than to the label. */
.statuses dd {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.status-note {
  margin: 0;
  color: var(--text-2);
  font-size: 14px;
}

.facts dd .status-note {
  margin-top: 6px;
}

.facts dd .status-note:first-child {
  margin-top: 0;
}

.pill-closed {
  color: var(--text-2);
}

/* Buy and sell are the one distinction a list of orders has to carry, and it
 * cannot be carried by colour alone. The word is always there; the colour is
 * the shortcut for people who already know it. */
.side-buy {
  border-color: var(--accent-quiet);
  background: var(--accent-wash);
  color: var(--accent);
}

.side-sell {
  border-color: var(--sell);
  background: var(--sell-wash);
  color: var(--sell);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

/* Two labels in one table cell sit one above the other. Side by side they
 * widened the column until the last one was cut off at the card edge. */
.pill-stack {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

/* ---------------------------------------------------------------- timeline */

.timeline {
  list-style: none;
  margin: 0 0 28px;
  padding: 0;
}

.step {
  position: relative;
  padding: 0 0 22px 30px;
  border-left: 2px solid var(--line);
}

.step:last-child {
  border-left-color: transparent;
  padding-bottom: 0;
}

.step::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
  background: var(--ground);
}

.step-done {
  border-left-color: var(--accent-quiet);
}

.step-done::before {
  border-color: var(--accent);
  background: var(--accent);
}

.step-current::before {
  border-color: var(--accent);
  background: var(--ground);
  box-shadow: 0 0 0 4px var(--accent-wash);
}

.step-name {
  display: block;
  font-weight: 600;
  color: var(--text);
}

.step-waiting .step-name,
.step-stopped .step-name {
  color: var(--text-3);
  font-weight: 400;
}

.step-note {
  display: block;
  color: var(--text-3);
  font-size: 14px;
}

.step-stopped::before {
  border-color: var(--bad);
  background: var(--bad-wash);
}

/* The approval gate's own progress list. Same idea as the timeline, but it runs
 * before an order exists, so it lives on the gate card instead. */
.approval-steps {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  text-align: left;
}

.approval-step {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 15px;
  color: var(--text-3);
}

.approval-step .tick {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex: none;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  font-size: 12px;
  font-weight: 700;
}

.approval-step.done {
  color: var(--text-2);
}

.approval-step.done .tick {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
}

.approval-step.now {
  color: var(--text);
  font-weight: 600;
}

.approval-step.now .tick {
  border-color: var(--warn);
  color: var(--warn);
}

.approval-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--warn);
  background: var(--warn-wash);
  color: var(--warn);
  font-size: 13px;
  font-weight: 600;
}

.approval-pill .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

/* ---------------------------------------------------------------- forms */

.form {
  display: grid;
  gap: 20px;
  max-width: 560px;
  margin: 0;
}

.form.panel,
.form-wide {
  max-width: none;
}

.field {
  display: grid;
  gap: 7px;
}

.field label {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.field input,
.field select,
.field textarea,
.input {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: inherit;
  /* 16px, not smaller: iOS Safari zooms the page when a field under 16px takes
   * focus, and it does not zoom back out. */
  font-size: 16px;
  line-height: 1.4;
  min-height: 48px;
}

.field textarea,
textarea.input {
  min-height: 120px;
  resize: vertical;
}

.field input::placeholder,
.field textarea::placeholder,
.input::placeholder {
  color: var(--text-3);
}

.field input:focus-visible,
.field select:focus-visible,
.field textarea:focus-visible,
.input:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-wash);
}

.field-error input,
.field-error select,
.field-error textarea {
  border-color: var(--bad);
}

.field .error,
.error {
  margin: 0;
  color: var(--bad);
  font-size: 14px;
}

.hint {
  margin: 0;
  max-width: 62ch;
  color: var(--text-3);
  font-size: 13.5px;
}

/* A currency sign welded to the left of the input, so the field is unambiguous
 * before anything is typed into it. */
.input-prefix {
  display: flex;
  align-items: stretch;
}

.input-prefix > span {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-right: 0;
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-2);
  font-size: 16px;
}

.input-prefix input {
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

label.check {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 44px;
  font-weight: 500;
  color: var(--text);
  cursor: pointer;
}

label.check input {
  width: 20px;
  height: 20px;
  min-height: 0;
  flex: none;
  accent-color: var(--accent);
}

/* ---------------------------------------------------------------- buttons
 *
 * Three levels and no more: primary is the action the page exists for, default
 * is everything else, danger is the one that cannot be undone. The old default
 * was a white fill on a near-white ground, which read as disabled — every
 * screenshot of it had somebody's eye sliding straight past "Start a sell".
 */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 48px;
  padding: 0 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .12s ease, border-color .12s ease, transform .06s ease;
}

.btn:hover {
  background: var(--line);
  border-color: var(--text-3);
  color: var(--text);
  text-decoration: none;
}

.btn:active {
  transform: translateY(1px);
}

.btn-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--on-accent);
  box-shadow: 0 0 24px -8px var(--accent);
}

.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--on-accent);
}

/* Destructive, and deliberately not the same colour as primary. They were two
 * shades of the same maroon before, sitting next to each other on the operator's
 * order screen with the irreversible one on top. */
.btn-danger {
  border-color: var(--bad);
  background: transparent;
  color: var(--bad);
  box-shadow: none;
}

.btn-danger:hover {
  background: var(--bad-wash);
  border-color: var(--bad);
  color: var(--bad);
}

.btn-block {
  width: 100%;
}

.btn-google {
  background: var(--surface-3);
  color: var(--text);
}

.g-logo {
  width: 18px;
  height: 18px;
  flex: none;
}

.link-button {
  min-height: 48px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 24px 0 0;
  max-width: none;
}

.order-actions {
  display: grid;
  gap: 14px;
  margin: 0 0 24px;
}

.order-action {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0;
}

.order-action .input {
  flex: 1 1 260px;
  width: auto;
}

.action.danger {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- notes
 *
 * Two treatments, not five. A note is an aside the reader can skip; terms are
 * the block they are being held to. Everything else that used to have its own
 * rule width and colour now uses one of these two.
 */

.note {
  margin: 24px 0;
  padding: 2px 0 2px 18px;
  border-left: 3px solid var(--accent-quiet);
  color: var(--text-2);
  font-size: 15px;
}

.note h2 {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--text);
}

.note p {
  margin: 0 0 10px;
}

.note p:last-child {
  margin-bottom: 0;
}

/* The one note that is not skippable: something the operator has to read
   before pressing a button on the same page. */
.note-warn {
  border-left-color: var(--warn);
  color: var(--text);
}

/* Louder still: money is about to move against something that does not add up.
   Filled rather than only ruled, so it cannot be read past on a busy screen. */
.note-bad {
  border-left-color: var(--bad);
  background: var(--bad-wash);
  color: var(--text);
}

.terms {
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-2);
  font-size: 14.5px;
}

.terms h2 {
  margin: 0 0 12px;
  font-size: 16px;
  color: var(--text);
}

.terms ul,
.list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 10px;
}

.terms li,
.list li {
  max-width: 68ch;
}

.terms strong {
  color: var(--text);
}

.next {
  margin: 26px 0 0;
  color: var(--text-2);
}

.fineprint {
  margin: 12px 0 0;
  max-width: 66ch;
  color: var(--text-3);
  font-size: 13.5px;
}

.rule {
  margin: 34px 0;
  border: 0;
  border-top: 1px solid var(--line);
}

/* ---------------------------------------------------------------- tables */

/* The horizontal scroller is focusable and named. A div with overflow and no
 * tabindex cannot be scrolled from the keyboard at all, which on a phone-width
 * order table hides half the columns from anyone not using a mouse. */
.scroll {
  overflow-x: auto;
  margin: 0 0 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.scroll:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.ledger {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
  white-space: nowrap;
}

.ledger th,
.ledger td {
  padding: 13px 18px;
  text-align: left;
  border-top: 1px solid var(--line);
}

.ledger thead th {
  border-top: 0;
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.ledger tbody tr:hover td {
  background: var(--surface-2);
}

.ledger td {
  color: var(--text-2);
}

.ledger td:first-child {
  color: var(--text);
}

.ledger .right,
.right {
  text-align: right;
}

.ledger a {
  font-family: var(--mono);
  font-size: .94em;
}

/* A ticket subject is the customer's own words, not a reference. Set in the
   reference face it read as an identifier. */
.ledger a.subject {
  font-family: inherit;
  font-size: inherit;
}

/* A UUID in a five-column table pushed the TDS column off the edge of the
   card at desktop width, and a scroller nobody can see is a cut-off table.
   Cells in an auto-layout table ignore max-width, so the cap goes on a span. */
.ledger .id {
  display: inline-block;
  max-width: 220px;
  overflow-wrap: anywhere;
  white-space: normal;
  vertical-align: top;
}

/* ---------------------------------------------------------------- account */

.trade-hero {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin: 0 0 28px;
  background:
    radial-gradient(90% 160% at 100% 0%, var(--accent-wash) 0%, transparent 60%),
    var(--surface);
}

.trade-hero h2 {
  margin: 0 0 6px;
  font-size: 19px;
}

.trade-hero p {
  margin: 0;
  max-width: 46ch;
  color: var(--text-2);
  font-size: 15px;
}

.trade-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.devices {
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.devices li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.device-name {
  font-weight: 600;
}

.device-note {
  color: var(--text-3);
  font-size: 13.5px;
}

.track-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin: 0 0 28px;
}

.track-form .field {
  flex: 1 1 260px;
  margin: 0;
}

.track_error {
  color: var(--bad);
}

/* ---------------------------------------------------------------- messages */

.thread {
  display: grid;
  gap: 14px;
  padding: 20px;
}

.msg {
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface-2);
  max-width: 46rem;
}

.msg.from_operator,
.msg.from-desk {
  border-color: var(--accent-quiet);
  background: var(--accent-wash);
}

.msg-who {
  display: block;
  margin: 0 0 4px;
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.msg-body {
  margin: 0;
  white-space: pre-wrap;
  color: var(--text);
}

/* ---------------------------------------------------------------- gate
 *
 * The sign-in screen and the waiting-for-review screen. One narrow card in the
 * middle of the page, because there is exactly one thing to do on it.
 */

.gate {
  max-width: 460px;
  margin: 40px auto;
  padding: 32px;
  text-align: center;
  box-shadow: var(--lift);
}

.gate-inner {
  display: grid;
  gap: 16px;
}

.gate-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  border: 1px solid var(--accent-quiet);
  background: var(--accent-wash);
  color: var(--accent);
}

.gate-icon svg {
  width: 22px;
  height: 22px;
}

.gate-logo {
  display: block;
  height: 36px;
  width: auto;
  margin: 0 auto 6px;
}

.gate h1 {
  font-size: 26px;
  margin: 0;
}

.gate-lead {
  margin: 0;
  color: var(--text-2);
  font-size: 15px;
}

.gate .form,
.gate-field {
  max-width: none;
  text-align: left;
}

.gate-or,
.signin-or {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-3);
  font-size: 13px;
}

.gate-or::before,
.gate-or::after,
.signin-or::before,
.signin-or::after {
  content: "";
  flex: 1;
  border-top: 1px solid var(--line);
}

.gate-foot {
  margin: 6px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------------------------------------------------------------- operator */

.record-id,
.desk h1.record-id {
  font-family: var(--mono);
  /* An email address is the heading now, and at 22px a normal-length one
   * broke mid-word on a phone. */
  font-size: clamp(17px, 4.4vw, 28px);
  letter-spacing: -.01em;
  word-break: break-all;
}

/* A revealed value and the button that copies it, on one line. The operator
 * is about to type these into another site, and a retyped PAN is a checked
 * PAN that may not be the customer's. */
.copyable {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 28px 12px;
}

/* The button keeps its 44px target but gives the height back to the row, so
 * the value sits on the same line as its label instead of eleven pixels below
 * it. The wide row gap stops a wrapped button overlapping the line above. */
.copyable .copy {
  margin-block: -11px;
}

.copy {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-3);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.copy:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.copy:disabled {
  color: var(--ok);
  border-color: var(--ok);
  cursor: default;
}

/* Off-screen scratch space for the clipboard fallback. Not display:none,
 * because a hidden textarea cannot be selected. */
.copy-scratch {
  position: fixed;
  top: 0;
  left: -9999px;
  opacity: 0;
}

/* A button the page has switched off says so beside it, so it does not read as
 * broken. The explanation is the hint under it. */
.btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  box-shadow: none;
}

.btn:disabled:hover {
  background: var(--surface-3);
  border-color: var(--line-strong);
}

.btn-primary:disabled:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.checks {
  display: grid;
  gap: 2px;
}

.checks .check {
  align-items: flex-start;
  min-height: 40px;
  padding-block: 9px;
  font-size: 15px;
}

.checks .check input {
  margin-top: 1px;
}

.checks .check input:disabled {
  opacity: .45;
}

.hint-why {
  margin-top: 10px;
  color: var(--warn);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
}

.filters a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 15px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 14px;
  text-decoration: none;
}

.filters a:hover {
  border-color: var(--text-3);
  color: var(--text);
}

.filters a.on {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
  font-weight: 600;
}

.filters .num {
  color: var(--text-3);
  font-size: 12.5px;
}

.filters a.on .num {
  color: var(--accent);
}

/* The second row of filters narrows the first, so it sits closer to the table
 * than to the tabs above it and runs a size smaller. */
.filters-sub {
  margin-top: -10px;
}

.filters-sub a {
  min-height: 40px;
  padding: 0 12px;
  font-size: 13px;
}

/* A card whose whole content is a table. The table's own cell padding is the
 * card's inset, so the card adds none of its own — otherwise every row sits
 * 48px in from the edge it is supposed to line up with. */
.panel-table {
  padding: 0;
  overflow: hidden;
}

.panel-table caption {
  padding-top: 18px;
}

.panel-table .breakdown-foot {
  border-radius: 0 0 var(--radius) var(--radius);
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel-title {
  margin: 0 0 4px;
  font-size: 17px;
}

.panel > .panel-title + .hint {
  margin-bottom: 18px;
}

.panel > .facts dt:first-of-type,
.panel > .facts dd:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.signin {
  max-width: 460px;
}

.gate-icon-stop {
  border-color: var(--bad);
  background: var(--bad-wash);
  color: var(--bad);
}

.mark-tag {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  color: var(--text-3);
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}

/* The operator surface is a screen somebody has open all day, so it runs tighter
 * than the customer one. Same palette, more rows on screen. */
.desk .wrap {
  padding-top: 24px;
}

.desk .ledger th,
.desk .ledger td {
  padding: 10px 16px;
}

.desk h1 {
  font-size: clamp(24px, 3vw, 30px);
}

.gate-pill {
  margin: 0 0 4px;
  text-align: center;
}

.action-spaced {
  margin-top: 16px;
}

/* Someone who has asked their system to stop animating things has usually asked
 * for a reason. The press dip and the fades are the only motion here, and none
 * of it carries meaning, so all of it goes. */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }

  .btn:active {
    transform: none;
  }
}

/* ---------------------------------------------------------------- narrow */

@media (max-width: 939px) {
  /* Stacked, the aside falls below the main column. That is right when the
   * aside is a running commentary — where an order has got to, what the
   * numbers mean — and wrong when it is something the reader has to have seen
   * before they act. */
  .split-side {
    order: 2;
  }

  /* Terms are the second kind. On the confirmation screen they carry "payment
   * from anyone else's account is rejected" and the risk disclosure, and they
   * were rendering underneath the Pay button — so the one screen the blueprint
   * asks for inline terms on was asking for agreement to terms below the fold.
   *
   * The figure still comes first (§17: the all-in figure before anything else),
   * then the terms, then the button that agrees to them. Reading order is the
   * order somebody should make the decision in. */
  .split-decide > .quote {
    order: 0;
  }

  .split-decide > .split-side {
    order: 1;
  }

  .split-decide > .split-act {
    order: 2;
  }
}

@media (max-width: 719px) {
  :root {
    --gutter: 16px;
  }

  .nav-burger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    margin: -2px -8px -2px 0;
    border-radius: var(--radius-sm);
    cursor: pointer;
    color: var(--text);
  }

  .nav-burger span,
  .nav-burger span::before,
  .nav-burger span::after {
    display: block;
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
  }

  .nav-burger span {
    position: relative;
  }

  .nav-burger span::before,
  .nav-burger span::after {
    content: "";
    position: absolute;
    left: 0;
  }

  .nav-burger span::before {
    top: -6px;
  }

  .nav-burger span::after {
    top: 6px;
  }

  .nav-toggle:checked ~ .nav-burger span {
    background: transparent;
  }

  .nav-toggle:checked ~ .nav-burger span::before {
    top: 0;
    transform: rotate(45deg);
  }

  .nav-toggle:checked ~ .nav-burger span::after {
    top: 0;
    transform: rotate(-45deg);
  }

  .nav-toggle:focus-visible ~ .nav-burger {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }

  .topbar {
    padding: 10px var(--gutter);
  }

  .topbar-links {
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    margin: 8px 0 4px;
  }

  .nav-toggle:checked ~ .topbar-links {
    display: flex;
  }

  .topbar-links a,
  .topbar-links button {
    justify-content: flex-start;
    min-height: 46px;
    padding: 0 14px;
  }

  .topbar-links button {
    width: 100%;
    text-align: left;
  }

  .topbar-buy {
    justify-content: center !important;
  }

  .quote-head,
  .breakdown th,
  .breakdown td,
  .breakdown-foot,
  .breakdown caption {
    padding-left: 18px;
    padding-right: 18px;
  }

  .breakdown th {
    white-space: normal;
    padding-right: 10px;
  }

  .facts,
  .pay-fields {
    grid-template-columns: minmax(0, 1fr);
  }

  .facts dd,
  .pay-fields dd {
    border-top: 0;
    padding-top: 0;
    padding-bottom: 14px;
  }

  .facts dt,
  .pay-fields dt {
    padding-bottom: 2px;
    font-size: 13px;
  }

  .quote,
  .pay,
  .panel,
  .trade-hero,
  .thread {
    padding-left: 18px;
    padding-right: 18px;
  }

  .quote {
    padding-left: 0;
    padding-right: 0;
  }

  .gate {
    margin: 20px auto;
    padding: 24px 20px;
  }

  .trade-hero-actions .btn,
  .actions .btn {
    flex: 1 1 auto;
  }

  .order-action {
    align-items: stretch;
    flex-direction: column;
  }

  .order-action .btn {
    width: 100%;
  }
}

/* ---------------------------------------------------------------- vip
 *
 * The one part of the site allowed to be loud. Each level has a colour, and the
 * colour only ever means that level: the tag in the operator's order list, the
 * perk tab and the level card are the same hue, so a Gold customer reads as
 * Gold everywhere without a legend.
 *
 * The customer page (vc-) is written for a phone first. Nothing on it is a
 * wide table by default; the comparison table sits behind a disclosure, and
 * the level cards swipe sideways rather than stacking into a column.
 */

.tier-none { --tier: var(--text-3); --tier-wash: var(--surface-2); }
.tier-bronze { --tier: var(--bronze); --tier-wash: var(--bronze-wash); }
.tier-silver { --tier: var(--silver); --tier-wash: var(--silver-wash); }
.tier-gold { --tier: var(--gold); --tier-wash: var(--gold-wash); }
.tier-platinum { --tier: var(--platinum); --tier-wash: var(--platinum-wash); }
.tier-diamond { --tier: var(--diamond); --tier-wash: var(--diamond-wash); }

.tier-icon {
  width: 28px;
  height: 28px;
  flex: none;
  color: var(--tier, var(--text-3));
  object-fit: contain;
}

.tier-icon-lg {
  width: 64px;
  height: 64px;
}

.tier-icon-xl {
  width: 96px;
  height: 96px;
  filter: drop-shadow(0 6px 22px color-mix(in srgb, var(--tier, #000) 55%, transparent));
}

/* Metallic lettering for level names. The colour underneath is the fallback
 * for a browser without background-clip on text. */
/* A level name takes its level's colour. It was a clipped metallic gradient
 * for a while; at this size that read as a sticker rather than as a rank. The
 * per-level classes exist because the name is not always inside an element
 * carrying the tier class. */
.metal { color: var(--tier, var(--text)); }
.metal-bronze { color: var(--bronze); }
.metal-silver { color: var(--silver); }
.metal-gold { color: var(--gold); }
.metal-platinum { color: var(--platinum); }
.metal-diamond { color: var(--diamond); }

.tier-tag {
  display: inline-block;
  padding: 3px 10px;
  border: 1px solid var(--tier);
  border-radius: 999px;
  background: var(--tier-wash);
  color: var(--tier);
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.topbar-links a.topbar-vip {
  color: var(--tier, var(--gold));
  font-weight: 650;
}

.topbar-links a.topbar-vip::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-right: 8px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 10px currentColor;
}

.btn-gold {
  border-color: var(--gold);
  background: linear-gradient(180deg, #ffe07a, var(--gold));
  color: var(--on-gold);
  box-shadow: 0 6px 24px -8px var(--gold);
}

.btn-gold:hover {
  border-color: #ffe08a;
  background: #ffe08a;
  color: var(--on-gold);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.pill + a {
  margin-left: 10px;
}

.perk-yes {
  color: var(--ok);
  font-weight: 800;
}

.perk-no {
  color: var(--text-3);
}

.pill-reward-unlocked {
  border-color: var(--gold);
  background: var(--gold-wash);
  color: var(--gold);
}

.pill-reward-claimed,
.pill-flag {
  border-color: var(--warn);
  background: var(--warn-wash);
  color: var(--warn);
}

.pill-reward-paid {
  border-color: var(--ok);
  background: var(--ok-wash);
  color: var(--ok);
}

a.pill {
  text-decoration: none;
}

/* ------------------------------------------------ customer VIP page
 *
 * Restrained on purpose. This sits on a site where the other screens show
 * somebody's bank account and a live price, so the VIP pages use the same
 * hairlines, the same tight radii and the same tabular figures. The level
 * colour appears on the emblem, the level name and one border; nothing else
 * is tinted.
 *
 * Motion: one entrance animation for the ring and one for the level-up card.
 * Nothing loops. A gradient that animates forever costs frames on a mid-range
 * phone, which is exactly the device this is read on.
 */

.vc-hero {
  position: relative;
  overflow: hidden;
  margin: 0 0 30px;
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-top: 1px solid color-mix(in srgb, var(--tier) 40%, var(--line));
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 50% -30%, color-mix(in srgb, var(--tier) 14%, transparent), transparent 70%),
    linear-gradient(180deg, var(--surface-2), var(--surface) 60%);
}

.vc-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.vc-hero-kicker {
  margin: 0;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

.vc-chip {
  margin: 0;
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
}

.vc-chip .num,
.vc-hero-next .num {
  color: var(--text);
}

.vc-hero-main {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 18px 0;
}

/* The emblem sits on a plain plate. A progress ring around it said the same
 * thing as the bar below, and at three percent it drew a stray dash. */
.vc-plate {
  display: grid;
  place-items: center;
  width: 96px;
  height: 96px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-2);
}

.vc-plate .tier-icon-xl {
  width: 58px;
  height: 58px;
}

.vc-level-name {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(30px, 8vw, 38px);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -.015em;
}

.vc-level-none {
  color: var(--text-2);
  font-size: .62em;
}

.vc-points {
  margin: 4px 0 0;
  color: var(--text-3);
  font-size: 14px;
}

.vc-points strong {
  color: var(--text);
  font-size: 16px;
  font-weight: 700;
}

.vc-hero-next {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 10px 0 0;
  color: var(--text-2);
  font-size: 13px;
}

.vc-hero-next .perk-icon {
  width: 16px;
  height: 16px;
  color: var(--text-3);
}

.vc-progress {
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.vc-progress-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.vc-progress-label {
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.vc-progress-pct {
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.vc-bar,
.vip-bar {
  display: block;
  width: 100%;
  height: 6px;
  margin: 10px 0 7px;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-3);
  appearance: none;
}

.vc-bar::-webkit-progress-bar,
.vip-bar::-webkit-progress-bar {
  border-radius: 999px;
  background: var(--surface-3);
}

.vc-bar::-webkit-progress-value,
.vip-bar::-webkit-progress-value {
  border-radius: 999px;
  background: var(--tier, var(--accent));
}

.vc-bar::-moz-progress-bar,
.vip-bar::-moz-progress-bar {
  border-radius: 999px;
  background: var(--tier, var(--accent));
}

.vc-progress-ends span {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 600;
}

.vc-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
}

.vc-stats div {
  padding: 14px 10px 0;
}

.vc-stats div + div {
  border-left: 1px solid var(--line);
}

.vc-stats dt {
  color: var(--text-3);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.vc-stats dd span {
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
}

/* Not clipped with an ellipsis: on a narrow phone that cut the unit off the
   end of the figure, so "1,200.00 USDT" read as "1,200.00 US…". */
.vc-stats dd {
  margin: 4px 0 0;
  color: var(--text);
  font-size: clamp(13px, 3.6vw, 16px);
  font-weight: 700;
  overflow-wrap: anywhere;
}

@media (min-width: 860px) {
  .vc-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, .8fr);
    grid-template-areas:
      "top top"
      "main progress"
      "stats stats";
    column-gap: 40px;
    padding: 24px 26px;
  }

  .vc-hero-top { grid-area: top; }
  .vc-hero-main { grid-area: main; margin-bottom: 0; }
  .vc-progress { grid-area: progress; align-self: center; border-top: 0; padding-top: 18px; }
  .vc-stats { grid-area: stats; }
  .vc-plate { width: 112px; height: 112px; }
  .vc-plate .tier-icon-xl { width: 66px; height: 66px; }
}

.vc-section {
  margin: 0 0 34px;
}

.vc-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 0 0 14px;
  font-family: var(--display);
  font-size: 19px;
  font-weight: 700;
}

.vc-count {
  color: var(--gold);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
}

.vc-hint {
  margin: 10px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

/* Rewards waiting to be claimed. */
.vc-gifts {
  display: grid;
  gap: 10px;
}

@media (min-width: 720px) {
  .vc-gifts {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  }
}

.vc-gift {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--gold) 35%, var(--line));
  border-radius: var(--radius);
  background: var(--surface);
}

.vc-gift-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background: var(--gold-wash);
  color: var(--gold);
}

.vc-gift-icon .perk-icon {
  width: 20px;
  height: 20px;
}

.vc-gift-body p {
  margin: 0;
}

.vc-gift-amount {
  color: var(--gold);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
}

.vc-gift-name {
  color: var(--text-2);
  font-size: 13.5px;
}

.vc-gift-note {
  color: var(--text-3);
  font-size: 12.5px;
}

.vc-gift-btn {
  min-height: 42px;
  padding: 0 18px;
}

/* How points are earned, and the calculator. */
.vc-earn {
  display: grid;
  gap: 10px;
  margin-bottom: 10px;
}

@media (min-width: 560px) {
  .vc-earn {
    grid-template-columns: 1fr 1fr;
  }
}

.vc-earn-tile {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.vc-earn-tile p {
  margin: 0;
}

.vc-earn-x {
  font-size: 20px;
  font-weight: 700;
}

.vc-earn-buy .vc-earn-x { color: var(--accent); }
.vc-earn-sell .vc-earn-x { color: var(--sell); }

.vc-earn-what {
  color: var(--text);
  font-weight: 600;
}

.vc-earn-pts {
  margin-left: auto !important;
  color: var(--text-3);
  font-size: 13.5px;
}

.vc-earn-tag {
  order: 2;
  padding: 2px 8px;
  border: 1px solid color-mix(in srgb, var(--sell) 45%, var(--line));
  border-radius: 999px;
  color: var(--sell);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

@media (min-width: 900px) {
  .vc-earn-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
    align-items: start;
  }

  .vc-earn {
    grid-template-columns: 1fr;
    margin-bottom: 0;
  }
}

.vc-calc {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.vc-calc-title {
  margin: 0 0 12px;
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.vc-calc-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.vc-calc-fields label span {
  display: block;
  margin-bottom: 5px;
  color: var(--text-3);
  font-size: 12.5px;
}

.vc-calc-fields .input {
  width: 100%;
  font-size: 16px;
  font-weight: 600;
}

.vc-calc-result {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 8px;
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--text-3);
  font-size: 13.5px;
}

.vc-calc-points {
  color: var(--text);
  font-size: 24px;
  font-weight: 700;
}

.vc-calc-level {
  flex-basis: 100%;
  color: var(--tier, var(--text-2));
  font-weight: 600;
}

/* The level track and the cards under it. */
.vc-track {
  position: relative;
  display: flex;
  justify-content: space-between;
  margin: 0 0 16px;
  padding: 0 4px;
  list-style: none;
}

.vc-track::before {
  content: "";
  position: absolute;
  top: 6px;
  left: 14px;
  right: 14px;
  height: 1px;
  background: var(--line);
}

.vc-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  width: 20%;
}

.vc-node-dot {
  width: 13px;
  height: 13px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: var(--ground);
}

.vc-node.is-done .vc-node-dot,
.vc-node.is-current .vc-node-dot {
  border-color: var(--tier);
  background: var(--tier);
}

.vc-node.is-current .vc-node-dot {
  outline: 1px solid var(--tier);
  outline-offset: 3px;
}

.vc-node-name {
  color: var(--text-3);
  font-size: 11.5px;
  font-weight: 600;
}

.vc-node.is-done .vc-node-name,
.vc-node.is-current .vc-node-name {
  color: var(--text-2);
}

.vc-levels {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 68%;
  gap: 10px;
  margin: 0 calc(var(--gutter) * -1);
  padding: 4px var(--gutter) 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.vc-levels::-webkit-scrollbar {
  display: none;
}

.vc-levels:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

@media (min-width: 900px) {
  .vc-levels {
    grid-auto-flow: row;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    margin: 0;
    padding: 0;
    overflow: visible;
  }
}

.vc-level {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  scroll-snap-align: center;
}

.vc-level.is-current {
  border-color: var(--tier);
}

.vc-level.is-locked {
  background: transparent;
}

.vc-level.is-locked .tier-icon {
  opacity: .5;
}

.vc-level-badge .tier-icon-lg {
  width: 40px;
  height: 40px;
}

.vc-level h3 {
  margin: 12px 0 2px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.vc-level p {
  margin: 0;
}

.vc-level-points {
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.vc-level-points span {
  margin-left: 3px;
  color: var(--text-3);
  font-size: 12px;
  font-weight: 500;
}

.vc-level-bonus {
  margin-top: 4px !important;
  color: var(--text-2);
  font-size: 13px;
}

.vc-level-bonus .num {
  color: var(--gold);
  font-weight: 700;
}

.vc-level-away {
  margin-top: 8px !important;
  color: var(--text-3);
  font-size: 12px;
}

.vc-level-examples {
  width: 100%;
  margin: 12px 0 0;
  padding: 10px 0 0;
  border-top: 1px solid var(--line);
  list-style: none;
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.7;
}

.vc-ribbon {
  position: absolute;
  top: 16px;
  right: 16px;
  color: var(--tier);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.vc-ribbon-done {
  color: var(--text-3);
}

.vc-ribbon-next {
  color: var(--text-2);
}

/* Perks, one tab per level. Radio inputs, so it needs no script. */
.vc-tab-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.vc-tabs {
  display: flex;
  gap: 6px;
  margin: 0 calc(var(--gutter) * -1) 14px;
  padding: 0 var(--gutter) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.vc-tabs::-webkit-scrollbar {
  display: none;
}

.vc-tab {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 7px;
  min-height: 48px;
  padding: 0 14px 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-3);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}

.vc-tab .tier-icon {
  width: 22px;
  height: 22px;
  opacity: .75;
}

.vc-panel {
  display: none;
}

#tab-bronze:checked ~ .vc-tabs [for="tab-bronze"],
#tab-silver:checked ~ .vc-tabs [for="tab-silver"],
#tab-gold:checked ~ .vc-tabs [for="tab-gold"],
#tab-platinum:checked ~ .vc-tabs [for="tab-platinum"],
#tab-diamond:checked ~ .vc-tabs [for="tab-diamond"] {
  border-color: var(--tier);
  background: var(--surface);
  color: var(--text);
}

#tab-bronze:checked ~ .vc-tabs [for="tab-bronze"] .tier-icon,
#tab-silver:checked ~ .vc-tabs [for="tab-silver"] .tier-icon,
#tab-gold:checked ~ .vc-tabs [for="tab-gold"] .tier-icon,
#tab-platinum:checked ~ .vc-tabs [for="tab-platinum"] .tier-icon,
#tab-diamond:checked ~ .vc-tabs [for="tab-diamond"] .tier-icon {
  opacity: 1;
}

#tab-bronze:focus-visible ~ .vc-tabs [for="tab-bronze"],
#tab-silver:focus-visible ~ .vc-tabs [for="tab-silver"],
#tab-gold:focus-visible ~ .vc-tabs [for="tab-gold"],
#tab-platinum:focus-visible ~ .vc-tabs [for="tab-platinum"],
#tab-diamond:focus-visible ~ .vc-tabs [for="tab-diamond"] {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

#tab-bronze:checked ~ .vc-panel-bronze,
#tab-silver:checked ~ .vc-panel-silver,
#tab-gold:checked ~ .vc-panel-gold,
#tab-platinum:checked ~ .vc-panel-platinum,
#tab-diamond:checked ~ .vc-panel-diamond {
  display: block;
}

.vc-perk-grid {
  display: grid;
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  list-style: none;
  overflow: hidden;
}

@media (min-width: 760px) {
  .vc-perk-grid {
    grid-template-columns: 1fr 1fr;
  }

  .vc-perk:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
}

.vc-perk {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-top: 1px solid var(--line);
}

.vc-perk:first-child,
.vc-perk:nth-child(2) {
  border-top: 0;
}

@media (max-width: 759px) {
  .vc-perk:nth-child(2) {
    border-top: 1px solid var(--line);
  }
}

.vc-perk .perk-icon {
  width: 18px;
  height: 18px;
  flex: none;
  color: var(--text-3);
}

.vc-perk-name {
  color: var(--text);
  font-size: 14px;
}

.vc-perk-value {
  margin-left: auto;
  color: var(--tier);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

.vc-perk.is-off .vc-perk-name {
  color: var(--text-3);
}

.vc-perk.is-off .vc-perk-value {
  color: var(--text-3);
  font-weight: 500;
}

.vc-compare,
.vc-rules {
  margin-top: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.vc-compare summary,
.vc-rules summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 16px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.vc-compare summary::-webkit-details-marker,
.vc-rules summary::-webkit-details-marker {
  display: none;
}

.vc-compare summary::after,
.vc-rules summary::after {
  content: "+";
  color: var(--text-3);
  font-size: 18px;
}

.vc-compare[open] summary::after,
.vc-rules[open] summary::after {
  content: "\2212";
}

.vc-table {
  width: 100%;
  min-width: 700px;
  border-collapse: collapse;
  font-size: 13.5px;
}

.vc-table th,
.vc-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  color: var(--text-2);
  text-align: center;
}

.vc-table thead th {
  color: var(--tier, var(--text-3));
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.vc-table th:first-child {
  text-align: left;
}

.vc-table tbody th {
  position: sticky;
  left: 0;
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  text-align: left;
}

.vc-rules ol {
  margin: 0;
  padding: 0 18px 16px 34px;
  color: var(--text-2);
  font-size: 14px;
}

.vc-rules li + li {
  margin-top: 6px;
}

/* Rewards and points history. Rows, not tables, so they read on a phone. */
.vc-list {
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  list-style: none;
  overflow: hidden;
}

.vc-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
}

.vc-row + .vc-row {
  border-top: 1px solid var(--line);
}

.vc-row-icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-3);
  font-size: 12.5px;
  font-weight: 700;
}

.vc-row-icon .perk-icon {
  width: 17px;
  height: 17px;
}

.vc-row-unlocked { color: var(--gold); }
.vc-row-claimed { color: var(--warn); }
.vc-row-paid { color: var(--ok); }
.vc-side-buy { color: var(--accent); }
.vc-side-sell { color: var(--sell); }
.vc-side-adjust { color: var(--text-2); }

.vc-row-main,
.vc-row-side {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.vc-row-side {
  align-items: flex-end;
}

.vc-row-title {
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vc-row-sub {
  overflow: hidden;
  color: var(--text-3);
  font-size: 12.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

a.vc-row-sub {
  color: var(--text-3);
}

.vc-row-amount {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.vc-row-amount.is-plus { color: var(--ok); }
.vc-row-amount.is-minus { color: var(--bad); }

.vc-row .pill {
  padding: 2px 9px;
  font-size: 11.5px;
}

.vc-empty {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-align: center;
  color: var(--text-2);
}

.vc-empty-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 10px;
}

/* What the next level adds. */
.vc-upgrade {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

.vc-upgrade-head {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}

.vc-upgrade-head p {
  margin: 0;
}

.vc-upgrade-head .tier-icon-lg {
  width: 38px;
  height: 38px;
}

.vc-upgrade-level {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.vc-upgrade-gap {
  color: var(--text-3);
  font-size: 12.5px;
}

.vc-upgrade-bonus {
  margin-left: auto !important;
  color: var(--gold);
  font-size: 22px;
  font-weight: 700;
}

.vc-upgrade-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (min-width: 760px) {
  .vc-upgrade-list {
    grid-template-columns: 1fr 1fr;
  }

  .vc-upgrade-list li:nth-child(odd) {
    border-right: 1px solid var(--line);
  }
}

.vc-upgrade-list li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 16px;
  border-top: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
}

.vc-upgrade-list li:first-child,
.vc-upgrade-list li:nth-child(2) {
  border-top: 0;
}

@media (max-width: 759px) {
  .vc-upgrade-list li:nth-child(2) {
    border-top: 1px solid var(--line);
  }
}

.vc-upgrade-list .perk-icon {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--text-3);
}

.vc-upgrade-list strong {
  margin-left: auto;
  color: var(--tier);
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

/* The claim button a phone keeps in reach. Solid, not blurred: a backdrop
 * filter over a scrolling page is one of the most expensive things a phone
 * browser can be asked to do. */
.vc-claim-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  transform: translateY(120%);
  transition: transform .2s ease;
}

.vc-claim-bar.is-on {
  transform: translateY(0);
}

.vc-claim-bar p {
  flex: 1;
  margin: 0;
  color: var(--text-2);
  font-size: 13.5px;
}

.vc-claim-bar .num {
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
}

.vc-claim-bar .btn {
  min-height: 42px;
}

@media (min-width: 760px) {
  .vc-claim-bar {
    display: none;
  }
}

/* ------------------------------------------------ level-up */

.levelup {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 20px;
  background: rgba(4, 8, 11, .88);
  animation: levelup-fade .2s ease-out;
}

.levelup-card {
  width: min(400px, 100%);
  padding: 26px 24px 20px;
  border: 1px solid var(--tier);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--tier) 16%, transparent), transparent 70%),
    var(--surface);
  text-align: center;
  animation: levelup-in .3s cubic-bezier(.2, .9, .3, 1) both;
}

/* The level-up screen earns its celebration: it fires once, the first time
 * somebody crosses a threshold, and every part of it stops on its own. */
.levelup-badge {
  position: relative;
  display: grid;
  place-items: center;
  height: 140px;
}

/* A phone held sideways is 360px tall. The badge and its rays are the part
   worth losing there, not the button that closes the screen. */
@media (max-height: 560px) {
  .levelup-badge {
    height: 84px;
  }

  .levelup-badge .tier-icon {
    width: 64px;
    height: 64px;
  }

  .levelup-rays {
    display: none;
  }

  .levelup-amount {
    margin: 8px 0 14px !important;
    font-size: 30px;
  }
}

.levelup-rays {
  position: absolute;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: repeating-conic-gradient(color-mix(in srgb, var(--tier) 38%, transparent) 0 7deg, transparent 7deg 20deg);
  mask-image: radial-gradient(circle, #000 26%, transparent 66%);
  -webkit-mask-image: radial-gradient(circle, #000 26%, transparent 66%);
  animation: levelup-rays 14s linear 1 both;
}

.levelup-badge .tier-icon {
  position: relative;
  width: 118px;
  height: 118px;
  animation: levelup-pop .7s cubic-bezier(.2, 1.3, .4, 1) both;
}

.levelup-burst {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.levelup-burst span {
  position: absolute;
  top: -18px;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  background: var(--gold);
  animation: levelup-fall 2.8s linear 3 both;
}

.levelup-burst span:nth-child(3n) { background: var(--accent); }
.levelup-burst span:nth-child(3n + 1) { background: var(--platinum); }
.levelup-burst span:nth-child(4n) { background: var(--sell); }
.levelup-burst span:nth-child(1) { left: 6%; animation-delay: 0s; }
.levelup-burst span:nth-child(2) { left: 14%; animation-delay: .7s; }
.levelup-burst span:nth-child(3) { left: 22%; animation-delay: .25s; }
.levelup-burst span:nth-child(4) { left: 30%; animation-delay: 1.1s; }
.levelup-burst span:nth-child(5) { left: 38%; animation-delay: .45s; }
.levelup-burst span:nth-child(6) { left: 46%; animation-delay: 1.4s; }
.levelup-burst span:nth-child(7) { left: 54%; animation-delay: .1s; }
.levelup-burst span:nth-child(8) { left: 62%; animation-delay: .9s; }
.levelup-burst span:nth-child(9) { left: 70%; animation-delay: .35s; }
.levelup-burst span:nth-child(10) { left: 78%; animation-delay: 1.25s; }
.levelup-burst span:nth-child(11) { left: 86%; animation-delay: .6s; }
.levelup-burst span:nth-child(12) { left: 94%; animation-delay: 1.6s; }

@keyframes levelup-rays {
  to { transform: rotate(120deg); }
}

@keyframes levelup-pop {
  from { opacity: 0; transform: scale(.4) rotate(-25deg); }
}

@keyframes levelup-fall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(420deg); opacity: .15; }
}

@media (prefers-reduced-motion: reduce) {
  .levelup-burst,
  .levelup-rays {
    display: none;
  }
}

.levelup-kicker {
  margin: 8px 0 0;
  color: var(--tier);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .18em;
  text-transform: uppercase;
}

.levelup-card h2 {
  margin: 6px 0 8px;
  font-family: var(--display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.15;
}

.levelup-card p {
  margin: 0;
  color: var(--text-2);
  font-size: 14.5px;
}

.levelup-amount {
  margin: 10px 0 18px !important;
  color: var(--gold) !important;
  font-size: 40px;
  font-weight: 700;
  line-height: 1.1;
}

@keyframes levelup-fade {
  from { opacity: 0; }
}

@keyframes levelup-in {
  from { opacity: 0; transform: translateY(8px); }
}

/* A short paragraph under a section heading, before the content starts. */


/* ------------------------------------------------ account card and desk */

.vip-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  margin: 0 0 28px;
  padding: 16px 18px;
  border: 1px solid color-mix(in srgb, var(--tier) 40%, #2a3a66);
  border-radius: 20px;
  background:
    radial-gradient(220px 140px at 0% 50%, color-mix(in srgb, var(--tier) 25%, transparent), transparent 70%),
    linear-gradient(120deg, #101d3a, #0c1426 60%, #150f2e);
  color: var(--text);
  text-decoration: none;
}

.vip-card:hover {
  border-color: var(--tier);
  color: var(--text);
  text-decoration: none;
}

.vip-card-body {
  flex: 1 1 200px;
}

.vip-card-body p {
  margin: 0;
}

.vip-card-level {
  font-family: var(--display);
  font-size: 22px;
  font-weight: 800;
}

.vip-card-body .vip-bar {
  height: 8px;
  margin: 8px 0 6px;
}

.vip-card-note {
  color: #b9c3e6;
  font-size: 14px;
}

.vip-hero {
  display: grid;
  gap: 22px;
  margin: 0 0 30px;
  padding: 24px;
  border: 1px solid color-mix(in srgb, var(--tier) 40%, #2a3a66);
  border-radius: 20px;
  background:
    radial-gradient(260px 200px at 0% 0%, color-mix(in srgb, var(--tier) 25%, transparent), transparent 70%),
    linear-gradient(140deg, #101d3a, #0c1426 60%, #150f2e);
}

@media (min-width: 900px) {
  .vip-hero {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
  }

  .vip-hero-stats {
    grid-column: 1 / -1;
  }
}

.vip-hero-rank {
  display: flex;
  align-items: center;
  gap: 16px;
}

.vip-hero-rank p {
  margin: 0;
}

.vip-hero-level {
  color: var(--tier);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
}

.vip-hero-points {
  color: var(--text-2);
}

.vip-progress-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
}

.vip-progress-pct {
  color: var(--text);
  font-family: var(--display);
  font-size: 24px;
  font-weight: 800;
}

.vip-hero-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin: 0;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.vip-hero-stats dt {
  color: var(--text-3);
  font-size: 13px;
}

.vip-hero-stats dd {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 19px;
  font-weight: 700;
}

.ledger td.points-plus {
  color: var(--ok);
}

.ledger td.points-minus {
  color: var(--bad);
}

.ledger td .hint {
  display: block;
  margin: 2px 0 0;
}

.vip-desk-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin: 0 0 26px;
}

.vip-desk-stats div {
  padding: 14px 16px;
  border-left: 3px solid var(--gold);
  background: var(--surface);
}

.vip-desk-stats dt {
  color: var(--text-3);
  font-size: 13px;
}

.vip-desk-stats dd {
  margin: 0;
  color: var(--text);
  font-size: 22px;
  font-weight: 800;
}

.inline-pay {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 320px;
}

.inline-pay .input {
  flex: 1 1 160px;
}

/* Where the money goes, on its own line above the reference field. */
.pay-to {
  display: block;
  flex-basis: 100%;
  color: var(--text-2);
  font-size: 0.85rem;
}

.pay-to .mono {
  color: var(--gold);
  font-weight: 700;
}

.inline-pay .input {
  min-height: 40px;
}

.inline-pay .btn {
  min-height: 40px;
  padding: 0 14px;
}

/* Shown in place of the pay form. .ledger doesn't wrap, and one long line
 * here pushed the whole table past its box. */
.pay-refused {
  white-space: normal;
  min-width: 260px;
  max-width: 360px;
  margin: 0;
}

.vip-desk-forms {
  margin: 26px 0;
}

@media (min-width: 940px) {
  .split.vip-desk-forms {
    grid-template-columns: 1fr 1fr;
  }
}

.pill-reward-cancelled {
  border-color: var(--text-3);
  background: var(--surface-2);
  color: var(--text-3);
}

.vc-row-cancelled {
  background: var(--surface-2);
  color: var(--text-3);
}

.cancel-reward summary {
  margin-top: 8px;
  color: var(--text-3);
  font-size: 13px;
  cursor: pointer;
}

.cancel-reward form {
  margin-top: 8px;
}

.vc-lead {
  margin: -6px 0 14px;
  max-width: 62ch;
  color: var(--text-2);
  font-size: 14.5px;
}

/* The reference a customer hands over: a UTR on a buy, a transaction hash on a
 * sell. Once one is on file this replaces the empty field at the top of the
 * panel, because the old screen looked the same before and after submitting and
 * people submitted the same number four times over.
 */

.ref-saved {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1px solid var(--ok);
  background: var(--ok-wash);
}

.ref-saved-tick {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--ok);
}

.ref-saved-title {
  margin: 0 0 6px;
  font-size: 16px;
  color: var(--ok);
}

.ref-saved-value {
  margin: 0 0 8px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .04em;
  word-break: break-all;
  color: var(--text);
}

.ref-change {
  margin-top: 16px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.ref-change > summary {
  cursor: pointer;
  color: var(--text-3);
  font-size: 13.5px;
  list-style: none;
}

.ref-change > summary::-webkit-details-marker { display: none; }

.ref-change > summary::before {
  content: "+ ";
  color: var(--accent);
}

.ref-change[open] > summary::before { content: "- "; }

.ref-change > summary:hover { color: var(--text-2); }

.ref-change > summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Picking the chain, on the buy and sell screens. Radios rather than a select,
 * because there are two of them and the whole point is that the choice is
 * visible before the price is quoted rather than buried in a dropdown.
 */

.chain-choice {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}

.chain-option {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 13px 15px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--surface-2);
  cursor: pointer;
  font-size: 14.5px;
}

.chain-option:hover { border-color: var(--accent); }

.chain-option input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
  flex: 0 0 auto;
  margin: 0;
}

.chain-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.chain-option:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* The CSV buttons under the books. A row that wraps, rather than a list, so
 * eight of them fit on a phone without becoming eight full-width bars.
 */

.downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.downloads .btn { flex: 0 0 auto; }

/* What the nightly check found, one finding per line. It used to be a single
 * paragraph carrying eighty-nine journal numbers and two raw UUIDs, which is
 * information nobody reads and therefore no information at all.
 */

.findings {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  display: grid;
  gap: 12px;
  /* A grid item is min-width:auto by default, so the table inside a finding
   * pushed the whole panel wider than the phone and the text was clipped
   * rather than wrapped. Both levels need it: the track and the item.
   */
  min-width: 0;
}

.finding {
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 13px 15px 13px 16px;
  border-radius: 10px;
  border: 1px solid var(--line);
  border-left-width: 3px;
  background: var(--surface-2);
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--text-2);
}

.finding strong { color: var(--text); }
.finding-bad { border-left-color: var(--bad); }
.finding-warn { border-left-color: var(--warn); }

.finding .mono { color: var(--accent); }

/* Wrapped in its own scroller by the template, so a long email scrolls inside
 * the finding instead of widening it.
 */
table.owed {
  margin-top: 10px;
  width: 100%;
  /* No minimum. The amount is the column that matters and a long email was
   * pushing it off the edge; the address wraps instead.
   */
  table-layout: fixed;
}

table.owed td:first-child {
  /* .ledger sets white-space: nowrap for the money columns, which an email
   * address then runs straight through. Same escape hatch .ledger .id uses.
   */
  white-space: normal;
  overflow-wrap: anywhere;
}

table.owed td:last-child,
table.owed th:last-child {
  width: 40%;
  white-space: nowrap;
}

.owed-scroll {
  overflow-x: auto;
  max-width: 100%;
}

table.owed td, table.owed th { padding: 6px 14px 6px 0; }

/* ---------------------------------------------------------------- books: period and stats */

.period-custom {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: -6px 0 26px;
}

.period-custom .field {
  flex: 1 1 150px;
  max-width: 220px;
}

.stats {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
  margin: 0 0 30px;
}

@media (min-width: 560px) {
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 940px) {
  .stats {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .stats-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.stat {
  position: relative;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, var(--surface-3) 0%, var(--surface) 70%);
  overflow: hidden;
}

/* A coloured edge on the left, not a bar across the top: the tile's colour
 * says what kind of money it is, and the figure stays the loudest thing. */
.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--line-strong);
}

.stat-accent { background: linear-gradient(160deg, var(--accent-wash) 0%, var(--surface) 75%); border-color: var(--accent-quiet); }
.stat-accent::before { background: var(--accent); }
.stat-accent .stat-figure { color: var(--accent); }

.stat-buy::before { background: var(--platinum); }
.stat-sell::before { background: var(--sell); }
.stat-sell .stat-figure { color: var(--sell); }
.stat-ok::before { background: var(--ok); }
.stat-ok .stat-figure { color: var(--ok); }

.stat-label {
  margin: 0 0 6px;
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
}

.stat-figure {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(24px, 3.4vw, 30px);
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.1;
  color: var(--text);
  overflow-wrap: anywhere;
}

.stat-figure span {
  font-size: .5em;
  font-weight: 600;
  color: var(--text-3);
}

.stat-sub {
  margin: 6px 0 0;
  color: var(--text-3);
  font-size: 13px;
}

/* ---------------------------------------------------------------- books: statement check */

.statement-check {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 16px 24px;
  background: var(--surface);
}

.statement-check p {
  flex: 1 1 260px;
  margin: 0;
  color: var(--text-2);
  font-size: 14.5px;
}

.statement-check strong { color: var(--text); }
.statement-check-ok { box-shadow: inset 4px 0 0 var(--ok); }
.statement-check-ok strong { color: var(--ok); }
.statement-check-bad { box-shadow: inset 4px 0 0 var(--bad); background: var(--bad-wash); }
.statement-check-bad strong { color: var(--bad); }

/* ---------------------------------------------------------------- books: downloads */

.downloads {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 10px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.downloads a {
  display: grid;
  gap: 3px;
  min-height: 48px;
  height: 100%;
  padding: 13px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  text-decoration: none;
}

.downloads a:hover {
  border-color: var(--accent);
  background: var(--accent-wash);
}

.downloads-name {
  color: var(--accent);
  font-weight: 600;
}

.downloads-hint {
  color: var(--text-3);
  font-size: 13px;
}

.note .btn {
  margin-top: 12px;
}

/* ---------------------------------------------------------------- account names */

.account-code {
  display: block;
  margin-top: 2px;
  color: var(--text-3);
  font-size: 12.5px;
  white-space: normal;
  overflow-wrap: anywhere;
}

/* ---------------------------------------------------------------- treasury */

.treasury-form [hidden] {
  display: none;
}

.choice {
  margin: 0;
  padding: 0;
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.choice legend {
  width: 100%;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-2);
}

.choice label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text);
  cursor: pointer;
}

.choice label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-wash);
  color: var(--accent);
}

.ledger tr.undone td {
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.ledger tr.undone td:first-child,
.ledger tr.undone td:last-child {
  text-decoration: none;
}

.undo {
  margin-top: 4px;
}

.undo summary {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  color: var(--sell);
  cursor: pointer;
  font-size: 14px;
}

.undo-form {
  display: grid;
  gap: 8px;
  min-width: 190px;
  padding-top: 8px;
  white-space: normal;
}

.checks {
  display: grid;
  gap: 10px;
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.checks li {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-left-width: 4px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.checks .check-ok { border-left-color: var(--ok); }
.checks .check-bad { border-left-color: var(--bad); background: var(--bad-wash); }

.checks-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 12px;
  margin: 0;
  font-size: 14px;
}

.check-ok .checks-head strong { color: var(--ok); }
.check-bad .checks-head strong { color: var(--bad); }

.checks-head span {
  color: var(--text-3);
  font-size: 13px;
}

.checks-gap {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 12px;
  margin: 8px 0 0;
  font-size: 13.5px;
}

.checks-gap dt { color: var(--text-3); }
.checks-gap dd { margin: 0; color: var(--text); overflow-wrap: anywhere; }

/* ---------------------------------------------------------------- stacked tables on a phone
 *
 * A five-column money table in a horizontal scroller put the one column that
 * mattered off the right edge of a 390px screen, where nobody scrolls to it.
 * Below 720px each row becomes a card: the first cell is its title, and every
 * other cell is a line with its column name on the left and the figure on the
 * right.
 */
@media (max-width: 719px) {
  .scroll:has(> .stack) {
    overflow: visible;
    border: 0;
    background: none;
  }

  .ledger.stack,
  .ledger.stack tbody,
  .ledger.stack tr,
  .ledger.stack td {
    display: block;
    width: 100%;
  }

  .ledger.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  .ledger.stack tr {
    margin: 0 0 10px;
    padding: 6px 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--surface);
  }

  .ledger.stack td {
    padding: 8px 16px;
    border: 0;
    white-space: normal;
    text-align: left;
  }

  .ledger.stack td:first-child {
    padding-top: 10px;
    font-weight: 600;
    overflow-wrap: anywhere;
  }

  .ledger.stack td[data-label] {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    text-align: right;
  }

  .ledger.stack td[data-label]::before {
    content: attr(data-label);
    color: var(--text-3);
    font-family: var(--sans);
    font-weight: 400;
    text-align: left;
    text-decoration: none;
  }

  .ledger.stack tbody tr:hover td {
    background: none;
  }

  /* The VIP payout form sits in a table cell with a desktop minimum width,
   * which pushed the member page 117px past a phone's edge. */
  .ledger.stack .inline-pay {
    min-width: 0;
  }

  .ledger.stack .inline-pay .input {
    flex: 1 1 auto;
    min-width: 0;
  }
}

.plain-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

/* Keys page: each key on one line with its remove button at the end. */
.key-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.btn-small {
  min-height: 44px;
  padding: 0 14px;
  font-size: 14px;
}

/* The dollar figure next to a rupee balance: smaller, on its own line. */
.vip-desk-stats dd .hint {
  display: block;
  margin: 2px 0 0;
  font-size: 13px;
  font-weight: 600;
}

.vip-settings {
  margin: 0 0 26px;
}

.vip-settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 14px 14px;
}

.vip-settings-grid .field {
  margin: 0;
}

.vip-settings .panel-title + .vip-settings-grid {
  margin-top: 10px;
}

.vip-settings .hint + .panel-title {
  margin-top: 22px;
}

.vip-books .hint:first-of-type {
  margin-top: 0;
}

.facts .vip-books-keep {
  color: var(--ok);
  font-weight: 800;
}

.facts.vip-books-owed {
  margin-top: 18px;
}

/* Weekly, monthly and anniversary rewards filling up. Each has its own colour
   so the three read apart at a glance on a phone. */
.vc-coming {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.vc-coming-tile {
  --tone: var(--accent);
  --tone-wash: var(--accent-wash);
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--tone) 40%, var(--line));
  border-radius: var(--radius);
  background: linear-gradient(150deg, var(--tone-wash), var(--surface) 70%);
}

.vc-coming-monthly {
  --tone: var(--platinum);
  --tone-wash: var(--platinum-wash);
}

.vc-coming-anniversary {
  --tone: var(--gold);
  --tone-wash: var(--gold-wash);
}

.vc-coming-tile p {
  margin: 0;
}

.vc-coming-name {
  color: var(--text-2);
  font-size: 13.5px;
  font-weight: 600;
}

.vc-coming-amount {
  margin: 4px 0 2px;
  color: var(--tone);
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
}

.vc-coming-when {
  color: var(--text-3);
  font-size: 13px;
}
