/*
 * Monarail partner app. The shared Monarail foundation (packages/design-system/design-system-v2.css) is spliced in at the marker below by
 * scripts/build.mjs. This file lays out the partner frame (Paper 3b; a pattern copy of the staff app's frame rules under the partner's
 * own `mrp-` prefix) and the campaigns list and long-form composer (Paper 9b). The modal and composer rules are adapted from snips-v2
 * 0c3e7192 backend/public/agent-exchange-control-plane/styles.css (`.aex-v2-cp-modal`, `-header`, `-footer`, `-wide`, `-scroll`, `-body`;
 * `.aex-v2-cp-composer-section`, `-form-grid`, `-readout`, `-composer-next`) onto the foundation's tokens. No colour, size or radius of
 * its own; the foundation is never patched here.
 */
/* ============================================================================
   Monarail design system — shared foundation
   (class and token prefix still `aex-v2`; the rename to `monarail` is a
   separate mechanical sweep)

   One file, two surfaces. The site loads it directly. The console build
   (backend/public/agent-exchange-control-plane/build.mjs) splices it into the
   console stylesheet at the @@shared-design-system@@ marker and rewrites the
   font URLs. The decisions live in the Paper file "Design System", page
   "0 · Decided"; this file is their code form. Never patch a surface around
   it — change the rule here, then look at both surfaces.

   Decided 2026-09-09/10:
     colour  — grey backgrounds always; colour only by role (lake, lake-green,
               credit gold as a mark); status green/amber/red inside badges.
     type    — ABC Diatype for every word; Geist Mono for figures inside data
               components (plain zero, ss09) and for code; weights 400/500 only.
     scale   — site: five sizes 46/32/20/14/11; product: measured 17/13/12/11/10.
     buttons — one step away from the surface they sit on; hover lifts 1px,
               press settles; quiet buttons only change fill; focus never lifts.
   ========================================================================== */

/* Monarail Console reconciliation to Paper "0 · Decided" (T9, 2026-10-08;
   source: snips-v2 0c3e7192 site/assets/design-system-v2.css). Where this
   code form and the Decided page differ, the Decided page wins, here, for
   every surface:
     product line heights — §2: body 13/18, dense 12/16, label 11/14,
                            caption 10/14, component title 15/20;
     focus                — §10: a 1px lake-500 ring with a 3px lake-100 halo
                            on every control (buttons and selects included);
     notice radius        — 9b: notices sit on a 6px radius.
   Focus is declared after the quiet and disabled button states, so a
   focused quiet button keeps its halo under the pointer and while pressed.
   Two containment corrections, no new token: the focus ring appears at
   once (it is not eased in with the hover shadow), and a table wrapper is
   the containing block of its visually hidden labels, so they cannot widen
   the page outside the wrapper's own scroll.
   The 3b page anatomy and the 9b operator wordmark are application shell
   rules and live with each console's shell. */

@font-face {
  font-family: 'ABCDiatype';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/ABCDiatype-Regular.a673720520b4f039.woff2') format('woff2');
}

@font-face {
  font-family: 'ABCDiatype';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/ABCDiatype-Medium.bdcca7f0c53eb392.woff2') format('woff2');
}

@font-face {
  font-family: 'GeistMono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/assets/GeistMono-Regular.a8eb1f882a9c87d4.woff2') format('woff2');
}

@font-face {
  font-family: 'GeistMono';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/assets/GeistMono-Medium.0850781900f50dd8.woff2') format('woff2');
}

:root {
  /* Families — two, one job each */
  --aex-v2-font-ui: 'ABCDiatype', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --aex-v2-font-marketing: var(--aex-v2-font-ui);
  --aex-v2-font-display: var(--aex-v2-font-ui);
  --aex-v2-font-numeric: 'GeistMono', 'SF Mono', SFMono-Regular, Menlo, monospace;
  --aex-v2-font-code: var(--aex-v2-font-numeric);
  --aex-v2-font-mono: var(--aex-v2-font-numeric);

  /* Weights — two working weights; nothing asks for more */
  --aex-v2-weight-regular: 400;
  --aex-v2-weight-medium: 500;

  /* Site type scale (five steps); line heights follow the role inside a step */
  --aex-v2-size-1: 46px; --aex-v2-lh-1: 50px;
  --aex-v2-size-2: 32px; --aex-v2-lh-2: 36px;
  --aex-v2-size-3: 20px; --aex-v2-lh-3: 26px; --aex-v2-lh-3-lead: 32px;
  --aex-v2-size-4: 14px; --aex-v2-lh-4: 21px;
  --aex-v2-size-5: 11px; --aex-v2-lh-5: 14px;

  /* Product type scale — measured from the console; confirmation is an open decision */
  --aex-v2-text-product-title: 17px;  --aex-v2-lh-product-title: 22px;
  --aex-v2-text-product-component-title: 15px; --aex-v2-lh-product-component-title: 20px;
  --aex-v2-text-product-body: 13px;   --aex-v2-lh-product-body: 18px;
  --aex-v2-text-product-note: 12px;   --aex-v2-lh-product-note: 16px;
  --aex-v2-text-product-label: 11px;  --aex-v2-lh-product-label: 14px;
  --aex-v2-text-product-tag: 10px;    --aex-v2-lh-product-tag: 14px;
  --aex-v2-text-product-metric: 25px; --aex-v2-lh-product-metric: 32px;

  /* Grey scale — every background lives here (node grey = 400) */
  --aex-v2-grey-50: #FAFAFA;
  --aex-v2-grey-100: #F5F5F5;
  --aex-v2-grey-200: #EBEBEB;
  --aex-v2-grey-300: #D9D9D9;
  --aex-v2-grey-400: #C4C4C4;
  --aex-v2-grey-500: #9B9B9B;
  --aex-v2-grey-600: #767676;
  --aex-v2-grey-700: #575757;
  --aex-v2-grey-800: #333333;
  --aex-v2-grey-900: #1A1A1A;
  --aex-v2-grey-950: #111111;

  /* Lake scale — the blue accent, anchored on 200 */
  --aex-v2-lake-50: #EDF4F8;
  --aex-v2-lake-100: #DAEAF1;
  --aex-v2-lake-200: #B1D5E6;
  --aex-v2-lake-300: #8CC0D9;
  --aex-v2-lake-400: #60A6C7;
  --aex-v2-lake-500: #3A84A6;
  --aex-v2-lake-600: #2E6C8A;
  --aex-v2-lake-700: #24546B;
  --aex-v2-lake-800: #1C3B4A;

  /* Lake-green scale — the green end of the lake, for cash */
  --aex-v2-lake-green-100: #DBF0EF;
  --aex-v2-lake-green-200: #B7E1E0;
  --aex-v2-lake-green-300: #92D3D0;
  --aex-v2-lake-green-400: #60BEBB;
  --aex-v2-lake-green-500: #3EA39F;
  --aex-v2-lake-green-600: #308885;
  --aex-v2-lake-green-700: #256A67;

  /* Roles — colour is assigned by what a thing means, never by where it sits */
  --aex-v2-role-node: var(--aex-v2-lake-200);
  --aex-v2-role-link: var(--aex-v2-lake-600);
  --aex-v2-role-link-underline: var(--aex-v2-lake-300);
  --aex-v2-role-activity: var(--aex-v2-lake-500);
  --aex-v2-role-activity-text: var(--aex-v2-lake-600);
  --aex-v2-role-chart-area: var(--aex-v2-lake-100);
  --aex-v2-role-focus: var(--aex-v2-lake-500);
  --aex-v2-role-focus-halo: var(--aex-v2-lake-100);
  --aex-v2-role-selection-edge: var(--aex-v2-lake-500);
  --aex-v2-role-money: var(--aex-v2-lake-green-500);
  --aex-v2-role-money-text: var(--aex-v2-lake-green-700);
  --aex-v2-role-credit: #C9940E; /* marks only: bars, coin mark. Never text, never a badge. */

  /* Status — inside badges only */
  --aex-v2-success: #247451;
  --aex-v2-success-fill: #E8F5EE;
  --aex-v2-warning: #8A5A00;
  --aex-v2-warning-fill: #FDF3E0;
  --aex-v2-danger: #B42318;
  --aex-v2-danger-fill: #FEE8E8;
  --aex-v2-danger-strong: #9E1F15;
  --aex-v2-live: var(--aex-v2-success);
  --aex-v2-live-fill: var(--aex-v2-success-fill);

  /* Legacy names, mapped onto the roles so older rules land on the system */
  --aex-v2-brand-black: var(--aex-v2-grey-950);
  --aex-v2-brand-blue: var(--aex-v2-role-activity);
  --aex-v2-action: var(--aex-v2-role-link);
  --aex-v2-action-strong: var(--aex-v2-lake-700);
  --aex-v2-action-soft: var(--aex-v2-lake-50);
  --aex-v2-focus: var(--aex-v2-role-focus);

  /* Light materials */
  --aex-v2-surface: #FFFFFF;
  --aex-v2-surface-raised: var(--aex-v2-grey-50);
  --aex-v2-surface-recessed: var(--aex-v2-grey-100);
  --aex-v2-surface-inverse: var(--aex-v2-grey-950);
  --aex-v2-text: var(--aex-v2-grey-900);
  --aex-v2-text-secondary: var(--aex-v2-grey-700);
  --aex-v2-text-tertiary: var(--aex-v2-grey-600);
  --aex-v2-text-disabled: rgba(0, 0, 0, 0.38);
  --aex-v2-on-inverse: #FFFFFF;
  --aex-v2-fill: rgba(0, 0, 0, 0.04);
  --aex-v2-fill-strong: rgba(0, 0, 0, 0.08);
  --aex-v2-border: rgba(0, 0, 0, 0.10);
  --aex-v2-border-strong: rgba(0, 0, 0, 0.16);
  --aex-v2-scrim: rgba(0, 0, 0, 0.40);
  --aex-v2-selection: var(--aex-v2-lake-200);

  /* 4px spatial scale */
  --aex-v2-space-1: 4px;
  --aex-v2-space-2: 8px;
  --aex-v2-space-3: 12px;
  --aex-v2-space-4: 16px;
  --aex-v2-space-5: 20px;
  --aex-v2-space-6: 24px;
  --aex-v2-space-8: 32px;
  --aex-v2-space-10: 40px;
  --aex-v2-space-12: 48px;
  --aex-v2-space-16: 64px;
  --aex-v2-space-20: 80px;
  --aex-v2-space-24: 96px;
  --aex-v2-space-32: 128px;

  /* Geometry */
  --aex-v2-control-dense: 26px;
  --aex-v2-control: 32px;
  --aex-v2-control-touch: 44px;
  /* Radius is a containment ladder, +2 per level: a surface is one step
     softer than the controls it holds, never the same and never sharper. A
     card at the button's own radius makes the button look rounder than the
     box around it. The textbook rule is outer = inner + padding, which at
     16-20px padding would give 24-28px — far too soft for this system's
     character — so the ladder steps once per level instead. Marks, bars and
     meters under 8px tall stay at 2-3px; at 8px they read as lozenges. */
  --aex-v2-radius-control-sm: 6px;
  --aex-v2-radius-control: 8px;
  --aex-v2-radius-card: 10px;
  --aex-v2-radius-menu: 12px;
  --aex-v2-radius-dialog: 14px;
  --aex-v2-radius-pill: 9999px;

  /* Elevation */
  --aex-v2-shadow-button: 0 1px 2px rgba(0, 0, 0, 0.06);
  --aex-v2-shadow-button-hover: 0 3px 8px rgba(0, 0, 0, 0.08);
  --aex-v2-shadow-low: 0 1px 1px rgba(0, 0, 0, 0.06), 0 2px 2px rgba(0, 0, 0, 0.04);
  --aex-v2-shadow-middle: 0 2px 4px rgba(0, 0, 0, 0.06), 0 8px 16px rgba(0, 0, 0, 0.05);
  --aex-v2-shadow-high: 0 4px 8px rgba(0, 0, 0, 0.08), 0 24px 48px rgba(0, 0, 0, 0.10);

  /* Motion */
  --aex-v2-duration-instant: 100ms;
  --aex-v2-duration-fast: 150ms;
  --aex-v2-duration-medium: 250ms;
  --aex-v2-duration-slow: 400ms;
  --aex-v2-ease-standard: cubic-bezier(0.4, 0, 0.2, 1);
  --aex-v2-ease-emphasized: cubic-bezier(0.2, 0, 0, 1);

  /* Layout */
  --aex-v2-container: 1000px;
  --aex-v2-sidebar: 240px;
  --aex-v2-inspector: 320px;
  --aex-v2-header: 56px;
}

@media (max-width: 640px) {
  :root {
    --aex-v2-size-1: 34px; --aex-v2-lh-1: 38px;
    --aex-v2-size-2: 26px; --aex-v2-lh-2: 30px;
    --aex-v2-size-3: 18px; --aex-v2-lh-3: 24px; --aex-v2-lh-3-lead: 28px;
  }
}

[data-aex-v2-theme='dark'] {
  --aex-v2-surface: #1C1C1E;
  --aex-v2-surface-raised: #2C2C2E;
  --aex-v2-surface-recessed: #0A0A0A;
  --aex-v2-surface-inverse: #F5F5F5;
  --aex-v2-text: #F5F5F5;
  --aex-v2-text-secondary: rgba(255, 255, 255, 0.68);
  --aex-v2-text-tertiary: rgba(255, 255, 255, 0.52);
  --aex-v2-text-disabled: rgba(255, 255, 255, 0.30);
  --aex-v2-on-inverse: #1A1A1A;
  --aex-v2-fill: rgba(255, 255, 255, 0.06);
  --aex-v2-fill-strong: rgba(255, 255, 255, 0.12);
  --aex-v2-border: rgba(255, 255, 255, 0.10);
  --aex-v2-border-strong: rgba(255, 255, 255, 0.18);
  --aex-v2-scrim: rgba(0, 0, 0, 0.62);
}
.aex-v2,
.aex-v2 *,
.aex-v2 *::before,
.aex-v2 *::after {
  box-sizing: border-box;
}

.aex-v2 {
  margin: 0;
  color: var(--aex-v2-text);
  background: var(--aex-v2-surface);
  font-family: var(--aex-v2-font-ui);
  font-size: var(--aex-v2-size-4);
  line-height: var(--aex-v2-lh-4);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.aex-v2 button,
.aex-v2 input {
  font: inherit;
}

.aex-v2 button,
.aex-v2 a {
  -webkit-tap-highlight-color: transparent;
}

.aex-v2 a {
  color: inherit;
  text-decoration: none;
}

.aex-v2 button {
  color: inherit;
}

/* Two weights: emphasis is Medium, never Bold (no 700 face ships). */
.aex-v2 strong,
.aex-v2 b {
  font-weight: 500;
}

/* Code and identifiers take the code face, not the browser's monospace. */
.aex-v2 code,
.aex-v2 pre,
.aex-v2 kbd,
.aex-v2 samp {
  font-family: var(--aex-v2-font-code);
}

.aex-v2 ::selection {
  color: var(--aex-v2-text);
  background: var(--aex-v2-selection);
}

/* §10: a 1px lake-500 ring with a 3px lake-100 halo on every control. */
.aex-v2 :focus-visible {
  outline: 1px solid var(--aex-v2-role-focus);
  outline-offset: 0;
  box-shadow: 0 0 0 4px var(--aex-v2-role-focus-halo);
}

/* Links inside prose take the link role; navigation and cards stay inherit. */
.aex-v2-link {
  color: var(--aex-v2-role-link);
  text-decoration: underline;
  text-decoration-color: var(--aex-v2-role-link-underline);
  text-underline-offset: 2px;
}

.aex-v2-link:hover {
  text-decoration-color: currentColor;
}

/* A field whose label is the wrapping <label>: label text above the control. */
label.aex-v2-field > span:first-child,
.aex-v2-field > span:first-child {
  color: var(--aex-v2-text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
}

.aex-v2-nowrap {
  white-space: nowrap;
}

/* A value that will not fit takes one line and an ellipsis, with the full
   string on the element's title. Wrapping a name to three lines to save a
   character sets the row height for the whole table. */
.aex-v2-truncate {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Empty state: a quiet grey tile with one line of guidance. */
.aex-v2-empty {
  padding: var(--aex-v2-space-5);
  background: var(--aex-v2-grey-100);
  border-radius: var(--aex-v2-radius-card);
}

.aex-v2-empty strong {
  display: block;
  font-size: 13px;
  font-weight: 500;
  line-height: 18px;
}

.aex-v2-empty p {
  max-width: 60ch;
  margin: 4px 0 0;
  color: var(--aex-v2-text-secondary);
  font-size: 12px;
  line-height: 16px;
}

/* Numeric role: figures inside data components, plain zero, tabular. Never a sentence. */
.aex-v2-numeric {
  font-family: var(--aex-v2-font-numeric);
  font-feature-settings: "ss09";
  font-variant-numeric: tabular-nums;
}

.aex-v2-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.aex-v2-skip {
  position: fixed;
  top: var(--aex-v2-space-3);
  left: var(--aex-v2-space-3);
  z-index: 200;
  transform: translateY(-80px);
  padding: var(--aex-v2-space-2) var(--aex-v2-space-3);
  color: #fff;
  background: var(--aex-v2-action-strong);
  border-radius: var(--aex-v2-radius-control-sm);
  transition: transform var(--aex-v2-duration-fast) var(--aex-v2-ease-standard);
}

.aex-v2-skip:focus {
  transform: translateY(0);
}

.aex-v2-container {
  width: min(calc(100% - 40px), var(--aex-v2-container));
  margin-inline: auto;
}

.aex-v2-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--aex-v2-text);
  font-family: var(--aex-v2-font-ui);
  font-size: var(--aex-v2-size-4);
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  white-space: nowrap;
}

.aex-v2-mark {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: var(--aex-v2-brand-blue);
  background: var(--aex-v2-brand-black);
  border-radius: 5px;
  font-family: var(--aex-v2-font-mono);
  font-size: 9px;
  letter-spacing: -0.04em;
}

.aex-v2-topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  height: var(--aex-v2-header);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.aex-v2-topbar-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  width: min(calc(100% - 32px), 1400px);
  height: 100%;
  margin-inline: auto;
}

.aex-v2-topnav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: var(--aex-v2-size-4);
  color: var(--aex-v2-text-secondary);
}

.aex-v2-topnav a {
  transition: color var(--aex-v2-duration-fast) var(--aex-v2-ease-standard);
}

.aex-v2-topnav a:hover {
  color: var(--aex-v2-text);
}

.aex-v2-status {
  justify-self: end;
  color: var(--aex-v2-text-secondary);
  font-family: var(--aex-v2-font-ui);
  font-size: 11px;
  line-height: 14px;
}

.aex-v2-hero {
  display: flex;
  min-height: calc(100svh - var(--aex-v2-header));
  align-items: center;
  padding: var(--aex-v2-space-16) 0 var(--aex-v2-space-24);
}

.aex-v2-hero-inner {
  width: 100%;
}

.aex-v2-hero-copy {
  max-width: 850px;
  margin: 0 auto var(--aex-v2-space-12);
  text-align: center;
}

.aex-v2-eyebrow {
  margin: 0 0 var(--aex-v2-space-4);
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-size-5);
  font-weight: 500;
  line-height: var(--aex-v2-lh-5);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.aex-v2-hero h1 {
  margin: 0;
  font-family: var(--aex-v2-font-display);
  font-size: var(--aex-v2-size-1);
  font-weight: 500;
  line-height: var(--aex-v2-lh-1);
  letter-spacing: -0.022em;
  text-wrap: balance;
}

.aex-v2-hero-lead {
  max-width: 620px;
  margin: var(--aex-v2-space-5) auto 0;
  color: var(--aex-v2-text-secondary);
  font-size: 18px;
  line-height: 28px;
  text-wrap: balance;
}

.aex-v2-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--aex-v2-space-3);
  margin-top: var(--aex-v2-space-6);
}

.aex-v2-btn {
  display: inline-flex;
  min-height: var(--aex-v2-control);
  align-items: center;
  justify-content: center;
  gap: var(--aex-v2-space-2);
  padding: 0 14px;
  color: var(--aex-v2-text);
  border: 1px solid transparent;
  border-radius: var(--aex-v2-radius-control);
  cursor: pointer;
  font-family: var(--aex-v2-font-ui);
  font-size: 13px;
  font-weight: 500;
  line-height: 16px;
  white-space: nowrap;
  transition:
    color var(--aex-v2-duration-fast) var(--aex-v2-ease-standard),
    background var(--aex-v2-duration-fast) var(--aex-v2-ease-standard),
    border-color var(--aex-v2-duration-fast) var(--aex-v2-ease-standard),
    box-shadow var(--aex-v2-duration-fast) var(--aex-v2-ease-standard),
    transform var(--aex-v2-duration-fast) var(--aex-v2-ease-standard);
}

/* Motion: filled and bordered buttons lift on hover and settle on press;
   quiet buttons only change fill; focus never lifts. */
.aex-v2-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--aex-v2-shadow-button-hover);
}

.aex-v2-btn:active {
  transform: translateY(1px);
  box-shadow: var(--aex-v2-shadow-button);
}

.aex-v2-btn:disabled,
.aex-v2-btn-quiet:hover,
.aex-v2-btn-quiet:active {
  transform: none;
  box-shadow: none;
}

/* Focus never lifts; it keeps the §10 halo (the ring is the outline above),
   shown at once rather than eased in. */
.aex-v2-btn:focus-visible {
  transform: none;
  transition: none;
  box-shadow: 0 0 0 4px var(--aex-v2-role-focus-halo);
}

@media (prefers-reduced-motion: reduce) {
  .aex-v2-btn:hover,
  .aex-v2-btn:active {
    transform: none;
  }
}

/* Primary: one step down from white. On a grey surface (.aex-v2-on-grey) it
   flips to white with a hairline and a soft shadow. `-console` is the same
   button under the console's older name. */
.aex-v2 .aex-v2-btn-primary,
.aex-v2 .aex-v2-btn-console {
  color: var(--aex-v2-text);
  background: var(--aex-v2-grey-200);
}

.aex-v2 .aex-v2-btn-primary:hover,
.aex-v2 .aex-v2-btn-console:hover {
  color: var(--aex-v2-text);
  background: var(--aex-v2-grey-300);
}

.aex-v2 .aex-v2-on-grey .aex-v2-btn-primary,
.aex-v2 .aex-v2-on-grey .aex-v2-btn-console {
  background: var(--aex-v2-surface);
  border-color: var(--aex-v2-border);
  box-shadow: var(--aex-v2-shadow-button);
}

.aex-v2 .aex-v2-on-grey .aex-v2-btn-primary:hover,
.aex-v2 .aex-v2-on-grey .aex-v2-btn-console:hover {
  background: var(--aex-v2-grey-50);
  box-shadow: var(--aex-v2-shadow-button-hover);
}

.aex-v2-btn-secondary {
  color: var(--aex-v2-text);
  background: var(--aex-v2-surface);
  border-color: var(--aex-v2-border-strong);
}

.aex-v2-btn-secondary:hover {
  background: var(--aex-v2-grey-50);
}

.aex-v2-on-grey .aex-v2-btn-secondary {
  background: transparent;
}

.aex-v2-on-grey .aex-v2-btn-secondary:hover {
  background: var(--aex-v2-surface);
}

.aex-v2-btn-quiet {
  color: var(--aex-v2-text-secondary);
  background: transparent;
}

.aex-v2-btn-quiet:hover {
  color: var(--aex-v2-text);
  background: var(--aex-v2-grey-100);
}

.aex-v2-btn-danger {
  color: #fff;
  background: var(--aex-v2-danger);
}

.aex-v2-btn-danger:hover {
  color: #fff;
  background: var(--aex-v2-danger-strong);
}

.aex-v2-btn-pill {
  border-radius: var(--aex-v2-radius-pill);
}

.aex-v2-icon {
  width: 16px;
  height: 16px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.aex-v2-demo {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  max-width: 860px;
  margin-inline: auto;
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border-strong);
  border-radius: var(--aex-v2-radius-card);
  box-shadow: var(--aex-v2-shadow-middle);
}

.aex-v2-demo-bar {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--aex-v2-space-4);
  border-bottom: 1px solid var(--aex-v2-border);
  font-family: var(--aex-v2-font-ui);
  font-size: 12px;
  line-height: 15px;
}

.aex-v2-demo-title,
.aex-v2-live-label {
  display: inline-flex;
  align-items: center;
  gap: var(--aex-v2-space-2);
}

.aex-v2-live-label {
  color: var(--aex-v2-live);
}

.aex-v2-live-dot {
  width: 7px;
  height: 7px;
  background: currentColor;
  border-radius: 50%;
  box-shadow: 0 0 0 3px var(--aex-v2-live-fill);
}

.aex-v2-query {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--aex-v2-space-3);
  padding: var(--aex-v2-space-4);
  border-bottom: 1px solid var(--aex-v2-border);
}

.aex-v2-query label {
  min-width: 0;
}

.aex-v2-input {
  width: 100%;
  min-height: var(--aex-v2-control);
  padding: 0 var(--aex-v2-space-3);
  color: var(--aex-v2-text);
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border-strong);
  border-radius: var(--aex-v2-radius-control);
  font-family: var(--aex-v2-font-ui);
  font-size: 13px;
  line-height: 16px;
}

.aex-v2-input::placeholder {
  color: var(--aex-v2-text-tertiary);
}

.aex-v2-input:focus-visible {
  outline: 0;
  border-color: var(--aex-v2-role-focus);
  box-shadow: 0 0 0 3px var(--aex-v2-role-focus-halo);
}

/* Toolbar above a list: tabs and filters start-aligned, search and the view's
   one action end-aligned. The filled primary is what makes the search read as
   part of the group. */
.aex-v2-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--aex-v2-space-3);
  min-height: var(--aex-v2-control);
  margin-bottom: var(--aex-v2-space-3);
}

.aex-v2-toolbar-start,
.aex-v2-toolbar-end {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--aex-v2-space-2);
}

.aex-v2-toolbar-end {
  margin-left: auto;
}

.aex-v2-toolbar-end > .aex-v2-btn,
.aex-v2-toolbar-end > .aex-v2-select {
  flex: none;
}

/* Search: a white hairline input with a leading magnifier. */
.aex-v2-input-search {
  width: min(240px, 100%);
  min-height: var(--aex-v2-control);
  padding: 0 10px 0 30px;
  color: var(--aex-v2-text);
  background: var(--aex-v2-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23767676' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") no-repeat 10px center;
  border: 1px solid var(--aex-v2-border-strong);
  border-radius: var(--aex-v2-radius-control);
  font-family: var(--aex-v2-font-ui);
  font-size: 13px;
  line-height: 16px;
}

.aex-v2-input-search-wide {
  width: 100%;
}

.aex-v2-input-search::placeholder {
  color: var(--aex-v2-text-tertiary);
}

.aex-v2-input-search:focus-visible {
  outline: 0;
  border-color: var(--aex-v2-role-focus);
  box-shadow: 0 0 0 3px var(--aex-v2-role-focus-halo);
}

.aex-v2-input-search::-webkit-search-decoration,
.aex-v2-input-search::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

/* Filter select: reads as a secondary button with a chevron. The list itself is native. */
.aex-v2-select {
  appearance: none;
  -webkit-appearance: none;
  min-height: var(--aex-v2-control);
  padding: 0 28px 0 12px;
  color: var(--aex-v2-text);
  background: var(--aex-v2-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23575757' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center;
  border: 1px solid var(--aex-v2-border-strong);
  border-radius: var(--aex-v2-radius-control);
  cursor: pointer;
  font-family: var(--aex-v2-font-ui);
  font-size: 13px;
  font-weight: 500;
  line-height: 16px;
}

.aex-v2-select:hover {
  background-color: var(--aex-v2-grey-50);
}

.aex-v2-select:focus-visible {
  outline: 1px solid var(--aex-v2-role-focus);
  outline-offset: 0;
  box-shadow: 0 0 0 4px var(--aex-v2-role-focus-halo);
}

/* Select box: the native <select> stays for forms and assistive tech, hidden;
   the trigger and the option list are the anchored menu, the same one the
   row actions use. Inline (toolbar filter) or block (a form field). */
/* Dense: a select that lives inside a card's head, beside an 11px label.
   The full 32px control out-weighs the label it sits next to. */
.aex-v2-select-dense,
.aex-v2-selectbox.is-dense .aex-v2-selectbox-trigger {
  min-height: 26px;
  height: 26px;
  /* The right inset keeps the chevron's lane — .aex-v2-select draws it as a
     background image at `right 10px`, so a symmetric padding would put the
     value underneath it. */
  padding: 0 24px 0 10px;
  font-size: 12px;
}

.aex-v2-select-dense,
.aex-v2-selectbox.is-dense .aex-v2-selectbox-trigger {
  background-position: right 8px center;
}

.aex-v2-selectbox {
  position: relative;
  display: block;
  min-width: 0;
}

.aex-v2-selectbox.is-inline {
  display: inline-block;
  flex: none; /* never shrink below the trigger inside a toolbar */
  min-width: max-content;
}

.aex-v2-selectbox-native {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  opacity: 0;
  pointer-events: none;
}

.aex-v2-selectbox-trigger {
  display: inline-flex;
  width: 100%;
  align-items: center;
  justify-content: flex-start;
  text-align: left;
}

.aex-v2-selectbox:not(.is-inline) .aex-v2-selectbox-trigger {
  font-weight: 400;
}

.aex-v2-selectbox.is-inline .aex-v2-selectbox-trigger {
  width: auto;
}

.aex-v2-selectbox-trigger[aria-expanded="true"] {
  border-color: var(--aex-v2-role-focus);
  box-shadow: 0 0 0 3px var(--aex-v2-role-focus-halo);
}

.aex-v2-selectbox-trigger:disabled {
  color: var(--aex-v2-text-disabled);
  background-color: var(--aex-v2-surface-recessed);
  cursor: not-allowed;
}

.aex-v2-selectbox-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aex-v2-select-menu {
  position: fixed;
  z-index: 1000; /* above dialogs: a select inside a modal opens over it */
  max-height: 320px;
  overflow: auto;
}

.aex-v2-select-menu .aex-v2-menu-item {
  justify-content: space-between;
}

.aex-v2-select-menu .aex-v2-menu-item.is-selected {
  color: var(--aex-v2-text);
}

.aex-v2-selectbox-check {
  width: 14px;
  height: 14px;
  flex: none;
  visibility: hidden;
}

.aex-v2-menu-item.is-selected .aex-v2-selectbox-check {
  visibility: visible;
}

.aex-v2-demo-meta {
  display: flex;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  gap: var(--aex-v2-space-3);
  padding: 0 var(--aex-v2-space-4);
  color: var(--aex-v2-text-secondary);
  background: var(--aex-v2-surface-raised);
  border-bottom: 1px solid var(--aex-v2-border);
  font-family: var(--aex-v2-font-ui);
  font-size: 11px;
  line-height: 14px;
}

.aex-v2-demo-tabs {
  display: flex;
  align-items: center;
  gap: var(--aex-v2-space-1);
}

.aex-v2-demo-tab {
  padding: 4px 8px;
  color: var(--aex-v2-text-secondary);
  background: transparent;
  border: 0;
  border-radius: var(--aex-v2-radius-control-sm);
  font-size: 11px;
}

.aex-v2-demo-tab[aria-selected='true'] {
  color: var(--aex-v2-text);
  background: var(--aex-v2-fill-strong);
}

.aex-v2-table-wrap {
  position: relative;
  overflow-x: auto;
}

.aex-v2-table {
  width: 100%;
  border-collapse: collapse;
  color: var(--aex-v2-text);
  font-family: var(--aex-v2-font-ui);
  font-size: 13px;
  line-height: 16px;
}

.aex-v2-table th {
  height: 34px;
  padding: 0 var(--aex-v2-space-4);
  color: var(--aex-v2-text-tertiary);
  border-bottom: 1px solid var(--aex-v2-border);
  font-size: 11px;
  font-weight: 400;
  line-height: 14px;
  text-align: left;
  white-space: nowrap;
}

.aex-v2-table td {
  height: 48px;
  padding: var(--aex-v2-space-2) var(--aex-v2-space-4);
  border-bottom: 1px solid var(--aex-v2-border);
  vertical-align: middle;
}

.aex-v2-table-dense td {
  height: 40px;
}

.aex-v2-table tr:last-child td {
  border-bottom: 0;
}

.aex-v2-table tbody tr {
  transition: background var(--aex-v2-duration-fast) var(--aex-v2-ease-standard);
}

.aex-v2-table tbody tr:hover {
  background: var(--aex-v2-fill);
}

/* Figures: right-aligned; the cells take the numeric role. Only cells, never
   the whole table — Diatype's tabular setting also widens word spaces. */
.aex-v2-table-number {
  text-align: right !important;
}

/* The trailing action column: a fixed 56px slot with its control centred, so
   the ⋯ reads as its own column instead of hanging off the table's edge. */
.aex-v2-table-actions {
  width: 56px;
  text-align: center !important;
  white-space: nowrap;
}

td.aex-v2-table-number {
  font-family: var(--aex-v2-font-numeric);
  font-feature-settings: "ss09";
  font-variant-numeric: tabular-nums;
}

.aex-v2-record {
  display: grid;
  gap: 2px;
}

.aex-v2-record strong {
  font-weight: 500;
}

.aex-v2-record small {
  color: var(--aex-v2-text-secondary);
  font-size: 11px;
  line-height: 14px;
}

.aex-v2-record small.record-connected {
  color: var(--aex-v2-live);
}

.aex-v2-tag {
  display: inline-flex;
  min-height: 22px;
  align-items: center;
  gap: 6px;
  padding: 0 8px;
  color: var(--aex-v2-text-secondary);
  background: var(--aex-v2-fill);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-pill);
  font-family: var(--aex-v2-font-ui);
  font-size: 10px;
  font-weight: 500;
  line-height: 13px;
  white-space: nowrap;
}

.aex-v2-tag-live {
  color: var(--aex-v2-live);
  background: var(--aex-v2-live-fill);
  border-color: transparent;
}

.aex-v2-tag-warning {
  color: var(--aex-v2-warning);
  background: var(--aex-v2-warning-fill);
  border-color: transparent;
}

.aex-v2-tag-danger {
  color: var(--aex-v2-danger);
  background: var(--aex-v2-danger-fill);
  border-color: transparent;
}

.aex-v2-reward {
  font-weight: 500;
  white-space: nowrap;
}

.aex-v2-section {
  padding: var(--aex-v2-space-32) 0 0;
}

.aex-v2-section:last-of-type {
  padding-bottom: var(--aex-v2-space-32);
}

.aex-v2-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 420px);
  gap: var(--aex-v2-space-8);
  align-items: end;
  margin-bottom: var(--aex-v2-space-10);
}

.aex-v2-section-kicker {
  margin: 0 0 var(--aex-v2-space-3);
  color: var(--aex-v2-text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.aex-v2-section h2 {
  margin: 0;
  font-family: var(--aex-v2-font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.01em;
}

.aex-v2-section-intro {
  margin: 0;
  color: var(--aex-v2-text-secondary);
  font-size: 16px;
  line-height: 26px;
}

.aex-v2-console-frame {
  overflow: hidden;
  min-height: 680px;
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border-strong);
  border-radius: var(--aex-v2-radius-card);
  box-shadow: var(--aex-v2-shadow-low);
  font-family: var(--aex-v2-font-ui);
}

.aex-v2-console-grid {
  display: grid;
  grid-template-columns: var(--aex-v2-sidebar) minmax(0, 1fr);
  min-height: 680px;
}

.aex-v2-sidebar {
  display: flex;
  flex-direction: column;
  padding: var(--aex-v2-space-2);
  border-right: 1px solid var(--aex-v2-border);
}

.aex-v2-sidebar-brand {
  display: flex;
  height: 42px;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--aex-v2-space-2);
  font-size: 17px;
  font-weight: 500;
  line-height: 22px;
}

.aex-v2-sidebar-groups {
  display: grid;
  gap: var(--aex-v2-space-5);
  margin-top: var(--aex-v2-space-2);
}

.aex-v2-sidebar-group-label {
  margin: 0 0 var(--aex-v2-space-2);
  padding: 0 var(--aex-v2-space-2);
  color: var(--aex-v2-text-secondary);
  font-size: 12px;
  line-height: 15px;
}

.aex-v2-sidebar-nav {
  display: grid;
  gap: 2px;
}

.aex-v2-sidebar-link {
  display: flex;
  height: var(--aex-v2-control);
  align-items: center;
  gap: var(--aex-v2-space-2);
  padding: 0 var(--aex-v2-space-2);
  color: var(--aex-v2-text-secondary);
  border-radius: var(--aex-v2-radius-control-sm);
  font-size: 13px;
  font-weight: 500;
  line-height: 19px;
}

.aex-v2-sidebar-link .aex-v2-icon {
  width: 14px;
  height: 14px;
}

.aex-v2-sidebar-link:hover,
.aex-v2-sidebar-link[aria-current='page'] {
  color: var(--aex-v2-text);
  background: var(--aex-v2-fill);
}

.aex-v2-account {
  display: flex;
  min-height: 48px;
  align-items: center;
  gap: var(--aex-v2-space-2);
  margin-top: auto;
  padding: var(--aex-v2-space-2);
  border-radius: var(--aex-v2-radius-control);
}

.aex-v2-account:hover {
  background: var(--aex-v2-fill);
}

.aex-v2-avatar {
  display: grid;
  width: 28px;
  height: 28px;
  flex: none;
  place-items: center;
  background: var(--aex-v2-fill-strong);
  border-radius: 50%;
  font-size: 11px;
  font-weight: 500;
}

.aex-v2-account-copy {
  display: grid;
  min-width: 0;
  gap: 2px;
  font-size: 11px;
  line-height: 14px;
}

.aex-v2-account-copy span:last-child {
  overflow: hidden;
  color: var(--aex-v2-text-secondary);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aex-v2-console-main {
  min-width: 0;
}

.aex-v2-console-header {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--aex-v2-space-4);
}

.aex-v2-console-header h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 500;
  line-height: 22px;
}

.aex-v2-console-content {
  padding: var(--aex-v2-space-4);
}

.aex-v2-card {
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-card);
}

/* Metric card — label / figure / note, with an optional trend, sparkline and
   bar. Colour follows the role of the number: .is-money (lake-green),
   .is-activity (lake, the default), .is-credit (gold, marks only). The same
   pattern as the landing page's audience dashboards. */
.aex-v2-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--aex-v2-space-3);
  margin-bottom: var(--aex-v2-space-6);
}

.aex-v2-metric {
  --aex-v2-metric-accent: var(--aex-v2-role-activity);
  --aex-v2-metric-accent-text: var(--aex-v2-role-activity-text);
  display: block;
  min-height: 0;
  padding: var(--aex-v2-space-4);
}

.aex-v2-metric.is-money {
  --aex-v2-metric-accent: var(--aex-v2-role-money);
  --aex-v2-metric-accent-text: var(--aex-v2-role-money-text);
}

.aex-v2-metric.is-credit {
  --aex-v2-metric-accent: var(--aex-v2-role-credit);
  --aex-v2-metric-accent-text: var(--aex-v2-text-secondary);
}

.aex-v2-metric-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--aex-v2-space-2);
}

.aex-v2-metric-label {
  display: block;
  margin: 0;
  color: var(--aex-v2-text-secondary);
  font-size: 11px;
  font-weight: 500;
  line-height: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.aex-v2-metric-value {
  display: block;
  margin: var(--aex-v2-space-2) 0 0;
  color: var(--aex-v2-text);
  font-family: var(--aex-v2-font-numeric);
  font-size: var(--aex-v2-text-product-metric);
  font-weight: 400;
  line-height: var(--aex-v2-lh-product-metric);
  letter-spacing: -0.02em;
  font-feature-settings: "ss09";
  font-variant-numeric: tabular-nums;
}

.aex-v2-metric-value small {
  margin-left: 4px;
  color: var(--aex-v2-text-tertiary);
  font-family: var(--aex-v2-font-ui);
  font-size: 12px;
  letter-spacing: 0;
}

/* A metric slot that holds words, not a figure (a state, a timestamp with prose). */
.aex-v2-metric-value.is-text {
  font-family: var(--aex-v2-font-ui);
  font-size: 13px;
  line-height: 18px;
  letter-spacing: 0;
}

.aex-v2-metric-trend {
  flex: none;
  margin-top: 2px;
  color: var(--aex-v2-metric-accent-text);
  font-family: var(--aex-v2-font-numeric);
  font-size: 11px;
  font-weight: 400;
  line-height: 14px;
  font-feature-settings: "ss09";
  white-space: nowrap;
}

.aex-v2-metric-note {
  display: block;
  margin: var(--aex-v2-space-2) 0 0;
  color: var(--aex-v2-text-secondary);
  font-size: 12px;
  line-height: 15px;
}

.aex-v2-metric-spark {
  display: block;
  width: 100%;
  height: 40px;
  margin-top: var(--aex-v2-space-2);
  overflow: visible;
}

.aex-v2-metric-spark-grid {
  fill: none;
  stroke: var(--aex-v2-border);
  stroke-width: 0.75;
}

.aex-v2-metric-spark-line {
  fill: none;
  stroke: var(--aex-v2-metric-accent);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.aex-v2-metric-spark-point {
  fill: var(--aex-v2-metric-accent);
}

.aex-v2-metric-bar {
  display: block;
  height: 4px;
  margin-top: var(--aex-v2-space-2);
  overflow: hidden;
  background: var(--aex-v2-grey-100);
  border-radius: 2px;
}

.aex-v2-metric-bar > em,
.aex-v2-metric-bar > span {
  display: block;
  height: 100%;
  background: var(--aex-v2-metric-accent);
  border-radius: inherit;
}

/* ---- Chart ----
   Shaped after the shadcn line chart (ui.shadcn.com/charts/line): horizontal
   dashed grid only, no axis line and no tick marks, a monotone curve at 2px
   with no dots, and a hover tooltip. The parts stay ours — this is the house
   line chart with that chart's manners, not a second charting vocabulary.

   The accent still comes from the role, so a revenue chart is money-green
   without being told. */
.aex-v2-chart {
  --aex-v2-chart-accent: var(--aex-v2-role-activity);
  position: relative;
  display: block;
  margin: 0;
}

.aex-v2-chart.is-money {
  --aex-v2-chart-accent: var(--aex-v2-role-money);
}

.aex-v2-chart-plot {
  display: block;
  width: 100%;
  height: 220px;
  overflow: visible;
}

/* CartesianGrid vertical={false}: horizontals only, dashed, hairline. */
.aex-v2-chart-grid {
  fill: none;
  stroke: var(--aex-v2-border);
  stroke-width: 1;
  stroke-dasharray: 3 3;
  vector-effect: non-scaling-stroke;
}

/* Line type="monotone" strokeWidth={2} dot={false}. */
.aex-v2-chart-line {
  fill: none;
  stroke: var(--aex-v2-chart-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

/* Two streams, stacked: their sum is the number the balance card shows, so the
   upper edge means something and the bands read as parts of one total. Roles
   are the system's own — money for commission, credit gold for credit sales —
   so the chart needs no legend to be guessable. */
.aex-v2-chart-line.is-commission {
  stroke: var(--aex-v2-role-money);
}

.aex-v2-chart-line.is-credit {
  stroke: var(--aex-v2-role-credit);
}

/* Reporting's two series use the roles they already mean elsewhere in the
   system: activity for traffic arriving, money for the part of it that was
   filled and can earn. The gap between the two lines IS the unfilled
   inventory, which is the thing a supply report exists to show. */
.aex-v2-chart-line.is-requests {
  stroke: var(--aex-v2-role-activity);
}

.aex-v2-chart-line.is-served {
  stroke: var(--aex-v2-role-money);
}

/* fillOpacity={0.4} in the shadcn reference; kept low so the grid stays
   readable through the band. */
.aex-v2-chart-area {
  stroke: none;
}

.aex-v2-chart-area.is-commission {
  fill: var(--aex-v2-role-money);
  opacity: 0.18;
}

.aex-v2-chart-area.is-credit {
  fill: var(--aex-v2-role-credit);
  opacity: 0.18;
}

.aex-v2-chart-area.is-requests {
  fill: var(--aex-v2-role-activity);
  opacity: 0.18;
}

/* A band axis. The ticks are already equal centred cells; the only thing to
   undo is the end alignment below, which pushes the first tick left and the
   last right so a LINE's end points — which sit ON the plot edges — get a
   label flush with them. A bar sits inside its slot, so its end ticks centre
   like every other one, and flush ones drift off the group they name. */
.aex-v2-chart-axis.is-band span:first-child,
.aex-v2-chart-axis.is-band span:last-child {
  text-align: center;
}

/* Bars sit on the baseline, so only their tops round — a rounded foot would
   lift a bar off the axis it is measured against. shadcn's radius={4}. */
.aex-v2-chart-bar {
  stroke: none;
}

.aex-v2-chart-bar.is-commission {
  fill: var(--aex-v2-role-money);
}

.aex-v2-chart-bar.is-credit {
  fill: var(--aex-v2-role-credit);
}

.aex-v2-chart-area.is-served {
  fill: var(--aex-v2-role-money);
  opacity: 0.18;
}

.aex-v2-chart-legend {
  display: flex;
  gap: var(--aex-v2-space-4);
  margin-top: var(--aex-v2-space-3);
}

.aex-v2-chart-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--aex-v2-text-secondary);
  font-family: var(--aex-v2-font-ui);
  font-size: 12px;
  line-height: 16px;
}

/* A dot per line, and only under the cursor — the resting chart has none.
   HTML rather than an SVG <circle>: the plot is preserveAspectRatio="none", so
   a circle inside its viewBox is scaled unevenly and draws as an ellipse.
   Filled in the series colour with a surface ring, the shape Recharts' activeDot
   uses — the ring is what separates the dot from the line running under it. */
.aex-v2-chart-dot {
  position: absolute;
  box-sizing: border-box;
  width: 10px;
  height: 10px;
  border: 2px solid var(--aex-v2-surface);
  border-radius: 50%;
  background: var(--aex-v2-chart-accent);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.aex-v2-chart-dot.is-visible {
  opacity: 1;
}

.aex-v2-chart-dot.is-commission {
  background: var(--aex-v2-role-money);
}

.aex-v2-chart-dot.is-credit {
  background: var(--aex-v2-role-credit);
}

.aex-v2-chart-dot.is-requests {
  background: var(--aex-v2-role-activity);
}

.aex-v2-chart-dot.is-served {
  background: var(--aex-v2-role-money);
}

/* XAxis tickLine={false} axisLine={false} tickMargin={8}. */
.aex-v2-chart-axis {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  color: var(--aex-v2-text-tertiary);
  font-family: var(--aex-v2-font-ui);
  font-size: 11px;
  line-height: 14px;
}

.aex-v2-chart-axis span {
  flex: 1 1 0;
  text-align: center;
}

.aex-v2-chart-axis span:first-child {
  text-align: left;
}

.aex-v2-chart-axis span:last-child {
  text-align: right;
}

/* ChartTooltipContent: a small raised card with the role swatch, the bucket
   label and the value. Follows the cursor, never covers the point. */
.aex-v2-chart-tooltip {
  position: absolute;
  z-index: 5;
  display: none;
  min-width: 140px;
  padding: 8px 10px;
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-control);
  box-shadow: var(--aex-v2-shadow-high);
  pointer-events: none;
}

.aex-v2-chart-tooltip.is-visible {
  display: block;
}

.aex-v2-chart-tooltip-label {
  display: block;
  color: var(--aex-v2-text-tertiary);
  font-family: var(--aex-v2-font-ui);
  font-size: 11px;
  line-height: 14px;
}

.aex-v2-chart-tooltip-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
  color: var(--aex-v2-text);
  font-family: var(--aex-v2-font-numeric);
  font-size: 12px;
  line-height: 16px;
}

/* ---- Calendar ----
   A range picker on the menu surface, so a popover is a popover whatever it
   holds. Monday-first, one month at a time; the edges of the range are filled
   and the days between take the quiet tint. */
.aex-v2-calendar {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  width: 260px;
}

.aex-v2-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--aex-v2-space-2);
  padding-bottom: var(--aex-v2-space-2);
}

.aex-v2-calendar-title {
  color: var(--aex-v2-text);
  font-family: var(--aex-v2-font-ui);
  font-size: 13px;
  font-weight: 500;
  line-height: 16px;
}

.aex-v2-calendar-head svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.aex-v2-calendar-grid {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.aex-v2-calendar-grid th {
  padding-bottom: 4px;
  color: var(--aex-v2-text-tertiary);
  font-family: var(--aex-v2-font-ui);
  font-size: 10px;
  font-weight: 500;
  line-height: 14px;
  text-align: center;
}

.aex-v2-calendar-grid td {
  padding: 1px;
  text-align: center;
}

.aex-v2-calendar-day {
  width: 100%;
  height: 30px;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--aex-v2-radius-control-sm);
  color: var(--aex-v2-text);
  cursor: pointer;
  font-family: var(--aex-v2-font-numeric);
  font-size: 12px;
  line-height: 16px;
}

.aex-v2-calendar-day:hover:not(:disabled) {
  background: var(--aex-v2-grey-100);
}

/* Outside the loaded series: shown, not hidden, so the edge of what the page
   knows is visible rather than a place the calendar silently will not go. */
.aex-v2-calendar-day:disabled {
  color: var(--aex-v2-text-disabled);
  cursor: default;
}

.aex-v2-calendar-day.is-within {
  background: var(--aex-v2-grey-100);
  border-radius: 0;
}

.aex-v2-calendar-day.is-edge {
  color: var(--aex-v2-surface);
  background: var(--aex-v2-role-money);
}

.aex-v2-calendar-hint {
  margin: var(--aex-v2-space-2) 0 0;
  color: var(--aex-v2-text-secondary);
  font-family: var(--aex-v2-font-ui);
  font-size: 11px;
  line-height: 14px;
}

.aex-v2-chart-tooltip-swatch {
  width: 8px;
  height: 8px;
  flex: none;
  border-radius: 2px;
  background: var(--aex-v2-chart-accent);
}

.aex-v2-chart-tooltip-swatch.is-commission {
  background: var(--aex-v2-role-money);
}

.aex-v2-chart-tooltip-swatch.is-credit {
  background: var(--aex-v2-role-credit);
}

/* A named gap, not a third category: grey because it is the absence of a
   reading rather than a lane of its own. */
.aex-v2-chart-tooltip-swatch.is-unknown {
  background: var(--aex-v2-border-strong);
}

.aex-v2-chart-tooltip-swatch.is-requests {
  background: var(--aex-v2-role-activity);
}

.aex-v2-chart-tooltip-swatch.is-served {
  background: var(--aex-v2-role-money);
}

/* The tooltip's rows put the label left and the figure right, so the two
   streams and their sum line up as a column of numbers. */
.aex-v2-chart-tooltip-row {
  justify-content: space-between;
}

.aex-v2-chart-tooltip-row > [data-series-tooltip-value] {
  margin-left: auto;
}

.aex-v2-chart-tooltip-row.is-total {
  margin-top: 6px;
  padding-top: 6px;
  border-top: 1px solid var(--aex-v2-border);
  font-weight: 500;
}

/* The two streams under a metric card's figure. */
.aex-v2-metric-split {
  display: flex;
  flex-wrap: wrap;
  gap: var(--aex-v2-space-3);
  margin-top: var(--aex-v2-space-2);
  color: var(--aex-v2-text-secondary);
  font-family: var(--aex-v2-font-ui);
  font-size: 11px;
  line-height: 14px;
}

.aex-v2-metric-split > span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

/* Plain: a metric inside another surface (a window, a panel) — no frame, no padding. */
.aex-v2-metric.is-plain {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

/* Dense: a KPI row inside another card — no frame, smaller figure. */
.aex-v2-metrics-dense {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--aex-v2-space-4);
  margin-bottom: 0;
}

.aex-v2-metrics-dense .aex-v2-metric {
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.aex-v2-metrics-dense .aex-v2-metric-value {
  margin-top: 4px;
  font-size: var(--aex-v2-text-product-title);
  line-height: var(--aex-v2-lh-product-title);
}

.aex-v2-console-table-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--aex-v2-space-2);
}

.aex-v2-console-table-head h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

.aex-v2-components-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--aex-v2-space-4);
}

.aex-v2-spec-card {
  min-height: 310px;
  padding: var(--aex-v2-space-6);
}

.aex-v2-spec-title {
  margin: 0 0 var(--aex-v2-space-6);
  font-family: var(--aex-v2-font-ui);
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

.aex-v2-control-stack {
  display: grid;
  gap: var(--aex-v2-space-6);
}

.aex-v2-control-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--aex-v2-space-2);
}

.aex-v2-field {
  display: grid;
  align-content: start; /* never stretch the control to a taller sibling */
  gap: var(--aex-v2-space-2);
}

.aex-v2-field label {
  color: var(--aex-v2-text-secondary);
  font-family: var(--aex-v2-font-ui);
  font-size: 11px;
  line-height: 14px;
}

/* Menu / popover */
.aex-v2-menu {
  padding: var(--aex-v2-space-2);
  background: var(--aex-v2-surface-raised);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-menu);
  box-shadow: var(--aex-v2-shadow-high);
}

.aex-v2-menu-item {
  display: flex;
  width: 100%;
  min-height: 32px;
  align-items: center;
  font-family: inherit;
  gap: 10px;
  padding: 0 var(--aex-v2-space-2);
  background: transparent;
  border: 0;
  border-radius: var(--aex-v2-radius-control-sm);
  color: var(--aex-v2-text-secondary);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  line-height: 19px;
  text-align: left;
}

.aex-v2-menu-item:hover {
  color: var(--aex-v2-text);
  background: var(--aex-v2-fill);
}

.aex-v2-menu {
  min-width: 208px;
  font-family: var(--aex-v2-font-ui);
}

.aex-v2-menu-item > span {
  display: block;
  min-width: 0;
}

.aex-v2-menu-item small {
  display: block;
  color: var(--aex-v2-text-tertiary);
  font-size: 11px;
  font-weight: 400;
  line-height: 14px;
  white-space: normal;
}

.aex-v2-menu-item:disabled {
  color: var(--aex-v2-text-disabled);
  background: transparent;
  cursor: not-allowed;
}

.aex-v2-menu-item.is-danger {
  color: var(--aex-v2-danger);
}

.aex-v2-menu-item.is-danger:hover {
  color: var(--aex-v2-danger);
  background: var(--aex-v2-danger-fill);
}

.aex-v2-menu-item.is-danger:disabled {
  color: var(--aex-v2-text-disabled);
  background: transparent;
}

.aex-v2-menu-item:has(small) {
  padding-top: 6px;
  padding-bottom: 6px;
  align-items: flex-start;
}

.aex-v2-dialog-stage {
  display: grid;
  min-height: 240px;
  place-items: center;
  padding: var(--aex-v2-space-6);
  background:
    linear-gradient(var(--aex-v2-scrim), var(--aex-v2-scrim)),
    var(--aex-v2-surface-recessed);
  border-radius: var(--aex-v2-radius-control);
}

.aex-v2-dialog {
  width: min(100%, 420px);
  padding: var(--aex-v2-space-6);
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-dialog);
  box-shadow: var(--aex-v2-shadow-high);
  font-family: var(--aex-v2-font-ui);
}

.aex-v2-dialog h4 {
  margin: 0;
  font-size: 15px;
  font-weight: 500;
  line-height: 20px;
}

.aex-v2-dialog p {
  margin: var(--aex-v2-space-3) 0 var(--aex-v2-space-5);
  color: var(--aex-v2-text-secondary);
  font-size: 13px;
  line-height: 18px;
}

.aex-v2-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: var(--aex-v2-space-2);
}

/* ---- Feedback: notice ----
   One banner for a failed load, a caution, or a result that needs a sentence.
   The panel stays grey like every other panel; the role speaks through a 2px
   edge and the mark, which is the accent rule the system already follows. A
   fully tinted panel competes with the data it sits above, and a page can
   carry several of these at once. Anything short enough to be a sentence and
   transient enough to dismiss itself is a toast, not a notice. */
.aex-v2-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--aex-v2-space-3);
  padding: var(--aex-v2-space-3) var(--aex-v2-space-4);
  background: var(--aex-v2-grey-100);
  border-left: 2px solid var(--aex-v2-grey-400);
  border-radius: var(--aex-v2-radius-control-sm);
  color: var(--aex-v2-text);
  font-family: var(--aex-v2-font-ui);
  font-size: 12px;
  line-height: 16px;
}

/* The mark is a fixed slot so the text lane holds across stacked notices. */
.aex-v2-notice-mark {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--aex-v2-text-tertiary);
}

.aex-v2-notice-body {
  min-width: 0;
  overflow-wrap: anywhere;
}

.aex-v2-notice-body p {
  margin: 0;
}

.aex-v2-notice-body p + p {
  margin-top: 2px;
}

.aex-v2-notice-body strong {
  display: block;
  font-weight: 500;
}

/* A request id or trace handle: the code face, one tier down, never the lead. */
.aex-v2-notice-ref {
  color: var(--aex-v2-text-tertiary);
  font-family: var(--aex-v2-font-mono);
  font-size: 11px;
  line-height: 14px;
}

/* Retry, Dismiss, View — the notice's one action, pinned to the far end. */
.aex-v2-notice-action {
  flex: none;
  margin-left: auto;
  align-self: center;
}

.aex-v2-notice-danger {
  border-left-color: var(--aex-v2-danger);
}

.aex-v2-notice-danger .aex-v2-notice-mark,
.aex-v2-notice-danger .aex-v2-notice-body strong {
  color: var(--aex-v2-danger);
}

.aex-v2-notice-warning {
  border-left-color: var(--aex-v2-warning);
}

.aex-v2-notice-warning .aex-v2-notice-mark,
.aex-v2-notice-warning .aex-v2-notice-body strong {
  color: var(--aex-v2-warning);
}

.aex-v2-notice-success {
  border-left-color: var(--aex-v2-success);
}

/* ---- Feedback: loading ----
   Two shapes, no spinner. A table waits as its own shape, so the page does
   not jump when the rows land; anything that is not a table waits as one
   quiet line. The console's reads are sub-second, and a spinner at that
   length is a flash, not information. */
.aex-v2-skeleton {
  display: block;
  height: 10px;
  border-radius: 3px;
  background: var(--aex-v2-grey-200);
  animation: aex-v2-skeleton-pulse 1.4s var(--aex-v2-ease-standard) infinite;
}

@keyframes aex-v2-skeleton-pulse {
  50% {
    opacity: 0.45;
  }
}

.aex-v2-loading {
  color: var(--aex-v2-text-tertiary);
  font-family: var(--aex-v2-font-ui);
  font-size: 12px;
  line-height: 16px;
  animation: aex-v2-skeleton-pulse 1.4s var(--aex-v2-ease-standard) infinite;
}

/* ---- Feedback: toast ----
   The confirmation for a write the operator just made and does not need to
   read twice: invited, rotated, paused, granted. It says what happened in the
   past tense and leaves. Anything that stays true until the underlying
   condition changes is a notice; anything that needs a decision is a dialog.

   Same accent language as the notice, one elevation up: white surface, 2px
   role edge, role mark. Bottom-right, newest nearest the corner, above the
   dialog scrim — a write can fail from inside a modal. */
.aex-v2-toast-stack {
  position: fixed;
  right: var(--aex-v2-space-5);
  bottom: var(--aex-v2-space-5);
  z-index: 1100;
  display: flex;
  flex-direction: column-reverse;
  gap: var(--aex-v2-space-2);
  pointer-events: none;
}

.aex-v2-toast {
  display: flex;
  align-items: flex-start;
  gap: var(--aex-v2-space-3);
  width: 360px;
  max-width: calc(100vw - var(--aex-v2-space-10));
  padding: var(--aex-v2-space-3) var(--aex-v2-space-4);
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border);
  border-left: 2px solid var(--aex-v2-grey-400);
  border-radius: var(--aex-v2-radius-card);
  box-shadow: var(--aex-v2-shadow-high);
  color: var(--aex-v2-text);
  font-family: var(--aex-v2-font-ui);
  font-size: 12px;
  line-height: 16px;
  pointer-events: auto;
  animation: aex-v2-toast-in var(--aex-v2-duration-medium) var(--aex-v2-ease-standard) both;
}

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

/* Leaving is a fade only: sliding out reads as a second arrival. */
.aex-v2-toast.is-leaving {
  opacity: 0;
  transition: opacity var(--aex-v2-duration-fast) var(--aex-v2-ease-standard);
}

.aex-v2-toast-mark {
  flex: none;
  width: 16px;
  height: 16px;
  color: var(--aex-v2-text-tertiary);
}

.aex-v2-toast-text {
  min-width: 0;
  overflow-wrap: anywhere;
}

.aex-v2-toast-dismiss {
  flex: none;
  width: 20px;
  height: 20px;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: var(--aex-v2-radius-control-sm);
  color: var(--aex-v2-text-tertiary);
  cursor: pointer;
}

.aex-v2-toast-dismiss:hover {
  color: var(--aex-v2-text);
  background: var(--aex-v2-grey-100);
}

.aex-v2-toast-danger {
  border-left-color: var(--aex-v2-danger);
}

.aex-v2-toast-danger .aex-v2-toast-mark {
  color: var(--aex-v2-danger);
}

.aex-v2-toast-warning {
  border-left-color: var(--aex-v2-warning);
}

.aex-v2-toast-warning .aex-v2-toast-mark {
  color: var(--aex-v2-warning);
}

.aex-v2-toast-success {
  border-left-color: var(--aex-v2-success);
}

.aex-v2-toast-success .aex-v2-toast-mark {
  color: var(--aex-v2-success);
}

.aex-v2-notice-success .aex-v2-notice-mark,
.aex-v2-notice-success .aex-v2-notice-body strong {
  color: var(--aex-v2-success);
}

.aex-v2-foundations {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: var(--aex-v2-space-4);
}

.aex-v2-type-specimen,
.aex-v2-color-specimen {
  padding: var(--aex-v2-space-6);
}

.aex-v2-type-list {
  display: grid;
  gap: var(--aex-v2-space-6);
}

.aex-v2-type-row {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: var(--aex-v2-space-5);
  align-items: baseline;
}

.aex-v2-type-label {
  color: var(--aex-v2-text-secondary);
  font-family: var(--aex-v2-font-mono);
  font-size: 10px;
  line-height: 13px;
}

.aex-v2-type-display {
  font-family: var(--aex-v2-font-display);
  font-size: 34px;
  font-weight: 400;
  line-height: 1.08;
}

.aex-v2-type-marketing {
  font-family: var(--aex-v2-font-marketing);
  font-size: 18px;
  line-height: 28px;
}

.aex-v2-type-ui {
  font-family: var(--aex-v2-font-ui);
  font-size: 13px;
  line-height: 16px;
}

.aex-v2-type-mono {
  font-family: var(--aex-v2-font-mono);
  font-size: 12px;
  line-height: 18px;
}

.aex-v2-swatches {
  display: grid;
  gap: var(--aex-v2-space-3);
}

.aex-v2-swatch {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: var(--aex-v2-space-3);
  align-items: center;
  color: var(--aex-v2-text-secondary);
  font-family: var(--aex-v2-font-ui);
  font-size: 11px;
  line-height: 14px;
}

.aex-v2-swatch-color {
  width: 48px;
  height: 32px;
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-control-sm);
}

.aex-v2-swatch-brand-black { background: var(--aex-v2-brand-black); }
.aex-v2-swatch-brand-blue { background: var(--aex-v2-brand-blue); }
.aex-v2-swatch-recessed { background: var(--aex-v2-surface-recessed); }
.aex-v2-swatch-fill { background: var(--aex-v2-fill-strong); }
.aex-v2-swatch-live { background: var(--aex-v2-live-fill); }

.aex-v2-page-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--aex-v2-space-6) 0;
  color: var(--aex-v2-text-secondary);
  border-top: 1px solid var(--aex-v2-border);
  font-size: 12px;
  line-height: 15px;
}

@media (max-width: 900px) {
  .aex-v2-topbar-inner {
    grid-template-columns: 1fr auto;
  }

  .aex-v2-topnav {
    display: none;
  }

  .aex-v2-section-head,
  .aex-v2-foundations {
    grid-template-columns: 1fr;
  }

  .aex-v2-console-grid {
    grid-template-columns: 188px minmax(0, 1fr);
  }

  .aex-v2-metrics,
  .aex-v2-components-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .aex-v2-container {
    width: min(calc(100% - 28px), var(--aex-v2-container));
  }

  .aex-v2-wordmark {
    font-size: 12px;
  }

  .aex-v2-status {
    display: none;
  }

  .aex-v2-topbar-inner {
    grid-template-columns: 1fr;
  }

  .aex-v2-hero {
    min-height: auto;
    padding: var(--aex-v2-space-20) 0;
  }

  .aex-v2-hero h1 {
    font-size: clamp(2.4rem, 11.5vw, 3rem);
  }

  .aex-v2-hero-lead {
    font-size: 16px;
    line-height: 25px;
  }

  .aex-v2-actions {
    flex-direction: column;
  }

  .aex-v2-actions .aex-v2-btn {
    width: 100%;
    min-height: var(--aex-v2-control-touch);
  }

  .aex-v2-query {
    grid-template-columns: 1fr;
  }

  .aex-v2-query .aex-v2-btn {
    min-height: var(--aex-v2-control-touch);
  }

  .aex-v2-demo-meta {
    align-items: flex-start;
    flex-direction: column;
    padding-block: var(--aex-v2-space-2);
  }

  .aex-v2-section {
    padding-top: var(--aex-v2-space-20);
  }

  .aex-v2-section:last-of-type {
    padding-bottom: var(--aex-v2-space-20);
  }

  .aex-v2-console-frame {
    min-height: 0;
  }

  .aex-v2-console-grid {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .aex-v2-sidebar {
    display: none;
  }

  .aex-v2-console-content {
    padding: var(--aex-v2-space-3);
  }

  .aex-v2-metric {
    min-height: 100px;
  }

  .aex-v2-spec-card,
  .aex-v2-type-specimen,
  .aex-v2-color-specimen {
    padding: var(--aex-v2-space-4);
  }

  .aex-v2-type-row {
    grid-template-columns: 1fr;
    gap: var(--aex-v2-space-2);
  }

  .aex-v2-page-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: var(--aex-v2-space-2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .aex-v2 *,
  .aex-v2 *::before,
  .aex-v2 *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }

  /* The waiting pulse is an animation, which the rule above does not reach.
     The bars stay; only the breathing stops. */
  .aex-v2-skeleton,
  .aex-v2-loading,
  .aex-v2-toast {
    animation: none;
  }
}

/* ---- Long-form composer (9b: centred 720px modal, fixed header and footer, scrolling body). Every modal in its frame shares it: the
   confirmations and one-time dialogs built as a bare `.aex-v2-cp-modal` (controls.ts, keys.ts, publisher-apps.ts) at a compact width;
   the foundation draws no `.aex-v2-cp-modal` of its own, so without this they fell back to the browser's dialog box. ---- */
:is(.mrp-composer, .aex-v2-cp-modal) {
  width: min(720px, calc(100vw - 24px));
  max-height: min(820px, calc(100vh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--aex-v2-text);
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-dialog);
  box-shadow: var(--aex-v2-shadow-high);
}
:is(.mrp-composer, .aex-v2-cp-modal)[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
:is(.mrp-composer, .aex-v2-cp-modal)::backdrop {
  background: var(--aex-v2-scrim);
}
:is(.mrp-composer, .aex-v2-cp-modal) .aex-v2-cp-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--aex-v2-space-3);
  padding: var(--aex-v2-space-5) var(--aex-v2-space-6) 14px;
}
:is(.mrp-composer, .aex-v2-cp-modal) h2 {
  margin: 0;
  font-size: var(--aex-v2-text-product-title);
  line-height: var(--aex-v2-lh-product-title);
}

:is(.mrp-composer, .aex-v2-cp-modal) .aex-v2-cp-modal-body {
  min-height: 0;
  padding: 0 var(--aex-v2-space-6) var(--aex-v2-space-5);
  overflow: auto;
}
/* A dialog whose footer is emptied (a show-once key's reveal) keeps no padded strip. */
:is(.mrp-composer, .aex-v2-cp-modal) .aex-v2-cp-modal-footer:empty {
  display: none;
}
:is(.mrp-composer, .aex-v2-cp-modal) .aex-v2-cp-modal-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--aex-v2-space-2);
  padding: var(--aex-v2-space-4) var(--aex-v2-space-6);
}
.aex-v2-cp-modal:not(.mrp-composer) {
  width: min(540px, calc(100vw - 24px));
}

/* AX primitives: bounded border-box geometry on both Staff and Partner. */
:is(.aex-v2-cp-modal, .mrp-composer, .aex-v2-dialog),
:is(.aex-v2-cp-modal, .mrp-composer, .aex-v2-dialog) * { box-sizing: border-box; min-width: 0; }
:is(.aex-v2-cp-modal, .mrp-composer, .aex-v2-dialog) {
  max-width: calc(100vw - 24px);
  max-height: min(820px, calc(100dvh - 48px - var(--mrp-modal-toast-room, 0px)));
  bottom: var(--mrp-modal-toast-room, 0px);
}
.aex-v2-cp-modal-body :is(form, fieldset, label, div) { min-width: 0; }
.aex-v2-cp-modal-body > :first-child { margin-top: 0; }
.aex-v2-cp-modal-body > :last-child { margin-bottom: 0; }
.aex-v2-field { gap: 8px; min-width: 0; }
.aex-v2-input { box-sizing: border-box; min-width: 0; padding: 8px 12px; }
textarea.aex-v2-input { min-height: 64px; resize: vertical; }
.mrp-required { margin-left: 4px; font-size: 11px; font-weight: 400; color: var(--aex-v2-text-secondary); }
.aex-v2-cp-modal pre, [data-prompt] { white-space: pre-wrap; overflow-wrap: anywhere; min-width: 0; max-width: 100%; }
.aex-v2-selectbox { min-width: 0; max-width: 100%; }
.aex-v2-selectbox.is-inline { min-width: 0; }
.aex-v2-selectbox .aex-v2-selectbox-trigger {
  position: relative; width: 100%; min-width: 0; min-height: 36px;
  padding: 8px 52px 8px 12px; text-align: left; font-weight: 400;
  color: var(--aex-v2-text-secondary); background-image: none;
  border: 1px solid var(--aex-v2-border); border-radius: 8px;
}
.aex-v2-selectbox .aex-v2-selectbox-trigger:focus-visible,
.aex-v2-selectbox .aex-v2-selectbox-trigger[aria-expanded="true"] {
  outline: 0; border-color: var(--aex-v2-role-focus); box-shadow: 0 0 0 3px var(--aex-v2-role-focus-halo);
}
.aex-v2-selectbox .mrp-select-chevron {
  position: absolute; top: 50%; right: 24px; width: 12px; height: 12px;
  color: var(--aex-v2-text-secondary); transform: translateY(-50%); pointer-events: none;
}
.aex-v2-select-menu[popover] {
  position: fixed; inset: auto; margin: 0; padding: 6px; min-width: 0;
  box-sizing: border-box; max-width: calc(100vw - 16px); overflow: auto;
  background: var(--aex-v2-grey-50); border: 1px solid var(--aex-v2-border);
  border-radius: 12px; box-shadow: var(--aex-v2-shadow-high);
}
.aex-v2-select-menu .aex-v2-menu-item {
  width: 100%; min-height: 40px; padding: 10px 18px 10px 26px;
  white-space: normal; text-align: left; color: var(--aex-v2-text-tertiary); font-weight: 400;
}
.aex-v2-select-menu .aex-v2-menu-item.is-selected { color: var(--aex-v2-text); font-weight: 500; }
.aex-v2-select-menu .aex-v2-menu-item:disabled { color: var(--aex-v2-text-disabled); cursor: not-allowed; }
.aex-v2-toast-stack[popover] {
  position: fixed; inset: auto 20px 20px auto; margin: 0; padding: 0;
  width: max-content; max-width: calc(100vw - 40px); max-height: calc(100dvh - 40px);
  overflow: auto; border: 0; background: transparent; pointer-events: none;
}
.aex-v2-toast-stack[popover] .aex-v2-toast { pointer-events: auto; }


/* ---- Page ---- */
/* `hidden` always hides: the foundation's display on a toolbar, button, field or select box would otherwise show a hidden one (Users' toolbar
   before its list is read, Home's setup toggle before its steps are known, a mock form's unused fields). */
[hidden] {
  display: none !important;
}
.mrp-page {
  font-size: var(--aex-v2-text-product-body);
  line-height: var(--aex-v2-lh-product-body);
}
.mrp-page h1,
.mrp-page h2,
.mrp-page summary,
.mrp-page legend {
  font-weight: 500;
}
.mrp-page h2 {
  margin: 0 0 var(--aex-v2-space-3);
  font-size: var(--aex-v2-text-product-component-title);
  line-height: var(--aex-v2-lh-product-component-title);
}
.mrp-dim,
.mrp-sub,
.mrp-hint {
  color: var(--aex-v2-text-secondary);
}
.mrp-sub {
  margin: 0 0 var(--aex-v2-space-5);
}
/* Identifiers and code: the code face with its shipped slashed zero (R8d). */
.mrp-id {
  font-family: var(--aex-v2-font-code);
  font-feature-settings: normal;
  overflow-wrap: anywhere;
}

/* ---- Wordmark (9b partner wordmark: 28px mark, 14px wordmark) ---- */
.mrp-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--aex-v2-space-2);
}
.mrp-mark {
  display: block;
  width: 28px;
  height: auto;
}
.mrp-wordmark {
  font-size: 14px;
  font-weight: 500;
  line-height: 16px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
}

/* ---- Sign-in and message pages: AX's signed-out page, one centred column (snips-v2 styles.css `.aex-v2.signed-out` :7703) ---- */
.mrp-centered {
  display: flex;
  min-height: 100vh;
  max-width: 420px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  padding: var(--aex-v2-space-12) var(--aex-v2-space-6);
  text-align: center;
}
.mrp-centered .mrp-logo {
  margin-bottom: var(--aex-v2-space-6);
}
.mrp-centered h1 {
  margin: 0;
  font-size: var(--aex-v2-size-3);
  line-height: var(--aex-v2-lh-3);
  letter-spacing: -0.012em;
}
.mrp-centered .mrp-sub {
  margin: var(--aex-v2-space-2) 0 0;
}

/* Self-serve app registration uses the same spacing and text inset for each control. */
.mrp-publisher-form { display: grid; gap: var(--aex-v2-space-4); }
.mrp-publisher-form :is(input, select, textarea) { padding-left: var(--aex-v2-space-3); }
.mrp-field-error { color: var(--aex-v2-danger); font-size: 13px; }
.mrp-offer-units-toolbar { align-items: flex-end; }
.mrp-centered > .aex-v2-btn {
  width: min(100%, 320px);
  margin-top: var(--aex-v2-space-6);
}
.mrp-centered .aex-v2-notice {
  align-self: stretch;
  margin-top: var(--aex-v2-space-4);
  text-align: left;
}

/* ---- Frame (Paper 3b): 240px sticky rail beside a fluid content column ---- */
.mrp-frame {
  display: flex;
  min-height: 100vh;
}
.mrp-rail {
  position: sticky;
  top: 0;
  display: flex;
  width: var(--aex-v2-sidebar);
  height: 100vh;
  flex: 0 0 var(--aex-v2-sidebar);
  flex-direction: column;
  align-self: flex-start;
  padding: var(--aex-v2-space-3) var(--aex-v2-space-2);
  border-right: 1px solid var(--aex-v2-border);
}
.mrp-rail-top {
  display: flex;
  min-height: var(--aex-v2-control);
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--aex-v2-space-2);
}
/* The top rail's 28px collapse toggle (Paper §3b; AX .aex-v2-cp-sidebar-toggle), as existing-token arithmetic: 24 + 4. */
.mrp-rail-toggle {
  display: grid;
  width: calc(var(--aex-v2-space-6) + var(--aex-v2-space-1));
  height: calc(var(--aex-v2-space-6) + var(--aex-v2-space-1));
  flex: none;
  place-items: center;
  padding: 0;
  color: var(--aex-v2-text-secondary);
  background: transparent;
  border: 0;
  border-radius: var(--aex-v2-radius-control-sm);
  cursor: pointer;
}
.mrp-rail-toggle:hover {
  color: var(--aex-v2-text);
  background: var(--aex-v2-fill);
}
/* Navigation (AX renderSidebar's .aex-v2-cp-nav as it renders, snips-v2 0c3e7192; Paper §3b): 8 above and 12 below the nav, groups 20 apart,
   items 2 apart, labels 11/14 in secondary grey with 4 beneath; items 32px, 13/16 regular in the text colour with a 14px icon 8 from the
   label, the current one on the fill. (AX draws its items as buttons, so the foundation's `.aex-v2 button { font: inherit }` sets them
   regular; links here say so directly.) */
.mrp-nav {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-5);
  padding: var(--aex-v2-space-2) 0 var(--aex-v2-space-3);
}
.mrp-nav-item {
  display: flex;
  height: var(--aex-v2-control);
  align-items: center;
  gap: var(--aex-v2-space-2);
  padding: 0 var(--aex-v2-space-2);
  color: var(--aex-v2-text);
  border-radius: var(--aex-v2-radius-control-sm);
  font-size: var(--aex-v2-text-product-body);
  font-weight: 400;
  line-height: 16px;
}
.mrp-nav-item.is-active {
  color: var(--aex-v2-text);
  background: var(--aex-v2-fill);
}
.mrp-nav-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mrp-nav-label {
  margin: 0 0 var(--aex-v2-space-1);
  padding: 0 var(--aex-v2-space-2);
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-label);
  line-height: var(--aex-v2-lh-product-label);
}
/* The footer mode switch (AX .aex-v2-cp-mode-switcher): two equal 28px segments, 4 apart, on no track; the current one on the fill in the
   text colour, the other secondary; 11/14 regular. */
.mrp-mode {
  display: flex;
  align-self: stretch;
  gap: var(--aex-v2-space-1);
}
.mrp-mode-item {
  display: flex;
  min-width: 0;
  min-height: calc(var(--aex-v2-space-6) + var(--aex-v2-space-1));
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  padding: 0 var(--aex-v2-space-1);
  white-space: nowrap;
  color: var(--aex-v2-text-secondary);
  border-radius: var(--aex-v2-radius-control-sm);
  font-size: var(--aex-v2-text-product-label);
  font-weight: 400;
  line-height: var(--aex-v2-lh-product-label);
  text-align: center;
}
.mrp-mode-item:hover {
  color: var(--aex-v2-text);
}
.mrp-mode-item.is-active {
  color: var(--aex-v2-text);
  background: var(--aex-v2-fill);
}

/* ---- Agent Distribution Home and Reporting (patterns of AX renderReadinessCard / renderDistributeReportingPage, snips-v2 0c3e7192) ---- */
/* Home's step cards (Paper 9b; AX .home-setup-steps and .issuer-step-card as rendered, the Operator 2026-10-22): side by side, 14 apart,
   lifted; a 34px tile, the title (13/16 medium) with its pill at the row's end, one line of copy, and the step's secondary action at the card's
   foot; the next step's primary beneath the grid. One column below 900px. */
.mrp-home-head {
  display: flex;
  min-height: var(--aex-v2-control);
  align-items: center;
  justify-content: space-between;
  gap: var(--aex-v2-space-3);
  margin-bottom: var(--aex-v2-space-3);
}
.mrp-home-head > .aex-v2-btn {
  margin-left: auto;
}
.mrp-setup-state:not([hidden]) {
  margin: 0;
  color: var(--aex-v2-text-secondary);
}
.mrp-setup {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.mrp-step {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--aex-v2-space-2);
  padding: 18px var(--aex-v2-space-5);
  box-shadow: var(--aex-v2-shadow-middle);
}
.mrp-step > .aex-v2-btn {
  align-self: flex-start;
  margin-top: auto;
}
.mrp-step-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.mrp-step h2 {
  margin: 0;
  font-size: var(--aex-v2-text-product-body);
  line-height: 16px;
}
.mrp-step-head .aex-v2-tag {
  flex: none;
}
.mrp-step p {
  margin: 0 0 var(--aex-v2-space-2);
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-body);
}
/* A toast's one action (Try again, Refresh keys) under its words; a toast in a container keeps the foundation's fixed place (toast.ts). */
.mrp-toast-action {
  margin-top: var(--aex-v2-space-2);
}
.aex-v2-toast-text strong {
  font-weight: 500;
}

/* ---- Report pages: Reporting, Billing and Earnings (AX renderDistributeReportingPage, renderDistributeBillingPage and
   renderMonetizeEarningsPage, snips-v2 0c3e7192; layout.ts) ---- */
/* The page's one notice that it isn't connected sits above its bar or cards. */
.mrp-content > .aex-v2-notice {
  margin-bottom: var(--aex-v2-space-4);
}
/* Offer flow (the user's local UI polish round 5): clear room below the chart above it, its filter and period on the left of a toolbar above
   the table and Generate report on the right. The Generate report dialog (report-export.ts) is a narrow form. */
.mrp-block.mrp-offer-flow {
  margin-top: var(--aex-v2-space-12);
}
.mrp-offer-flow-bar {
  flex-wrap: wrap;
  row-gap: var(--aex-v2-space-2);
  margin-bottom: var(--aex-v2-space-3);
}
.mrp-offer-flow-bar .aex-v2-toolbar-start {
  flex-wrap: wrap;
  gap: var(--aex-v2-space-2);
  min-width: 0;
}
.mrp-report-dialog {
  width: min(520px, calc(100vw - 24px));
}
.mrp-report-dialog .aex-v2-cp-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-3);
}
.mrp-report-dialog .mrp-hint,
.mrp-report-dialog .mrp-field-error {
  margin: 0;
}
.mrp-range-notice:not(:empty) {
  margin-top: var(--aex-v2-space-6);
}
/* Disabled until a report connection exists, and visibly so (the design system's disabled control tokens). */
.mrp-gated-action .aex-v2-btn:disabled,
.mrp-step .aex-v2-btn:disabled {
  color: var(--aex-v2-text-disabled);
  background-color: var(--aex-v2-surface-recessed);
  border-color: var(--aex-v2-border);
  cursor: not-allowed;
}
/* A figure Monarail doesn't serve: the card's words in the figure's place, in the secondary ink, never a zero. */
.mrp-metric-pending {
  color: var(--aex-v2-text-secondary);
  font-feature-settings: normal;
  font-variant-numeric: normal;
}
/* AX .aex-v2-metric-action: a card's one action, at its head's end (Earnings' Set up payouts) or, .is-footer, under its figure. A head
   action is AX's dense control (.aex-v2-btn-dense: 26 tall, 12px), and every head in the row keeps that height, so the figures line up. */
.mrp-metric-action {
  display: inline-flex;
  flex: none;
}
.mrp-metrics .aex-v2-metric-head {
  min-height: var(--aex-v2-control-dense);
}
.mrp-metric-action .aex-v2-btn {
  min-height: var(--aex-v2-control-dense);
  height: var(--aex-v2-control-dense);
  padding: 0 10px;
  font-size: var(--aex-v2-text-product-note);
}
.mrp-metric-foot {
  margin-top: var(--aex-v2-space-3);
}
/* Billing's monthly budget card (budget.ts): "left" in the UI face after the figure, the capped note under it, and the edit dialog (the
   composer modal, narrower) with its choice, note and error. */
.mrp-budget-left {
  font-family: var(--aex-v2-font-ui);
  font-size: var(--aex-v2-text-product-note);
  color: var(--aex-v2-text-secondary);
}
.mrp-composer.mrp-budget-dialog {
  width: min(480px, calc(100vw - 24px));
}
.mrp-budget-capped {
  margin: var(--aex-v2-space-2) 0 0;
  color: var(--aex-v2-warning);
  font-size: var(--aex-v2-text-product-note);
}
.mrp-budget-form {
  display: grid;
  gap: var(--aex-v2-space-4);
}
.mrp-budget-choice {
  display: flex;
  gap: var(--aex-v2-space-5);
  margin: 0;
  padding: 0;
  border: 0;
}
.mrp-budget-choice label {
  display: inline-flex;
  align-items: center;
  gap: var(--aex-v2-space-2);
}
.mrp-budget-note {
  margin: 0;
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
}
.mrp-budget-error {
  margin: 0;
  color: var(--aex-v2-danger);
}
/* AX .section-block and .aex-v2-cp-section-heading: each section below the cards, its heading row carrying one control at its end. */
.mrp-block {
  margin-top: var(--aex-v2-space-6);
}
.mrp-block-head {
  display: flex;
  min-height: var(--aex-v2-control);
  align-items: center;
  justify-content: space-between;
  gap: var(--aex-v2-space-4);
  margin-bottom: var(--aex-v2-space-3);
}
.mrp-page .mrp-block-head h2 {
  margin: 0;
}
/* AX .earnings-range-controls: the section's selects (range, campaign) side by side at the heading's end. */
.mrp-block-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--aex-v2-space-2);
}
/* A chart with nothing to draw (chart.ts renderEmptyChart): its words centred over the empty plot, on the surface so no grid line runs
   through them. */
.mrp-chart-empty-note {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.mrp-chart-empty-note > span {
  display: flex;
  max-width: 420px;
  flex-direction: column;
  align-items: center;
  gap: var(--aex-v2-space-1);
  padding: var(--aex-v2-space-2) var(--aex-v2-space-3);
  background: var(--aex-v2-surface);
  text-align: center;
}
.mrp-chart-empty-note strong {
  font-weight: 500;
}
.mrp-chart-empty-note strong + span {
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
.mrp-block-note {
  margin: var(--aex-v2-space-1) 0 0;
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
.mrp-block > .mrp-hint {
  max-width: 720px;
  margin: 0;
}
.mrp-block > .aex-v2-table-wrap + .mrp-hint {
  margin-top: var(--aex-v2-space-3);
}
/* One small note under a checklist (lead 2026-10-09 16:20). */
.mrp-footnote {
  max-width: 720px;
  margin: var(--aex-v2-space-3) 0 0;
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
.mrp-footnote p {
  margin: 0;
}
/* Home's step tile (cut 4; Paper 9b: "a 34px tile (check on success-bg when complete, the step number on grey-100 otherwise)"; AX
   .issuer-step-tile), as existing-token arithmetic: 32 + 2. Decorative; the pill carries the state. Gated sections keep at most one
   unavailable action. */
.mrp-step-tile {
  display: inline-flex;
  width: calc(var(--aex-v2-space-8) + var(--aex-v2-space-1) / 2);
  height: calc(var(--aex-v2-space-8) + var(--aex-v2-space-1) / 2);
  flex: none;
  align-items: center;
  justify-content: center;
  color: var(--aex-v2-text-secondary);
  background: var(--aex-v2-grey-100);
  border-radius: var(--aex-v2-radius-control);
  font-size: var(--aex-v2-text-product-body);
  font-weight: 500;
  line-height: var(--aex-v2-lh-product-body);
}
/* The number is generated content, so no digit enters the page's text (Home shows no number). */
.mrp-step-tile:not(.is-complete)::before {
  content: attr(data-step-tile);
}
.mrp-step-tile.is-complete {
  color: var(--aex-v2-success);
  background: var(--aex-v2-success-fill);
}
/* ---- Guided store connect (connect.ts; the Operator, 2026-10-27; P2, 2026-10-28): the steps are Home's setup cards (a check, spinner,
   number or "!" tile, a status pill, one line and at most one action) with Hide steps as Home's Hide setup; the unfinished store's row
   below them before a store exists. ---- */
.mrp-connect {
  margin-bottom: var(--aex-v2-space-6);
}
/* The cards' row of small controls (Home's .mrp-home-head): the hidden state's line on the left, Start over and Hide steps on the right
   (once every step is done, Hide steps alone). */
.mrp-connect-head-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--aex-v2-space-2);
  margin-left: auto;
}
/* Five cards share one row on a wide content column (1440); fewer per row as it narrows (no card under 200px, so its name, pill, line and
   action stay inside it; R13-R1), and one per row on a narrow screen (Home's breakpoint, below). Home's own grid is unchanged. */
.mrp-connect .mrp-setup {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}
/* Inside a step card: the name and its pill wrap rather than overflow, a long store domain breaks, and the step's action wraps its words
   within the card (only here; buttons elsewhere keep the foundation's single line). */
.mrp-connect-step .mrp-step-head {
  flex-wrap: wrap;
}
.mrp-connect-step p {
  overflow-wrap: anywhere;
}
.mrp-connect-step .mrp-connect-action {
  max-width: 100%;
}
.mrp-connect-step .mrp-connect-action .aex-v2-btn {
  max-width: 100%;
  padding-block: 7px;
  white-space: normal;
  text-align: center;
}
.mrp-connect-step h3 {
  margin: 0;
  font-size: var(--aex-v2-text-product-body);
  line-height: 16px;
}
.mrp-connect-step.is-todo h3 {
  color: var(--aex-v2-text-tertiary);
}
.mrp-connect-step.is-failed p {
  color: var(--aex-v2-danger);
}
.mrp-step-tile.is-active {
  background: transparent;
}
.mrp-step-tile.is-failed {
  color: var(--aex-v2-danger);
  background: var(--aex-v2-danger-fill);
}
.mrp-connect-action {
  margin-top: auto;
}
.mrp-connect-spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--aex-v2-grey-200);
  border-top-color: var(--aex-v2-text);
  border-radius: 50%;
  animation: mrp-connect-spin 0.8s linear infinite;
}
@keyframes mrp-connect-spin {
  to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
  .mrp-connect-spinner {
    animation: none;
    border-right-color: var(--aex-v2-text);
  }
}
.mrp-connect-pending {
  margin-top: var(--aex-v2-space-4);
}
/* Before a store exists, the store step's "Connect a store to start" gives way to the stepper while it is on screen. */
.mrp-connect:not([hidden]) ~ .mrp-gated {
  display: none;
}
@media (max-width: 899px) {
  .mrp-connect .mrp-setup {
    grid-template-columns: minmax(0, 1fr);
  }
  /* Connect store stays at the right above the table (P2), not the narrow toolbar's full-width row. */
  .mrp-page .mrp-connect-toolbar .aex-v2-toolbar-end {
    flex: 0 0 auto;
    margin-left: auto;
  }
}
/* A complete card's last action (connect.ts `render`'s footer) shows only on a narrow screen, below its compact list; on a wide one it stays
   in its Ready card, so there is one visible copy at any width. */
.mrp-connect-foot {
  display: none;
}
/* Lead screenshot review (2026-11-11 19:37), connect cards only: on a narrow screen the steps are a compact vertical stepper. Each step is
   one line (tile, name and pill); a done step shows nothing more, and a not-started one only while another step is active or stalled (a
   not-started step that is the frontier, such as Ready waiting on later pages, keeps its reason and action). The active or stalled step
   keeps its line and action under its name. Home's setup cards are unchanged. */
@media (max-width: 899px) {
  .mrp-connect .mrp-setup {
    gap: 6px;
  }
  .mrp-connect-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    column-gap: var(--aex-v2-space-3);
    row-gap: var(--aex-v2-space-2);
    padding: var(--aex-v2-space-2) var(--aex-v2-space-3);
  }
  .mrp-connect-step > :not(.mrp-step-tile) {
    grid-column: 2;
  }
  .mrp-connect-step .mrp-step-head {
    flex-wrap: nowrap;
    min-width: 0;
  }
  .mrp-connect-step .mrp-step-head h3 {
    min-width: 0;
  }
  .mrp-connect-step p {
    margin: 0;
  }
  .mrp-connect-step.is-done > p,
  .mrp-connect-step.is-done > .mrp-connect-action,
  .mrp-setup:has(.is-active, .is-failed) > .mrp-connect-step.is-todo > p,
  .mrp-setup:has(.is-active, .is-failed) > .mrp-connect-step.is-todo > .mrp-connect-action {
    display: none;
  }
  .mrp-connect-card > .mrp-setup:not([hidden]) + .mrp-connect-foot:not(:empty) {
    display: flex;
    margin-top: var(--aex-v2-space-3);
  }
  /* Stores' two tables scroll sideways inside their own wrappers (never the page), each column at its content's width and at least 72px. A
     connection's name or ID wraps within the first column, so Connection and Provider both show before any scrolling at 390. */
  .mrp-stores-table {
    width: max-content;
    min-width: 100%;
  }
  .mrp-stores-table th {
    min-width: 72px;
  }
  .mrp-stores-table td {
    white-space: nowrap;
  }
  .mrp-stores-table td:first-child > :is(strong, .mrp-id) {
    display: block;
    max-width: 180px;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}
.mrp-gated-section {
  max-width: 720px;
  margin-top: var(--aex-v2-space-6);
}
.mrp-gated-section h2 {
  margin-bottom: var(--aex-v2-space-1);
}
.mrp-gated-section .mrp-hint {
  margin: 0 0 var(--aex-v2-space-3);
}
.mrp-catalog-toolbar {
  align-items: end;
  flex-wrap: wrap;
}
.mrp-catalog-toolbar > label { flex: 1 1 120px; min-width: 0; }
.mrp-catalog-toolbar > button { margin-left: auto; }
/* F10: product-set choices stay in Guided Create's existing product step. */
.mrp-catalog-set-card {
  min-width: 0;
  margin: var(--aex-v2-space-4) 0;
  padding: var(--aex-v2-space-3);
  box-sizing: border-box;
}
.mrp-catalog-set-card > legend {
  float: left;
  padding: var(--aex-v2-space-2) 0;
}
.mrp-catalog-set-header {
  display: flex;
  justify-content: flex-end;
  gap: var(--aex-v2-space-1);
  margin-bottom: var(--aex-v2-space-3);
}
.mrp-catalog-set-card > .aex-v2-field { clear: both; }
.mrp-catalog-set-card .aex-v2-selectbox,
.mrp-catalog-set-card .aex-v2-select { width: 100%; min-width: 0; }
.mrp-catalog-set-bids {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--aex-v2-space-3);
  margin-top: var(--aex-v2-space-3);
}
@media (max-width: 600px) {
  .mrp-catalog-set-bids { grid-template-columns: minmax(0, 1fr); }
  .mrp-catalog-set-header { flex-wrap: wrap; }
}
.mrp-catalog-toolbar > label > .aex-v2-select,
.mrp-catalog-toolbar .aex-v2-selectbox,
.mrp-catalog-toolbar .aex-v2-selectbox.is-inline .aex-v2-selectbox-trigger { width: 100%; min-width: 0; }
@media (max-width: 600px) {
  .mrp-catalog-toolbar { flex-direction: column; align-items: stretch; }
  .mrp-catalog-toolbar > label { flex: 0 1 auto; }
  .mrp-catalog-toolbar > button { margin-left: 0; align-self: flex-start; }
}
.mrp-gated-action {
  margin-top: var(--aex-v2-space-3);
}
/* An unavailable action (cut 4, UX-UA-R1): aria-disabled so the keyboard reaches it, drawn with the design system's disabled control tokens,
   never lifting; its reason is a tip on focus or hover (the menu surface tokens), hidden at rest as .aex-v2-sr-only hides, and after
   Escape (shell.ts) until focus leaves. */
.aex-v2-btn[aria-disabled="true"] {
  color: var(--aex-v2-text-disabled);
  background-color: var(--aex-v2-surface-recessed);
  border-color: var(--aex-v2-border);
  cursor: not-allowed;
}
.aex-v2-btn[aria-disabled="true"]:hover:not(:focus-visible),
.aex-v2-btn[aria-disabled="true"]:active:not(:focus-visible) {
  transform: none;
  box-shadow: none;
}
.mrp-unavailable {
  position: relative;
  display: inline-flex;
}
.mrp-unavailable-tip,
.mrp-info-tip {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.mrp-unavailable:not([data-dismissed="true"]):is(:hover, :focus-within) .mrp-unavailable-tip,
.mrp-info:not([data-dismissed="true"]):is(:hover, :focus-within) .mrp-info-tip {
  z-index: 20;
  top: calc(100% + var(--aex-v2-space-1));
  left: 0;
  width: max-content;
  max-width: min(calc(100vw - var(--aex-v2-space-6)), calc(var(--aex-v2-sidebar) + var(--aex-v2-space-10)));
  height: auto;
  overflow: visible;
  padding: var(--aex-v2-space-2);
  clip: auto;
  clip-path: none;
  color: var(--aex-v2-text-secondary);
  background: var(--aex-v2-surface-raised);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-menu);
  box-shadow: var(--aex-v2-shadow-high);
  font-size: var(--aex-v2-text-product-label);
  font-weight: 400;
  line-height: var(--aex-v2-lh-product-label);
  text-align: left;
  white-space: normal;
}
.mrp-unavailable-end:not([data-dismissed="true"]):is(:hover, :focus-within) .mrp-unavailable-tip,
:is(.aex-v2-toolbar-end, .mrp-block-controls, .mrp-metric-action, .aex-v2-cp-modal-footer) > .mrp-unavailable:not([data-dismissed="true"]):is(:hover, :focus-within) .mrp-unavailable-tip {
  right: 0;
  left: auto;
}
/* A field's info tip (info-tip.ts): a quiet 20px ⓘ after the label's text; its tip is the unavailable reason's, anchored to the whole label
   row and never wider than the field, so it stays inside a narrow dialog. */
.mrp-field-label {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--aex-v2-space-1);
}
.mrp-info {
  display: inline-flex;
}
.mrp-info-button {
  display: inline-grid;
  width: 20px;
  height: 20px;
  margin: -3px 0;
  padding: 0;
  place-items: center;
  color: var(--aex-v2-text-tertiary);
  background: transparent;
  border: 0;
  border-radius: 999px;
  cursor: default;
}
.mrp-info-button:hover,
.mrp-info-button:focus-visible {
  color: var(--aex-v2-text);
}
.mrp-info-button:focus-visible {
  outline: 1px solid var(--aex-v2-role-focus);
  box-shadow: 0 0 0 3px var(--aex-v2-role-focus-halo);
}
.mrp-info-button .aex-v2-icon {
  width: 14px;
  height: 14px;
}
/* At rest the tip isn't drawn at all; aria-describedby still gives the button its text. */
.mrp-info-tip {
  display: none;
}
.mrp-info:not([data-dismissed="true"]):is(:hover, :focus-within) .mrp-info-tip {
  display: block;
  max-width: min(280px, 100%);
}
/* In a dialog's footer the reason opens above its action, inside the dialog, rather than below the dialog's edge. */
.aex-v2-cp-modal-footer > .mrp-unavailable:not([data-dismissed="true"]):is(:hover, :focus-within) .mrp-unavailable-tip {
  top: auto;
  bottom: calc(100% + var(--aex-v2-space-1));
}
/* The footer (Paper §3b): the mode switcher, then the account row, 12 apart, pinned to the bottom. */
.mrp-rail-foot {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-3);
  margin-top: auto;
}
/* The account row (AX .aex-v2-cp-user): 44px, the 28px avatar 8 from two lines, the person 12/15 medium over the workspace 11/14 regular in
   secondary grey, and a 14px tertiary chevron pointing to where the menu opens (up; down while open). The shared menu (Paper 9b) opens 8
   above the row, the footer's full width, its icons 16px (AX .aex-v2-cp-account-menu). */
.mrp-account {
  position: relative;
}
.mrp-account-row {
  display: flex;
  width: 100%;
  min-height: var(--aex-v2-control-touch);
  align-items: center;
  gap: var(--aex-v2-space-2);
  padding: var(--aex-v2-space-1) var(--aex-v2-space-2);
  color: var(--aex-v2-text);
  background: transparent;
  border: 0;
  border-radius: var(--aex-v2-radius-control);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.mrp-account-row:hover {
  background: var(--aex-v2-fill);
}
.mrp-account-copy {
  display: grid;
  min-width: 0;
  flex: 1 1 auto;
  gap: 2px;
}
.mrp-operator {
  overflow: hidden;
  font-size: var(--aex-v2-text-product-note);
  font-weight: 500;
  line-height: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The workspace line: only the organization name ellipsizes; the Sandbox badge keeps its width beside it (review UX-R1). */
.mrp-account-org {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: var(--aex-v2-space-1);
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-label);
  line-height: var(--aex-v2-lh-product-label);
}
.mrp-account-org .mrp-workspace {
  min-width: 0;
  flex: 0 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mrp-account-org .mrp-env {
  flex: none;
}
.mrp-account-chevron {
  display: grid;
  flex: none;
  margin-left: auto;
  color: var(--aex-v2-text-tertiary);
}
.mrp-account-chevron .aex-v2-icon {
  width: 14px;
  height: 14px;
}
.mrp-account-row[aria-expanded="true"] .mrp-account-chevron .aex-v2-icon {
  transform: rotate(180deg);
}
.mrp-account-menu {
  position: absolute;
  z-index: 20;
  right: 0;
  bottom: calc(100% + var(--aex-v2-space-2));
  left: 0;
}
.mrp-account-menu .aex-v2-icon {
  width: 16px;
  height: 16px;
  flex: none;
}
.mrp-account-item-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* The account menu's environment group (the Operator, 2026-10-22): a small label, then Sandbox with the select menu's check and Live with
   its reason, between hairlines. */
.mrp-menu-group {
  margin: var(--aex-v2-space-1) 0;
  padding: var(--aex-v2-space-1) 0;
  border-top: 1px solid var(--aex-v2-border);
  border-bottom: 1px solid var(--aex-v2-border);
}
.mrp-menu-label {
  margin: var(--aex-v2-space-1) var(--aex-v2-space-2) 2px;
  color: var(--aex-v2-text-tertiary);
  font-size: var(--aex-v2-text-product-label);
  font-weight: 500;
  line-height: var(--aex-v2-lh-product-label);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mrp-menu-group .aex-v2-selectbox-check {
  margin-left: auto;
}
.mrp-menu-group .aex-v2-menu-item[aria-disabled="true"] {
  color: var(--aex-v2-text-disabled);
  cursor: not-allowed;
}
.mrp-menu-group .aex-v2-menu-item[aria-disabled="true"]:hover {
  background: transparent;
}
.mrp-env {
  padding: 0 var(--aex-v2-space-2);
  color: var(--aex-v2-text-secondary);
  background: var(--aex-v2-grey-100);
  border-radius: var(--aex-v2-radius-pill);
  font-size: var(--aex-v2-text-product-tag);
  line-height: var(--aex-v2-lh-product-tag);
}
/* Collapsed rail (desktop only; Paper "still open", AX's 48px icon rail as the proposal): icons and the avatar remain, labels stay the
   accessible names (visually hidden as .aex-v2-sr-only does), the mode switcher and the client switcher hide. */
@media (min-width: 900px) {
  .mrp-frame[data-rail="collapsed"] .mrp-rail {
    width: var(--aex-v2-space-12);
    flex-basis: var(--aex-v2-space-12);
  }
  .mrp-frame[data-rail="collapsed"] .mrp-logo,
  .mrp-frame[data-rail="collapsed"] .mrp-nav-label,
  .mrp-frame[data-rail="collapsed"] .mrp-mode,
  .mrp-frame[data-rail="collapsed"] .mrp-agency-switcher,
  .mrp-frame[data-rail="collapsed"] .mrp-account-copy,
  .mrp-frame[data-rail="collapsed"] .mrp-account-chevron {
    display: none;
  }
  .mrp-frame[data-rail="collapsed"] .mrp-rail-top,
  .mrp-frame[data-rail="collapsed"] .mrp-nav-item,
  .mrp-frame[data-rail="collapsed"] .mrp-account-row {
    justify-content: center;
    padding: 0;
  }
  .mrp-frame[data-rail="collapsed"] .mrp-nav-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .mrp-frame[data-rail="collapsed"] .mrp-account-menu {
    right: auto;
    min-width: calc(var(--aex-v2-sidebar) - var(--aex-v2-space-4));
  }
}
.mrp-content {
  min-width: 0;
  flex: 1 1 auto;
  padding: var(--aex-v2-space-3) var(--aex-v2-space-6) var(--aex-v2-space-12);
}
/* Room under the page for the bottom-right toasts (toast.ts), so the last control scrolls clear of a toast that stays. */
.mrp-frame .mrp-content {
  padding-bottom: max(var(--aex-v2-space-12), var(--mrp-toast-room, 0px));
}
.mrp-page-header {
  display: flex;
  height: var(--aex-v2-control);
  align-items: center;
  margin-bottom: var(--aex-v2-space-5);
}
.mrp-page-header h1 {
  margin: 0;
  font-size: var(--aex-v2-text-product-title);
  line-height: var(--aex-v2-lh-product-title);
  letter-spacing: -0.01em;
}


.mrp-page h3,
.mrp-page h4 {
  font-weight: 500;
}

/* ---- Campaigns view ---- */
/* A change with an unknown outcome stays on screen while the person scrolls (persistent, never a toast). */
#mrp-unresolved {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--aex-v2-surface);
}
#mrp-unresolved:not(:empty) {
  padding: var(--aex-v2-space-3) 0;
}
.mrp-unresolved + .mrp-unresolved {
  margin-top: var(--aex-v2-space-3);
}
/* Below the toolbar (12 to the table, Paper 9b): a completed change's status line and any notice sit between it and the list, 12 above it. */
.mrp-status:not(:empty) {
  margin-bottom: var(--aex-v2-space-3);
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
#mrp-messages .aex-v2-notice {
  margin-bottom: var(--aex-v2-space-3);
}
/* Lists (AX's tables as its console renders them, snips-v2 0c3e7192 styles.css `.aex-v2-cp .aex-v2-table`): the first and last cells sit on
   the content edge, in line with the page title and the toolbar, and rows don't highlight on hover. An identifier never breaks mid-word; one
   standing in for the row's name in the lead column is set like a name (R8d, revised 2026-10-22). */
.mrp-page .aex-v2-table th:first-child,
.mrp-page .aex-v2-table td:first-child {
  padding-left: 0;
}
.mrp-page .aex-v2-table th:last-child,
.mrp-page .aex-v2-table td:last-child {
  padding-right: 0;
}
.mrp-page .aex-v2-table tbody tr:hover {
  background: transparent;
}
.aex-v2-table .mrp-id,
.aex-v2-table .mrp-row-name {
  overflow-wrap: normal;
  white-space: nowrap;
}
/* Exact-revision management provenance is a secondary sub-line, with room between its label and actions/status. */
.mrp-managed-by {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
  margin-top: 4px;
}
.mrp-managed-by:empty { display: none; }
/* One-line rows (round 19): in the Campaigns table the confirmed manager sits inline after the name, not as a sub-line. */
.mrp-managed-by[data-compact] {
  display: inline-flex;
  margin: 0 0 0 var(--aex-v2-space-2);
  vertical-align: middle;
}
.mrp-managed-by[data-compact]:empty { display: none; }
/* A table cell's info tip (info-tip.ts `cellTip`): the reason that used to be a second line, shown on hover or focus beside its tag. */
.mrp-cell-info {
  position: relative;
  align-items: center;
}
.mrp-info.mrp-cell-info:not([data-dismissed="true"]):is(:hover, :focus-within) .mrp-info-tip {
  /* Fixed in the viewport (round 19, R19-R1; it outranks the shared absolute tip rule by specificity), so the table's scrolling wrapper can't clip it; shell.ts places it beside its ⓘ. */
  position: fixed;
  top: auto;
  left: auto;
  width: max-content;
  max-width: min(320px, calc(100vw - 16px));
}
/* A row's own header (Earnings' states, the sponsored previews' rows) is a body cell set like the lead column's name, with the body rule
   under it and none under the last row, as the foundation sets td; the foundation's th is the column header's. */
.mrp-page .aex-v2-table tbody th {
  padding-top: var(--aex-v2-space-2);
  padding-bottom: var(--aex-v2-space-2);
  color: var(--aex-v2-text);
  font-size: var(--aex-v2-text-product-body);
  font-weight: 500;
  line-height: var(--aex-v2-lh-product-body);
  vertical-align: middle;
}
.mrp-page .aex-v2-table tbody tr:last-child th {
  border-bottom: 0;
}
/* The toolbar's filters (Paper 9b segmented tabs; AX .aex-v2-cp-tabs as rendered): 30px, 13/16 regular in the text colour, 2 apart, the
   chosen one on the fill. */
.mrp-tabs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px;
}
.mrp-tabs .mrp-tab {
  min-height: calc(var(--aex-v2-control) - 2px);
  padding: 0 var(--aex-v2-space-2);
  color: var(--aex-v2-text);
  background: transparent;
  border: 0;
  border-radius: var(--aex-v2-radius-control-sm);
  cursor: pointer;
  font: inherit;
  font-size: var(--aex-v2-text-product-body);
  line-height: 16px;
  white-space: nowrap;
}
/* A step that waits for a registration (Create app's Connect) reads as unavailable and doesn't react. */
.mrp-tabs .mrp-tab[aria-disabled="true"] {
  color: var(--aex-v2-text-disabled);
  cursor: default;
}
.mrp-tabs .mrp-tab[aria-pressed="true"],
.mrp-tabs .mrp-tab[aria-selected="true"] {
  background: var(--aex-v2-fill);
}
/* The search gives way first; its magnifier and the select's chevron are inline icons in the foundation's place and colour (toolbar.ts,
   selectbox.ts), and the foundation's data: background images are switched off so the page's CSP refuses nothing. */
.mrp-page .aex-v2-input-search,
.mrp-page .aex-v2-select {
  background-image: none;
}
.mrp-search {
  position: relative;
  display: flex;
  min-width: 0;
  flex: 0 1 240px;
}
.mrp-search .aex-v2-input-search {
  width: 100%;
}
.mrp-search .aex-v2-icon {
  position: absolute;
  top: 50%;
  left: 10px;
  width: 14px;
  height: 14px;
  color: var(--aex-v2-text-tertiary);
  pointer-events: none;
  transform: translateY(-50%);
}
.aex-v2-selectbox-trigger {
  position: relative;
}
/* Partner selects (the user's local UI polish, 2026-11-04): the chevron 12px from the right border, the value's ellipsis 8px before it.
   Partner-only: Staff keeps the foundation's inset. A content-width menu (a compact filter, browser.ts) keeps every option on one line. */
.aex-v2-selectbox .aex-v2-selectbox-trigger {
  padding-right: 32px;
}
.aex-v2-selectbox .mrp-select-chevron {
  right: 12px;
}
.aex-v2-select-menu.is-content-width .aex-v2-menu-item {
  white-space: nowrap;
}
/* A menu button (Stores' Connect store): the shared menu anchored 4 under it, right-aligned, its items a label over an 11/14 tertiary hint
   (Paper 9b's menu). */
.mrp-menu-button {
  position: relative;
  display: inline-flex;
  flex: none;
}
.mrp-menu-button > .aex-v2-btn .aex-v2-icon {
  width: 12px;
  height: 12px;
  margin-left: var(--aex-v2-space-1);
}
.mrp-connect-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + var(--aex-v2-space-1));
  right: 0;
  width: max-content;
  max-width: min(320px, calc(100vw - var(--aex-v2-space-6)));
}
.mrp-menu-item-hinted {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding-top: 6px;
  padding-bottom: 6px;
  text-align: left;
}
.mrp-menu-item-hint {
  color: var(--aex-v2-text-tertiary);
  font-size: var(--aex-v2-text-product-label);
  font-weight: 400;
  line-height: var(--aex-v2-lh-product-label);
  white-space: normal;
}
.mrp-select-chevron {
  position: absolute;
  top: 50%;
  right: 10px;
  width: 12px;
  height: 12px;
  color: var(--aex-v2-text-secondary);
  transform: translateY(-50%);
}
.mrp-badges {
  display: inline-flex;
  flex-wrap: wrap;
  gap: var(--aex-v2-space-1);
}
.mrp-reason {
  max-width: 48ch;
  margin: var(--aex-v2-space-1) 0 0;
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
/* The foundation's inline link (.aex-v2-link) inside its own `.aex-v2 a` reset, which otherwise wins on specificity and leaves the link
   plain text (Campaigns' budget-pause line links to Billing). */
.aex-v2 .aex-v2-link {
  color: var(--aex-v2-role-link);
  text-decoration: underline;
  text-decoration-color: var(--aex-v2-role-link-underline);
}
.aex-v2 .aex-v2-link:hover {
  text-decoration-color: currentColor;
}
.mrp-pager {
  display: flex;
  gap: var(--aex-v2-space-2);
  margin-top: var(--aex-v2-space-3);
}
.mrp-hint {
  margin: var(--aex-v2-space-1) 0 0;
  color: var(--aex-v2-text-tertiary);
  font-size: var(--aex-v2-text-product-label);
  line-height: var(--aex-v2-lh-product-label);
}

/* ---- Partner reads: Store connections, catalog and the inline preparation region (read-only) ---- */
.mrp-basis {
  margin: 0 0 var(--aex-v2-space-3);
}
.mrp-row-actions {
  width: auto;
}
.mrp-row-actions .aex-v2-btn + .aex-v2-btn {
  margin-left: var(--aex-v2-space-1);
}
.mrp-sub-id {
  display: block;
  margin-top: 2px;
  color: var(--aex-v2-text-tertiary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
.mrp-panel {
  margin-top: var(--aex-v2-space-8);
  padding: var(--aex-v2-space-5);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-card);
}
.mrp-panel h2 {
  margin: 0;
  font-size: var(--aex-v2-text-product-component-title);
  line-height: var(--aex-v2-lh-product-component-title);
}
.mrp-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--aex-v2-space-3);
  margin-bottom: var(--aex-v2-space-3);
}
.mrp-panel .aex-v2-notice,
.mrp-panel .aex-v2-empty {
  margin-top: var(--aex-v2-space-3);
}
.mrp-choices {
  display: flex;
  flex-wrap: wrap;
  gap: var(--aex-v2-space-2);
}
/* A choice naming a long connection wraps inside the viewport instead of widening the page (found at 390px by LY2, cut 4). */
.mrp-choices .aex-v2-btn {
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: left;
  white-space: normal;
}
.mrp-facts-inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--aex-v2-space-2) var(--aex-v2-space-6);
  margin: 0 0 var(--aex-v2-space-2);
}
.mrp-facts-inline dt {
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-label);
  font-weight: 500;
  line-height: var(--aex-v2-lh-product-label);
}
.mrp-facts-inline dd {
  margin: 0;
}

.mrp-kicker {
  margin: 0 0 var(--aex-v2-space-1);
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-label);
  line-height: var(--aex-v2-lh-product-label);
}
[data-alerts] .aex-v2-notice,
.mrp-note {
  margin-bottom: var(--aex-v2-space-4);
}
.aex-v2-cp-composer-section {
  margin-top: var(--aex-v2-space-5);
  padding-top: var(--aex-v2-space-5);
  border-top: 1px solid var(--aex-v2-border);
}
.aex-v2-cp-composer > .aex-v2-cp-composer-section:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}
.aex-v2-cp-composer-section > h3 {
  margin: 0 0 var(--aex-v2-space-3);
  font-size: var(--aex-v2-text-product-body);
  line-height: var(--aex-v2-lh-product-body);
}
.mrp-subhead {
  margin: var(--aex-v2-space-3) 0 var(--aex-v2-space-2);
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
.aex-v2-cp-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--aex-v2-space-3);
}
.aex-v2-cp-readout {
  padding: var(--aex-v2-space-2) var(--aex-v2-space-3);
  background: var(--aex-v2-grey-100);
  border-radius: var(--aex-v2-radius-control);
}
.aex-v2-cp-readout strong {
  display: block;
  font-size: var(--aex-v2-text-product-body);
  font-weight: 500;
  line-height: var(--aex-v2-lh-product-body);
}
.aex-v2-cp-readout small {
  display: block;
  margin-top: 2px;
  color: var(--aex-v2-text-tertiary);
  font-size: var(--aex-v2-text-product-label);
  line-height: var(--aex-v2-lh-product-label);
}
/* Edit's title with the campaign's state tag beside it (Live or Paused). */
.mrp-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--aex-v2-space-2);
}
/* A dialog footer's own action at its start (Edit's Pause or Resume), apart from Cancel and the submit at its end; on a narrow screen it
   takes its own line above them. */
/* A centred multi-view flow (steps, sections, tabs or pages in one dialog; round 18) keeps ONE frame for every view: a fixed height, bounded
   by the viewport like every dialog here, so switching views never moves or resizes it. The shared grid keeps the header and footer
   anchored and scrolls the body. Each flow picks its height (`--mrp-modal-height`); single-view dialogs aren't affected. */
:is(.mrp-composer, .aex-v2-cp-modal).mrp-modal-stable {
  height: min(var(--mrp-modal-height, 640px), calc(100dvh - 48px - var(--mrp-modal-toast-room, 0px)));
}
.mrp-creator-frame {
  --mrp-modal-height: 760px;
}
/* The rotation confirmation is sized to its shown-once key result; the agency invite to its link result at each width (round 18 review). */
.mrp-rotate-frame {
  --mrp-modal-height: 288px;
}
.mrp-invite-frame {
  --mrp-modal-height: 448px;
}
@media (max-width: 560px) {
  .mrp-invite-frame {
    --mrp-modal-height: 520px;
  }
}
/* The campaigns panel (Details, History pages, Preparation) is not the cp-modal grid: its body fills the same bounded frame and scrolls. Only
   this stable panel; other `.mrp-panel-dialog` consumers (host settings) keep their own sizing. */
.mrp-panel-dialog.mrp-modal-stable {
  height: min(var(--mrp-modal-height, 640px), calc(100dvh - 48px));
}
.mrp-panel-dialog.mrp-modal-stable .mrp-panel-dialog-body {
  box-sizing: border-box;
  height: 100%;
  max-height: 100%;
}
/* Create app is sized to its tallest view (Connect: facts and setup prompt), so Connect keeps its natural fit with no blank body. */
.mrp-create-app-frame {
  --mrp-modal-height: 416px;
}
.aex-v2-cp-modal-footer > .mrp-footer-start {
  margin-right: auto;
}
@media (max-width: 600px) {
  .aex-v2-cp-modal-footer > .mrp-footer-start {
    flex-basis: 100%;
  }
}
.aex-v2-cp-composer-section.aex-v2-cp-composer-next {
  padding: 14px var(--aex-v2-space-4);
  background: var(--aex-v2-grey-100);
  border-top: 0;
  border-radius: var(--aex-v2-radius-card);
}
.aex-v2-cp-composer-next > h3 {
  margin-bottom: 6px;
}
.aex-v2-cp-composer-next p {
  margin: 0;
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
.mrp-field {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-2);
}
.mrp-field-error:not(:empty) {
  margin: var(--aex-v2-space-1) 0 0;
  color: var(--aex-v2-danger);
  font-size: var(--aex-v2-text-product-label);
  line-height: var(--aex-v2-lh-product-label);
}
.mrp-field-error:empty {
  display: none;
}
.mrp-steps,
.mrp-products {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-1);
  margin: 0 0 var(--aex-v2-space-3);
  padding: 0;
  list-style: none;
}
.mrp-steps li {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  align-items: center;
  gap: var(--aex-v2-space-3);
}
.mrp-pool {
  color: var(--aex-v2-text-tertiary);
  font-size: var(--aex-v2-text-product-note);
}
.mrp-products {
  margin-top: var(--aex-v2-space-2);
}

/* ---- Guided Create (the composer's modal; only drawn behind the factory opt-in) ---- */
.mrp-create-store {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--aex-v2-space-3);
}
.mrp-create-store > .mrp-field {
  flex: 1 1 240px;
  min-width: 0;
}
/* Step two's read-only store: the small grey label "Store", the chosen store and provider below it. */
.mrp-chosen-store {
  margin: 0 0 var(--aex-v2-space-5);
}
.mrp-chosen-store dt {
  color: var(--aex-v2-text-tertiary);
  font-size: var(--aex-v2-text-product-label);
  line-height: var(--aex-v2-lh-product-label);
}
.mrp-chosen-store dd {
  margin: var(--aex-v2-space-1) 0 0;
  overflow-wrap: anywhere;
}
.mrp-create-steps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--aex-v2-space-2) var(--aex-v2-space-4);
  margin: 0;
  padding: 0;
  border: 0;
}
.mrp-create-steps legend {
  width: 100%;
  margin-top: 0;
  padding: 0;
}
.mrp-check {
  display: inline-flex;
  align-items: center;
  gap: var(--aex-v2-space-2);
}
.mrp-check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--aex-v2-role-focus);
}
.mrp-check input:focus-visible {
  outline: 2px solid var(--aex-v2-role-focus);
  outline-offset: 2px;
}
/* Each field after the first starts a little apart; its hint and error stay close beneath it. */
.mrp-create-stack > .mrp-field:not(:first-child),
.mrp-create-stack > .mrp-check,
.mrp-create-stack > .mrp-subhead {
  margin-top: var(--aex-v2-space-3);
}
/* Create's product choice: one product per row under its label, the error close beneath. */
.mrp-create-products {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--aex-v2-space-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}
.mrp-create-products legend {
  margin: 0 0 var(--aex-v2-space-2);
  padding: 0;
}
.mrp-create-products .mrp-check {
  overflow-wrap: anywhere;
}
.mrp-create-stack > .mrp-budget-context {
  margin-top: var(--aex-v2-space-4);
}

/* While the drawer is open the page behind it doesn't scroll (shell.ts sets the class; it is cleared on close and on widening). */
html.mrp-drawer-lock {
  overflow: hidden;
}
/* The narrow top bar, the drawer's close and the scrim exist only below 900px. */
.mrp-topbar,
.mrp-drawer-close,
.mrp-scrim {
  display: none;
}

/* ---- Below 900px (cut 4; Paper "Still open", the Operator's approved proposal; AX renderMobileTopbar and its drawer) ----
   A 56px top bar (--aex-v2-header) with Open navigation and the wordmark; the rail is a drawer over a scrim, hidden from focus and assistive
   technology until opened (shell.ts). The desktop collapse never applies here. Nothing scrolls sideways except a wide table inside its own
   wrapper. */
@media (max-width: 899px) {
  .mrp-frame {
    display: block;
  }
  .mrp-topbar {
    position: sticky;
    z-index: 50;
    top: 0;
    display: flex;
    height: var(--aex-v2-header);
    align-items: center;
    gap: var(--aex-v2-space-3);
    padding: 0 var(--aex-v2-space-3);
    background: var(--aex-v2-surface);
    border-bottom: 1px solid var(--aex-v2-border);
  }
  .mrp-rail {
    position: fixed;
    z-index: 80;
    top: 0;
    left: 0;
    width: min(var(--aex-v2-sidebar), calc(100% - var(--aex-v2-space-12)));
    height: 100dvh;
    overflow-y: auto;
    visibility: hidden;
    background: var(--aex-v2-surface);
    box-shadow: var(--aex-v2-shadow-high);
    transform: translateX(-100%);
    transition: transform var(--aex-v2-duration-medium) var(--aex-v2-ease-emphasized), visibility 0s linear var(--aex-v2-duration-medium);
  }
  .mrp-frame[data-drawer="open"] .mrp-rail {
    visibility: visible;
    transform: none;
    transition: transform var(--aex-v2-duration-medium) var(--aex-v2-ease-emphasized);
  }
  .mrp-frame[data-drawer="open"] .mrp-scrim:not([hidden]) {
    position: fixed;
    z-index: 70;
    inset: 0;
    display: block;
    background: var(--aex-v2-scrim);
  }
  .mrp-rail-toggle {
    display: none;
  }
  .mrp-drawer-open,
  .mrp-drawer-close {
    display: grid;
  }
  .mrp-content {
    padding: var(--aex-v2-space-3) var(--aex-v2-space-3) var(--aex-v2-space-12);
  }
  .mrp-block-head {
    flex-wrap: wrap;
  }
  .mrp-block-controls {
    justify-content: flex-start;
  }
  /* The toolbar takes two rows: the filters, then the search (taking the room) beside the view's action. */
  .mrp-page .aex-v2-toolbar {
    flex-wrap: wrap;
  }
  .mrp-page .aex-v2-toolbar-start:not(:empty),
  .mrp-page .aex-v2-toolbar-end {
    flex: 1 1 100%;
  }
  .mrp-page .aex-v2-toolbar-end {
    margin-left: 0;
  }
  .mrp-search {
    flex: 1 1 auto;
  }
  .mrp-setup {
    grid-template-columns: minmax(0, 1fr);
  }
  .aex-v2-cp-form-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  :is(.mrp-composer, .aex-v2-cp-modal) .aex-v2-cp-modal-header,
  :is(.mrp-composer, .aex-v2-cp-modal) .aex-v2-cp-modal-footer {
    padding-right: var(--aex-v2-space-4);
    padding-left: var(--aex-v2-space-4);
  }
  :is(.mrp-composer, .aex-v2-cp-modal) .aex-v2-cp-modal-body {
    padding-right: var(--aex-v2-space-4);
    padding-left: var(--aex-v2-space-4);
  }
  .mrp-centered {
    padding: var(--aex-v2-space-8) var(--aex-v2-space-4);
  }
}

/* ---- The campaigns dialog (the Operator, 2026-10-22: AX's app modal): details, history or preparation, one at a time; the panel's head is
   the dialog's header (title, then its quiet actions and the close glyph) and the body scrolls under it ---- */
.mrp-panel-dialog {
  width: min(960px, calc(100vw - 24px));
  max-height: min(860px, calc(100vh - 48px));
  margin: auto;
  padding: 0;
  overflow: hidden;
  color: var(--aex-v2-text);
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-dialog);
  box-shadow: var(--aex-v2-shadow-high);
}
.mrp-panel-dialog::backdrop {
  background: var(--aex-v2-scrim);
}
.mrp-panel-dialog-body {
  max-height: inherit;
  overflow: auto;
  padding: var(--aex-v2-space-5) var(--aex-v2-space-6) var(--aex-v2-space-6);
}
.mrp-panel-dialog .mrp-details,
.mrp-panel-dialog .mrp-history,
.mrp-panel-dialog .mrp-panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
}
.mrp-panel-dialog .mrp-history-head,
.mrp-panel-dialog .mrp-panel-head {
  margin-bottom: var(--aex-v2-space-5);
}
.mrp-panel-dialog .mrp-history-head h2,
.mrp-panel-dialog .mrp-panel-head h2 {
  font-size: var(--aex-v2-text-product-title);
  line-height: var(--aex-v2-lh-product-title);
}
/* An app's details (Agent App): its facts above the host settings, whose own heading repeats the dialog's title, so it is kept for screen
   readers only. */
.mrp-panel-dialog .mrp-app-facts {
  margin-bottom: var(--aex-v2-space-6);
  padding-bottom: var(--aex-v2-space-5);
  border-bottom: 1px solid var(--aex-v2-border);
}
/* The host settings inside an app's dialog (host-settings.ts, unstyled until now): the change form as one row of labelled controls in the
   foundation's input look, and section headings spaced like the dialog's. */
.mrp-host h3 {
  margin: var(--aex-v2-space-6) 0 var(--aex-v2-space-3);
  font-size: var(--aex-v2-text-product-body);
  font-weight: 500;
  line-height: var(--aex-v2-lh-product-body);
}
.mrp-host-change {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--aex-v2-space-3);
  margin: var(--aex-v2-space-4) 0 var(--aex-v2-space-2);
}
.mrp-host-change label {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-1);
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
.mrp-host-change select,
.mrp-host-change input {
  min-height: var(--aex-v2-control);
  padding: 0 var(--aex-v2-space-3);
  color: var(--aex-v2-text);
  background: var(--aex-v2-surface);
  border: 1px solid var(--aex-v2-border-strong);
  border-radius: var(--aex-v2-radius-control);
  font: inherit;
  font-size: var(--aex-v2-text-product-body);
}
.mrp-host-app-blocks {
  margin: 0;
  padding-left: var(--aex-v2-space-5);
}
/* A publisher app's status card on Agent App (publisher-apps.ts): padded inside its border, spaced from the Create app toolbar above and the
   page's own notice below; its facts, note and actions in one column. Nothing else uses `.mrp-publisher-app`. */
.mrp-publisher-app {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-3);
  margin: var(--aex-v2-space-4) 0 var(--aex-v2-space-6);
  padding: 18px var(--aex-v2-space-5);
}
.mrp-publisher-app h2,
.mrp-publisher-app p {
  margin: 0;
}
.mrp-panel-dialog .mrp-host > h3:first-child {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* The front-end mocks' dialogs (Create app, offer units; mocks.ts), in the composer's modal: stacked fields, a row of side-by-side fields,
   the deal type as three choice cards, the steps as tabs. */
.mrp-mock-dialog .aex-v2-cp-modal-header .mrp-icon-button {
  margin-left: auto;
}
/* A mock's "Preview, not connected" marker beside its page or dialog title (pages.ts). */
.mrp-page-header .mrp-preview-marker {
  margin-left: var(--aex-v2-space-3);
}
.mrp-mock-dialog .aex-v2-cp-modal-header {
  justify-content: flex-start;
}
.mrp-dialog-tabs {
  margin-bottom: var(--aex-v2-space-5);
}
.mrp-mock-form {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-4);
}
.mrp-mock-form fieldset {
  margin: 0;
  padding: 0;
  border: 0;
}
.mrp-mock-form legend {
  margin-bottom: var(--aex-v2-space-2);
  padding: 0;
}
.mrp-field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--aex-v2-space-3);
}
/* A row's controls line up when one label wraps to two lines: each field's control sits at its stretched field's bottom, the label's spare
   height above it. */
.mrp-field-row > .mrp-field > :last-child {
  margin-top: auto;
}
/* Create app's Connect step (reached only after a registration): a two-row table, its labels in a fixed first column at the Register tab's
   text inset, the values left-aligned in one shared column (wrapping when long) and each value's copy button after it; Setup prompt is its
   own section below, with room above it. Each step is its own height. */
.mrp-app-connect-facts {
  width: calc(100% - var(--aex-v2-space-2));
  margin-left: var(--aex-v2-space-2);
  border-collapse: collapse;
}
.mrp-app-connect-facts th,
.mrp-app-connect-facts td {
  padding: var(--aex-v2-space-1) 0;
  vertical-align: middle;
  text-align: left;
}
.mrp-app-connect-facts th {
  width: 112px;
  color: var(--aex-v2-text-secondary);
  font-weight: 400;
}
.mrp-app-connect-facts td:last-child {
  width: 1%;
  padding-left: var(--aex-v2-space-2);
  white-space: nowrap;
  text-align: right;
}
.mrp-app-connect-facts code {
  font-family: var(--aex-v2-font-mono);
  overflow-wrap: anywhere;
}
.mrp-app-connect-prompt {
  max-height: 240px;
  margin: 0;
  overflow: auto;
  padding: var(--aex-v2-space-3);
  background: var(--aex-v2-surface-recessed);
  border-radius: var(--aex-v2-radius-control);
  font-size: var(--aex-v2-text-product-label);
}
.mrp-app-connect-setup {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-2);
  margin-top: var(--aex-v2-space-6);
  padding: var(--aex-v2-space-4) 0 0 var(--aex-v2-space-2);
  border-top: 1px solid var(--aex-v2-border);
}
.mrp-app-connect-setup h3 {
  margin: 0;
  font-size: var(--aex-v2-text-product-body);
  font-weight: 500;
}
.mrp-app-connect-setup .mrp-hint {
  margin: 0;
}
.mrp-app-connect-setup-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--aex-v2-space-2);
}
/* A description box: the first line clear of the top edge, three comfortable lines, never resized by hand. */
.aex-v2-input.aex-v2-textarea {
  min-height: 92px;
  padding-top: 10px;
  padding-bottom: 10px;
  line-height: 20px;
  resize: none;
}
.mrp-choices-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--aex-v2-space-2);
}
.mrp-choice-card {
  display: flex;
  align-items: flex-start;
  gap: var(--aex-v2-space-2);
  padding: var(--aex-v2-space-3);
  border: 1px solid var(--aex-v2-border);
  border-radius: var(--aex-v2-radius-control);
  cursor: pointer;
}
.mrp-choice-card:has(input:checked) {
  border-color: var(--aex-v2-text);
}
.mrp-choice-card span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.mrp-choice-card small {
  color: var(--aex-v2-text-secondary);
  font-size: var(--aex-v2-text-product-note);
  line-height: var(--aex-v2-lh-product-note);
}
@media (max-width: 899px) {
  .mrp-choices-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}
/* Stores' connections (stores.ts, T15): the table's notes and pager slots, kept across background answers, take no room while empty. */
[data-conn-notes]:empty,
[data-conn-pager]:empty {
  display: none;
}
/* A close glyph in the control's square (AX's dialog close). */
.mrp-icon-button {
  width: var(--aex-v2-control);
  justify-content: center;
  padding: 0;
}

/* ---- Campaign history (read only; an inline region below the list, foundation table, notice and empty state) ---- */
.aex-v2-table-actions .aex-v2-btn + .aex-v2-btn {
  margin-left: var(--aex-v2-space-1);
}
.mrp-history {
  margin-top: var(--aex-v2-space-6);
}
.mrp-history-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--aex-v2-space-2);
  margin-bottom: var(--aex-v2-space-3);
}
.mrp-history-head h2 {
  margin: 0;
  font-size: var(--aex-v2-text-product-body);
  line-height: var(--aex-v2-lh-product-body);
}
.mrp-history-actions {
  display: flex;
  gap: var(--aex-v2-space-2);
}
.mrp-history-reason {
  display: block;
  max-width: 48ch;
  color: var(--aex-v2-text-secondary);
}

/* ---- Campaign details (read only; the decided detail template: a facts list and grey-100 read-only snapshot summaries) ---- */
.mrp-details {
  margin-top: var(--aex-v2-space-6);
}
.mrp-facts {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: var(--aex-v2-space-2) var(--aex-v2-space-4);
  margin: 0;
}
.mrp-facts dt {
  color: var(--aex-v2-text-secondary);
}
.mrp-facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}
.mrp-details-state {
  margin-bottom: var(--aex-v2-space-5);
}
.mrp-snapshots {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--aex-v2-space-3);
}
.mrp-snapshot {
  padding: var(--aex-v2-space-4);
  border-radius: var(--aex-v2-radius-card);
  background: var(--aex-v2-surface-recessed);
}
.mrp-snapshot h3 {
  margin: 0 0 var(--aex-v2-space-3);
  font-size: var(--aex-v2-text-product-body);
  font-weight: 500;
  line-height: var(--aex-v2-lh-product-body);
}
.mrp-snapshot-absent p {
  margin: 0;
  color: var(--aex-v2-text-secondary);
}
@media (max-width: 899px) {
  .mrp-snapshots {
    grid-template-columns: minmax(0, 1fr);
  }
  .mrp-facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
  .mrp-facts dd + dt {
    margin-top: var(--aex-v2-space-2);
  }
}

/* ---- Users and Organization settings (docs/users-organization-scope.md; AX renderUsersTable row menu, renderOrganizationNameSection) ---- */
.mrp-row-actions {
  position: relative;
  width: 1%;
  text-align: right;
}
.mrp-menu {
  position: absolute;
  z-index: 10;
  top: 100%;
  right: 0;
  max-width: 280px;
  text-align: left;
  white-space: normal;
}
/* The campaigns row menu (cut 4; Paper 9b: anchored 4px under its ⋯, right-aligned, flipping above near the edge, fixed so the table
   wrapper never clips it; campaigns.ts sets its place). */
.mrp-row-menu {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  text-align: left;
  white-space: normal;
}
.mrp-menu-hint {
  margin: 0 var(--aex-v2-space-2) var(--aex-v2-space-1);
  color: var(--aex-v2-text-tertiary);
  font-size: var(--aex-v2-text-product-label);
  line-height: var(--aex-v2-lh-product-label);
}
/* Users' row menu is fixed beside its ⋯ (team.ts places it), so the table's sideways scroll never clips it or scrolls for it. */
#mrp-team .mrp-menu {
  position: fixed;
  z-index: 30;
  top: 0;
  right: auto;
  left: 0;
}
#mrp-team-messages .aex-v2-notice,
#mrp-team .aex-v2-table-wrap {
  margin-top: var(--aex-v2-space-3);
}
.mrp-team-dialog .aex-v2-cp-modal-body {
  display: flex;
  flex-direction: column;
  gap: var(--aex-v2-space-3);
}
.mrp-org-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--aex-v2-space-3);
}
.mrp-org-form .mrp-field {
  flex: 1 1 240px;
  min-width: 0;
}
.mrp-org-form .mrp-field-error,
.mrp-org-form .mrp-hint {
  flex-basis: 100%;
  margin: 0;
}

/* ---- Agency console gates (docs/agency-scope.md): the rail's disabled client switcher ---- */
.mrp-agency-switcher {
  margin: var(--aex-v2-space-3) 0;
}
.mrp-agency-switcher .mrp-hint {
  margin: var(--aex-v2-space-1) 0 0;
}
/* Reduced motion: the drawer opens and closes at once (the shared rule shortens durations but not the closed drawer's visibility delay). */
@media (prefers-reduced-motion: reduce) {
  .mrp-rail,
  .mrp-frame[data-drawer="open"] .mrp-rail {
    transition: none;
  }
}

/* ---- Catalog set preview (server-rendered, catalog-sets.ts): native radios outside any form choose which example status shows; no script ---- */
.mrp-catalog-choices {
  border: 0;
  margin: var(--aex-v2-space-3) 0;
  min-width: 0;
  padding: 0;
}
.mrp-catalog-panel {
  display: none;
  margin-top: var(--aex-v2-space-3);
}
.mrp-catalog-preview:has(input[value="all"]:checked) .mrp-catalog-panel[data-kind="all"],
.mrp-catalog-preview:has(input[value="collection"]:checked) .mrp-catalog-panel[data-kind="collection"],
.mrp-catalog-preview:has(input[value="category"]:checked) .mrp-catalog-panel[data-kind="category"],
.mrp-catalog-preview:has(input[value="products"]:checked) .mrp-catalog-panel[data-kind="products"] {
  display: block;
}

/* Native agency account menu only; the renderer exists behind MRP_AGENCY_CONSOLE. */
.mrp-agency-native .mrp-menu-group + .mrp-menu-group { margin-top: 0; border-top: 0; }
.mrp-agency-native .mrp-account-menu > .mrp-menu-group:first-child { margin-top: 0; border-top: 0; }

/* Once-shown key fields (#109 follow-up): full width, the copy icon inside the field's right edge. */
.mrp-key-fields { display: flex; flex-direction: column; gap: var(--aex-v2-space-4); margin-bottom: var(--aex-v2-space-4); }
.mrp-copy-field { position: relative; display: block; }
.mrp-copy-field > .aex-v2-input { width: 100%; padding-right: 44px; }
.mrp-copy-button { position: absolute; top: 50%; right: 4px; transform: translateY(-50%); display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; min-height: 0; padding: 0; }
/* The agency's Client relationships (Home and Stores): a section like any other, with the same gap above it as `.mrp-block`. */
.mrp-agency-native section[aria-label="Client relationships"] {
  margin-top: var(--aex-v2-space-6);
}
