/* Merchant application (Design A): the agent's workspace inside the portal, and the merchant's own page.
   One spacing scale for both, set here and nowhere else: 8 (inside a control row), 12 (between controls),
   16 (between blocks), 24 (between sections). Every gap is a `gap` on the parent, never a margin on a child,
   so a pill, a box and a button can never sit at a different distance by accident.
   Colors, radii and type come from the portal's own tokens (css/app.css :root). The merchant's page has no
   portal stylesheet, so it carries the same values under .ma-public. */

.ma-public {
  --ink: #101820; --ink-3: #2A3542; --crimson: #BB2031; --crimson-dk: #94141F; --crimson-lt: #FDECEE; --steel: #5C6871; --steel-lt: #8A949B;
  --mist: #C2C6C8; --hair: #DDE3E9; --hair-soft: #EAEEF2; --paper: #F4F6F8; --card: #FFFFFF; --green: #1C7A56; --green-lt: #E7F4EF;
  --amber: #A8761B; --amber-lt: #FBF2E2; --blue: #2A5C8A; --blue-lt: #EAF1F7; --danger: #8E1F27; --danger-lt: #FBEBEC; --r-sm: 10px; --r: 14px;
  margin: 0; background: var(--page, #FFFFFF); color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}
html[data-theme="dark"] .ma-public,
html[data-theme="dark"] .ma-overlay {
  --page: var(--ui-page, #17191D); --ui-scheme: dark;
  --ink: var(--ui-text, #ECEEF2); --ink-3: var(--ui-secondary, #BEC1C8);
  --crimson-dk: #FF8E97; --crimson-lt: var(--ui-error-bg, #47262C);
  --steel: var(--ui-secondary, #BEC1C8); --steel-lt: var(--ui-secondary, #BEC1C8);
  --mist: var(--ui-control-edge, #9399A4); --hair: var(--ui-line, #4A4E58); --hair-soft: var(--ui-line, #4A4E58);
  --paper: var(--ui-page, #17191D); --card: var(--ui-surface, #22252B);
  --green: var(--ui-green, #8EE0B0); --green-lt: var(--ui-green-bg, #183D2C);
  --amber: var(--ui-amber, #F4CF86); --amber-lt: var(--ui-amber-bg, #44361C);
  --blue: var(--ui-blue, #A6C9FF); --blue-lt: var(--ui-blue-bg, #203650);
  --danger: var(--ui-error, #FFB0B7); --danger-lt: var(--ui-error-bg, #47262C);
  background: var(--ui-page, #17191D); color: var(--ui-text, #ECEEF2);
}
.ma-public *, .ma * { box-sizing: border-box; }
.ma-public [hidden], .ma [hidden] { display: none !important; }

/* ---- layout ------------------------------------------------------------------------------------------- */
.ma, .ma-page { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.ma-page { max-width: 720px; margin: 0 auto; padding: 16px 16px calc(96px + env(safe-area-inset-bottom)); }
.ma-block { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ma-stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ma-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ma-row--split { justify-content: space-between; }
.ma-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; min-width: 0; }
.ma-grid > .ma-field--wide { grid-column: 1 / -1; }
.ma-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ma-card { display: flex; flex-direction: column; gap: 16px; padding: 16px; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); min-width: 0; }
.ma-card--quiet { background: var(--paper); border-color: var(--hair-soft); }

/* ---- type --------------------------------------------------------------------------------------------- */
.ma-brand { display: flex; align-items: center; gap: 8px; font-weight: 650; letter-spacing: -.01em; }
.ma-brand img { width: 32px; height: 32px; border-radius: 8px; }
.ma-h1 { margin: 0; font-size: 24px; line-height: 1.25; letter-spacing: -.02em; }
.ma-h2 { margin: 0; font-size: 17px; line-height: 1.3; letter-spacing: -.01em; }
.ma-h3 { margin: 0; font-size: 14px; line-height: 1.35; font-weight: 650; }
.ma-sub { margin: 0; color: var(--steel); font-size: 14px; line-height: 1.5; }
.ma-eyebrow { margin: 0; color: var(--steel); font-size: 11.5px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }

/* ---- pills -------------------------------------------------------------------------------------------- */
.ma-pill { display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; border-radius: 999px; background: var(--hair-soft); color: var(--steel);
  font-size: 11.5px; font-weight: 650; line-height: 1; white-space: nowrap; }
.ma-pill--required { background: var(--crimson-lt); color: var(--crimson-dk); }
.ma-pill--done { background: var(--green-lt); color: var(--green); }
.ma-pill--todo { background: var(--amber-lt); color: var(--amber); }
.ma-pill--info { background: var(--blue-lt); color: var(--blue); }

/* ---- notes -------------------------------------------------------------------------------------------- */
.ma-note { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 12px 16px; border-radius: var(--r-sm); background: var(--blue-lt); color: var(--ink); font-size: 14px; line-height: 1.5; }
.ma-note--warn { background: var(--amber-lt); }
.ma-note--stop { background: var(--danger-lt); }
.ma-note--ok { background: var(--green-lt); }
.ma-note p, .ma-note ul { margin: 0; }
.ma-note ul { padding-left: 18px; }
.ma-note ul.ma-list { padding-left: 0; }
.ma-list { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
/* A list whose rows each hold a line, a pill and buttons (the documents the rep reviews): the rows sit further apart
   (16px) than the parts of one row (12px), so each document reads as one thing. */
.ma-list--rows { gap: 16px; }
.ma-list a { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }

/* ---- fields ------------------------------------------------------------------------------------------- */
.ma-field { display: flex; flex-direction: column; gap: 8px; min-width: 0; scroll-margin-top: 112px; }
/* A label row is as tall as a pill (22px) whether it carries one or not, so two boxes side by side start at the same
   height. Found by measuring the equipment forms card: "Account Type [Required]" sat 4.5px lower than "Software". */
.ma-field__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 22px; }
.ma-field__label { font-size: 13px; font-weight: 650; line-height: 1.35; color: var(--ink); }
/* A label that is a paragraph (the heading over the packet's file list) carries no margin of its own: the browser's
   default 13px sat on top of the stack's 12px and made a 25px gap. Found by measuring the Send to EPI card. */
p.ma-field__label { margin: 0; }
.ma-field__meta { color: var(--steel); font-size: 12.5px; line-height: 1.4; margin: 0; }
.ma-field__error { color: var(--danger); font-size: 13px; line-height: 1.4; margin: 0; }
.ma-field__masked { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-height: 48px; padding: 0 12px; border: 1px dashed var(--mist); border-radius: var(--r-sm); background: var(--paper); color: var(--ink);
  font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.ma-input, .ma-select, .ma-textarea { width: 100%; min-width: 0; min-height: 48px; padding: 0 12px; border: 1px solid var(--select-line, var(--hair)); border-radius: var(--r-sm); background-color: var(--card, #FFFFFF); color: var(--ink); font: inherit; color-scheme: var(--ui-scheme, light); }
.ma-input-suffix { display: flex; align-items: stretch; width: 100%; min-width: 0; }
.ma-input-suffix .ma-input { flex: 1 1 auto; border-top-right-radius: 0; border-bottom-right-radius: 0; border-right: 0; }
.ma-input-suffix__unit { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 12px; border: 1px solid var(--select-line, var(--hair)); border-left: 0; border-radius: 0 var(--r-sm) var(--r-sm) 0; background: var(--paper); color: var(--steel); font-size: 14px; font-weight: 650; user-select: none; }
.ma-group-sum { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 0; padding: 8px 12px; border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--paper); color: var(--ink); font-size: 13px; line-height: 1.4; font-weight: 600; }
.ma-group-sum--ok { border-color: var(--green); background: var(--green-lt); color: var(--green); }
.ma-group-sum--warn { border-color: var(--amber); background: var(--amber-lt); color: var(--amber); }
.ma-textarea { min-height: 96px; padding: 12px; resize: vertical; }
.ma-input:focus-visible, .ma-select:focus-visible, .ma-textarea:focus-visible, .ma-btn:focus-visible, .ma-choice input:focus-visible + span, .ma-page a:focus-visible {
  outline: 3px solid rgba(42, 92, 138, .45); outline-offset: 2px; }
.ma-input[aria-invalid="true"], .ma-select[aria-invalid="true"], .ma-textarea[aria-invalid="true"] { border-color: var(--danger); }
.ma-choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.ma-choice { position: relative; display: inline-flex; }
.ma-choice input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.ma-choice span { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border: 1px solid var(--select-line, var(--hair)); border-radius: var(--r-sm); background: var(--card, #FFFFFF); color: var(--ink); font-size: 15px; }
.ma-choice input:checked + span { border-color: var(--ink); background: var(--ink); color: #fff; }

/* ---- buttons ------------------------------------------------------------------------------------------ */
.ma-btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border: 1px solid var(--select-line, var(--hair)); border-radius: var(--r-sm);
  background: var(--card, #FFFFFF); color: var(--ink); font: inherit; font-size: 15px; font-weight: 650; cursor: pointer; text-decoration: none; }
.ma-btn--primary { background: var(--crimson); border-color: var(--crimson); color: #fff; }
.ma-btn--ink { background: var(--ink); border-color: var(--ink); color: #fff; }
.ma-btn--quiet { border-color: transparent; background: transparent; color: var(--blue); padding: 0 8px; }
/* A small button is still a 48px touch target wherever a finger may press it (DESIGN.md). It is only allowed to be
   shorter inside the agent's workspace on a wide screen with a mouse. Found on the merchant page at 390px. */
.ma-btn--sm { min-height: 48px; padding: 0 12px; font-size: 13.5px; }
.ma-btn--x { min-width: 48px; padding: 0 10px; font-size: 18px; line-height: 1; color: var(--steel); }
.ma-btn--x:hover { border-color: var(--danger); color: var(--danger); background: var(--danger-lt); }
.ma-btn--danger { background: var(--danger); border-color: var(--danger); color: #fff; }
@media (min-width: 900px) and (pointer: fine) { .ma-overlay .ma-btn--sm { min-height: 36px; } .ma-overlay .ma-btn--x { min-width: 36px; } }
.ma-btn:disabled { opacity: .5; cursor: default; }
.ma-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ma-resend-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
/* The rep's Hand to client row (owner, 2026-11-19: it shows the whole time the application is open). It keeps to the top of the
   workspace's scroll so it is never down in a card, on a computer, a tablet or a phone. Its padding is its own inner space; the
   gap to its neighbours is the workspace's 24px, and what is inside it sits 12px apart like any other row of controls. */
.ma-handbar { position: sticky; top: 8px; z-index: 2; align-items: flex-end; justify-content: flex-end; padding: 12px 16px; background: var(--card); border: 1px solid var(--hair); border-radius: var(--r); }
.ma-handbar > .ma-field { flex: 1 1 220px; }

/* ---- the merchant's page ------------------------------------------------------------------------------ */
/* One step of the application: where the person is, then Back and the one Next in the bar at the foot. */
.ma-step { margin: 0; color: var(--steel); font-size: 13px; font-weight: 650; line-height: 1.4; }
.ma-progress { height: 6px; border-radius: 999px; background: var(--hair-soft); overflow: hidden; }
.ma-progress > span { display: block; height: 100%; border-radius: 999px; background: var(--ink); }
.ma-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: var(--page, #FFFFFF); border-top: 1px solid var(--hair); }
.ma-bar__status { flex: 1 1 160px; margin: 0; color: var(--steel); font-size: 13px; min-width: 0; }
.ma-bar__nav { display: flex; align-items: center; gap: 12px; min-width: 0; }
.ma-card:focus-visible, .ma-h1:focus-visible { outline: 3px solid rgba(42, 92, 138, .45); outline-offset: 2px; }
.ma-h1:focus { outline: none; }

/* On the rep's device the client's way back ("Hand back to agent") is in this row at the top of every step and stays there as the page
   scrolls. Its parts sit 8px apart (a line of the same row), and it is opaque so nothing shows through it. */
.ma-top { position: sticky; top: 0; z-index: 3; display: flex; flex-direction: column; gap: 8px; padding: 8px 0; background: var(--page, #FFFFFF); border-bottom: 1px solid var(--hair-soft); min-width: 0; }

/* ---- the hand-off welcome (Design 1, owner-approved 2026-11-20: official stacked logo + EMV chip pulse + bloom) --
   Pure white canvas with subtle warm radial wash, our official stacked mark (TPS__StackedLogo_FullColorRGB),
   and one private prompt. Twin rounded-square EMV chip pulse rings in Pantone 200 C (#BA0C2F) radiate from the chip
   mark until the client clicks "Tap to begin", blooming radially into Step 1. Reduced motion shows a still logo
   and static button with zero animations and an immediate step transition. */
.ma-page--welcome { max-width: none; min-height: 100vh; min-height: 100svh; padding: 24px 16px; align-items: center; justify-content: center; overflow: hidden;
  background: radial-gradient(circle at 50% 38%, rgba(186, 12, 47, .055) 0%, #FFFFFF 62%); }
.ma-welcome { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; max-width: 440px; min-width: 0; text-align: center;
  font-family: "Avenir Next", "Montserrat", "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; }
.ma-welcome__stage { position: relative; isolation: isolate; width: clamp(190px, 24vw, 236px); aspect-ratio: 900 / 613; pointer-events: none; }
.ma-welcome__stage img { position: relative; z-index: 2; display: block; width: 100%; height: 100%; object-fit: contain; }
.ma-welcome__stage::before, .ma-welcome__stage::after, .ma-welcome__bloom {
  content: ""; position: absolute; left: 50%; top: 22.6%; width: 30.74%; aspect-ratio: 1; border-radius: 17%; opacity: 0;
  transform: translate(-50%, -50%) scale(.86); pointer-events: none; }
.ma-welcome__stage::before, .ma-welcome__stage::after { z-index: 1; border: 2px solid #BA0C2F; }
.ma-welcome__bloom { z-index: 3; border: 2px solid rgba(186, 12, 47, .58);
  background: radial-gradient(circle, rgba(186, 12, 47, .30) 0%, rgba(186, 12, 47, .08) 60%, transparent 100%); }
.ma-welcome__copy { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.ma-welcome__title { margin: 0; color: var(--ink); font-size: 24px; font-weight: 700; line-height: 1.25; letter-spacing: -.02em; }
.ma-welcome__sub { margin: 0; color: var(--steel); font-size: 14px; line-height: 1.5; max-width: 360px; }
.ma-welcome__cta { position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 52px; min-width: min(100%, 220px); padding: 0 32px; border: 0; border-radius: 14px; background: #BA0C2F; color: #FFFFFF;
  font: inherit; font-size: 16px; font-weight: 600; cursor: pointer; box-shadow: 0 12px 28px -6px rgba(186, 12, 47, .45);
  -webkit-tap-highlight-color: rgba(186, 12, 47, .12); }
.ma-welcome__cta:hover { background: #940924; }
.ma-welcome__cta:focus-visible { outline: 3px solid rgba(42, 92, 138, .45); outline-offset: 2px; }
.ma-welcome__cta::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .28), transparent); transform: translateX(-140%) skewX(-20deg); pointer-events: none; }
.ma-welcome__trust { margin: 0; display: inline-flex; align-items: center; justify-content: center; gap: 8px; color: var(--steel); font-size: 12.5px; line-height: 1.4; }
/* The finished screen has no bar at its foot to clear. */
.ma-page--done { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
@keyframes ma-ripple { 0% { opacity: 0; transform: translate(-50%, -50%) scale(.86); } 22% { opacity: .52; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(2.15); } }
@keyframes ma-breathe { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }
@keyframes ma-sheen { 0% { transform: translateX(-140%) skewX(-20deg); } 45%, 100% { transform: translateX(240%) skewX(-20deg); } }
@keyframes ma-bloom { 0% { opacity: .72; transform: translate(-50%, -50%) scale(.9); } 55% { opacity: .28; } 100% { opacity: 0; transform: translate(-50%, -50%) scale(18); } }
@keyframes ma-step-enter { 0% { opacity: 0; transform: translateY(14px); } 100% { opacity: 1; transform: translateY(0); } }
@media (prefers-reduced-motion: no-preference) {
  .ma-welcome__stage::before, .ma-welcome__stage::after { animation: ma-ripple 2.4s cubic-bezier(.16, 1, .3, 1) infinite; }
  .ma-welcome__stage::after { animation-delay: 1.2s; }
  .ma-welcome__stage { animation: ma-breathe 4.4s ease-in-out infinite; }
  .ma-welcome__cta::after { animation: ma-sheen 3.8s ease-in-out infinite; }
  .ma-welcome__cta { transition: background-color .16s ease, transform .12s ease, opacity .36s ease; }
  .ma-welcome__cta:active { transform: scale(.98); }
  .ma-welcome__stage img, .ma-welcome__copy, .ma-welcome__trust { transition: opacity .36s ease, transform .42s cubic-bezier(.16, 1, .3, 1); }
  .ma-welcome--leaving .ma-welcome__stage::before, .ma-welcome--leaving .ma-welcome__stage::after { animation: none; opacity: 0; }
  .ma-welcome--leaving .ma-welcome__stage { animation: none; }
  .ma-welcome--leaving .ma-welcome__bloom { animation: ma-bloom .7s cubic-bezier(.16, 1, .3, 1) forwards; }
  .ma-welcome--leaving .ma-welcome__stage img, .ma-welcome--leaving .ma-welcome__copy,
  .ma-welcome--leaving .ma-welcome__cta, .ma-welcome--leaving .ma-welcome__trust { opacity: 0; transform: translateY(-10px) scale(.97); }
  .ma-page--enter { animation: ma-step-enter .34s cubic-bezier(.16, 1, .3, 1) forwards; }
}

/* ---- the rep's device while it is being handed over: everything of the rep's is covered at once ------------- */
.ma-cover { position: fixed; inset: 0; z-index: 2147483000; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; padding: 24px 16px; background: var(--page, #FFFFFF); color: var(--ink); text-align: center; }
.ma-cover__logo { display: block; width: clamp(170px, 19vw, 230px); height: auto; }
.ma-cover__body { display: flex; flex-direction: column; align-items: center; gap: 16px; max-width: 480px; }
.ma-cover .ma-actions { justify-content: center; }
/* The person's own ID and the optional statements, side by side where there is room and stacked on a phone. */
.ma-docs { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 16px; align-items: start; min-width: 0; }
.ma-pages { display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.ma-pagecard { display: flex; flex-direction: column; gap: 8px; padding: 8px; border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--card, #FFFFFF); color: var(--ink); min-width: 0; }
.ma-pagecard__img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; background: var(--paper); }
/* The rep's REVIEW of a document: each page whole, at its own shape, large enough to read, and a link to open it full
   size. (The small cropped card above is the client's own thumbnail of a page they just took.) Found by looking at the
   review of a landscape check, where only the middle showed. */
.ma-pages--review { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.ma-review__link { display: block; border-radius: 6px; }
.ma-review__img { display: block; width: 100%; height: auto; border: 1px solid var(--hair); border-radius: 6px; background: var(--paper); }
.ma-pagecard__state { margin: 0; font-size: 12.5px; color: var(--steel); }
.ma-pagecard__state--error { color: var(--danger); }
.ma-crop { display: flex; flex-direction: column; gap: 12px; }
.ma-crop__stage { position: relative; align-self: center; max-width: 100%; overflow: hidden; line-height: 0; }
.ma-crop__stage img { max-width: 100%; max-height: 50vh; }
.ma-crop__box { position: absolute; border: 2px solid var(--crimson); box-shadow: 0 0 0 9999px rgba(16, 24, 32, .45); pointer-events: none; }
.ma-dialog { position: fixed; inset: 0; z-index: 10; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(16, 24, 32, .5); }
.ma-dialog__panel { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 480px; max-height: 100%; overflow: auto; padding: 16px; border-radius: var(--r); background: var(--card, #FFFFFF); color: var(--ink); border: 1px solid var(--hair); }

/* ---- the agent's workspace ---------------------------------------------------------------------------- */
.ma-overlay { position: fixed; inset: 0; z-index: 5000; display: flex; flex-direction: column; background: var(--page, #FFFFFF); color: var(--ink); }
.ma-overlay__top { flex: 0 0 auto; padding: 12px 16px; background: var(--page, #FFFFFF); border-bottom: 1px solid var(--hair); min-width: 0; }
.ma-overlay__top-inner { max-width: 880px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.ma-overlay__panel { flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; scroll-padding-top: 112px; padding: 24px 16px calc(24px + env(safe-area-inset-bottom)); -webkit-overflow-scrolling: touch; }
.ma-overlay__panel > .ma { max-width: 880px; margin: 0 auto; }
.ma-owed { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px; }
.ma-owed__cell { display: flex; flex-direction: column; gap: 4px; padding: 12px; border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--card); min-width: 0; }
.ma-owed__n { font-size: 22px; font-weight: 700; line-height: 1.1; font-variant-numeric: tabular-nums; }
.ma-section > summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; font-weight: 650; list-style: none; }
.ma-section > summary::-webkit-details-marker { display: none; }
.ma-section[open] > summary { padding-bottom: 12px; }
.ma-section { padding: 0 16px; border: 1px solid var(--hair); border-radius: var(--r); background: var(--card); }
.ma-section[open] { padding-bottom: 16px; }
/* What sits under an open section's heading is spaced like everything else (12px). Found by measuring the equipment
   forms card, where a line of help, the fields, a notice and two rows of buttons sat edge to edge (0px). The heading
   row spaces what follows it with its own padding, so the whole row stays the press target. */
.ma-section > :not(summary) + :not(summary) { margin-top: 12px; }
/* The rep's PRICE SCREEN (Cygma page 3, 2026-11-19): the section's fields as groups (bands) of printed lines (rows).
   Groups sit 16px apart, each under a hairline so it reads as its own part of the page; a group's heading and lines
   are 12px apart, and a line's cells 12px/16px, as in .ma-grid. A line of rate cells lines up on its boxes (end), so a
   label that wraps to two lines on a phone never pushes its box below its neighbours'. Labels wrap; nothing is cut. */
.ma-priced { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.ma-band { display: flex; flex-direction: column; gap: 12px; min-width: 0; padding-top: 16px; border-top: 1px solid var(--hair-soft); }
.ma-band__row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 16px; align-items: end; min-width: 0; }
/* Six fees in a printed group: two lines of three on a computer and a tablet, three of two on a phone, one each below 360px. */
.ma-band__row--six { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* The lines of one group that each hold several answers (a rate, a custom fee, six fees) are told apart by a hairline. */
.ma-band__row + .ma-band__row { padding-top: 12px; border-top: 1px dashed var(--hair-soft); }
.ma-band .ma-field__label, .ma-band .ma-choice span { overflow-wrap: anywhere; }
.ma-band__flag .ma-choice { align-self: flex-start; max-width: 100%; }
.ma-band__flag .ma-choice span, .ma-band__flags .ma-choice span { min-width: 0; }
@media (max-width: 620px) {
  .ma-band__row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* On a phone a line's tick box and its type and frequency choices each take the whole width; the amounts pair up. */
  .ma-band__row > .ma-band__flag, .ma-band__row > .ma-band__chips, .ma-band__row > .ma-field--wide { grid-column: 1 / -1; }
}
@media (max-width: 360px) { .ma-band__row { grid-template-columns: minmax(0, 1fr); } }
.ma-files { display: flex; flex-direction: column; gap: 8px; margin: 0; padding-left: 24px; }
.ma-trail { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; font-size: 13px; color: var(--steel); }
.ma-docs-block { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--hair-soft); min-width: 0; }
.ma-docrow { padding: 12px; border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--card); }
.ma-docrow--selected { border-color: var(--crimson); background: var(--crimson-lt, #FFF9FA); }
.ma-docrow__confirm { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ma-routebar { gap: 12px; }
.ma-routebar .ma-grid { gap: 12px; }
.ma-delivery { display: flex; flex-direction: column; gap: 8px; padding-top: 12px; border-top: 1px solid var(--hair-soft); min-width: 0; }
.ma-delivery__options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; min-width: 0; }
.ma-delivery__opt { display: flex; align-items: flex-start; gap: 10px; min-height: 48px; padding: 12px; border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--card); cursor: pointer; min-width: 0; }
.ma-delivery__opt input { margin: 3px 0 0; flex: 0 0 auto; accent-color: var(--crimson); }
.ma-delivery__opt:has(input:checked) { border-color: var(--crimson); background: var(--crimson-lt, #FFF9FA); }
.ma-delivery__opt:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.ma-delivery__copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ma-delivery__title { font-size: 14px; font-weight: 600; color: var(--ink); overflow-wrap: anywhere; }
.ma-delivery__hint { font-size: 12.5px; color: var(--steel); line-height: 1.35; overflow-wrap: anywhere; }
.ma-inperson-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px; border: 1px solid var(--hair); border-radius: var(--r-sm); background: var(--paper); min-width: 0; }
.ma-pagecard .ma-sub { overflow-wrap: anywhere; }

@media (max-width: 620px) {
  .ma-grid, .ma-grid--3, .ma-delivery__options { grid-template-columns: minmax(0, 1fr); }
  .ma-grid > .ma-field--wide { grid-column: auto; }
  .ma-actions .ma-btn--primary, .ma-actions .ma-btn--ink { flex: 1 1 100%; }
  /* On a phone the brand and "Hand back to agent" do not share a line: the button takes the row under the brand, as the rep's buttons do. */
  .ma-top .ma-btn { flex: 1 1 100%; }
  .ma-h1 { font-size: 22px; }
  /* On a phone the saved-status line sits above Back and Next, and Next takes the width that is left. */
  .ma-bar__status, .ma-bar__nav { flex: 1 1 100%; }
  .ma-bar__nav .ma-btn--primary { flex: 1 1 auto; }
  .ma-page { padding-bottom: calc(136px + env(safe-area-inset-bottom)); }
  .ma-page--welcome { padding: 24px 16px; }
  .ma-welcome__title { font-size: 22px; }
  .ma-page--done { padding-bottom: calc(24px + env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: no-preference) { .ma-btn, .ma-choice span { transition: background-color .12s ease, border-color .12s ease; } }

/* ---- dark mode surface & contrast parity (#13) --------------------------------------------------------- */
.ma-band__row--wide > .ma-band__chips,
.ma-band__row--wide > .ma-field--wide { grid-column: 1 / -1; }

html[data-theme="dark"] .ma-choice input:checked + span { border-color: var(--ui-text, #ECEEF2); background: var(--ui-text, #ECEEF2); color: #101820; }
html[data-theme="dark"] .ma-btn--ink { background: var(--ui-raised, #2C3037); border-color: var(--ui-control-edge, #9399A4); color: var(--ui-text, #ECEEF2); }
html[data-theme="dark"] .ma-btn--primary { background: var(--accent, #BB2031); border-color: var(--accent, #BB2031); color: #FFFFFF; }
html[data-theme="dark"] .ma-btn--danger { background: #8E1F27; border-color: #8E1F27; color: #FFFFFF; }
html[data-theme="dark"] .ma-btn--quiet { background: transparent; border-color: transparent; color: var(--ui-link, #FF6571); }
html[data-theme="dark"] .ma-pill--required { background: var(--ui-error-bg, #47262C); color: var(--ui-error, #FFB0B7); }
html[data-theme="dark"] .ma-progress { background: var(--ui-raised, #2C3037); }
html[data-theme="dark"] .ma-progress > span { background: var(--ui-text, #ECEEF2); }
html[data-theme="dark"] .ma-docrow--selected,
html[data-theme="dark"] .ma-delivery__opt:has(input:checked) { border-color: var(--ui-link, #FF6571); background: var(--ui-raised, #2C3037); }
html[data-theme="dark"] .ma-page--welcome { background: radial-gradient(circle at 50% 38%, rgba(186, 12, 47, .16) 0%, var(--ui-page, #17191D) 62%); }
html[data-theme="dark"] .ma-brand img[src$="logomark.png"] { content: url("../assets/logomark-white.png"); }
html[data-theme="dark"] .ma-welcome__stage,
html[data-theme="dark"] .ma-cover__logo { background: #FFFFFF; border-radius: 16px; padding: 10px 14px; }
html[data-theme="dark"] .ma-input-suffix__unit { border-color: var(--ui-control-edge, #9399A4); background: var(--ui-raised, #2C3037); color: var(--ui-secondary, #BEC1C8); }

/* ---- Cost analysis -> Merchant application autofill (2026-11-23) ------------------------------------- */
.ma-costbar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border: 1px solid var(--hair); border-radius: var(--r-sm);
  background: var(--paper); min-width: 0;
}
.ma-costbar__copy { display: flex; flex-direction: column; gap: 6px; flex: 1 1 260px; min-width: 0; }
.ma-costbar__head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; min-width: 0; }
.ma-costbar__summary { overflow-wrap: anywhere; }
.ma-costbar__controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 0 1 auto; min-width: 0; }
.ma-costbar__pick { width: auto; min-width: 180px; max-width: 100%; min-height: 48px; }
@media (min-width: 900px) and (pointer: fine) {
  .ma-overlay .ma-costbar__pick { min-height: 36px; font-size: 13.5px; }
}
@media (max-width: 620px) {
  .ma-costbar__controls { flex: 1 1 100%; }
  .ma-costbar__pick, .ma-costbar__controls .ma-btn { flex: 1 1 100%; }
}
.ma-rate-wrap { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; min-width: 0; }
.ma-rate-wrap > .ma-input-suffix { flex: 1 1 110px; min-width: 0; width: auto; }
.ma-bps {
  display: inline-flex; align-items: center; min-height: 28px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--hair); background: var(--paper); color: var(--steel);
  font-size: 12.5px; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.ma-field__meta--cost { color: var(--blue); font-weight: 500; }
html[data-theme="dark"] .ma-costbar {
  border-color: var(--ui-line, #4A4E58); background: var(--ui-surface, #22252B);
}
html[data-theme="dark"] .ma-bps {
  border-color: var(--ui-line, #4A4E58); background: var(--ui-raised, #2C3037); color: var(--ui-secondary, #BEC1C8);
}
html[data-theme="dark"] .ma-field__meta--cost { color: var(--ui-blue, #A6C9FF); }
