/*
 * Partner portal — visual system.
 *
 * Static by constraint (decision 86): no framework, no build step, no webfont.
 * The palette is the app's indigo-violet and warm pastels (docs/07), translated
 * for a web dashboard: a deep gradient header, a pale lavender page, white
 * cards, pastel icon chips and tabular numbers.
 *
 * Everything here is presentation. The money rules live in the Worker, and no
 * colour or layout change carries a balance.
 */

:root {
  /* Brand */
  --brand-950: #1d1952;
  --brand-900: #241f66;
  --brand-800: #2a2668;
  --brand-700: #322b7a;
  --brand-600: #4b3fc4;
  --brand-500: #5c46d6;
  --brand-300: #a99cf5;

  /* Surfaces */
  --page: #f3f2f9;
  --page-2: #eeecf8;
  --surface: #ffffff;
  --surface-soft: #faf9fe;
  --surface-tint: #f4f2fd;

  /* Ink */
  --ink: #191632;
  --ink-soft: #403c5c;
  --muted: #615d79;
  --muted-2: #6b6783;
  --on-dark: #ffffff;
  --on-dark-soft: rgba(255, 255, 255, 0.88);
  --on-dark-faint: rgba(255, 255, 255, 0.8);

  /* Lines and status */
  --line: #e6e3f1;
  --line-strong: #d7d2ea;
  --green: #0f7a4d;
  --green-soft: #e6f6ee;
  --amber: #8a5500;
  --amber-soft: #fff4dc;
  --red: #b3261e;
  --red-soft: #fdecea;

  /* Warm pastel chips: fill + ink, matching the app's rotation */
  --peach: #ffe9d9;
  --peach-ink: #8a4318;
  --sand: #fff3d1;
  --sand-ink: #7a5710;
  --sage: #e2f5e8;
  --sage-ink: #1c6b45;
  --blush: #ffe4ec;
  --blush-ink: #8c2f4d;
  --lilac: #ece6ff;
  --lilac-ink: #4b3fc4;
  --aqua: #dff3f7;
  --aqua-ink: #175f70;

  --radius-xl: 24px;
  --radius-card: 16px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --radius-sm: 12px;

  --shadow-card: 0 1px 2px rgba(29, 25, 82, 0.04), 0 12px 32px rgba(29, 25, 82, 0.06);
  --shadow-float: 0 18px 48px rgba(29, 25, 82, 0.12);
  --ring: 0 0 0 3px rgba(75, 63, 196, 0.28);

  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1100px 520px at 82% -12%, rgba(124, 96, 230, 0.11), transparent 62%),
    radial-gradient(900px 460px at 4% 4%, rgba(255, 196, 150, 0.10), transparent 58%),
    var(--page);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand-600); text-underline-offset: 2px; }
a:hover { color: var(--brand-700); }

img, svg { display: block; }

.icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.88em;
  background: var(--surface-tint);
  border-radius: 6px;
  padding: 1px 6px;
}

:focus-visible {
  outline: 3px solid rgba(75, 63, 196, 0.55);
  outline-offset: 2px;
}

/* Visible to a screen reader, not on the page. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -64px;
  z-index: 100;
  background: var(--brand-900);
  color: #fff;
  padding: 10px 16px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus { top: 12px; color: #fff; }

/* ---------------------------------------------------------------- header -- */

.site-header {
  position: relative;
  z-index: 20;
  background:
    radial-gradient(700px 220px at 90% -40%, rgba(255, 255, 255, 0.16), transparent 70%),
    linear-gradient(120deg, var(--brand-950), var(--brand-800) 48%, var(--brand-500));
  color: var(--on-dark);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  box-shadow: 0 10px 30px rgba(29, 25, 82, 0.18);
}

.site-header-inner {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.brand:hover { color: #fff; }

.brand-mark {
  width: 46px;
  height: 46px;
  flex: none;
  display: block;
  overflow: hidden;
  border-radius: 13px;
  background: #0b1b4d;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
}

.brand-mark img { width: 100%; height: 100%; object-fit: cover; display: block; }

.brand-text { display: flex; flex-direction: column; line-height: 1.1; min-width: 0; }
.brand-text strong { font-size: 1.03rem; letter-spacing: -0.01em; }
.brand-text small {
  margin-top: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
}

.header-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.header-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: var(--on-dark-soft);
  font-size: 0.76rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.header-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #4ade9f;
  box-shadow: 0 0 0 3px rgba(74, 222, 159, 0.18);
}

.header-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.84rem;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.header-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.42);
}

/* ------------------------------------------------------------------ page -- */

.page {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 30px 24px 56px;
  flex: 1;
}

.card {
  min-width: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: 24px;
}

.card + .card { margin-top: 20px; }

.eyebrow {
  margin: 0 0 7px;
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand-600);
}

.eyebrow.light { color: var(--on-dark-faint); }

h1, h2, h3 { letter-spacing: -0.02em; }

h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 3.2vw, 2.2rem); line-height: 1.12; }
h2 { margin: 0 0 6px; font-size: 1.12rem; line-height: 1.25; }
h3 { margin: 0 0 8px; font-size: 0.98rem; line-height: 1.3; }

.lede { margin: 0 0 18px; color: var(--muted); font-size: 1rem; }
.fine { margin: 10px 0 0; color: var(--muted); font-size: 0.82rem; }

.card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 20px;
  margin-bottom: 18px;
}

.card-head > div { min-width: 0; }
.card-title { margin: 0; font-size: 1.12rem; }
.card-sub { margin: 5px 0 0; color: var(--muted); font-size: 0.86rem; max-width: 66ch; }

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  margin: 22px 0 10px;
}

.section-head h3 { margin: 0; }

/* ------------------------------------------------------------------ gate -- */

.gate {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  padding: 0;
  overflow: hidden;
  max-width: 1040px;
  margin: 18px auto 0;
}

.gate-pitch {
  position: relative;
  overflow: hidden;
  padding: 44px;
  color: #fff;
  background:
    radial-gradient(520px 280px at 100% 0%, rgba(255, 255, 255, 0.15), transparent 65%),
    radial-gradient(420px 260px at 0% 100%, rgba(255, 178, 120, 0.14), transparent 70%),
    linear-gradient(145deg, var(--brand-950), var(--brand-700) 54%, var(--brand-500));
}

.gate-pitch::after {
  content: "";
  position: absolute;
  right: -90px;
  bottom: -110px;
  width: 300px;
  height: 300px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 34px rgba(255, 255, 255, 0.04),
    0 0 0 70px rgba(255, 255, 255, 0.025);
  pointer-events: none;
}

.gate-pitch h1 { font-size: clamp(1.9rem, 3.6vw, 2.55rem); margin-bottom: 14px; }
.gate-pitch h1:focus { outline: none; }
.gate-pitch h1:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.65); outline-offset: 4px; border-radius: 6px; }
.gate-pitch .lede { color: var(--on-dark-soft); max-width: 46ch; margin-bottom: 0; }
.gate-pitch .fine { color: var(--on-dark-soft); }

.benefit-list {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 26px 0 0;
  padding: 0;
  display: grid;
  gap: 15px;
}

.benefit-list li { display: flex; align-items: flex-start; gap: 12px; }

.benefit-icon {
  width: 36px;
  height: 36px;
  flex: none;
  display: grid;
  place-items: center;
  line-height: 0;
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.benefit-icon svg { display: block; width: 19px; height: 19px; }
.benefit-list strong { display: block; font-size: 0.93rem; }
.benefit-list li > div > span { display: block; margin-top: 2px; color: var(--on-dark-faint); font-size: 0.82rem; }

.gate-stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 28px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.gate-stats dt {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
}

.gate-stats dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }

.pitch-note {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  color: var(--on-dark-soft);
  font-size: 0.82rem;
}

.gate-auth {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 44px;
  background: var(--surface);
}

.gate-auth h2 { font-size: 1.35rem; margin-bottom: 8px; }
.gate-auth p { margin-top: 0; }
.gate-auth .fine { margin-top: 14px; }

.gsi {
  display: flex;
  justify-content: flex-start;
  min-height: 48px;
  margin: 6px 0 4px;
}

.gate-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--muted-2);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.gate-divider::before,
.gate-divider::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.gate-apply {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-soft);
  color: var(--brand-700);
  font-weight: 700;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.gate-apply:hover { background: var(--surface-tint); border-color: var(--brand-300); }
.gate-apply svg { width: 16px; height: 16px; }

.trust-list {
  list-style: none;
  display: grid;
  gap: 9px;
  margin: 22px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
}

.trust-list li {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
  font-size: 0.8rem;
}

.trust-list svg { width: 15px; height: 15px; flex: none; color: var(--brand-600); }

/* The gate's app card: what the partner is asking their audience to install. */
.gate-app {
  position: relative;
  z-index: 1;
  margin: 22px 0 0;
  padding: 15px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.08);
}

.gate-app-head { display: flex; align-items: center; gap: 11px; }
.gate-app-head img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; }
.gate-app-head strong { display: block; font-size: 0.88rem; }
.gate-app-head span { display: block; margin-top: 1px; color: var(--on-dark-faint); font-size: 0.76rem; }
.gate-app p { margin: 10px 0 0; color: var(--on-dark-soft); font-size: 0.8rem; }
.gate-app a { display: inline-block; margin-top: 9px; color: #fff; font-size: 0.8rem; font-weight: 700; }
.gate-app a:hover { color: #fff; }
.gate-app-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0 0;
  padding: 0;
  list-style: none;
}
.gate-app-facts li {
  padding: 3px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: var(--on-dark-soft);
  font-size: 0.75rem;
  font-weight: 700;
}

.gate-guide-link { position: relative; z-index: 1; margin: 14px 0 0; font-size: 0.82rem; }
.gate-guide-link a { color: #fff; font-weight: 700; }
.gate-guide-link a:hover { color: #fff; }

/* ------------------------------------------------------------- dashboard -- */

.dash-hero {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 26px;
  padding: 30px 32px;
  border-radius: var(--radius-xl);
  color: #fff;
  background:
    radial-gradient(640px 280px at 92% -30%, rgba(255, 255, 255, 0.18), transparent 66%),
    radial-gradient(420px 260px at 0% 120%, rgba(255, 190, 140, 0.16), transparent 70%),
    linear-gradient(120deg, var(--brand-950), var(--brand-700) 52%, var(--brand-500));
  box-shadow: var(--shadow-float);
}

.dash-hero::after {
  content: "";
  position: absolute;
  right: 6%;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 28px rgba(255, 255, 255, 0.035),
    0 0 0 58px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.dash-hero-main { position: relative; z-index: 1; min-width: 0; }
.dash-identity { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 6px 0 8px; }

.who-name {
  margin: 0;
  font-size: clamp(1.55rem, 3.4vw, 2.15rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.who-name:focus { outline: none; }
.who-name:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.6); outline-offset: 4px; border-radius: 4px; }

.dash-sub { margin: 0; max-width: 58ch; color: var(--on-dark-soft); font-size: 0.93rem; }

.dash-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-tint);
  color: var(--brand-600);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip-on-dark {
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 13px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.status-pill::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade9f;
  box-shadow: 0 0 0 4px rgba(74, 222, 159, 0.18);
}

body.paused .status-pill::before {
  background: #ffc266;
  box-shadow: 0 0 0 4px rgba(255, 194, 102, 0.18);
}

.when-paused { display: none; }
.when-loading { display: none; }
body:not(.ready) .when-active,
body:not(.ready) .when-paused { display: none; }
body:not(.ready) .when-loading { display: inline; }
body:not(.ready) .status-pill::before {
  background: #ffc266;
  box-shadow: 0 0 0 4px rgba(255, 194, 102, 0.18);
}
body.paused .when-active { display: none; }
body.paused .when-paused { display: inline; }

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font: inherit;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-ghost:hover { background: rgba(255, 255, 255, 0.16); border-color: rgba(255, 255, 255, 0.45); }
.btn-ghost svg { width: 15px; height: 15px; }

/* KPI tiles */

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0;
}

.dash-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  margin: 14px 0 0;
  padding: 5px;
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 999px;
}

.dash-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 7px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.dash-nav a:hover { background: var(--surface-tint); color: var(--brand-700); }

#share, #ledger, #payouts, #payout-history, #details, #data { scroll-margin-top: 24px; }

.kpi {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  padding: 15px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.kpi-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
}

.kpi-icon svg { width: 19px; height: 19px; }

.tint-peach { background: var(--peach); color: var(--peach-ink); }
.tint-sand { background: var(--sand); color: var(--sand-ink); }
.tint-sage { background: var(--sage); color: var(--sage-ink); }
.tint-blush { background: var(--blush); color: var(--blush-ink); }
.tint-lilac { background: var(--lilac); color: var(--lilac-ink); }
.tint-aqua { background: var(--aqua); color: var(--aqua-ink); }

.kpi-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.kpi-value {
  margin: 2px 0 0;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* Referral link */

.share {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.86fr);
  gap: 16px 30px;
  align-items: center;
  background:
    radial-gradient(420px 200px at 100% 0%, rgba(124, 96, 230, 0.07), transparent 70%),
    var(--surface);
  border-color: #ded8f3;
  margin-bottom: 18px;
}

.share-copy { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.share-copy h2 { margin-bottom: 3px; }
.share-copy .fine { margin: 0; }

/* The link's advantages over a bare code, stated once directly under the link
   so a partner knows why the link is the thing to share. Full width: this is
   the teaching block, not a column of small print. */
.share-benefits {
  grid-column: 1 / -1;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.share-benefits-title {
  margin: 0 0 7px;
  color: var(--ink);
  font-size: 0.84rem;
  font-weight: 800;
}

.share-benefits ul {
  display: grid;
  gap: 5px;
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.82rem;
}

.share-benefits strong { color: var(--ink); }
.share-benefits li::marker { color: var(--brand-600); }

.share-icon {
  width: 40px;
  height: 40px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--lilac);
  color: var(--lilac-ink);
}

.share-icon svg { width: 19px; height: 19px; }

.share-row {
  display: flex;
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.share-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 8px 10px;
  font: inherit;
  font-size: 0.86rem;
  color: var(--ink);
}

.share-row input:focus-visible { outline-offset: -2px; border-radius: 8px; }
.share-row button { padding: 0 16px; min-height: 42px; border-radius: 9px; font-size: 0.84rem; }
.share #copy-status { grid-column: 1 / -1; margin: -6px 0 0; }

/* Dashboard grids */

.dash-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dash-grid > *, .details-columns > *, .share > * { min-width: 0; }

.card-wide { grid-column: 1 / -1; }

.figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}

.figures > div {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.figures dt { color: var(--muted); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.figures dd { margin: 3px 0 0; font-size: 1.3rem; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Tables */

.scroll {
  overflow-x: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.scroll:focus-visible { outline: 3px solid rgba(75, 63, 196, 0.4); outline-offset: 2px; }

.scroll-hint { display: none; margin: 8px 0 0; color: var(--muted); font-size: 0.76rem; }

@media (max-width: 700px) {
  .scroll-hint { display: block; }
}

table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 560px; }

th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: left;
  padding: 10px 14px;
  background: var(--surface-soft);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
}

td {
  padding: 12px 14px;
  border-bottom: 1px solid #f0eef8;
  vertical-align: top;
}

tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover { background: #fbfaff; }

.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; font-weight: 600; }

td.status-pending { color: var(--amber); font-weight: 700; }
td.status-approved, td.status-paid, td.status-resolved { color: var(--green); font-weight: 700; }
td.status-rejected, td.status-reversed { color: var(--red); font-weight: 700; }
td.status-requested { color: var(--brand-600); font-weight: 700; }
td.status-open { color: var(--brand-600); font-weight: 700; }

.sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  overflow-wrap: anywhere;
}

.empty { color: var(--muted); text-align: center; padding: 22px 12px; }

/* Forms */

.payout { margin: 0; }

label {
  display: block;
  margin: 0 0 7px;
  color: var(--ink-soft);
  font-size: 0.8rem;
  font-weight: 700;
}

input[type="number"], input[type="text"], input[type="search"], input[type="url"],
input[type="tel"], input[type="email"], input[type="password"], select, textarea {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.94rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

input:hover, select:hover, textarea:hover { border-color: #c4bee0; }

input:focus, select:focus, textarea:focus {
  border-color: var(--brand-500);
  box-shadow: var(--ring);
  outline: none;
}

textarea { resize: vertical; min-height: 92px; }

select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 34px; }

.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row > input, .row > select { flex: 1 1 190px; }

/* The earnings window: a filter and a reference search over the fetched
   latest-200 rows (decision 98). It narrows the table, never a balance. */
.ledger-tools {
  display: grid;
  grid-template-columns: minmax(0, 190px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 0 0 14px;
}
.ledger-tools label { margin-bottom: 6px; }
.ledger-tools button { min-height: 44px; }
@media (max-width: 700px) {
  .ledger-tools { grid-template-columns: 1fr; }
  .ledger-tools button { width: 100%; }
}

button {
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-600);
  color: #fff;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  min-height: 46px;
  padding: 0 18px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease, box-shadow 0.15s ease;
}

button:hover { background: var(--brand-700); }
button:active { transform: translateY(1px); }
button:disabled { opacity: 0.48; cursor: not-allowed; transform: none; }

button.secondary {
  background: var(--surface-soft);
  color: var(--brand-700);
  border: 1px solid var(--line-strong);
  font-weight: 700;
}

button.secondary:hover { background: var(--surface-tint); border-color: var(--brand-300); }

button.danger { background: var(--red); }
button.danger:hover { background: #8f1d17; }

button.link {
  background: none;
  color: var(--brand-600);
  padding: 6px;
  min-height: 0;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.link:hover { color: var(--brand-700); }

.section-head button { min-height: 38px; padding: 0 14px; font-size: 0.8rem; }

.notice {
  margin: 0 0 16px;
  padding: 12px 15px;
  border: 1px solid #f0d9a8;
  border-left: 4px solid var(--amber);
  border-radius: var(--radius-sm);
  background: var(--amber-soft);
  color: #5f3d00;
  font-size: 0.88rem;
}

/* The one-time approval card. It sits above the tabs, so the partner sees it
   before the balance, and it uses the green "done" language rather than the
   amber warning used by the offer-readiness notice. */
.approval-notice {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  border-color: #bfe6cf;
  background: linear-gradient(180deg, var(--green-soft), var(--surface) 72%);
}

.approval-notice-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--green);
  color: #fff;
}

.approval-notice-icon svg { width: 24px; height: 24px; }
.approval-notice-body { min-width: 0; }
.approval-notice .card-title { margin-bottom: 0; }
.approval-notice-bonus { margin: 10px 0 0; color: var(--green); font-weight: 700; }
.approval-notice-once { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

@media (max-width: 560px) {
  .approval-notice { flex-direction: column; }
}

.error { margin: 12px 0 0; color: var(--red); font-size: 0.88rem; font-weight: 600; }
.ok { margin: 12px 0 0; color: var(--green); font-size: 0.88rem; font-weight: 600; }

/* Details and data cards */

.details { margin-top: 18px; }

.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  align-items: end;
}

.details-grid.financial { align-items: stretch; margin-top: 0; }

.detail-block {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.detail-block h3 { font-size: 0.98rem; }
.detail-block p { margin: 6px 0 10px; }
.detail-block strong { font-size: 1.02rem; font-variant-numeric: tabular-nums; }
.detail-block .link { padding-left: 0; text-align: left; }
.detail-block .payout { margin-top: 10px; }

.details-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 18px;
  align-items: start;
}

.panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-soft);
}

.panel > h3:first-child { margin-top: 0; }
.panel .details-grid { align-items: start; }
.panel .row { margin-top: 14px; }
.panel .fine { margin-top: 12px; }

.table-title { margin: 22px 0 10px; font-size: 0.95rem; }

.check { display: flex; align-items: flex-start; gap: 9px; margin: 16px 0; font-weight: 500; font-size: 0.9rem; color: var(--ink-soft); }
.check input { flex: none; margin-top: 3px; width: 18px; height: 18px; accent-color: var(--brand-600); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Apply and admin */

.apply { max-width: 1040px; margin: 18px auto 0; }
.apply-pitch { display: flex; flex-direction: column; justify-content: center; }

.apply-pitch .steps {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 24px 0 0;
  padding: 0;
  display: grid;
  gap: 14px;
  counter-reset: step;
}

.apply-pitch .steps li { display: flex; gap: 12px; align-items: flex-start; counter-increment: step; }
.apply-pitch .steps li::before {
  content: counter(step);
  width: 28px;
  height: 28px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  font-size: 0.76rem;
  font-weight: 800;
}

.apply-pitch .steps strong { display: block; font-size: 0.92rem; }
.apply-pitch .steps span { display: block; margin-top: 2px; color: var(--on-dark-faint); font-size: 0.82rem; }

.apply-auth { justify-content: flex-start; }
.apply-auth h2 { margin-bottom: 4px; }
.apply-auth .card-sub { margin-bottom: 18px; }

.apply-form .details-grid { margin-bottom: 4px; }
.apply-form > label:not(.check) { margin-top: 16px; }
.apply-form .row { margin-top: 4px; }
.apply-form > button[type="submit"] { margin-top: 18px; }

/* The code check's status and its one action sit under the field, so the input
   keeps the full width of its cell and the form's row alignment stays clean. */
.code-status { min-height: 1.2em; margin-top: 2px; }
.code-status[data-state="ok"] { color: var(--green); }
.code-status[data-state="taken"] { color: var(--red); }
.code-link { margin-top: 2px; overflow-wrap: anywhere; }
.code-suggest { margin-top: 2px; padding: 6px 0; min-height: 32px; font-size: 0.84rem; }

/* The success state is a handover note, not a one-line toast. */
.apply-ok {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  color: var(--ink);
  font-weight: 500;
}
.apply-ok strong { display: block; color: var(--green); font-size: 1rem; }
.apply-ok p { margin: 6px 0 0; font-size: 0.9rem; }
.apply-ok .fine { color: var(--muted); font-size: 0.82rem; }
.apply-ok ol { margin: 8px 0 0; padding-left: 20px; color: var(--muted); font-size: 0.86rem; }
.apply-ok li + li { margin-top: 4px; }

/* The FAQ sits below the split card; it never competes with the form. */
.apply-faq .faq-list { margin-top: 0; }

/* A payout screenshot is private; it is fetched with the token and shown in
   this dialog, never linked as a public image. */
.proof-link { margin-top: 6px; padding: 0; font-size: 0.82rem; }
.proof-dialog {
  width: min(900px, 92vw);
  max-height: 90vh;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--ink);
  overflow: auto;
}
.proof-dialog::backdrop { background: rgb(20 18 45 / 0.62); }
.proof-dialog-inner { padding: 18px; }
.proof-dialog-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.proof-dialog-head h2 { margin: 0; font-size: 1.1rem; }
.proof-dialog img {
  display: block;
  width: 100%;
  max-height: 68vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
}
.proof-dialog .fine { margin: 10px 0 0; }

/* The joining-bonus conditions, stated before the FAQ so nobody has to guess. */
.apply-bonus .card-head { margin-bottom: 0; }
.bonus-rules {
  margin: 12px 0 0;
  padding-left: 20px;
  color: var(--ink);
  font-size: 0.9rem;
}
.bonus-rules li { margin-top: 8px; }
.bonus-rules strong { color: var(--ink); }
.apply-bonus > .fine { margin-top: 14px; max-width: 75ch; }

/* ------------------------------------------------ the public programme --- */

.programme-page { max-width: 980px; }

.page-lang {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-size: 0.82rem;
}
.page-lang a { color: var(--brand-600); font-weight: 700; text-decoration: none; }
.page-lang a:hover { text-decoration: underline; }
.page-lang [aria-current="page"] { color: var(--ink); font-weight: 800; }

/* Hindi is a reading language, not a label language: no uppercase tracking,
   and enough line height that a matra never touches the line above. */
html[lang="hi"] body { line-height: 1.7; }
html[lang="hi"] h1, html[lang="hi"] h2, html[lang="hi"] h3 { letter-spacing: 0; }
html[lang="hi"] .programme-hero h1 { line-height: 1.35; }
html[lang="hi"] .eyebrow,
html[lang="hi"] .programme-label,
html[lang="hi"] .brand-text small { letter-spacing: 0.02em; text-transform: none; }
html[lang="hi"] .programme-facts dt { letter-spacing: 0.02em; }
html[lang="hi"] .programme-steps strong,
html[lang="hi"] .timeline strong,
html[lang="hi"] .faq summary { line-height: 1.6; }
html[lang="hi"] .app-checks li,
html[lang="hi"] .rule-list li,
html[lang="hi"] .trust-checks li,
html[lang="hi"] .trust-limits li { line-height: 1.7; }
html[lang="hi"] .scroll td::before { letter-spacing: 0; }

.hi-legal-note {
  position: relative;
  z-index: 1;
  margin: 14px 0 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-dark-soft);
  font-size: 0.8rem;
}
.hi-legal-note a { color: #fff; font-weight: 700; }
.hi-legal-note a:hover { color: #fff; }

.programme-hero {
  position: relative;
  overflow: hidden;
  padding: 40px;
  border: 0;
  border-radius: var(--radius-xl);
  color: #fff;
  background:
    radial-gradient(560px 300px at 96% -20%, rgba(255, 255, 255, 0.16), transparent 68%),
    radial-gradient(420px 260px at 0% 120%, rgba(255, 190, 140, 0.15), transparent 70%),
    linear-gradient(125deg, var(--brand-950), var(--brand-700) 54%, var(--brand-500));
  box-shadow: var(--shadow-float);
}

.programme-hero::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -120px;
  width: 290px;
  height: 290px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 0 0 30px rgba(255, 255, 255, 0.035),
    0 0 0 64px rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.programme-hero h1 { font-size: clamp(1.9rem, 3.6vw, 2.55rem); margin-bottom: 12px; }
.programme-hero .lede { color: var(--on-dark-soft); max-width: 62ch; margin-bottom: 0; }
.programme-hero .fine { color: var(--on-dark-soft); max-width: 74ch; }
.programme-hero .fine strong { white-space: nowrap; }
.programme-hero code { background: rgba(255, 255, 255, 0.16); color: #fff; }

.programme-facts {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 0;
  padding: 18px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.18);
}

.programme-facts dt {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--on-dark-faint);
}

.programme-facts dd { margin: 4px 0 0; font-size: 1.3rem; font-weight: 800; letter-spacing: -0.02em; }

.programme-hero-actions {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}

.programme-cta { background: #fff; border-color: #fff; color: var(--brand-800); }
.programme-cta:hover { background: #f3f0ff; border-color: #f3f0ff; color: var(--brand-800); }
.programme-link { color: #fff; font-size: 0.86rem; font-weight: 700; }
.programme-link:hover { color: #fff; }

.programme-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 18px 0;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.7);
}

.programme-toc a { color: var(--ink-soft); font-size: 0.8rem; font-weight: 700; text-decoration: none; }
.programme-toc a:hover { color: var(--brand-600); text-decoration: underline; }

.programme-section { scroll-margin-top: 18px; }
.programme-section h2 { font-size: 1.35rem; }
.programme-section .card-sub { max-width: 72ch; }
.programme-label { margin: 18px 0 0; color: var(--ink); font-size: 0.86rem; font-weight: 700; }
.programme-subhead { margin: 26px 0 8px; font-size: 1rem; }

.programme-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: programme-step;
}

.programme-steps li {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.programme-steps .step-number {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-600);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 800;
}

.programme-steps strong { display: block; font-size: 0.9rem; }
.programme-steps span:not(.step-number) { display: block; margin-top: 3px; color: var(--muted); font-size: 0.82rem; }

.programme-table { margin-top: 18px; }
.programme-table caption { text-align: left; }

.programme-note {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-left: 4px solid var(--brand-300);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--surface-tint);
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.programme-note strong { color: var(--ink); }

.timeline {
  margin: 20px 0 0;
  padding: 0 0 0 20px;
  list-style: none;
  border-left: 2px solid var(--line-strong);
}

.timeline li { position: relative; margin: 0 0 18px; padding-left: 18px; }
.timeline li:last-child { margin-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 5px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--surface);
  border: 3px solid var(--brand-500);
}
.timeline strong { display: block; font-size: 0.92rem; }
.timeline span { display: block; margin-top: 3px; color: var(--muted); font-size: 0.86rem; }
.timeline em { color: var(--ink); font-style: normal; font-weight: 700; }

.tier-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 20px;
}

.tier {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}
.tier h3 { margin-bottom: 4px; }
.tier p:last-child { margin: 0; color: var(--muted); font-size: 0.84rem; }

.app-summary {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: 22px;
  margin-top: 20px;
}

.app-summary h3 { margin-bottom: 8px; }
.app-summary p { margin: 0 0 10px; color: var(--ink-soft); font-size: 0.9rem; }
.app-checks { margin: 12px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 0.86rem; }
.app-checks li { margin: 6px 0; }
.app-checks li::marker { color: var(--brand-600); }
.app-price {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
}
.app-price .app-offer {
  margin: 14px 0 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: #fff;
  border: 1px solid var(--line);
}
.app-offer strong { display: block; font-size: 1.25rem; color: var(--brand-700); letter-spacing: -0.02em; }
.app-offer span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.8rem; }

.talking-points { margin: 12px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 0.9rem; }
.talking-points li { margin: 8px 0; }
.talking-points li::marker { color: var(--brand-600); font-weight: 800; }

.demo-box {
  margin: 20px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}
.demo-box p:last-child { margin: 0; color: var(--ink-soft); font-size: 0.88rem; }

.guide-links { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.guide-links .gate-apply { gap: 7px; flex-direction: column; align-items: flex-start; min-height: 58px; padding: 9px 16px; }
.guide-links .gate-apply span { color: var(--muted); font-size: 0.72rem; font-weight: 600; }

.rule-list { margin: 16px 0 0; padding-left: 20px; color: var(--ink-soft); font-size: 0.9rem; }
.rule-list li { margin: 9px 0; }
.rule-list li::marker { color: var(--brand-600); }

.trust-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  margin-top: 18px;
}
.trust-grid h3 { margin-bottom: 8px; }
.trust-checks, .trust-limits { margin: 0; padding-left: 20px; color: var(--ink-soft); font-size: 0.86rem; }
.trust-checks li, .trust-limits li { margin: 8px 0; }
.trust-checks li::marker { color: var(--green); }
.trust-limits li::marker { color: var(--amber); }

.who-we-are {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.who-we-are p { margin: 0 0 8px; max-width: 78ch; color: var(--ink-soft); font-size: 0.88rem; }
.who-we-are p:last-child { margin-bottom: 0; }

.programme-cta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 20px;
  color: #fff;
  background:
    radial-gradient(520px 240px at 96% -20%, rgba(255, 255, 255, 0.16), transparent 68%),
    linear-gradient(120deg, var(--brand-900), var(--brand-600));
  border: 0;
  border-radius: var(--radius-xl);
}
.programme-cta-card h2 { color: #fff; margin-bottom: 6px; }
.programme-cta-card p { margin: 0; max-width: 58ch; color: var(--on-dark-soft); font-size: 0.9rem; }
.programme-cta-card .programme-hero-actions { margin-top: 0; flex: none; }
.programme-cta-card .eyebrow { color: var(--on-dark-faint); }

.admin { max-width: 1040px; margin: 0 auto; }
.admin-head { margin-bottom: 18px; }
.admin-head h1 { margin-bottom: 8px; }

.admin .notice { margin-top: 4px; }

.auth-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.auth-bar > div { flex: 1 1 260px; }
.auth-bar .row { flex: 1 1 auto; margin: 0; }
.auth-bar .row > input { flex: 1 1 240px; }

.admin-section { margin-top: 30px; padding-top: 24px; border-top: 1px solid var(--line); }
.admin-section .card-head { margin-bottom: 14px; }

.queue { display: grid; gap: 14px; }
.queue > .card + .card { margin-top: 0; }

.application {
  padding: 20px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-300);
  border-radius: var(--radius-lg);
  box-shadow: none;
  background: var(--surface-soft);
}

.application-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 16px; }
.application-head h2 { margin-bottom: 3px; font-size: 1.02rem; }
.application-head h3 { margin: 0 0 3px; font-size: 0.98rem; }
.application .sub { margin: 0; }
.application p { margin: 10px 0 0; font-size: 0.9rem; }
.application-review { margin-top: 14px; }
.application-actions { margin-top: 10px; flex-wrap: wrap; }
.application textarea { width: 100%; }
.application .row > button { flex: 0 0 auto; }

/* Copy buttons sit beside the value the owner would otherwise retype. */
.copy-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.copy-row .copy-btn {
  min-height: 36px;
  padding: 0 12px;
  font-size: 0.78rem;
}

.copy-row .copy-status { flex-basis: 100%; margin: 0; }

.change-values {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 18px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.change-values > div { min-width: 0; }
.change-values strong { display: block; margin-top: 3px; overflow-wrap: anywhere; }
.change-label {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.application > .link { margin-top: 8px; }
.application .check-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
  font-weight: 600;
}
.application .check-line input { flex: none; margin-top: 3px; }

/* Help: native details, so it works without a script. */
.faq-list { margin-top: 4px; }
.faq { border-top: 1px solid var(--line); }
.faq:first-child { border-top: 0; }
.faq summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 0;
  cursor: pointer;
  color: var(--ink);
  font-weight: 700;
}
.faq summary::marker { color: var(--brand-600); }
.faq p {
  margin: 4px 0 14px;
  max-width: 75ch;
  color: var(--muted);
  font-size: 0.9rem;
}

/* The signed-in help centre: a searchable set of groups, then the reference
   cards. All native details; the search only hides what is already rendered. */
.help-card { margin-top: 0; }
.help-guide-link { flex: none; align-self: flex-start; min-height: 40px; font-size: 0.82rem; }
.help-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  align-items: end;
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}
.help-tools label { margin: 0; }
.help-tools input { grid-column: auto; }
.help-tools .fine { grid-column: auto; margin: 2px 0 0; }
.help-lang {
  display: inline-flex;
  justify-self: start;
  gap: 3px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.help-lang-button {
  min-height: 34px;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  /* The global button style animates background; on a pressed-state switch that
     can leave the two buttons mid-swap with unreadable text. The switch is an
     instant state change, so it does not animate. */
  transition: none;
}
.help-lang-button:hover {
  background: var(--surface-tint);
  color: var(--ink);
}
.help-lang-button[aria-pressed="true"] {
  background: var(--brand-600);
  color: #fff;
}
.help-lang-button[aria-pressed="true"]:hover {
  background: var(--brand-700);
  color: #fff;
}
.help-lang-button:focus-visible {
  outline: 3px solid var(--brand-600);
  outline-offset: 2px;
}
/* The Help translation is inside an English page, so the programme page's
   html[lang="hi"] rules do not reach it. Keep the Devanagari line height and
   drop the uppercase tracking on its headings. */
#help [data-help-hi] { line-height: 1.7; }
#help [data-help-hi] summary { line-height: 1.6; }
#help [data-help-hi] h3,
#help .eyebrow [data-help-hi] {
  letter-spacing: 0;
  text-transform: none;
}
.help-group { margin: 0 0 22px; }
.help-group:last-of-type { margin-bottom: 8px; }
.help-group h3 {
  margin: 0 0 2px;
  color: var(--brand-600);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.help-extra {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 8px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.help-extra-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}
.help-extra-card h3 { margin-bottom: 6px; font-size: 0.94rem; }
.help-extra-card p { margin: 0 0 8px; color: var(--muted); font-size: 0.84rem; }
.help-extra-card p:last-child { margin-bottom: 0; }
.help-extra-card .fine { margin-top: 8px; font-size: 0.78rem; }
.glossary, .status-list { margin: 0; }
.glossary > div, .status-list > div {
  display: grid;
  grid-template-columns: minmax(92px, 0.7fr) minmax(0, 1.3fr);
  gap: 10px;
  padding: 5px 0;
  border-top: 1px solid var(--line);
}
.glossary > div:first-child, .status-list > div:first-child { border-top: 0; }
.glossary dt, .status-list dt { color: var(--ink); font-size: 0.78rem; font-weight: 700; }
.glossary dd, .status-list dd { margin: 0; color: var(--muted); font-size: 0.78rem; }
.help-support button { margin-top: 2px; }

/* Policy: readable long-form, not a dashboard. No money state, no script. */

.policy { max-width: 860px; margin: 0 auto; }
.policy h1:focus { outline: none; }
.policy h1:focus-visible {
  outline: 3px solid rgba(75, 63, 196, 0.4);
  outline-offset: 4px;
  border-radius: 6px;
}
.policy h2 { margin: 26px 0 8px; font-size: 1.22rem; }
.policy h3 { margin: 18px 0 6px; }
.policy p { margin: 0 0 10px; max-width: 76ch; color: var(--ink-soft); }
.policy ul { margin: 0 0 12px; padding-left: 20px; }
.policy li { margin: 5px 0; max-width: 76ch; color: var(--ink-soft); }
.policy li::marker { color: var(--brand-600); }
.policy code {
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-tint);
  font-size: 0.88em;
}
.policy section { scroll-margin-top: 18px; }
.policy section + section {
  margin-top: 22px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
}
.policy-meta { margin: 0 0 16px; color: var(--muted); font-size: 0.8rem; }
.policy-toc {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 16px;
  margin: 0 0 8px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.policy-toc a { font-size: 0.84rem; font-weight: 700; text-decoration: none; }
.policy-toc a:hover { text-decoration: underline; }
.policy-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  margin: 0 0 12px;
}
.policy-facts > div {
  padding: 12px 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.policy-facts dt {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.policy-facts dd {
  margin: 3px 0 2px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.policy-facts dd span {
  display: block;
  margin-top: 2px;
  max-width: none;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: 0;
}

/* Footer */

.site-footer {
  margin-top: auto;
  background: rgba(255, 255, 255, 0.72);
  border-top: 1px solid var(--line);
}

.footer-inner {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 24px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px 32px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-inner p { margin: 0 0 4px; max-width: 62ch; }
.footer-brand { color: var(--ink); font-weight: 800; font-size: 0.86rem; }
.footer-links { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; }
.footer-links a { color: var(--ink-soft); font-weight: 600; text-decoration: none; }
.footer-links a:hover { color: var(--brand-600); text-decoration: underline; }

/* Paused: history stays readable (decision 86), money does not. */
.paused [data-money] { display: none; }
body.paused .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

/* ------------------------------------------------ overview and share kit -- */

.updated {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 0.76rem;
}

.updated button.link { padding: 4px 6px; min-height: 32px; font-size: 0.76rem; }
.noscript-notice { margin: 16px 24px; }

.overview {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  margin: 0 0 18px;
}

/* The trend is a read, not a money rule: counts only, IST days. */
.trend { margin: 0 0 18px; }
.trend .card-head { margin-bottom: 12px; }
.trend-periods { display: flex; gap: 6px; flex-wrap: wrap; }
.trend-periods button {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.82rem;
  background: var(--surface-soft);
  color: var(--brand-700);
  border: 1px solid var(--line);
}
.trend-periods button:hover { background: var(--surface-tint); }
.trend-periods button[aria-pressed="true"] {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #fff;
}
.trend-periods button[aria-pressed="true"]:hover { background: var(--brand-700); }
.trend-chart { min-height: 150px; }
.trend-chart svg { display: block; width: 100%; height: auto; }
.trend-axis { stroke: var(--line-strong); stroke-width: 1; }
.trend-label { fill: var(--muted); font-size: 12px; font-family: inherit; }
.line-clicks { stroke: var(--aqua-ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.line-installs { stroke: var(--lilac-ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.line-sales { stroke: var(--sage-ink); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.point-clicks { fill: var(--aqua-ink); }
.point-installs { fill: var(--lilac-ink); }
.point-sales { fill: var(--sage-ink); }
.trend-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.8rem;
}
.trend-legend span { display: inline-flex; align-items: center; gap: 6px; }
.trend-dot { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }
.trend-dot.line-clicks { stroke: none; background: var(--aqua-ink); }
.trend-dot.line-installs { stroke: none; background: var(--lilac-ink); }
.trend-dot.line-sales { stroke: none; background: var(--sage-ink); }

.money-hero {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
  background:
    radial-gradient(420px 220px at 100% 0%, rgba(124, 96, 230, 0.08), transparent 70%),
    var(--surface);
  border-color: #ded8f3;
}

.money-hero-main { min-width: 0; }

.money-hero-value {
  margin: 2px 0 6px;
  font-size: clamp(2rem, 5.2vw, 2.9rem);
  line-height: 1.05;
  letter-spacing: -0.035em;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.money-facts {
  display: grid;
  /* A six-figure amount must never break mid-number at the 360px floor, so the
     row reflows to two (then one) full-width facts instead of shrinking. */
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
  margin: 0;
}

.money-facts > div {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.money-facts dt {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.money-facts dd {
  margin: 3px 0 0;
  font-size: 1.02rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  overflow-wrap: anywhere;
}


.traffic-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  align-content: start;
}

.overview-aside {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.mini-help { padding: 16px; }
.mini-help .card-title { font-size: 0.98rem; }
.mini-help .fine { margin-top: 6px; }
.mini-help .gate-apply { width: 100%; margin-top: 12px; min-height: 40px; font-size: 0.82rem; }

.traffic-grid .kpi {
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 13px;
}

.traffic-grid .kpi-value { font-size: 1.15rem; }

.traffic-grid .kpi-sub {
  margin: 3px 0 0;
  color: var(--brand-700);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.25;
}

/* A reported sale is already in the Sales count. This line sits under the
   three KPIs so the partner sees the state and the date without opening
   Earnings. It is hidden by default and shown only while a sale waits. */
.traffic-awaiting {
  margin: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface-tint);
  color: var(--ink-soft);
  font-size: 0.78rem;
  line-height: 1.45;
}

.awaiting-line { color: var(--brand-700); font-weight: 600; }

.progress {
  height: 10px;
  margin: 12px 0 8px;
  border-radius: 999px;
  background: var(--surface-tint);
  overflow: hidden;
}

.progress > span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-600), var(--brand-300));
  transition: width 0.35s ease;
}

.money-hero .row { margin-top: 12px; }
.money-hero .row > button { flex: 0 1 auto; }

body.paused .overview { grid-template-columns: 1fr; }
body.paused .traffic-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.load-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.load-error button { min-height: 36px; padding: 0 12px; font-size: 0.8rem; }

/* First-run checklist */
.getting-started { margin: 0 0 18px; }

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

.checklist li {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface-soft);
}

.checklist li.next { border-color: var(--brand-300); background: var(--surface-tint); }
.checklist li.done { opacity: 0.78; }

.check-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--lilac);
  color: var(--lilac-ink);
  font-size: 0.78rem;
  font-weight: 800;
}

.checklist li.done .check-mark { background: var(--green-soft); color: var(--green); }
.checklist strong { display: block; font-size: 0.88rem; }
.checklist div > span { display: block; margin-top: 2px; color: var(--muted); font-size: 0.79rem; }

.check-state {
  color: var(--brand-600);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
}

.checklist li.done .check-state { color: var(--green); }

/* Share kit */
.share-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.share-actions a,
.share-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-soft);
  color: var(--brand-700);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.share-actions a:hover,
.share-actions button:hover { background: var(--surface-tint); border-color: var(--brand-300); }
.share-actions a[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.share-code-group { min-width: 0; }
.share-code { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 12px; }
.share-code button { margin-left: auto; min-height: 38px; padding: 0 14px; font-size: 0.82rem; }
.share-code-hint { margin-top: 8px; }

/* The QR is a print artefact: a fixed square, white behind it and a caption
   that explains why scanning still counts. It sits below the code so the
   share actions stay the primary row. */
.share-qr {
  display: flex; align-items: center; gap: 14px;
  margin: 16px 0 0; padding-top: 16px; border-top: 1px solid var(--line);
}
.share-qr[hidden] { display: none; }
.share-qr img {
  width: 132px; height: 132px; flex: none;
  background: #fff; border: 1px solid var(--line); border-radius: 12px;
}
.share-qr figcaption { display: grid; gap: 4px; font-size: 0.86rem; color: var(--muted); }
.share-qr figcaption strong { color: var(--ink); font-size: 0.92rem; }
.share-qr figcaption a { color: var(--brand-700); }
.share-qr figcaption a:focus-visible { outline: 3px solid var(--brand-600); outline-offset: 2px; }
@media (max-width: 420px) {
  .share-qr { align-items: flex-start; }
  .share-qr img { width: 104px; height: 104px; }
}

.share-code-label {
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Status pills: a label and a dot, never colour alone. */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
}

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

.pill-pending { background: var(--amber-soft); color: var(--amber); }
.pill-approved, .pill-paid, .pill-resolved { background: var(--green-soft); color: var(--green); }
.pill-rejected, .pill-reversed { background: var(--red-soft); color: var(--red); }
.pill-requested, .pill-open { background: var(--surface-tint); color: var(--brand-600); }

/* The section nav stays in view on a long page and says where you are. */
.dash-nav {
  position: sticky;
  top: 8px;
  z-index: 15;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 4px 18px rgba(29, 25, 82, 0.07);
}

.dash-nav a[aria-current] { background: var(--brand-600); color: #fff; }
.dash-nav a[aria-current]:hover { background: var(--brand-700); color: #fff; }

/* Five tabs, one page. A closed panel is inert and unfocusable because of the
   global [hidden] rule; the nav carries the state with aria-current. */
.tab-panel { min-width: 0; scroll-margin-top: 84px; }
.tab-panel > :last-child { margin-bottom: 0; }

.payout-steps {
  display: grid;
  gap: 14px;
  margin: 4px 0 14px;
  padding: 0;
  list-style: none;
}

.payout-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
}

.payout-steps .step-dot {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-tint);
  color: var(--brand-700);
  font-size: 0.76rem;
  font-weight: 800;
}

.payout-steps div { display: grid; gap: 2px; }
.payout-steps strong { font-size: 0.9rem; }
.payout-steps div span { color: var(--muted); font-size: 0.86rem; line-height: 1.5; }

@supports (backdrop-filter: blur(8px)) {
  .dash-nav { background: rgba(255, 255, 255, 0.82); backdrop-filter: blur(10px); }
}

#overview, #trend, #share, #getting-started, #ledger, #payouts, #payout-history, #details, #data, #help {
  scroll-margin-top: 84px;
}

@media (max-width: 920px) {
  .overview { grid-template-columns: 1fr; }
  body.paused .overview { grid-template-columns: 1fr; }
  .mini-help { display: none; }
}

@media (max-width: 620px) {
  /* Label left, amount right. One fact per row keeps a six-figure value on
     one line at the 360px floor instead of breaking it mid-number. */
  .money-facts { grid-template-columns: 1fr; gap: 7px; }
  .money-facts > div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 9px 12px;
  }
  .money-facts dt { font-size: 0.75rem; letter-spacing: 0.03em; }
  .money-facts dd { margin-top: 0; font-size: 0.95rem; text-align: right; }
  .traffic-grid { gap: 8px; }
  .traffic-grid .kpi { padding: 10px; }
  .traffic-grid .kpi-icon { width: 30px; height: 30px; border-radius: 9px; }
  .traffic-grid .kpi-label { font-size: 0.75rem; letter-spacing: 0.03em; }
  .traffic-grid .kpi-value { font-size: 1rem; }
  .dash-nav { top: 4px; border-radius: 14px; }
  .checklist li { grid-template-columns: 28px minmax(0, 1fr); }
  .check-state { grid-column: 2; }
  .share-actions > * { flex: 1 1 140px; }
}

/* ------------------------------------------------------------- responsive -- */

@media (max-width: 1080px) {
  .kpi-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 920px) {
  .gate { grid-template-columns: 1fr; max-width: 680px; }
  #gate .gate-auth { order: -1; }
  .apply .gate-auth { order: -1; }
  .gate-pitch, .gate-auth { padding: 32px; }
  .gate-pitch::after { display: none; }
  .dash-grid { grid-template-columns: 1fr; }
  .card-wide { grid-column: auto; }
  .details-columns { grid-template-columns: 1fr; }
  .share { grid-template-columns: 1fr; }
  .dash-hero { align-items: flex-start; flex-direction: column; }
  .programme-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-summary { grid-template-columns: 1fr; }
  .tier-grid { grid-template-columns: 1fr; }
  .programme-cta-card { flex-direction: column; align-items: flex-start; }
  .programme-cta-card .programme-hero-actions { margin-top: 4px; }
}

@media (max-width: 700px) {
  .site-header { border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
  .site-header-inner { padding: 13px 16px; }
  .header-pill { display: none; }
  .dash-nav {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 2px;
    width: 100%;
    border-radius: 16px;
  }
  .dash-nav a {
    justify-content: center;
    padding: 7px 3px;
    font-size: clamp(0.66rem, 3vw, 0.76rem);
    letter-spacing: -0.01em;
  }
  .page { padding: 20px 16px 42px; }
  .card, .application { padding: 20px; }
  .gate-pitch, .gate-auth { padding: 26px 22px; }
  .gate { margin-top: 8px; }
  .gate-stats { gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .gate-stats dd { font-size: 1.12rem; }
  .programme-hero { padding: 26px 22px; }
  .programme-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .programme-facts dd { font-size: 1.12rem; }
  .programme-steps { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: 1fr; }
  .help-extra { grid-template-columns: 1fr; }
  .help-tools { grid-template-columns: 1fr; }
  .help-tools input { grid-column: auto; }
  .help-guide-link { width: 100%; }
  .programme-toc { gap: 7px 12px; padding: 10px 12px; }
  .programme-cta-card { padding: 22px; }
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  body.paused .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 12px; }
  .kpi-icon { width: 34px; height: 34px; border-radius: 10px; }
  .kpi-value { font-size: 1.08rem; }
  .dash-hero { padding: 24px 20px; }
  .dash-hero-actions { width: 100%; justify-content: space-between; }
  .share-row { flex-wrap: nowrap; }
  .details-grid { grid-template-columns: 1fr; }
  .figures { grid-template-columns: 1fr 1fr; }
  .row > button { flex: 1 1 auto; }
  .auth-bar .row > button { flex: 1 1 auto; }

  /* The ledger, payout history and data requests become cards under 700px.
     The headers stay in the accessibility tree (visually hidden) and every
     cell carries its label through data-label. */
  .scroll { overflow: visible; border: 0; background: transparent; }
  .scroll table { min-width: 0; }
  .scroll thead {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
  }
  .scroll tbody, .scroll tr, .scroll td { display: block; }
  .scroll tbody tr {
    margin-bottom: 12px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-md);
    background: var(--surface);
  }
  .scroll tbody tr:last-child { margin-bottom: 0; }
  .scroll tbody tr:hover { background: var(--surface); }
  .scroll td {
    padding: 6px 0;
    border: 0;
    text-align: right;
  }
  .scroll td::before {
    content: attr(data-label);
    display: block;
    margin-bottom: 2px;
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-align: left;
    text-transform: uppercase;
  }
  .scroll td[colspan] { padding: 10px 0; text-align: center; }
  .scroll td[colspan]::before { display: none; }
  .scroll td .sub { text-align: right; }
  .scroll-hint { display: none; }
  .footer-inner { padding: 20px 16px; }
}

@media (max-width: 460px) {
  .figures { grid-template-columns: 1fr; }
  .brand-text strong { font-size: 0.96rem; }
  .header-link { padding: 7px 11px; font-size: 0.79rem; }
  .gate-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .gate-stats dd { font-size: 1.05rem; }
  .programme-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .programme-facts dd { font-size: 1.05rem; }
  .glossary > div, .status-list > div { grid-template-columns: 1fr; gap: 1px; padding: 7px 0; }
  .share-row { flex-wrap: wrap; }
  .share-row input { flex-basis: 100%; }
  .share-row button { width: 100%; }
  .share-code button { margin-left: 0; }
}

@media (max-width: 380px) {
  /* Five labels do not fit a 360px row without touching; two centred rows is
     more legible than shrinking the type below 11px. */
  .dash-nav { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .dash-nav a { grid-column: span 2; font-size: 0.74rem; }
  .dash-nav a:nth-child(4) { grid-column: 2 / span 2; }
  .dash-nav a:nth-child(5) { grid-column: 4 / span 2; }
}

/* ------------------------------------- Phase 1: trust and a next action --- */

/* The safeguards a partner checks before sharing anything personal. */
.trust-bar {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  color: var(--muted);
  font-size: 0.75rem;
}

.trust-bar li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.trust-bar li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--brand-500);
  flex: none;
}

.trust-bar.on-dark { color: var(--on-dark-faint); }
.trust-bar.on-dark li::before { background: #fff; opacity: 0.7; }

/* One next-best-action, derived from the partner's own funnel. */
.next-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 16px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--brand-600);
  border-radius: var(--radius-md);
  background: var(--surface-tint);
}

.next-action .eyebrow { margin-bottom: 2px; }

.next-action-text {
  margin: 0;
  color: var(--ink);
  font-size: 0.9rem;
  font-weight: 600;
}

.next-action .gate-apply {
  flex: none;
  min-height: 40px;
  padding: 0 14px;
  font-size: 0.82rem;
}

/* A phone-first share shortcut. It is hidden until the dashboard renders and
   is only fixed below the 700px breakpoint. */
.mobile-share { display: none; }

@media (max-width: 700px) {
  .next-action {
    flex-direction: column;
    align-items: stretch;
  }

  .next-action .gate-apply { width: 100%; }

  .mobile-share {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
    background: var(--brand-950);
    color: #fff;
    box-shadow: 0 -8px 24px rgba(20, 16, 50, 0.22);
  }

  .mobile-share[hidden] { display: none; }

  .mobile-share-label {
    display: block;
    color: var(--on-dark-faint);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-share strong { display: block; font-size: 0.84rem; }

  .mobile-share .gate-apply {
    flex: none;
    min-height: 40px;
    padding: 0 16px;
    font-size: 0.84rem;
  }

  body.has-mobile-share .page { padding-bottom: 78px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; }
}
