/* =======================================================================================
   IFT Partners — shared design system.

   Loaded by index.html (partner recruitment), portal.html (affiliate portal) and
   admin.html (network console). Everything above the page-specific block at the bottom is
   generic and named conventionally, because three pages written independently have to
   agree on what ".card" means without agreeing on anything else.

   No external assets by design. A network that handles partner payment details has no
   business shipping a font CDN a visitor never agreed to talk to. System font stack only;
   every icon in the markup is inline SVG.

   Component contracts (the markup each block expects):
     nav       .nav > .nav-inner > .brand | .nav-links | .nav-actions  (+ .nav-toggle)
     card      .card > .card-head > (.card-title + .card-sub) | .card-body | .card-foot
     tile      .tile > .tile-label + .tile-value + .tile-delta
     table     .table-wrap > table.table            <- the wrap is what scrolls, always
     field     .field > label.label + .input|.select|.textarea + .hint|.form-error
     badge     span.badge.badge-<tone>              <- tones double as status names
     modal     .modal[.is-open] > .modal-panel > .modal-head|.modal-body|.modal-foot
     toast     .toast-stack > .toast.toast-ok|.toast-err|.toast-info
   ======================================================================================= */

/* ---------------------------------------------------------------------------------------
   1. Tokens
   --------------------------------------------------------------------------------------- */

:root {
  color-scheme: dark;

  /* Surfaces climb from near-black in even steps so a card inside a panel inside a section
     still separates without a border doing all the work. */
  --bg: #05060b;
  --bg-soft: #070911;
  --surface: #0a0d17;
  --surface-2: #10141f;
  --surface-3: #171c2b;
  --line: #1c2233;
  --line-2: #2a3245;
  --line-hi: #3b4560;

  --text: #eaeef8;
  --text-dim: #a3aec4;
  /* Measured, not eyeballed: --text-mute carries the smallest type in the product (11-13px
     labels, hints, table headers). At #6b768f it fell to 3.7:1 on --surface-3, under WCAG AA.
     This value clears 4.5:1 against every surface token above. */
  --text-mute: #7d8aa4;

  /* Violet is the network itself: nav, primary actions, links. */
  --brand: #7c68ff;
  --brand-2: #5f45ff;
  --brand-3: #9d8dff;
  --brand-ink: #0b0620;
  --brand-soft: rgba(124, 104, 255, 0.14);
  --brand-line: rgba(124, 104, 255, 0.38);

  /* Mint is money. Every earned figure, every positive delta, every "paid". */
  --money: #19e3a5;
  --money-2: #0cbc88;
  --money-soft: rgba(25, 227, 165, 0.12);
  --money-line: rgba(25, 227, 165, 0.34);

  /* Gold marks the featured plan and anything needing attention without alarm. */
  --accent: #f5b93f;
  --accent-soft: rgba(245, 185, 63, 0.13);
  --accent-line: rgba(245, 185, 63, 0.36);

  --up: var(--money);
  --down: #ff5a6b;
  --down-soft: rgba(255, 90, 107, 0.13);
  --down-line: rgba(255, 90, 107, 0.36);
  --warn: var(--accent);
  --info: #5aa9ff;
  --info-soft: rgba(90, 169, 255, 0.13);
  --info-line: rgba(90, 169, 255, 0.34);

  --radius-xs: 6px;
  --radius-sm: 9px;
  --radius: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 72px;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.55);
  --shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 32px 80px rgba(0, 0, 0, 0.62);
  --glow: 0 0 0 1px var(--brand-line), 0 18px 50px rgba(124, 104, 255, 0.18);

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, "Noto Sans", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
    "Liberation Mono", monospace;

  --maxw: 1200px;
  --maxw-narrow: 800px;
  --nav-h: 64px;
  --speed: 160ms;
}

/* ---------------------------------------------------------------------------------------
   2. Reset + base
   --------------------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-h) + 16px);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  /* The hero glows overflow their box on purpose; the page must still never scroll sideways. */
  overflow-x: hidden;
}

body.is-locked {
  overflow: hidden;
}

h1, h2, h3, h4, h5 {
  margin: 0;
  line-height: 1.14;
  letter-spacing: -0.025em;
  font-weight: 650;
}

h1 { font-size: clamp(2.05rem, 5.2vw, 3.4rem); }
h2 { font-size: clamp(1.55rem, 3.3vw, 2.25rem); }
h3 { font-size: clamp(1.12rem, 2vw, 1.38rem); }
h4 { font-size: 1.02rem; }

p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 var(--sp-4); padding-left: 1.15rem; }
ul:last-child, ol:last-child { margin-bottom: 0; }
li { margin-bottom: var(--sp-2); }
li:last-child { margin-bottom: 0; }

a {
  color: var(--brand-3);
  text-decoration: none;
  transition: color var(--speed) ease;
}
a:hover { color: #c0b6ff; }

img, svg { max-width: 100%; }
svg { display: block; }

hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: var(--sp-6) 0;
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--brand-3);
  outline-offset: 2px;
  border-radius: var(--radius-xs);
}

::selection {
  background: var(--brand-soft);
  color: var(--text);
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg-soft); }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: var(--radius-pill);
  border: 2px solid var(--bg-soft);
}
::-webkit-scrollbar-thumb:hover { background: var(--line-hi); }

[hidden] { display: none !important; }

.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: -9999px;
  top: 0;
  z-index: 200;
  padding: var(--sp-3) var(--sp-4);
  background: var(--brand);
  color: var(--brand-ink);
  font-weight: 650;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  left: 0;
  color: var(--brand-ink);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ---------------------------------------------------------------------------------------
   3. Layout primitives
   --------------------------------------------------------------------------------------- */

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

.container-narrow {
  width: 100%;
  max-width: var(--maxw-narrow);
  margin: 0 auto;
  padding: 0 var(--sp-5);
}

.section {
  padding: var(--sp-8) 0;
  position: relative;
}
.section-tight { padding: var(--sp-7) 0; }
.section-line { border-top: 1px solid var(--line); }
.section-soft { background: var(--bg-soft); }

.section-head {
  max-width: 720px;
  margin-bottom: var(--sp-6);
}
.section-head.center {
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand-3);
  margin-bottom: var(--sp-3);
}

.lede {
  font-size: clamp(1rem, 1.5vw, 1.14rem);
  color: var(--text-dim);
  margin-top: var(--sp-4);
}

.grid { display: grid; gap: var(--sp-4); }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid-auto-sm { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.grid-5 { gap: var(--sp-5); }

.row {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.row-tight { gap: var(--sp-2); }
.row-between { justify-content: space-between; }
.row-end { justify-content: flex-end; }
.row-center { justify-content: center; }
.row-top { align-items: flex-start; }
.row-nowrap { flex-wrap: nowrap; }

.stack { display: flex; flex-direction: column; gap: var(--sp-4); }
.stack-sm { gap: var(--sp-2); }
.stack-lg { gap: var(--sp-6); }

.split {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: var(--sp-7);
  align-items: center;
}
.split-even { grid-template-columns: 1fr 1fr; }
.split-wide { grid-template-columns: 1.35fr 0.65fr; }

.divider {
  height: 1px;
  background: var(--line);
  margin: var(--sp-5) 0;
}

/* ---------------------------------------------------------------------------------------
   4. Navigation
   --------------------------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(5, 6, 11, 0.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--sp-5);
  height: var(--nav-h);
  display: flex;
  align-items: center;
  gap: var(--sp-5);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-3);
  color: var(--text);
  font-weight: 680;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand:hover { color: var(--text); }

.brand-mark {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-2) 100%);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 16px rgba(124, 104, 255, 0.35);
}
.brand-mark svg { width: 18px; height: 18px; }

.brand-sub {
  color: var(--text-mute);
  font-weight: 500;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--sp-5);
  margin-left: auto;
}
.nav-links a {
  color: var(--text-dim);
  font-size: 0.92rem;
  font-weight: 550;
  white-space: nowrap;
}
.nav-links a:hover,
.nav-links a.is-active { color: var(--text); }

.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  /* The console header carries more buttons than the marketing one, and at middling widths
     they push the page wider than the viewport rather than dropping to a second line. */
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}
.nav-links + .nav-actions { margin-left: 0; }
.nav-actions:first-of-type { margin-left: auto; }

.nav-toggle {
  display: none;
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  place-items: center;
  cursor: pointer;
}
.nav-mobile-only { display: none; }

/* ---------------------------------------------------------------------------------------
   5. Buttons
   --------------------------------------------------------------------------------------- */

.btn {
  --btn-bg: var(--surface-2);
  --btn-fg: var(--text);
  --btn-line: var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 0.62rem 1.05rem;
  min-height: 42px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--btn-line);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 0.93rem;
  font-weight: 620;
  letter-spacing: -0.01em;
  white-space: nowrap;
  cursor: pointer;
  text-align: center;
  transition: transform var(--speed) ease, filter var(--speed) ease,
    background var(--speed) ease, border-color var(--speed) ease, color var(--speed) ease;
}
.btn:hover { filter: brightness(1.12); color: var(--btn-fg); }
.btn:active { transform: translateY(1px); }
.btn[disabled],
.btn.is-busy {
  opacity: 0.55;
  pointer-events: none;
}
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  --btn-bg: linear-gradient(150deg, var(--brand) 0%, var(--brand-2) 100%);
  --btn-fg: #fff;
  --btn-line: transparent;
  box-shadow: 0 6px 20px rgba(124, 104, 255, 0.3);
}
.btn-money {
  --btn-bg: linear-gradient(150deg, var(--money) 0%, var(--money-2) 100%);
  --btn-fg: #032015;
  --btn-line: transparent;
  box-shadow: 0 6px 20px rgba(25, 227, 165, 0.24);
}
.btn-accent {
  --btn-bg: linear-gradient(150deg, #ffd27a 0%, var(--accent) 100%);
  --btn-fg: #241802;
  --btn-line: transparent;
}
.btn-danger {
  --btn-bg: rgba(255, 90, 107, 0.14);
  --btn-fg: #ff8a95;
  --btn-line: var(--down-line);
}
.btn-outline {
  --btn-bg: transparent;
  --btn-line: var(--line-hi);
}
.btn-ghost {
  --btn-bg: transparent;
  --btn-fg: var(--text-dim);
  --btn-line: transparent;
}
.btn-ghost:hover { --btn-fg: var(--text); background: var(--surface-2); }

.btn-sm { padding: 0.38rem 0.7rem; min-height: 34px; font-size: 0.84rem; }
.btn-lg { padding: 0.85rem 1.5rem; min-height: 52px; font-size: 1rem; }
.btn-block { display: flex; width: 100%; }
.btn-icon { padding: 0; width: 38px; min-height: 38px; }

/* ---------------------------------------------------------------------------------------
   6. Cards + panels
   --------------------------------------------------------------------------------------- */

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  flex-wrap: wrap;
}
.card-title {
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}
.card-sub {
  font-size: 0.85rem;
  color: var(--text-mute);
  margin-top: 2px;
}
.card-body { padding: var(--sp-5); }
.card-foot {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}
.card-flush > .card-body { padding: 0; }

.card-hover {
  transition: border-color var(--speed) ease, transform var(--speed) ease,
    box-shadow var(--speed) ease;
}
.card-hover:hover {
  border-color: var(--line-hi);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.panel {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-5);
}
.panel-soft {
  background: var(--brand-soft);
  border-color: var(--brand-line);
}
.panel-money {
  background: var(--money-soft);
  border-color: var(--money-line);
}
.panel-warn {
  background: var(--accent-soft);
  border-color: var(--accent-line);
}

.feature-icon {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: var(--brand-3);
  margin-bottom: var(--sp-4);
}
.feature-icon svg { width: 19px; height: 19px; }
.feature-icon.money {
  background: var(--money-soft);
  border-color: var(--money-line);
  color: var(--money);
}
.feature-icon.accent {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

/* ---------------------------------------------------------------------------------------
   7. Stat tiles
   --------------------------------------------------------------------------------------- */

.tile {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  min-width: 0;
}
.tile-label {
  font-size: 0.73rem;
  font-weight: 650;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
  display: flex;
  align-items: center;
  gap: var(--sp-2);
}
.tile-value {
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 680;
  letter-spacing: -0.03em;
  margin-top: var(--sp-2);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}
.tile-value.money { color: var(--money); }
.tile-value.brand { color: var(--brand-3); }
.tile-delta {
  font-size: 0.82rem;
  color: var(--text-mute);
  margin-top: var(--sp-1);
}
.tile-delta.up { color: var(--up); }
.tile-delta.down { color: var(--down); }

/* ---------------------------------------------------------------------------------------
   8. Tables
   --------------------------------------------------------------------------------------- */

/* The wrapper scrolls, never the page. Every wide table in this product is inside one. */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: var(--surface);
}
.card .table-wrap,
.card-flush .table-wrap {
  border: 0;
  border-radius: 0;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 640px;
}
.table-narrow { min-width: 460px; }
.table-wide { min-width: 900px; }

.table thead th {
  position: relative;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--text-mute);
  background: var(--bg-soft);
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.table tbody td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  color: var(--text-dim);
}
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: rgba(255, 255, 255, 0.018); }
.table tbody td.strong,
.table tbody td:first-child { color: var(--text); }
.table tfoot td {
  padding: var(--sp-3) var(--sp-4);
  border-top: 1px solid var(--line-2);
  background: var(--bg-soft);
  font-weight: 650;
  color: var(--text);
}

.table .num,
.table .text-right { text-align: right; font-variant-numeric: tabular-nums; }
.table-compact tbody td,
.table-compact thead th { padding: var(--sp-2) var(--sp-3); }

.table-sticky thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

/* ---------------------------------------------------------------------------------------
   9. Forms
   --------------------------------------------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  min-width: 0;
}

.label {
  font-size: 0.8rem;
  font-weight: 620;
  color: var(--text-dim);
  letter-spacing: -0.005em;
}
.label .req { color: var(--brand-3); }

.input,
.select,
.textarea {
  width: 100%;
  padding: 0.66rem 0.8rem;
  min-height: 44px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.94rem;
  transition: border-color var(--speed) ease, background var(--speed) ease,
    box-shadow var(--speed) ease;
}
.input::placeholder,
.textarea::placeholder { color: var(--text-mute); }
.input:hover,
.select:hover,
.textarea:hover { border-color: var(--line-hi); }
.input:focus,
.select:focus,
.textarea:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--brand-soft);
}
.input[aria-invalid="true"],
.select[aria-invalid="true"] {
  border-color: var(--down-line);
  box-shadow: 0 0 0 3px var(--down-soft);
}
.input[disabled],
.select[disabled],
.textarea[disabled] { opacity: 0.55; cursor: not-allowed; }

.textarea {
  min-height: 96px;
  resize: vertical;
  font-family: inherit;
  line-height: 1.5;
}

.select {
  appearance: none;
  -webkit-appearance: none;
  /* Inline data-URI chevron: an SVG the file carries itself, not a request to anywhere. */
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%237d8aa4' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.7rem center;
  background-size: 16px;
  padding-right: 2.1rem;
}
.select option { background: var(--surface-2); color: var(--text); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-4);
}
.field-full { grid-column: 1 / -1; }

.inline-form {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: flex-end;
}
.inline-form .field { flex: 1 1 180px; }

.hint {
  font-size: 0.79rem;
  color: var(--text-mute);
  line-height: 1.45;
}

.form-error {
  font-size: 0.86rem;
  color: #ff8a95;
  background: var(--down-soft);
  border: 1px solid var(--down-line);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
}

.form-note {
  font-size: 0.86rem;
  color: var(--text-dim);
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-sm);
  padding: var(--sp-3) var(--sp-4);
}

.checkbox {
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  font-size: 0.87rem;
  color: var(--text-dim);
  cursor: pointer;
  line-height: 1.5;
}
.checkbox input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  margin-top: 2px;
  border: 1px solid var(--line-hi);
  border-radius: 5px;
  background: var(--surface-2);
  cursor: pointer;
  position: relative;
}
.checkbox input[type="checkbox"]:checked {
  background: var(--brand);
  border-color: var(--brand);
}
.checkbox input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 5px;
  top: 1px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ---------------------------------------------------------------------------------------
   10. Badges, chips, dots
   --------------------------------------------------------------------------------------- */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-1);
  padding: 0.16rem 0.55rem;
  border-radius: var(--radius-pill);
  font-size: 0.73rem;
  font-weight: 680;
  letter-spacing: 0.02em;
  line-height: 1.5;
  white-space: nowrap;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  color: var(--text-dim);
}
.badge-brand   { background: var(--brand-soft); border-color: var(--brand-line); color: var(--brand-3); }
.badge-up,
.badge-money   { background: var(--money-soft); border-color: var(--money-line); color: var(--money); }
.badge-down    { background: var(--down-soft);  border-color: var(--down-line);  color: #ff8a95; }
.badge-warn,
.badge-accent  { background: var(--accent-soft);border-color: var(--accent-line);color: var(--accent); }
.badge-info    { background: var(--info-soft);  border-color: var(--info-line);  color: var(--info); }
.badge-muted   { background: transparent;       border-color: var(--line-2);     color: var(--text-mute); }

/* Status aliases so a portal or console can render commissions.status straight into a class.
   These, and only these, capitalise: the text in them comes from a database column, not from
   a writer. A sentence-case label anywhere else must survive untouched. */
.badge-pending,
.badge-approved,
.badge-paid,
.badge-active,
.badge-rejected,
.badge-suspended,
.badge-paused { text-transform: capitalize; }

.badge-pending   { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.badge-approved  { background: var(--info-soft);   border-color: var(--info-line);   color: var(--info); }
.badge-paid,
.badge-active    { background: var(--money-soft);  border-color: var(--money-line);  color: var(--money); }
.badge-rejected,
.badge-suspended { background: var(--down-soft);   border-color: var(--down-line);   color: #ff8a95; }
.badge-paused    { background: var(--surface-3);   border-color: var(--line-2);      color: var(--text-mute); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  font-size: 0.82rem;
  color: var(--text-dim);
}
.chip svg { width: 14px; height: 14px; }

.dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--text-mute);
  flex: 0 0 7px;
}
.dot-live {
  background: var(--money);
  box-shadow: 0 0 0 0 rgba(25, 227, 165, 0.55);
  animation: pulse 2.4s infinite;
}
@keyframes pulse {
  70% { box-shadow: 0 0 0 8px rgba(25, 227, 165, 0); }
  100% { box-shadow: 0 0 0 0 rgba(25, 227, 165, 0); }
}

/* ---------------------------------------------------------------------------------------
   11. Modals
   --------------------------------------------------------------------------------------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--sp-4);
  background: rgba(3, 4, 8, 0.78);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  overflow-y: auto;
}
.modal.is-open { display: flex; }

.modal-panel {
  width: 100%;
  max-width: 440px;
  max-height: calc(100vh - 2 * var(--sp-4));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  animation: modal-in 200ms cubic-bezier(0.16, 1, 0.3, 1);
}
.modal-panel-wide { max-width: 620px; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(14px) scale(0.985); }
  to   { opacity: 1; transform: none; }
}

.modal-head {
  padding: var(--sp-5) var(--sp-5) var(--sp-3);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--sp-3);
}
.modal-head h3 { margin-bottom: var(--sp-1); }
.modal-body {
  padding: var(--sp-3) var(--sp-5) var(--sp-5);
  overflow-y: auto;
}
.modal-foot {
  padding: var(--sp-4) var(--sp-5);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.modal-close {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--text-dim);
  cursor: pointer;
}
.modal-close:hover { color: var(--text); border-color: var(--line-hi); }
.modal-close svg { width: 15px; height: 15px; }

/* ---------------------------------------------------------------------------------------
   12. Toasts
   --------------------------------------------------------------------------------------- */

.toast-stack {
  position: fixed;
  right: var(--sp-4);
  bottom: var(--sp-4);
  z-index: 160;
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  max-width: min(360px, calc(100vw - 2 * var(--sp-4)));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 0.88rem;
  color: var(--text);
  animation: toast-in 200ms ease-out;
}
.toast svg { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; }
.toast-ok   { border-color: var(--money-line); color: var(--money); }
.toast-err  { border-color: var(--down-line);  color: #ff8a95; }
.toast-info { border-color: var(--info-line);  color: var(--info); }

@keyframes toast-in {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------------------------
   13. Small components
   --------------------------------------------------------------------------------------- */

.kv {
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  padding: var(--sp-2) 0;
  border-bottom: 1px dashed var(--line);
  font-size: 0.88rem;
}
.kv:last-child { border-bottom: 0; }
.kv > span:first-child { color: var(--text-mute); }
.kv > span:last-child { color: var(--text); font-weight: 600; text-align: right; }

.code {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  padding: 0.1rem 0.38rem;
  color: var(--brand-3);
  word-break: break-all;
}

.code-wrap {
  position: relative;
  background: var(--bg-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  overflow-x: auto;
}
.code-wrap pre {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.65;
  color: var(--text-dim);
  white-space: pre;
}
.code-wrap .k { color: var(--brand-3); }
.code-wrap .s { color: var(--money); }
.code-wrap .c { color: var(--text-mute); }

.kbd {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  padding: 0.1rem 0.35rem;
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: var(--radius-xs);
  background: var(--surface-2);
  color: var(--text-dim);
}

.steps { display: grid; gap: var(--sp-4); counter-reset: step; }
.step {
  position: relative;
  padding: var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: var(--brand-3);
  font-size: 0.82rem;
  font-weight: 700;
  margin-bottom: var(--sp-3);
}
.step h4 { margin-bottom: var(--sp-2); }
.step p { font-size: 0.9rem; color: var(--text-dim); }

.faq details {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  margin-bottom: var(--sp-3);
  overflow: hidden;
}
.faq details[open] { border-color: var(--line-hi); }
.faq summary {
  padding: var(--sp-4) var(--sp-5);
  cursor: pointer;
  font-weight: 620;
  font-size: 0.97rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.15rem;
  color: var(--text-mute);
  font-weight: 400;
  line-height: 1;
  flex: 0 0 auto;
}
.faq details[open] summary::after { content: "\2212"; }
.faq summary:hover { background: var(--surface-2); }
.faq .faq-body {
  padding: 0 var(--sp-5) var(--sp-5);
  color: var(--text-dim);
  font-size: 0.92rem;
}

.empty {
  padding: var(--sp-7) var(--sp-5);
  text-align: center;
  color: var(--text-mute);
  font-size: 0.92rem;
}
.empty svg {
  width: 34px;
  height: 34px;
  margin: 0 auto var(--sp-3);
  color: var(--line-hi);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--line-hi);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

.skeleton {
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 50%, var(--surface-2) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.3s linear infinite;
  border-radius: var(--radius-xs);
  min-height: 12px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

.progress {
  height: 6px;
  border-radius: var(--radius-pill);
  background: var(--surface-3);
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand-2), var(--brand-3));
}
.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: var(--text-mute);
  margin-top: var(--sp-2);
}

/* The qualification cell in the referrals table. The bar needs a floor width or it collapses
   to a sliver next to longer columns and stops reading as progress at all. */
.t-progress {
  min-width: 132px;
}
.t-progress .progress {
  margin-bottom: var(--sp-1);
}

.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--line);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.tab {
  padding: var(--sp-3) var(--sp-4);
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  color: var(--text-mute);
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover { color: var(--text-dim); }
.tab.is-active { color: var(--text); border-bottom-color: var(--brand); }

/* Portal / console shell, so the two app pages share one frame. */
.app-shell {
  display: grid;
  grid-template-columns: 232px minmax(0, 1fr);
  min-height: calc(100vh - var(--nav-h));
}
.sidebar {
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
  padding: var(--sp-5) var(--sp-3);
  display: flex;
  flex-direction: column;
  gap: var(--sp-1);
}
.sidebar a {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  font-size: 0.9rem;
  font-weight: 560;
}
.sidebar a:hover { background: var(--surface-2); color: var(--text); }
.sidebar a.is-active {
  background: var(--brand-soft);
  color: var(--brand-3);
  box-shadow: inset 2px 0 0 var(--brand);
}
.sidebar svg { width: 17px; height: 17px; }
.app-main { padding: var(--sp-6) var(--sp-5); min-width: 0; }

/* ---------------------------------------------------------------------------------------
   14. Utilities
   --------------------------------------------------------------------------------------- */

.muted { color: var(--text-dim); }
.mute-2 { color: var(--text-mute); }
.strong { color: var(--text); font-weight: 620; }
.up { color: var(--up); }
.down { color: var(--down); }
.warn { color: var(--warn); }
.info { color: var(--info); }
.money-text { color: var(--money); }
.brand-text { color: var(--brand-3); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-variant-numeric: tabular-nums; }
.small { font-size: 0.87rem; }
.tiny { font-size: 0.78rem; }
.upper { text-transform: uppercase; letter-spacing: 0.08em; }
.center { text-align: center; }
.text-right { text-align: right; }
.nowrap { white-space: nowrap; }
.break { word-break: break-all; overflow-wrap: anywhere; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.relative { position: relative; }
.flex-1 { flex: 1 1 auto; min-width: 0; }
.full { width: 100%; }
.hidden { display: none !important; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mt-6 { margin-top: var(--sp-6); }
.mb-0 { margin-bottom: 0; }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }

/* =======================================================================================
   15. Page block — index.html (partner recruitment)
   ======================================================================================= */

.hero {
  position: relative;
  padding: var(--sp-8) 0 var(--sp-7);
  overflow: hidden;
}
/* Two soft light sources rather than an image: no asset to load, no third-party request. */
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  filter: blur(90px);
  pointer-events: none;
  z-index: 0;
}
.hero::before {
  width: 620px;
  height: 620px;
  top: -280px;
  left: -160px;
  background: rgba(124, 104, 255, 0.2);
}
.hero::after {
  width: 480px;
  height: 480px;
  top: 40px;
  right: -220px;
  background: rgba(25, 227, 165, 0.11);
}
.hero > * { position: relative; z-index: 1; }

.hero-grid {
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: var(--sp-7);
  align-items: center;
}

.hero h1 { margin-bottom: var(--sp-4); }
.hero h1 .grad {
  background: linear-gradient(100deg, var(--brand-3) 0%, var(--money) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-cta {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  margin-top: var(--sp-6);
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-4);
  margin-top: var(--sp-7);
  padding-top: var(--sp-5);
  border-top: 1px solid var(--line);
}
.hero-stat-value {
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.hero-stat-label {
  font-size: 0.76rem;
  color: var(--text-mute);
  margin-top: 2px;
  line-height: 1.35;
}

/* The hero's right-hand card: a labelled sample of the ledger the portal renders. */
.ledger {
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.ledger-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-soft);
  border-bottom: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--text-mute);
}
.ledger-body { padding: var(--sp-4); }
.ledger-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--sp-3);
  align-items: center;
  padding: var(--sp-3) 0;
  border-bottom: 1px dashed var(--line);
}
.ledger-row:last-child { border-bottom: 0; }
.ledger-who { font-size: 0.86rem; color: var(--text); font-weight: 600; }
.ledger-meta {
  font-size: 0.74rem;
  color: var(--text-mute);
  font-family: var(--font-mono);
  margin-top: 2px;
}
.ledger-amt {
  text-align: right;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--money);
}
/* A clawback in money-green would be the exact dishonesty this page claims not to do. */
.ledger-amt.down { color: var(--down); }
.ledger-amt small {
  display: block;
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--text-mute);
  margin-top: 2px;
}
.ledger-foot {
  padding: var(--sp-4);
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-3);
}

.offer-grid { display: grid; gap: var(--sp-4); grid-template-columns: repeat(3, minmax(0, 1fr)); }

.offer {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: var(--sp-6) var(--sp-5) var(--sp-5);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  transition: border-color var(--speed) ease, transform var(--speed) ease;
}
.offer:hover { border-color: var(--line-hi); transform: translateY(-3px); }
.offer.flagship {
  border-color: var(--brand-line);
  background: linear-gradient(180deg, rgba(124, 104, 255, 0.09), var(--surface) 45%);
  box-shadow: var(--glow);
}
.offer-flag {
  position: absolute;
  top: -11px;
  left: var(--sp-5);
  padding: 0.14rem 0.62rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(150deg, var(--brand) 0%, var(--brand-2) 100%);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.offer-name {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.11em;
  text-transform: uppercase;
  color: var(--text-mute);
}
.offer-price {
  font-size: clamp(2rem, 4vw, 2.7rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: var(--sp-3) 0 var(--sp-1);
  line-height: 1;
}
.offer-price .unit {
  font-size: 0.95rem;
  font-weight: 550;
  color: var(--text-mute);
  letter-spacing: -0.01em;
}
.offer-sub { font-size: 0.88rem; color: var(--text-dim); min-height: 2.6em; }
.offer-specs {
  list-style: none;
  padding: 0;
  margin: var(--sp-4) 0 var(--sp-5);
  display: grid;
  gap: var(--sp-2);
  font-size: 0.88rem;
  color: var(--text-dim);
  flex: 1 1 auto;
}
.offer-specs li {
  display: flex;
  gap: var(--sp-2);
  align-items: flex-start;
  margin: 0;
}
.offer-specs svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  margin-top: 4px;
  color: var(--money);
}

.flow {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: var(--sp-3);
  counter-reset: flowstep;
}
.flow-node {
  position: relative;
  padding: var(--sp-4);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.flow-node::after {
  content: "";
  position: absolute;
  top: 50%;
  right: calc(-1 * var(--sp-3) - 1px);
  width: var(--sp-3);
  height: 1px;
  background: var(--line-hi);
}
.flow-node:last-child::after { display: none; }
.flow-icon {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  border: 1px solid var(--brand-line);
  color: var(--brand-3);
  margin-bottom: var(--sp-3);
}
.flow-icon svg { width: 16px; height: 16px; }
.flow-node h4 { font-size: 0.92rem; margin-bottom: var(--sp-1); }
.flow-node p { font-size: 0.81rem; color: var(--text-mute); line-height: 1.5; }
.flow-node .code { font-size: 0.72rem; }

.guarantee {
  display: grid;
  gap: var(--sp-3);
}
.guarantee-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: var(--sp-3);
  align-items: flex-start;
  font-size: 0.92rem;
  color: var(--text-dim);
}
.guarantee-row svg { width: 18px; height: 18px; margin-top: 3px; }
.guarantee-row.yes svg { color: var(--money); }
.guarantee-row.no svg { color: var(--down); }
.guarantee-row b { color: var(--text); font-weight: 620; }

.cta-band {
  background: linear-gradient(140deg, rgba(124, 104, 255, 0.16), rgba(25, 227, 165, 0.08));
  border: 1px solid var(--brand-line);
  border-radius: var(--radius-lg);
  padding: var(--sp-7) var(--sp-6);
  text-align: center;
}

.footer {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  padding: var(--sp-7) 0 var(--sp-5);
  font-size: 0.88rem;
  color: var(--text-mute);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, minmax(0, 1fr));
  gap: var(--sp-6);
  margin-bottom: var(--sp-6);
}
.footer h5 {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: var(--sp-3);
}
.footer-links { display: grid; gap: var(--sp-2); }
.footer-links a { color: var(--text-mute); font-size: 0.88rem; }
.footer-links a:hover { color: var(--text-dim); }
.footer-bottom {
  border-top: 1px solid var(--line);
  padding-top: var(--sp-4);
  display: flex;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
  font-size: 0.8rem;
}
.disclaimer {
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--text-mute);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--sp-4);
  background: var(--surface);
  margin-bottom: var(--sp-5);
}

/* ---------------------------------------------------------------------------------------
   16. Responsive
   --------------------------------------------------------------------------------------- */

@media (max-width: 1080px) {
  .flow { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .flow-node::after { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 940px) {
  .nav-links,
  .nav-actions .btn-desktop-only { display: none; }
  .nav-toggle { display: grid; }
  .nav.is-open .nav-links {
    display: flex;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: var(--sp-3);
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
  }
  .nav.is-open .nav-links a { padding: var(--sp-3) var(--sp-4); border-radius: var(--radius-sm); }
  .nav.is-open .nav-links a:hover { background: var(--surface-2); }
  .nav-mobile-only { display: flex; }

  .hero-grid,
  .split,
  .split-even,
  .split-wide { grid-template-columns: minmax(0, 1fr); gap: var(--sp-6); }
  .offer-grid,
  .grid-3,
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar {
    flex-direction: row;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding: var(--sp-3);
  }
  .sidebar a { white-space: nowrap; }
  .sidebar a.is-active { box-shadow: inset 0 -2px 0 var(--brand); }
}

@media (max-width: 720px) {
  :root { --sp-8: 56px; --sp-7: 36px; }
  .section { padding: var(--sp-7) 0; }
  .container,
  .container-narrow,
  .nav-inner { padding: 0 var(--sp-4); }
  .hero { padding: var(--sp-7) 0 var(--sp-6); }
  .hero-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offer-grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .flow,
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .footer-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .card-body,
  .panel,
  .modal-body,
  .modal-head,
  .modal-foot { padding-left: var(--sp-4); padding-right: var(--sp-4); }
  .cta-band { padding: var(--sp-6) var(--sp-4); }
  .hero-cta .btn { flex: 1 1 100%; }
  .toast-stack { left: var(--sp-3); right: var(--sp-3); max-width: none; }
}

@media (max-width: 400px) {
  body { font-size: 15px; }
  .brand-sub { display: none; }
  .hero-stats { gap: var(--sp-3); }
}

@media print {
  .nav, .toast-stack, .modal, .hero-cta, .cta-band { display: none !important; }
  body { background: #fff; color: #000; }
}
