/* ==========================================================================
   Paymesh Design System — tokens and components
   Token names mirror the Figma variables (text/primary → --text-primary,
   spacing/16 → --spacing-16, Heading/3XL/Bold → --heading-3xl, …).
   Components carry the Figma component name in a comment and use a ds- prefix
   so they can sit alongside the original prototype styles in app.css.
   ========================================================================== */

/* Rebond Grotesque — the .otf files uploaded to the repo (assets/fonts); a weight downloads only when used */
@font-face {
  font-family: "Rebond Grotesque";
  src: url("../assets/fonts/Rebond Grotesque.otf") format("opentype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rebond Grotesque";
  src: url("../assets/fonts/Rebond Grotesque Medium.otf") format("opentype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rebond Grotesque";
  src: url("../assets/fonts/Rebond Grotesque Semibold.otf") format("opentype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rebond Grotesque";
  src: url("../assets/fonts/Rebond Grotesque Bold.otf") format("opentype");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Rebond Grotesque";
  src: url("../assets/fonts/Rebond Grotesque Extrabold.otf") format("opentype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

:root {
  /* Colour — text */
  --text-primary: #1b1b1e;
  --text-secondary: #4f4f58;
  --text-tertiary: #72727a;
  --text-default: #0c0e10;
  --text-inverse: #fafafb;
  --text-brand: #503ff1;
  --text-muted: #6e6e6e;

  /* Colour — action, icon, border, surface */
  --action-primary-default: #503ff1;
  --action-primary-hover: #4331d4;
  --icon-primary: #26262a;
  --border-default: #bdbdc1;
  --border-subtle: #e5e5e7;
  --border-focus: #818dfe;
  --border-danger: #fc0606;
  --surface-primary: #fafafb;
  --surface-secondary: #f4f4f6;
  --base-white: #ffffff;
  --neutral-300: #d4d4d4;
  --neutral-700: #404040;
  --brand-100: #f4ebff;

  /* Spacing */
  --spacing-0: 0;
  --spacing-2: 2px;
  --spacing-4: 4px;
  --spacing-8: 8px;
  --spacing-12: 12px;
  --spacing-16: 16px;
  --spacing-24: 24px;
  --spacing-32: 32px;
  --spacing-48: 48px;
  --spacing-72: 72px;
  --spacing-96: 96px;

  /* Radius */
  --radius-s: 4px;
  --radius-m: 8px;
  --radius-xl: 16px;
  --radius-full: 999px;

  /* Effects */
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-xs-focused: 0 1px 2px rgba(0, 0, 0, .05), 0 0 0 4px var(--brand-100);
  /* Selected input: the 1px border plus a 1px inset ring reads as a 2px border
     without shifting the content */
  --shadow-input-selected: inset 0 0 0 1px var(--action-primary-default), var(--shadow-xs-focused);
  --shadow-card-outer: 0 2px 4px rgba(0, 0, 0, .04);
  --shadow-card-inner: 0 6px 16px rgba(0, 0, 0, .04), 0 2px 4px rgba(0, 0, 0, .04), 0 0 1px rgba(0, 0, 0, .4);

  /* Type — families */
  --font-family-rebond: "Rebond Grotesque", "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-family-inter: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --tracking-text: -0.16px;

  /* Type — styles (weight size/line-height family) */
  --heading-3xl: 700 40px/40px var(--font-family-rebond);
  --heading-2xl: 700 32px/32px var(--font-family-rebond);
  --heading-m-bold: 700 20px/28px var(--font-family-rebond);
  --heading-m: 600 20px/28px var(--font-family-rebond);
  --heading-s: 600 18px/26px var(--font-family-rebond);
  --heading-xs: 600 16px/24px var(--font-family-rebond);
  --heading-l: 600 24px/32px var(--font-family-rebond);
  --text-m: 400 16px/24px var(--font-family-inter);
  --text-m-medium: 500 16px/24px var(--font-family-inter);
  --text-m-semibold: 600 16px/24px var(--font-family-inter);
  --text-s: 400 14px/20px var(--font-family-inter);
  --text-xs: 400 12px/16px var(--font-family-inter);
  --text-xs-medium: 500 12px/16px var(--font-family-inter);
  --label-m: 600 14px/20px var(--font-family-inter);
  --button-l: 600 18px/26px var(--font-family-inter);
  --link-m: 400 16px/24px var(--font-family-inter);
  --link-m-semibold: 600 16px/24px var(--font-family-inter);
  --link-l-semibold: 600 18px/26px var(--font-family-inter);

  /* Metrics */
  --ds-col: 458px;
  --ds-widget: 423px;
  --ds-control-h: 52px;
}

/* ==========================================================================
   Layout — registration-* frames
   ========================================================================== */

.ds-page {
  /* The footer sits at the very bottom of the screen: the large viewport
     height runs under the browser's bottom bar and doesn't jump with it. */
  min-height: 100vh;
  min-height: 100lvh;
  display: flex;
  flex-direction: column;
  padding: var(--spacing-32) var(--spacing-16);
  background: var(--base-white);
  color: var(--text-primary);
  font: var(--text-m);
  letter-spacing: var(--tracking-text);
}

/* navigation */
.ds-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--spacing-16);
  min-height: 32px;
}
.ds-nav .logo svg { height: 32px; width: auto; }
.ds-nav .logo__mark { display: none; }

/* Main Content */
.ds-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-72) 10px var(--spacing-96);
}

.ds-container { width: var(--ds-col); max-width: 100%; }
.ds-container--widget { width: var(--ds-widget); }
.ds-container--center { text-align: center; }

/* Pinned CTA (page({ cta })): follows the content on desktop; on phones it sits
   at the bottom above the footer, and above the keyboard while typing. */
.ds-cta { margin-top: var(--spacing-24); }
.ds-cta--float { position: fixed; left: var(--spacing-16); right: var(--spacing-16); z-index: 40; margin: 0; }

/* Vertical rhythm — the auto-layout gaps used across the frames */
.ds-stack { display: flex; flex-direction: column; align-items: stretch; }
.ds-stack--4 { gap: var(--spacing-4); }
.ds-stack--8 { gap: var(--spacing-8); }
.ds-stack--16 { gap: var(--spacing-16); }
.ds-stack--24 { gap: var(--spacing-24); }
.ds-stack--32 { gap: var(--spacing-32); }
.ds-stack--48 { gap: var(--spacing-48); }
.ds-stack--center { align-items: center; }

/* footer-info */
.ds-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--spacing-16);
  text-align: center;
}
.ds-footer__methods { display: flex; gap: var(--spacing-8); }
.ds-footer__text { display: flex; flex-direction: column; gap: 6px; }
.ds-footer__line { margin: 0; font: var(--text-xs-medium); color: var(--text-primary); }
.ds-footer__line a { color: inherit; }

/* Payment method icon — 34×24 card-scheme badge */
.ds-method {
  width: 34px; height: 24px;
  display: inline-grid; place-items: center;
  flex: 0 0 auto;
  background: var(--base-white);
  border: 1px solid #e5e5e5;
  border-radius: var(--radius-s);
}
.ds-method img { width: 22px; height: auto; }
img.ds-method { border: 0; background: none; }
.ds-method--lg { width: 45px; height: 32px; }
.ds-method--lg img { width: 28px; height: auto; }

/* ==========================================================================
   Typography
   ========================================================================== */

.ds-h1 { margin: 0; font: var(--heading-3xl); letter-spacing: 0; color: var(--text-primary); }
.ds-h2 { margin: 0; font: var(--heading-s); letter-spacing: 0; color: var(--text-primary); }
.ds-body { margin: 0; font: var(--text-m); color: var(--text-default); }
.ds-body strong { font-weight: 600; }
.ds-small { margin: 0; font: var(--text-s); color: var(--text-default); }
.ds-center { text-align: center; }

/* Link — Link/M/Regular, underlined */
.ds-link {
  display: inline;
  padding: 0;
  background: none;
  border: 0;
  font: var(--link-m);
  letter-spacing: var(--tracking-text);
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.ds-link:hover { opacity: .7; }
.ds-link--strong { font: var(--link-m-semibold); }
.ds-link--block { display: block; margin: 0 auto; text-align: center; }

/* ==========================================================================
   Button — primary / secondary / link, L size
   ========================================================================== */

.ds-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-8);
  width: 100%;
  height: var(--ds-control-h);
  padding: var(--spacing-12) var(--spacing-16) var(--spacing-12) 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  font: var(--button-l);
  letter-spacing: 0;
  cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.ds-btn img { width: 24px; height: 24px; flex: 0 0 auto; }

.ds-btn--primary { background: var(--action-primary-default); color: var(--text-inverse); }
.ds-btn--primary:hover { background: var(--action-primary-hover); }

.ds-btn--secondary { background: var(--base-white); color: var(--text-primary); border-color: var(--border-default); }
.ds-btn--secondary:hover { background: var(--surface-primary); }

/* Link-style button ("Find address manually", "Add card") */
.ds-btn--link {
  width: auto;
  align-self: flex-start;
  background: var(--base-white);
  color: var(--text-primary);
  font: var(--link-m-semibold);
  text-decoration: underline;
  text-underline-offset: 3px;
  height: auto;
  padding: 10px var(--spacing-16) 10px 14px;
}
.ds-btn--link:hover { background: var(--surface-primary); }
.ds-btn--link-l { font: var(--link-l-semibold); height: var(--ds-control-h); }

/* Buttons are never disabled; a busy button ignores repeat presses. */
.ds-btn--busy { cursor: progress; }

/* Spinner/White — the 24px ring from the design system, turning */
.ds-spinner { width: 24px; height: 24px; animation: ds-spin .8s linear infinite; }
@keyframes ds-spin { to { transform: rotate(360deg); } }

/* Authorize button — label, spinner and "Continue" stacked in one centred cell
   and animated by checkout.js#authorizeSequence */
.ds-btn.ds-auth { display: grid; place-items: center; overflow: hidden; }
.ds-auth > * { grid-area: 1 / 1; }
.ds-auth__label { white-space: nowrap; }
.ds-auth__spinner { position: relative; z-index: 1; width: 24px; height: 24px; }
.ds-auth__spinner img { display: block; width: 24px; height: 24px; }

/* Social sign-up buttons: label centred, provider logo pinned 16px from the left */
.ds-social .ds-btn { position: relative; }
/* left is measured inside the 1px border, so subtract it to land 16px from the outer edge */
.ds-social .ds-btn img { position: absolute; left: calc(var(--spacing-16) - 1px); top: 50%; transform: translateY(-50%); }

/* Or Divider */
.ds-or {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--spacing-24);
  font: var(--label-m);
  letter-spacing: 0;
  text-transform: uppercase;
  color: #000;
}
.ds-or::before, .ds-or::after { content: ""; height: 1px; background: var(--border-subtle); }

/* ==========================================================================
   input — label, control, helper text
   ========================================================================== */

.ds-field { display: flex; flex-direction: column; gap: var(--spacing-8); }

.ds-label { font: var(--label-m); letter-spacing: 0; color: var(--text-primary); }
.ds-label__req { color: var(--border-danger); }
.ds-label__optional { color: var(--text-secondary); font-weight: 600; }

.ds-input {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  height: var(--ds-control-h);
  padding: 0 var(--spacing-12) 0 var(--spacing-16);
  background: var(--base-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ds-input:focus-within { border-color: var(--action-primary-default); box-shadow: var(--shadow-input-selected); }
.ds-input:has([aria-invalid="true"]) { border-color: var(--border-danger); }

.ds-input input,
.ds-input select {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: none;
  background: transparent;
  font: var(--text-m);
  letter-spacing: var(--tracking-text);
  color: var(--text-primary);
}
.ds-input input::placeholder { color: var(--text-secondary); }
.ds-input > img { width: 24px; height: 24px; flex: 0 0 auto; }

/* Select — native select with the design-system chevron */
.ds-input--select { position: relative; padding-right: var(--spacing-16); }
.ds-input--select select { appearance: none; cursor: pointer; padding-right: 32px; }
.ds-input--select > img { position: absolute; right: var(--spacing-16); pointer-events: none; }

/* Trailing icon button (eye, close) */
.ds-input__btn {
  flex: 0 0 auto;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  padding: 0; border: 0; border-radius: var(--radius-m);
  background: none;
  cursor: pointer;
}
.ds-input__btn:hover { background: var(--surface-secondary); }
.ds-input__btn img { width: 24px; height: 24px; }
.ds-input__btn[data-clear] img { width: 20px; height: 20px; }

.ds-hint { margin: 0; font: var(--text-s); color: var(--text-primary); }

/* Reuses ui.js showError/clearError, which target .field__error */
.ds-field .field__error { margin: 0; font: var(--text-s); color: var(--border-danger); }

/* Card number — scheme badges inside the field */
.ds-input__schemes { display: flex; gap: var(--spacing-4); flex: 0 0 auto; }

/* Phone number — dial-code prefix + number in one bordered field, so focus
   (on either part) highlights the whole thing */
.ds-phone {
  display: grid; grid-template-columns: 122px 1fr;
  background: var(--base-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ds-phone:focus-within { border-color: var(--action-primary-default); box-shadow: var(--shadow-input-selected); }
.ds-phone:has([aria-invalid="true"]) { border-color: var(--border-danger); }
.ds-phone__code {
  position: relative;
  display: flex; align-items: center; gap: var(--spacing-8);
  height: calc(var(--ds-control-h) - 2px);
  padding: 0 var(--spacing-12) 0 var(--spacing-16);
  border-right: 1px solid var(--border-default);
  font: var(--text-m);
  color: var(--text-default);
}
.ds-phone__code [data-dial] { display: flex; align-items: center; gap: var(--spacing-8); white-space: nowrap; }
.ds-phone__code > img { width: 24px; height: 24px; margin-left: -6px; }
.ds-phone__code .flag { width: 24px; height: 24px; border-radius: 50%; box-shadow: 0 0 0 1px var(--border-subtle); }
.ds-phone .ds-input,
.ds-phone .ds-input:focus-within,
.ds-phone .ds-input:has([aria-invalid="true"]) {
  height: calc(var(--ds-control-h) - 2px);
  border: 0; border-radius: 0; box-shadow: none;
  background: transparent; /* let the outer field's selected ring show through */
}

/* Search — leading icon and a results list */
.ds-combo { position: relative; }
.ds-combo__list {
  position: absolute; z-index: 20;
  top: calc(100% + 6px); left: 0; right: 0;
  margin: 0; padding: 6px;
  list-style: none;
  background: var(--base-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card-inner);
  max-height: 300px; overflow-y: auto;
}
/* options are painted by ui.js#wireAddressLookup */
.ds-combo__list .combo__opt { padding: 10px 12px; border-radius: var(--radius-m); font: var(--text-m); }
.ds-combo__list .combo__opt small { font: var(--text-s); color: var(--text-secondary); }
.ds-combo__list .combo__opt:hover,
.ds-combo__list .combo__opt[aria-selected="true"] { background: var(--surface-secondary); }

/* ==========================================================================
   OTP-input
   ========================================================================== */

.ds-otp { display: flex; justify-content: space-between; gap: var(--spacing-8); padding-bottom: var(--spacing-16); }
.ds-otp__box {
  width: 56px; height: 56px;
  padding: 0;
  text-align: center;
  font: var(--heading-l);
  color: #000;
  background: var(--base-white);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  box-shadow: var(--shadow-xs);
}
.ds-otp__box:focus { outline: none; border-color: var(--action-primary-default); box-shadow: var(--shadow-input-selected); }
.ds-otp[data-invalid="true"] .ds-otp__box { border-color: var(--border-danger); }

/* ==========================================================================
   Checkbox (sm)
   ========================================================================== */

.ds-check { display: inline-flex; align-items: flex-start; gap: var(--spacing-8); cursor: pointer; font: var(--text-s); color: var(--text-primary); }
.ds-check input {
  appearance: none;
  flex: 0 0 auto;
  width: 16px; height: 16px;
  margin: 2px 0 0;
  border: 1px solid var(--neutral-300);
  border-radius: var(--radius-s);
  background: var(--base-white) center/11px no-repeat;
  cursor: pointer;
}
.ds-check input:checked {
  background-color: var(--action-primary-default);
  border-color: var(--action-primary-default);
  background-image: url("../assets/ds/radio-check.svg");
}
.ds-check input:focus-visible { outline: none; box-shadow: var(--shadow-xs-focused); }
.ds-check[data-invalid="true"] input { border-color: var(--border-danger); }
.ds-check a { color: inherit; }
.ds-check--muted { color: var(--neutral-700); }

/* ==========================================================================
   Error status under a primary action (buttons are never disabled)
   ========================================================================== */

[data-form-error] .alert { margin-top: 0; font: var(--text-s); color: var(--border-danger); }

/* ==========================================================================
   Merchant Logo, PaymentValue, image/success
   ========================================================================== */

.ds-art { display: block; width: 120px; height: 120px; object-fit: contain; margin: 0 auto; }

.ds-merchant { display: flex; flex-direction: column; align-items: center; gap: var(--spacing-8); padding-bottom: var(--spacing-16); }
.ds-merchant__logo { width: 48px; height: 48px; border-radius: var(--radius-full); object-fit: cover; }
.ds-merchant__name { font: var(--heading-m); letter-spacing: 0; color: #000; }

.ds-value { display: flex; flex-direction: column; gap: var(--spacing-4); text-align: center; }
.ds-value__usd { font: var(--heading-2xl); letter-spacing: 0; color: #000; }
.ds-value__token { font: var(--heading-s); letter-spacing: 0; color: var(--text-muted); }

.ds-pay-head { display: flex; flex-direction: column; align-items: center; padding: var(--spacing-16) 0; }

/* ==========================================================================
   Payment-widget — outer grey card with an inner white card
   ========================================================================== */

.ds-card {
  display: flex; flex-direction: column; gap: var(--spacing-8);
  padding: var(--spacing-16) 1px 1px;
  background: var(--surface-secondary);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card-outer);
}
.ds-card__title { margin: 0; padding: 0 var(--spacing-16); font: var(--heading-m-bold); letter-spacing: 0; color: var(--text-primary); }
.ds-card__body {
  display: flex; flex-direction: column; align-items: stretch; gap: var(--spacing-16);
  padding: var(--spacing-24) var(--spacing-16) var(--spacing-16);
  background: var(--base-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card-inner);
}
.ds-card__body--32 { gap: var(--spacing-32); }

/* PaymeshBalance / Radio group item */
.ds-option {
  display: flex; align-items: flex-start; gap: var(--spacing-12);
  width: 100%;
  padding: var(--spacing-16);
  background: var(--base-white);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-m);
  text-align: left;
  font: inherit; color: inherit;
}
button.ds-option { cursor: pointer; }
.ds-option__radio {
  flex: 0 0 auto;
  width: 16px; height: 16px; margin-top: 4px;
  border: 1px solid var(--border-default);
  border-radius: 10px;
  background: var(--base-white) center/11px no-repeat;
}
.ds-option__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.ds-option__title { font: var(--text-m-medium); }
.ds-option__sub { font: var(--text-s); }
.ds-option__side { flex: 0 0 auto; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.ds-option__side > img { width: 45px; height: 32px; }

.ds-option[aria-checked="true"] {
  background: var(--surface-primary);
  border-color: var(--border-focus);
  color: var(--text-brand);
}
.ds-option[aria-checked="true"] .ds-option__radio {
  background-color: var(--action-primary-default);
  border-color: var(--action-primary-default);
  background-image: url("../assets/ds/radio-check.svg");
}
.ds-option--disabled { cursor: default; }

.ds-amount { font: var(--text-m-semibold); color: var(--text-primary); }
.ds-amount-sub { font: var(--text-m); color: var(--text-secondary); }

/* Payment-list-item */
.ds-list-item { display: flex; flex-direction: column; gap: var(--spacing-12); padding: var(--spacing-24) 0; }
.ds-list-item__row { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--spacing-8); }
.ds-list-item__label { display: flex; align-items: center; gap: var(--spacing-8); font: var(--text-m-medium); letter-spacing: -0.32px; }
.ds-list-item__label img { width: 24px; height: 24px; }

.ds-address { display: flex; flex-direction: column; border-bottom: 1px solid var(--border-subtle); padding-bottom: var(--spacing-16); }
.ds-address__name { display: flex; align-items: center; gap: var(--spacing-8); padding: 0 var(--spacing-16); font: var(--text-m-medium); letter-spacing: -0.32px; }
.ds-address__name img { width: 24px; height: 24px; }
.ds-address__lines { padding: 0 var(--spacing-16) 0 var(--spacing-48); font: var(--text-m); color: var(--text-secondary); }
.ds-address__lines p { margin: var(--spacing-2) 0 0; }

/* Billing address when it matches shipping — with an Edit link inside the box */
.ds-address-summary {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--spacing-8);
  padding: var(--spacing-16);
  background: var(--surface-primary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  font: var(--text-m);
  color: var(--text-primary);
}
.ds-address-summary p { margin: 0; }
.ds-address-summary__lines { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.ds-address-summary > button { flex: 0 0 auto; }
.ds-address-summary p:first-child { font-weight: 600; }
.ds-link--s-strong { font: 600 14px/20px var(--font-family-inter); letter-spacing: var(--tracking-text); }

/* Two fields side by side (expiry + security code) */
.ds-row-2 { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--spacing-16); }

.ds-divider { height: 1px; background: var(--border-subtle); border: 0; margin: 0; }

/* Info */
.ds-info {
  display: flex; gap: var(--spacing-12);
  padding: var(--spacing-16);
  background: var(--surface-primary);
  border: 1px solid var(--border-focus);
  border-radius: var(--radius-m);
  font: var(--text-s);
  color: var(--text-brand);
}
.ds-info img { width: 20px; height: 20px; flex: 0 0 auto; }
.ds-info strong { font-weight: 600; }

/* What identity verification asks for (Verify identity) */
.ds-requirements { text-align: left; }
.ds-requirements__title { margin: 0 0 var(--spacing-8); font-weight: 600; }
.ds-requirements__list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: var(--spacing-8); }
.ds-requirements__list li { display: flex; align-items: flex-start; gap: var(--spacing-8); }

.ds-secure { display: flex; align-items: center; justify-content: center; gap: var(--spacing-8); font: var(--text-s); }
.ds-secure img { width: 20px; height: 20px; }

/* Transfer — Paymesh wallet → merchant */
.ds-transfer { display: flex; align-items: center; justify-content: center; gap: var(--spacing-24); padding: 0 var(--spacing-16); }
.ds-transfer__end { width: 120px; display: flex; flex-direction: column; align-items: center; gap: var(--spacing-8); font: var(--heading-xs); letter-spacing: 0; text-align: center; }
.ds-transfer__logo { width: 64px; height: 64px; border-radius: var(--radius-full); object-fit: cover; }
.ds-transfer__logo--paymesh { display: grid; place-items: center; background: var(--action-primary-default); }
.ds-transfer__logo--paymesh img { width: 38px; height: 24px; }
.ds-transfer > img { width: 32px; height: 32px; }

/* Confirmation-list-item */
.ds-confirm { display: flex; flex-direction: column; gap: var(--spacing-16); padding: var(--spacing-32) 0; text-align: left; }
.ds-confirm__row { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-16); }
.ds-confirm__label { font: var(--text-m); color: var(--text-muted); }
.ds-confirm__value { display: flex; align-items: center; gap: var(--spacing-8); font: var(--text-m-semibold); color: #000; text-align: right; }
.ds-confirm__value img { width: 24px; height: 24px; border-radius: var(--radius-full); }
.ds-confirm__sub { font: var(--text-s); color: var(--text-tertiary); text-align: right; margin-top: calc(-1 * var(--spacing-12)); }
.ds-chip {
  padding: 2px 4px;
  background: #fbfbfb;
  border: 1px solid #dbdbdb;
  border-radius: var(--radius-s);
  font: 600 10px/normal var(--font-family-inter);
  letter-spacing: -0.2px;
  color: #717171;
}
.ds-copy { display: inline-grid; place-items: center; padding: 0; border: 0; background: none; cursor: pointer; }
.ds-copy img { border-radius: 0; }

/* ==========================================================================
   Narrow screens
   ========================================================================== */

@media (max-width: 560px) {
  .ds-page { padding: var(--spacing-24) var(--spacing-16); }
  /* Flows "mobile" frames: mark-only logo and "Back to [merchant]" */
  .ds-nav .logo > svg { display: none; }
  .ds-nav .logo__mark { display: inline-flex; }
  .ds-page { padding-top: var(--spacing-16); }
  .ds-main { justify-content: flex-start; padding: var(--spacing-48) 0 var(--spacing-48); }
  .ds-h1 { font-size: 32px; line-height: 32px; letter-spacing: -0.64px; }
  .ds-page--cta .ds-main { padding-bottom: var(--spacing-32); }
  .ds-page--cta .ds-container { flex: 1 1 auto; display: flex; flex-direction: column; }
  .ds-page--cta .ds-cta { margin-top: auto; padding-top: var(--spacing-24); }
  .ds-h1--large { font: var(--heading-3xl); letter-spacing: 0; } /* the mobile frames keep 40px here */
  .ds-otp__box { width: 100%; min-width: 0; height: 52px; }
  .ds-transfer { gap: var(--spacing-8); padding: 0; }
  .ds-page { padding-bottom: calc(var(--spacing-16) + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   Split-payment widget — Figma Flows "registration-10" (widget.html, #/v2/payment)
   ========================================================================== */

:root {
  --primary-blue-600: #2563eb; /* Switch on, as in the Figma component */
  --primary-gray-300: #d2d5da; /* Switch off */
  --brand-50: #f9f5ff;
}

.sw-stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* let the widget shrink below 423px on phones */
  place-items: center;
  padding: var(--spacing-48) var(--spacing-16);
  background: var(--base-white);
  font: var(--text-m);
  letter-spacing: var(--tracking-text);
  color: var(--text-primary);
}
.sw { width: var(--ds-col); max-width: 100%; }

.sw-main { display: flex; flex-direction: column; gap: var(--spacing-24); }
.sw-section { display: flex; flex-direction: column; gap: var(--spacing-8); }
.sw-section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-12); }
.sw-section__head--top { align-items: flex-start; }
.sw-section__head--baseline { align-items: baseline; }

.sw-amounts { display: flex; flex-direction: column; align-items: flex-end; text-align: right; flex: 0 0 auto; }
.sw-sub { font: var(--text-s); color: var(--text-tertiary); }

/* Switch */
.sw-switch { display: inline-flex; align-items: center; gap: var(--spacing-12); cursor: pointer; }
.sw-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sw-switch__track {
  position: relative;
  width: 36px; height: 20px;
  border-radius: 100px;
  background: var(--primary-gray-300);
  transition: background-color .2s ease;
}
.sw-switch__track::after {
  content: "";
  position: absolute; top: 2px; left: 2px;
  width: 16px; height: 16px;
  border-radius: 100px;
  background: var(--base-white);
  box-shadow: 0 2px 4px rgba(39, 39, 39, .1);
  transition: transform .2s ease;
}
.sw-switch input:checked + .sw-switch__track { background: var(--primary-blue-600); }
.sw-switch input:checked + .sw-switch__track::after { transform: translateX(16px); }
.sw-switch input:focus-visible + .sw-switch__track { box-shadow: var(--shadow-xs-focused); }
.sw-switch__label { font: 600 14px/20px var(--font-family-inter); letter-spacing: var(--tracking-text); color: #000; }
.sw-switch-row { display: flex; justify-content: flex-end; }
.sw-section--balance { gap: var(--spacing-12); }

/* Radio group item — the new 16px-radius version that can hold an amount editor */
.sw-item {
  display: flex; flex-direction: column; gap: var(--spacing-16);
  padding: var(--spacing-16);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  background: var(--base-white);
}
.sw-item[aria-checked="true"] {
  border-color: var(--action-primary-default);
  box-shadow: inset 0 0 0 1px var(--action-primary-default);
}
.sw-item__row { display: flex; align-items: flex-start; gap: var(--spacing-12); width: 100%; }
.sw-item__pick { padding: 0; border: 0; background: none; font: inherit; color: inherit; text-align: left; cursor: pointer; }
.sw-item .ds-option__side > img { width: 45px; height: 32px; }
.sw-item[aria-checked="true"] .ds-option__radio {
  border: 0;
  background: url("../assets/ds/radio-selected.svg") center/16px no-repeat;
}

/* A card that pays the whole order (no balance): selected option, no amount editor */
.sw-item--covers[aria-checked="true"] {
  /* 2px border: 1px border plus the 1px inset ring from .sw-item[aria-checked=true] */
  border-color: var(--action-primary-default);
  background: var(--surface-primary);
  color: var(--text-brand);
}
.sw-item--covers[aria-checked="true"] .ds-option__radio {
  background: var(--action-primary-default) url("../assets/ds/radio-check.svg") center/11px no-repeat;
}

/* Paymesh balance checkbox (square) */
.sw-square {
  flex: 0 0 auto;
  width: 16px; height: 16px; margin-top: 4px;
  border: 1px solid var(--action-primary-default);
  border-radius: var(--radius-s);
  background: var(--brand-50) url("../assets/ds/check-brand.svg") center/11px no-repeat;
}

/* Amount field + chips */
.sw-editor { display: flex; flex-direction: column; align-items: flex-end; gap: var(--spacing-8); }
.sw-editor__input { align-self: stretch; }
.sw-editor__input input { text-align: right; }
.sw-chips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--spacing-8); }
.sw-chip {
  display: inline-flex; align-items: center; justify-content: center;
  height: 32px;
  padding: 0 var(--spacing-16);
  border: 0;
  border-radius: var(--radius-full);
  background: var(--surface-secondary);
  font: var(--text-xs);
  font-weight: 500;
  letter-spacing: var(--tracking-text);
  color: var(--text-primary);
  cursor: pointer;
}
.sw-chip:hover { background: var(--border-subtle); }
.sw-chip[aria-pressed="true"] { background: var(--action-primary-default); color: var(--text-inverse); }

/* Billing info — plain text under its header */
.sw-billing { font: var(--text-m); color: var(--text-primary); }
.sw-billing p { margin: 0; }
.sw-billing p:first-child { font-weight: 600; }

/* Header: title with the merchant's 24px logo on the right */
.sw-head { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-12); padding: 0 var(--spacing-16); }
.sw-head .ds-card__title { padding: 0; }
.sw-head__logo { width: 32px; height: 32px; border-radius: var(--radius-full); object-fit: cover; flex: 0 0 auto; }
.sw.ds-card { gap: var(--spacing-16); }

/* Body: full-width dividers, so the horizontal padding moves onto each block */
.sw .sw-body { padding: var(--spacing-24) 0 var(--spacing-16); gap: var(--spacing-24); }
.sw-pad { padding: 0 var(--spacing-16); }
.sw-divider { width: 100%; height: 0; margin: 0; border: 0; border-top: 1px solid var(--border-subtle); }

/* Amount to pay */
.sw-total { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--spacing-4); }
.sw-total__label,
.sw-total__usd { font: var(--heading-m-bold); letter-spacing: 0; color: #000; }
.sw-total__value { display: flex; flex-direction: column; align-items: flex-end; gap: var(--spacing-2); text-align: right; }
.sw-total__token { font: var(--text-s); color: var(--text-muted); }

/* Info box uses the brand border in this layout */
.sw .ds-info { border-color: var(--action-primary-default); }

/* ==========================================================================
   Menu of prototypes after the password screen (#/menu) — deliberately plain
   ========================================================================== */

.menu {
  max-width: 560px;
  margin: 0 auto;
  padding: var(--spacing-48) var(--spacing-16);
  font: var(--text-m);
  letter-spacing: var(--tracking-text);
  color: var(--text-primary);
}
.menu h1 { margin: 0 0 var(--spacing-32); font: var(--heading-2xl); }
.menu h2 { margin: var(--spacing-32) 0 var(--spacing-8); font: var(--heading-s); }
.menu h3 { margin: 0 0 var(--spacing-4); font: var(--text-m-semibold); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.menu ul { margin: 0; padding: 0; list-style: none; }
.menu__links li + li { margin-top: var(--spacing-4); }
.menu__links a { color: var(--text-primary); text-decoration: underline; text-underline-offset: 3px; }
.menu__links a:hover { opacity: .7; }
.menu .menu__sublinks { margin-top: var(--spacing-4); padding-left: var(--spacing-16); font: var(--text-s); }
.menu__entry + .menu__entry { margin-top: var(--spacing-16); }
.menu__note { margin: 0; color: var(--text-secondary); }

/* Amount scenarios beside the widget (below 760px they sit above it) */
.sw-wrap { position: relative; width: var(--ds-col); max-width: 100%; display: flex; flex-direction: column; }
.sw-wrap .sw { width: 100%; }
.sw-random {
  position: absolute; top: 0; left: calc(100% + var(--spacing-16));
  display: flex; flex-direction: column; align-items: flex-start; gap: var(--spacing-8);
}
.sw-random__btn {
  padding: 6px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--base-white);
  font: var(--text-s);
  letter-spacing: var(--tracking-text);
  color: var(--text-primary);
  white-space: nowrap;
  cursor: pointer;
}
.sw-random__btn:hover { background: var(--surface-secondary); }
@media (max-width: 760px) {
  .sw-random { position: static; flex-direction: row; flex-wrap: wrap; justify-content: center; margin-bottom: var(--spacing-12); }
}

.sw-cards { display: flex; flex-direction: column; gap: var(--spacing-8); }

/* ==========================================================================
   Newest payment widget — design system file, node 1444:11042 (widget-new.html)
   ========================================================================== */

.nw-wrap { width: var(--ds-col); gap: var(--spacing-40, 40px); }
.nw.ds-card { gap: var(--spacing-12); }
.nw-logo { width: 24px; height: 24px; border-radius: var(--radius-full); object-fit: cover; flex: 0 0 auto; }
.sw-random__btn[aria-pressed="true"] { border-color: var(--action-primary-default); color: var(--text-brand); background: var(--surface-primary); }

.nw-body {
  display: flex; flex-direction: column; gap: var(--spacing-16);
  padding: var(--spacing-16) 0;
  background: var(--base-white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-card-inner);
  overflow: hidden;
}
.nw-divider { height: 1px; margin: 0; border: 0; background: var(--border-subtle); }
.nw-divider--inset { margin: 0; }
.nw-pad { padding: 0 var(--spacing-16); }
.nw-grey { font: var(--text-s); color: var(--text-tertiary); }
.nw-grey--m { font: var(--text-m); }
.nw-grey--xs { font: 400 12px/16px var(--font-family-inter); }

/* Rows with a leading 24px icon: Payment method, Billing address, Amount to pay */
.nw-row {
  display: flex; align-items: flex-start; gap: var(--spacing-16);
  width: 100%; padding: 0 var(--spacing-16);
  border: 0; background: none; text-align: left; font: inherit; color: inherit;
}
.nw-row > img { flex: 0 0 auto; margin-top: 1px; }
button.nw-row { cursor: pointer; }
.nw-row__content { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.nw-row__title {
  display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-8);
  font: 600 18px/26px var(--font-family-inter); letter-spacing: var(--tracking-text); color: var(--text-primary);
}
.nw-row__sub { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font: var(--text-m); }
.nw-row__sub strong, .nw-billing strong { font-weight: 600; }
.nw-chevron { flex: 0 0 auto; transition: transform .2s ease; }
.nw-chevron--up { transform: rotate(180deg); }
.nw-billing { display: flex; flex-direction: column; font: var(--text-m); }

/* Amount to pay */
.nw-total { align-items: flex-start; gap: var(--spacing-16); }
.nw-total__label { font: 600 18px/26px var(--font-family-inter); letter-spacing: var(--tracking-text); color: #000; }
.nw-total__value {
  flex: 1 1 auto; display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right;
  font: 600 18px/26px var(--font-family-inter); letter-spacing: var(--tracking-text); color: #000;
}

/* Expanded payment methods */
.nw-methods { display: flex; flex-direction: column; gap: var(--spacing-16); }
.nw-switch-row { padding: 0 var(--spacing-16); }
.nw-list { display: flex; flex-direction: column; gap: var(--spacing-16); padding: 0 var(--spacing-16) var(--spacing-16); }
.nw-remaining { margin: 0; font: var(--heading-xs); letter-spacing: 0; color: var(--text-primary); }
.nw-add { align-self: flex-start; }

.nw-item { display: flex; align-items: center; gap: var(--spacing-12); min-height: 44px; cursor: pointer; }
.nw-item__text { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; font: var(--text-m); }
.nw-item--balance .nw-item__text { flex: 0 1 220px; }
.nw-item__text strong, .nw-item__title { font-weight: 600; }
.nw-amount { flex: 1 1 0; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.nw-amount__usd { font: 600 16px/24px var(--font-family-inter); letter-spacing: var(--tracking-text); }

.nw-badge {
  flex: 0 0 auto; display: grid; place-items: center;
  width: 34px; height: 24px;
  background: var(--base-white); border: 1px solid #e5e5e5; border-radius: 4px;
}
.nw-scheme { flex: 0 0 auto; width: 34px; height: 24px; }

/* Radio / checkbox controls (24px) */
.nw-control {
  flex: 0 0 auto; width: 24px; height: 24px; padding: 0;
  border: 1px solid var(--border-default); border-radius: var(--radius-full);
  background: var(--base-white) center / 16.8px no-repeat;
  cursor: pointer;
}
.nw-control--check { border-radius: 6px; }
.nw-control[aria-checked="true"] {
  border-color: var(--action-primary-default);
  background-color: var(--action-primary-default);
  background-image: url("../assets/ds/nw-check.svg");
}
.nw-control:focus-visible { outline: none; box-shadow: var(--shadow-xs-focused); }

/* Split payment amounts */
.nw-input { flex: 0 0 auto; width: 150px; margin-left: auto; gap: var(--spacing-4); padding: 0 var(--spacing-12); }
@media (max-width: 560px) {
  /* Phones: the amount field drops below the method, lined up with its text */
  .nw-item { flex-wrap: wrap; row-gap: var(--spacing-12); }
  .nw-input { order: 1; flex: 1 0 calc(100% - 82px); width: auto; margin-left: 82px; }
}
.nw-input input { text-align: right; min-width: 0; }
.nw-clear { flex: 0 0 auto; display: grid; place-items: center; width: 20px; height: 20px; padding: 0; border: 0; background: none; cursor: pointer; opacity: .6; }
.nw-clear:hover { opacity: 1; }

.nw-terms { padding: 0 var(--spacing-16) var(--spacing-8); }
.nw-back { align-self: center; }

/* ==========================================================================
   Payment widget scenarios — Work in progress file, node 499:3741
   (widget-scenarios.html). Reuses the newest widget; only the switcher is new.
   ========================================================================== */
.ws-switcher { width: 240px; gap: var(--spacing-16); }
.ws-group { display: flex; flex-direction: column; align-items: flex-start; gap: var(--spacing-8); }
.ws-group__label { font: var(--text-s); font-weight: 600; letter-spacing: var(--tracking-text); color: var(--text-tertiary); }
.ws-note { margin: 0; font: var(--text-s); letter-spacing: var(--tracking-text); color: var(--text-tertiary); }
@media (max-width: 760px) {
  .ws-switcher { width: auto; flex-direction: column; align-items: center; }
  .ws-group { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: center; }
  .ws-group__label { width: 100%; text-align: center; }
  .ws-note { text-align: center; }
}

/* ==========================================================================
   Wallet dashboard — Work in progress file, node 646:16528 "Desktop-large (XL)"
   (dashboard.html). The frame is in the dark theme, so the colour variables
   take their dark values inside .db.
   ========================================================================== */
.db {
  --background-canvas: #0e0e11;
  --text-primary: #fafafb;
  --text-secondary: #bdbdc1;
  --text-tertiary: #97979d;
  --text-inverse: #0e0e11;
  --action-primary-default: #9facff;
  --action-secondary-pressed: #4f4f58;
  --surface-secondary: #26262a;
  --transaction-expense: #fe9a93;
  --transaction-completed: #8fe6a2;
  --radius-lg: 12px;
  --db-nav-w: 340px;

  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--db-nav-w) minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  column-gap: var(--spacing-16);
  padding: 0 var(--spacing-16);
  background: var(--background-canvas);
  color: var(--text-primary);
  font: var(--text-m);
  letter-spacing: var(--tracking-text);
}
body:has(.db) { background: #0e0e11; }
.db.is-folded { --db-nav-w: 52px; }
.db a { color: inherit; }
.db :focus-visible { outline: 2px solid var(--action-primary-default); outline-offset: 2px; }

/* Header — logo and account */
.db-header {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* the logo sits 32px down; the menu and content start at 119px */
  height: 119px;
}
.db-logo {
  display: inline-block;
  height: 40.19px;
  font: 700 24px/normal var(--font-family-rebond);
  letter-spacing: -0.72px;
  align-self: flex-start;
  margin-top: 32px;
  text-decoration: none;
  /* A highlight sweeps across the logo gradient (left to right: #3740ff,
     #55d7ff at 59%, #5a8eff) once every 10 seconds. */
  background:
    linear-gradient(105deg, transparent 42%, rgba(255, 255, 255, .85) 50%, transparent 58%) 200% 0 / 250% 100% no-repeat,
    linear-gradient(90deg, #3740ff 0%, #55d7ff 59%, #5a8eff 100%) 0 0 / 100% 100% no-repeat;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  animation: db-logo-shimmer 10s ease-in-out infinite;
}
@keyframes db-logo-shimmer {
  0% { background-position: 200% 0, 0 0; }
  15%, 100% { background-position: -100% 0, 0 0; }
}
@media (prefers-reduced-motion: reduce) {
  .db-logo { animation: none; }
}
.db-user { position: fixed; top: 32px; right: var(--spacing-16); display: flex; align-items: center; gap: 6px; }
.db-user__name { font: var(--text-s); letter-spacing: var(--tracking-text); color: #fff; }

/* Account avatar / merchant logo */
.db-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: var(--action-primary-default);
  color: var(--text-inverse);
  font: var(--label-m);
  letter-spacing: var(--tracking-text);
}
.db-avatar--logo { object-fit: contain; background: none; }
/* businesses without a logo of their own */
.db-avatar--business { background: var(--action-secondary-pressed); color: var(--text-primary); }

/* Side menu — Button (ghost, L) */
.db-nav {
  position: sticky;
  top: 119px;
  height: calc(100vh - 119px);
  height: calc(100dvh - 119px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding-bottom: 30px;
}
.db-nav__group { display: flex; flex-direction: column; }
.db-nav__item {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  height: 52px;
  padding: var(--spacing-12) var(--spacing-16) var(--spacing-12) 14px;
  border: 0;
  border-radius: var(--radius-xl);
  background: none;
  color: var(--text-primary);
  font: var(--button-l);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  cursor: pointer;
}
.db-nav__group--foot .db-nav__item { height: 50px; }
.db-nav__item:hover { background: var(--surface-secondary); }
.db-nav__item:active { background: var(--action-secondary-pressed); }
.db-icon { flex: 0 0 auto; display: block; width: 24px; height: 24px; }
/* "Show balance": the design system's eye, in the dark theme's icon colour */
.db-icon--eye { background: #f4f4f6; -webkit-mask: url("../assets/ds/eye.svg") center / 24px 24px no-repeat; mask: url("../assets/ds/eye.svg") center / 24px 24px no-repeat; }
.is-folded .db-nav__label { display: none; }
.is-folded .db-nav__fold .db-icon { transform: scaleX(-1); }

/* Main column */
.db-main {
  display: flex;
  flex-direction: column;
  gap: 40px;
  width: 100%;
  max-width: 696px;
  /* Centred on the page. At 1440px that's exactly where the frame puts it
     (372px in), so wider screens keep it centred instead of left-aligned. */
  margin-left: max(0px, calc((100vw - 696px) / 2 - 2 * var(--spacing-16) - var(--db-nav-w)));
  padding-bottom: var(--spacing-48);
  min-width: 0;
}

/* Balance */
.db-balance { padding: 0 var(--spacing-16); }
.db-balance h2 { margin: 0; }
.db-balance__label { font: var(--heading-l); color: var(--text-tertiary); }
.db-balance__row { display: flex; align-items: center; gap: var(--spacing-16); }
.db-balance__amount { margin: 0; font: 700 56px/64px var(--font-family-rebond); letter-spacing: -2.24px; white-space: nowrap; }
.db-balance__cents { font-size: 32px; line-height: 32px; }
.db-balance__other { margin: 0; font: var(--heading-m); color: var(--text-tertiary); white-space: nowrap; }
.db-iconbtn { display: grid; place-items: center; width: 32px; height: 32px; margin: -4px; padding: 0; border: 0; border-radius: var(--radius-m); background: none; cursor: pointer; }
.db-iconbtn:hover { background: var(--surface-secondary); }

/* Transactions */
.db-section { display: flex; flex-direction: column; gap: var(--spacing-8); }
.db-section__head { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--spacing-16); }
.db-section__head h2 { margin: 0; font: var(--heading-l); color: #fff; }
.db-link { font: var(--link-m); letter-spacing: var(--tracking-text); text-decoration: underline; color: #fff; }
.db-link:hover { opacity: .7; }
.db-txlist { margin: 0; padding: 0; list-style: none; }
.db-tx {
  display: flex;
  align-items: center;
  gap: var(--spacing-12);
  width: 100%;
  padding: var(--spacing-8) var(--spacing-16);
  border: 0;
  border-radius: var(--radius-lg);
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.db-tx:hover { background: var(--surface-secondary); }
.db-tx:active { background: var(--action-secondary-pressed); }
.db-tx__info { flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; }
.db-tx__line { display: flex; align-items: center; gap: var(--spacing-8); }
.db-tx__line--main { font: var(--text-m-semibold); letter-spacing: var(--tracking-text); }
.db-tx__line--sub { font: var(--text-s); letter-spacing: var(--tracking-text); }
.db-tx__party, .db-tx__date { flex: 1 1 0; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.db-tx__party { color: var(--text-primary); }
.db-tx__date { color: var(--text-tertiary); }
.db-tx__amount, .db-tx__usdt { white-space: nowrap; }
.db-tx__amount.is-expense { color: var(--transaction-expense); }
.db-tx__amount.is-income { color: var(--transaction-completed); }
.db-tx__usdt { color: var(--text-secondary); }
.db-empty { margin: 0; padding: 0 var(--spacing-16); color: var(--text-tertiary); }

/* Transactions page — node 639:12567 */
.db { --border-default: #4f4f58; }
/* the frame starts this page at 160px, 41px below the menu */
.db-tx-page { display: flex; flex-direction: column; gap: var(--spacing-24); padding-top: 41px; }
/* pages with no frame of their own start level with the menu */
.db-tx-page--top { padding-top: 0; }
.db-tx-page__head { display: flex; align-items: center; justify-content: space-between; gap: var(--spacing-16); }
.db-tx-page__title { margin: 0; font: var(--heading-2xl); color: #fff; }
.db-tx-page__actions { display: flex; align-items: center; gap: var(--spacing-16); }
/* Type filter — Button/S */
.db-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px 5px 7px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-m);
  background: none;
  color: var(--text-primary);
  font: 600 14px/20px var(--font-family-inter);
  white-space: nowrap;
  cursor: pointer;
}
.db-chip:hover { background: var(--surface-secondary); }
.db-chip--primary { padding: 6px 10px 6px 8px; border: 0; border-radius: 10px; background: var(--action-primary-default); color: var(--text-inverse); }
.db-chip--primary:hover { background: #b6c0ff; }
.db-filters { display: flex; flex-wrap: wrap; gap: var(--spacing-8); }
.db-filter { padding: 6px 12px; border: 1px solid var(--border-default); border-radius: var(--radius-full); background: none; color: var(--text-secondary); font: 600 14px/20px var(--font-family-inter); cursor: pointer; }
.db-filter:hover { background: var(--surface-secondary); }
.db-filter[aria-checked="true"] { border-color: var(--text-primary); color: var(--text-primary); }
/* search — Input */
.db-search {
  display: flex;
  align-items: center;
  gap: var(--spacing-8);
  height: 52px;
  padding: 0 var(--spacing-16);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xs);
  cursor: text;
}
.db-search:focus-within { border-color: var(--action-primary-default); }
.db-search img { flex: 0 0 auto; }
.db-search input { flex: 1 1 0; min-width: 0; height: 100%; border: 0; outline: 0; background: none; color: var(--text-primary); font: var(--text-m); letter-spacing: var(--tracking-text); }
.db-search input::placeholder { color: var(--text-tertiary); }
.db-search input::-webkit-search-cancel-button { filter: invert(1); }
.db-groups { display: flex; flex-direction: column; gap: var(--spacing-24); }
.db-group__label { margin: 0 0 var(--spacing-8); font: 600 14px/20px var(--font-family-inter); color: #fff; }
.db-groups .db-empty { padding: 0; }

/* Phones only: the hamburger button and the sticky Add funds button */
.db-menu-btn, .db-addfunds { display: none; }
.db-icon--close { background: #f4f4f6; -webkit-mask: url("../assets/ds/close.svg") center / 24px 24px no-repeat; mask: url("../assets/ds/close.svg") center / 24px 24px no-repeat; }

/* Narrower screens: the menu folds to its icons */
@media (max-width: 1000px) {
  .db { --db-nav-w: 52px; }
  .db .db-nav__label { display: none; }
  .db .db-nav__fold { display: none; }
}
/* Phones: the menu becomes a tab bar along the bottom */
@media (max-width: 640px) {
  .db { grid-template-columns: minmax(0, 1fr); padding: 0 var(--spacing-8); column-gap: 0; }
  .db-header { height: auto; padding: var(--spacing-24) var(--spacing-8); }
  .db-logo { margin-top: 0; align-self: center; }
  .db-user { position: static; }
  .db-nav__item[aria-current="page"] { background: var(--surface-secondary); }
  .db-user__name { display: none; }
  .db-main { padding-bottom: 116px; }
  .db-balance__amount { font-size: 44px; line-height: 52px; letter-spacing: -1.76px; }
  .db-balance__cents { font-size: 26px; line-height: 26px; }
  .db-tx-page { padding: 0 var(--spacing-8); }
  .db-tx-page__title { font-size: 26px; line-height: 32px; }
  .db-tx-page__head { flex-wrap: wrap; row-gap: var(--spacing-12); }
  .db-tx-page__actions { gap: var(--spacing-8); }
  /* the header stays put, with the hamburger next to the avatar */
  .db-header { position: sticky; top: 0; z-index: 20; height: 88px; background: var(--background-canvas); }
  .db-user { gap: var(--spacing-12); }
  .db-menu-btn { display: grid; margin: 0; width: 40px; height: 40px; }
  /* the menu opens as a full-screen sheet under the header */
  .db-nav {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 15;
    height: auto;
    padding: 88px var(--spacing-16) calc(var(--spacing-24) + env(safe-area-inset-bottom));
    background: var(--background-canvas);
    overflow-y: auto;
  }
  .is-menu-open .db-nav { display: flex; }
  .db .db-nav__label { display: inline; }
  .db .db-nav__fold { display: none; }
  body:has(.is-menu-open) { overflow: hidden; }
  /* Add funds — Button (primary, L), stuck to the bottom */
  .db-addfunds {
    display: block;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 10;
    padding: var(--spacing-24) var(--spacing-16) calc(var(--spacing-16) + env(safe-area-inset-bottom));
    background: linear-gradient(to bottom, transparent, var(--background-canvas) 40%);
    pointer-events: none;
  }
  .is-menu-open .db-addfunds { display: none; }
  .db-addfunds__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-8);
    height: 52px;
    border-radius: var(--radius-xl);
    background: var(--action-primary-default);
    color: var(--text-inverse) !important;
    font: var(--button-l);
    text-decoration: none;
    pointer-events: auto;
  }
  .db-addfunds__btn:active { background: #b6c0ff; }
}
