:root {
  --td-aff-primary: #0357ee;
  --td-aff-secondary: #031335;
  --td-aff-accent: #FBD10D;
  --td-aff-bg: #f4f6fb;
  --td-aff-muted: #64748b;
}

.td-aff-auth-page {
  min-height: 100vh;
  background: var(--td-aff-bg);
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--td-aff-secondary);
  -webkit-font-smoothing: antialiased;
}

.td-aff-auth-grid {
  min-height: 100vh;
}

.td-aff-auth-panel {
  padding: 1.25rem 1rem 2.5rem;
  display: flex;
  justify-content: center;
}

@media (min-width: 992px) {
  .td-aff-auth-panel {
    padding: 2rem 2.5rem 3rem;
  }
}

.td-aff-auth-panel__inner {
  width: 100%;
  max-width: 640px;
}

.td-aff-auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.td-aff-auth-toplink {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--td-aff-primary);
  text-decoration: none;
  white-space: nowrap;
}

.td-aff-auth-toplink:hover {
  color: #0249c9;
  text-decoration: underline;
}

.td-aff-auth-header {
  margin-bottom: 1.25rem;
}

.td-aff-auth-header__title {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--td-aff-secondary);
  margin: 0 0 0.35rem;
}

.td-aff-auth-header__lead {
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--td-aff-muted);
  margin: 0;
}

/* Stepper tabs */
.td-aff-stepper {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-bottom: 1.75rem;
}

@media (min-width: 768px) {
  .td-aff-stepper {
    flex-direction: row;
    gap: 0.5rem;
  }
}

.td-aff-stepper__item {
  flex: 1;
  display: flex;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  opacity: 0.72;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.td-aff-stepper__item.is-active {
  opacity: 1;
  border-color: var(--td-aff-primary);
  box-shadow: 0 0 0 3px rgba(3, 87, 238, 0.12);
}

.td-aff-stepper__item.is-done {
  opacity: 1;
  border-color: #c7d2e3;
}

.td-aff-stepper__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.td-aff-stepper__label {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--td-aff-secondary);
  line-height: 1.25;
}

.td-aff-stepper__fraction {
  font-weight: 800;
  color: var(--td-aff-muted);
  letter-spacing: 0.02em;
}

.td-aff-stepper__item.is-active .td-aff-stepper__fraction {
  color: var(--td-aff-primary);
}

.td-aff-stepper__item.is-done .td-aff-stepper__fraction {
  color: var(--td-aff-primary);
}

.td-aff-stepper__done {
  margin-left: auto;
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--td-aff-primary);
}

.td-aff-stepper__sub {
  font-size: 0.72rem;
  color: var(--td-aff-muted);
  line-height: 1.35;
}

.td-aff-form-card {
  background: #fff;
  border-radius: 20px;
  border: 1px solid #e2e8f0;
  padding: 1.5rem 1.35rem;
  box-shadow: 0 12px 40px rgba(3, 19, 53, 0.06);
}

@media (min-width: 576px) {
  .td-aff-form-card {
    padding: 1.75rem 1.65rem;
  }
}

.td-aff-auth-page .form-label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--td-aff-secondary);
  margin-bottom: 0.35rem;
}

.td-aff-auth-page .form-control,
.td-aff-auth-page .form-select {
  border: 1px solid #cfd8e6;
  border-radius: 12px;
  padding: 0.65rem 0.85rem;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--td-aff-secondary);
  background-color: #fff;
  box-shadow: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.td-aff-auth-page .form-control:focus,
.td-aff-auth-page .form-select:focus {
  border-color: var(--td-aff-primary);
  box-shadow: 0 0 0 3px rgba(3, 87, 238, 0.15);
}

.td-aff-auth-page .form-control::placeholder {
  color: #94a3b8;
}

.td-aff-auth-page .form-text {
  font-size: 0.78rem;
  color: var(--td-aff-muted);
  margin-top: 0.35rem;
}

.td-aff-auth-page .form-check-input {
  border-radius: 6px;
  border-color: #cfd8e6;
}

.td-aff-auth-page .form-check-input:checked {
  background-color: var(--td-aff-primary);
  border-color: var(--td-aff-primary);
}

.td-aff-auth-page .alert-info {
  border-radius: 12px;
  border-color: rgba(3, 87, 238, 0.2);
  background: rgba(3, 87, 238, 0.06);
  color: var(--td-aff-secondary);
}

.td-aff-auth-page a:not(.btn) {
  color: var(--td-aff-primary);
  font-weight: 600;
}

.td-aff-auth-footer-link {
  display: inline-block;
  margin-top: 1.25rem;
  font-size: 0.875rem;
  color: var(--td-aff-muted);
  text-decoration: none;
}

.td-aff-auth-footer-link:hover {
  color: var(--td-aff-primary);
}

.td-aff-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: stretch;
  margin-top: 0.25rem;
}

.td-aff-auth-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  margin: 0;
  font-weight: 700;
}

.td-aff-auth-actions .td-aff-btn-primary {
  flex: 1 1 auto;
}

.td-aff-auth-page .btn-outline-secondary {
  border-radius: 999px;
  border-color: #cfd8e6;
  color: var(--td-aff-secondary);
  font-weight: 600;
  min-height: 3rem;
  display: inline-flex;
  align-items: center;
}

.td-aff-hero {
  background: linear-gradient(160deg, var(--td-aff-secondary) 0%, #0a2a6b 55%, var(--td-aff-primary) 100%);
  color: #fff;
  min-height: 280px;
  display: flex;
  align-items: flex-end;
  padding: 2rem;
  position: relative;
  overflow: hidden;
}

.td-aff-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(3, 87, 238, 0.35) 0%, transparent 50%);
  pointer-events: none;
}

@media (min-width: 992px) {
  .td-aff-hero {
    min-height: 100vh;
    padding: 3rem;
    align-items: center;
  }
}

.td-aff-hero__content {
  position: relative;
  z-index: 1;
  max-width: 22rem;
}

.td-aff-hero__eyebrow {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

.td-aff-hero__title {
  font-size: clamp(1.65rem, 2.8vw, 2.15rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff !important;
  margin-bottom: 0.85rem;
}

.td-aff-hero__lead {
  font-size: 0.98rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
}

.td-aff-verify-input {
  letter-spacing: 0.35em;
  font-weight: 700;
  font-size: 1.35rem !important;
  text-align: center;
}

.td-aff-btn-primary {
  background: var(--td-aff-primary);
  border-color: var(--td-aff-primary);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  padding: 0.75rem 1.35rem;
}

.td-aff-btn-primary:hover {
  background: #0249c9;
  border-color: #0249c9;
  color: #fff;
}

.td-aff-auth-page button[type="submit"]:disabled,
.td-aff-auth-page input[type="submit"]:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.td-aff-btn-secondary-navy {
  background: var(--td-aff-secondary);
  border-color: var(--td-aff-secondary);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
}

.td-aff-sidebar-code {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 12px;
  background: rgba(3, 87, 238, 0.08);
  border: 1px dashed rgba(3, 87, 238, 0.35);
}

.td-aff-sidebar-code__label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--td-aff-muted);
  margin-bottom: 0.35rem;
}

.td-aff-sidebar-code__value {
  font-weight: 700;
  color: var(--td-aff-secondary);
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: break-word;
}

.td-aff-wallet-card {
  background: var(--td-aff-secondary);
  color: #fff;
  border-radius: 18px;
  padding: 1.5rem 1.5rem 1.25rem;
}

.td-aff-wallet-card__amount {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 800;
  line-height: 1.1;
}

.td-aff-onboard-step {
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 1rem;
  height: 100%;
  background: #fff;
}

.td-aff-onboard-step.is-done {
  border-color: rgba(3, 87, 238, 0.35);
  background: rgba(3, 87, 238, 0.04);
}

.td-aff-complete-card {
  margin-top: 0.5rem;
}

.td-aff-complete-card__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(3, 87, 238, 0.12);
  color: var(--td-aff-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 1rem;
}

.td-aff-complete-card .input-group .form-control {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}

.td-aff-complete-card .input-group .btn {
  border-radius: 0 12px 12px 0;
  padding-left: 1rem;
  padding-right: 1rem;
}

.td-aff-ref-box {
  text-align: left;
  background: rgba(3, 87, 238, 0.06);
  border-radius: 12px;
  padding: 1rem;
  margin: 1.25rem 0;
}

/* —— Referral programme landing (public) —— */
.td-referral-page {
  color: var(--td-aff-secondary);
}

.td-referral-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--td-aff-secondary) 0%, #0a3d8f 52%, var(--td-aff-primary) 100%);
  color: #fff;
  margin-top: 0 !important;
  padding: 10.5rem 0 4.5rem;
}

@media (max-width: 991px) {
  .td-referral-hero {
    padding-top: 9rem;
  }
}

@media (max-width: 575px) {
  .td-referral-hero {
    padding-top: 8rem;
    padding-bottom: 3.25rem;
  }
}

.td-referral-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 85% 15%, rgba(3, 87, 238, 0.35) 0%, transparent 45%),
    radial-gradient(circle at 8% 85%, rgba(255, 255, 255, 0.07) 0%, transparent 40%);
  pointer-events: none;
}

.td-referral-hero .container {
  position: relative;
  z-index: 1;
}

/* Theme h1 color override */
.td-referral-page .td-referral-hero h1,
.td-referral-page .td-referral-hero p,
.td-referral-page .td-referral-hero .td-referral-hero__lead,
.td-referral-page .td-referral-hero .td-referral-hero__note {
  color: #fff;
}

.td-referral-hero__eyebrow {
  display: inline-block;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  margin-bottom: 1.25rem;
}

.td-referral-hero__title {
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
  max-width: 22rem;
}

.td-referral-hero__title-line {
  display: inline-block;
  white-space: nowrap;
}

@media (max-width: 399px) {
  .td-referral-hero__title-line {
    white-space: normal;
  }
}

.td-referral-hero__lead {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  line-height: 1.65;
  max-width: 36rem;
  opacity: 0.95;
  margin-bottom: 1.75rem;
}

.td-referral-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.td-referral-hero__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  margin: 0 !important;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.25;
  white-space: nowrap;
}

.td-referral-hero__note {
  font-size: 0.875rem;
  opacity: 0.8;
  margin: 0;
}

.td-referral-hero__panel {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 18px;
  padding: 1.35rem 1.5rem;
  backdrop-filter: blur(8px);
}

.td-referral-hero__panel-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.85;
  margin-bottom: 0.75rem;
}

.td-referral-hero__stat {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.td-referral-hero__stat:last-child {
  margin-bottom: 0;
}

.td-referral-hero__stat-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(3, 87, 238, 0.35);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-weight: 800;
  font-size: 0.9rem;
}

.td-aff-btn-outline-light {
  border: 2px solid rgba(255, 255, 255, 0.9);
  color: #fff;
  font-weight: 700;
  border-radius: 999px;
  background: transparent;
  box-sizing: border-box;
}

.td-aff-btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

.td-aff-btn-primary.btn-lg,
.td-aff-btn-outline-light.btn-lg {
  border-radius: 999px;
}

.td-referral-section {
  padding: 4rem 0;
}

.td-referral-section--muted {
  background: var(--td-aff-bg);
}

.td-referral-section__header {
  max-width: 40rem;
  margin: 0 auto 2.5rem;
  text-align: center;
}

.td-referral-section__eyebrow {
  color: var(--td-aff-primary);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.td-referral-section__title {
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  color: var(--td-aff-secondary);
  margin-bottom: 0.65rem;
}

.td-referral-section__lead {
  color: var(--td-aff-muted);
  margin: 0;
  line-height: 1.6;
}

.td-referral-step-card {
  height: 100%;
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  padding: 1.5rem 1.35rem;
  box-shadow: 0 8px 24px rgba(3, 19, 53, 0.05);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.td-referral-step-card:hover {
  transform: translateY(-3px);
  border-color: rgba(3, 87, 238, 0.25);
  box-shadow: 0 14px 32px rgba(3, 87, 238, 0.1);
}

.td-referral-step-card__num {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(3, 87, 238, 0.1);
  color: var(--td-aff-primary);
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}

.td-referral-step-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--td-aff-secondary);
  margin-bottom: 0.5rem;
}

.td-referral-step-card p {
  color: var(--td-aff-muted);
  font-size: 0.95rem;
  line-height: 1.55;
  margin: 0;
}

.td-referral-audience {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  justify-content: center;
  margin-top: 1.5rem;
}

.td-referral-audience__pill {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--td-aff-secondary);
}

.td-referral-cta-band {
  background: var(--td-aff-secondary);
  color: #fff;
  border-radius: 20px;
  padding: 2.5rem 2rem;
  text-align: center;
  margin-top: 2rem;
}

.td-referral-cta-band h2 {
  color: #fff;
  font-size: clamp(1.35rem, 3vw, 1.85rem);
  font-weight: 800;
  margin-bottom: 0.65rem;
}

.td-referral-cta-band__lead {
  color: rgba(255, 255, 255, 0.88);
  max-width: 32rem;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

.td-referral-cta-band__actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  width: 100%;
}

.td-referral-cta-band__actions .td-aff-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  margin: 0;
  padding: 0.75rem 2rem;
}

.td-referral-cta-band__signin {
  margin: 0;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.5;
  text-align: center;
}

.td-referral-cta-band__signin a {
  color: #fff;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.td-referral-cta-band__signin a:hover {
  color: rgba(255, 255, 255, 0.9);
}

.td-referral-trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem 2rem;
  justify-content: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid #e8edf5;
}

.td-referral-trust-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--td-aff-muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.td-referral-trust-item svg {
  color: var(--td-aff-primary);
  flex-shrink: 0;
}

.dashboard-nav__menu-list .menu-item.active > a,
.dashboard-nav__menu-list li.active > a {
  color: var(--td-aff-primary);
}

/* Brand kit */
.td-aff-kit-hero {
  background: linear-gradient(135deg, var(--td-aff-secondary) 0%, #0a2a6e 100%);
  color: #fff;
  border-radius: 16px;
  padding: 1.75rem 1.5rem;
}

.td-aff-kit-hero__badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  margin-bottom: 0.75rem;
}

.td-aff-kit-hero__title,
.td-aff-kit-hero h2.td-aff-kit-hero__title {
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  margin: 0 0 0.75rem;
  color: #fff;
}

.td-aff-kit-hero__lead {
  margin: 0;
  opacity: 0.9;
  max-width: 52rem;
  line-height: 1.55;
}

.td-aff-kit-card {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
}

.td-aff-kit-card__title {
  font-weight: 700;
  color: var(--td-aff-secondary);
  margin-bottom: 0.5rem;
}

.td-aff-kit-link-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-top: 1px solid #eef2f8;
}

.td-aff-kit-link-row:first-of-type {
  border-top: none;
}

.td-aff-graphic-card {
  border: 1px solid #e8edf5;
  border-radius: 12px;
  overflow: hidden;
  height: 100%;
  background: #fff;
}

.td-aff-graphic-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.td-aff-graphic-card__body {
  padding: 0.75rem;
}

.td-aff-caption-card {
  border: 1px solid #e8edf5;
  border-radius: 10px;
  padding: 0.85rem;
  margin-bottom: 0.75rem;
  background: #fafbfd;
}

.td-aff-caption-card__text {
  white-space: pre-wrap;
  line-height: 1.5;
}

.td-aff-offer-row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-top: 1px solid #eef2f8;
}

.td-aff-offer-row:first-of-type {
  border-top: none;
}

.td-aff-offer-row__amount {
  font-weight: 700;
  color: var(--td-aff-secondary);
  white-space: nowrap;
}

.td-aff-logo-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.65rem;
  border: 1px solid #eef2f8;
  border-radius: 10px;
}

.td-aff-logo-card img {
  max-width: 72px;
  max-height: 48px;
  object-fit: contain;
}

.td-aff-color-swatch {
  text-align: center;
  min-width: 72px;
}

.td-aff-color-swatch span {
  display: block;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  margin: 0 auto 0.35rem;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.td-aff-rules {
  list-style: none;
  padding-left: 0;
}

.td-aff-rules li {
  padding-left: 1.35rem;
  position: relative;
  margin-bottom: 0.45rem;
}

.td-aff-rules--ok li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: #16a34a;
  font-weight: 700;
}

.td-aff-rules--no li::before {
  content: "✕";
  position: absolute;
  left: 0;
  color: #dc2626;
  font-weight: 700;
}

.td-aff-page-head__title {
  font-size: clamp(1.35rem, 2.5vw, 1.65rem);
  font-weight: 700;
  color: var(--td-aff-secondary);
  margin: 0 0 0.35rem;
}

.td-aff-page-head__lead {
  margin: 0;
  color: var(--td-aff-muted);
  font-size: 0.95rem;
  max-width: 40rem;
}

.td-aff-performance .container--wide {
  max-width: 1120px;
}

.td-aff-panel {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(3, 19, 53, 0.04);
  overflow: hidden;
}

.td-aff-panel__header {
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid #eef2f8;
  background: #fafbfd;
}

.td-aff-panel__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--td-aff-secondary);
}

.td-aff-panel__body {
  padding: 1.35rem;
}

.td-aff-subsection {
  border-top: 1px solid #eef2f8;
}

.td-aff-subsection__title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--td-aff-muted);
  margin: 0 0 1rem;
}

.td-aff-funnel {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: 0.5rem 0.35rem;
  align-items: stretch;
}

@media (max-width: 991px) {
  .td-aff-funnel {
    grid-template-columns: 1fr;
  }
  .td-aff-funnel__arrow {
    display: none;
  }
}

.td-aff-funnel__step {
  background: #f8fafc;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  padding: 1rem;
  text-align: center;
}

.td-aff-funnel__step--accent {
  background: rgba(3, 87, 238, 0.06);
  border-color: rgba(3, 87, 238, 0.2);
}

.td-aff-funnel__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--td-aff-muted);
  margin-bottom: 0.25rem;
}

.td-aff-funnel__value {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--td-aff-secondary);
  line-height: 1.1;
}

.td-aff-funnel__hint {
  display: block;
  font-size: 0.75rem;
  color: var(--td-aff-muted);
  margin-top: 0.35rem;
}

.td-aff-funnel__arrow {
  width: 24px;
  align-self: center;
  height: 2px;
  background: linear-gradient(90deg, #cbd5e1, var(--td-aff-primary));
  position: relative;
}

.td-aff-funnel__arrow::after {
  content: "";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  border: 5px solid transparent;
  border-left-color: var(--td-aff-primary);
}

.td-aff-stat-tile {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  padding: 1.1rem 1.2rem;
  height: 100%;
}

.td-aff-stat-tile__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--td-aff-muted);
  margin-bottom: 0.35rem;
}

.td-aff-stat-tile__value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--td-aff-secondary);
  line-height: 1.2;
}

.td-aff-currency {
  font-variant-numeric: tabular-nums;
}

.td-aff-stat-tile--green { background: #ecfdf5; border-color: #bbf7d0; }
.td-aff-stat-tile--orange { background: #fff7ed; border-color: #fed7aa; }
.td-aff-stat-tile--blue { background: #eff6ff; border-color: #bfdbfe; }
.td-aff-stat-tile--muted { background: #f8fafc; }

.td-aff-empty-state {
  text-align: center;
  padding: 2.5rem 1.5rem;
  background: #f8fafc;
  border: 1px dashed #d1dae6;
  border-radius: 12px;
}

.td-aff-empty-state--compact {
  padding: 1.75rem 1.25rem;
}

.td-aff-empty-state__title {
  font-weight: 700;
  color: var(--td-aff-secondary);
  margin: 0 0 0.5rem;
}

.td-aff-empty-state__text {
  color: var(--td-aff-muted);
  font-size: 0.9rem;
  max-width: 28rem;
  margin: 0 auto 1rem;
}

.td-aff-chart-wrap {
  background: #f8fafc;
  border: 1px solid #e8edf5;
  border-radius: 12px;
  padding: 1rem 1rem 0.75rem;
}

.td-aff-activity-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  min-height: 160px;
  overflow-x: auto;
  padding: 0 0.25rem 0.5rem;
  -webkit-overflow-scrolling: touch;
}

.td-aff-activity-chart__col {
  flex: 1 0 14px;
  min-width: 14px;
  max-width: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 140px;
}

.td-aff-activity-chart__bars {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 2px;
  flex: 1;
  width: 100%;
  min-height: 100px;
}

.td-aff-activity-chart__bar {
  width: 4px;
  border-radius: 3px 3px 0 0;
  min-height: 0;
  transition: height 0.2s ease;
}

.td-aff-activity-chart__bar--clicks { background: #64748b; }
.td-aff-activity-chart__bar--apps { background: #dc2626; }
.td-aff-activity-chart__bar--enrol { background: #0ea5e9; }

.td-aff-activity-chart__label {
  font-size: 0.65rem;
  color: var(--td-aff-muted);
  white-space: nowrap;
  margin-top: 0.35rem;
  line-height: 1;
  writing-mode: horizontal-tb;
}

.td-aff-activity-chart__label--spacer {
  visibility: hidden;
  height: 0.65rem;
}

.td-aff-chart-legend {
  font-size: 0.8rem;
  color: var(--td-aff-muted);
}

.td-aff-chart-legend__dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.td-aff-chart-legend__dot--clicks { background: #64748b; }
.td-aff-chart-legend__dot--apps { background: #dc2626; }
.td-aff-chart-legend__dot--enrol { background: #0ea5e9; }

.td-aff-table-wrap {
  border: 1px solid #e8edf5;
  border-radius: 12px;
  overflow: hidden;
}

.td-aff-table {
  margin: 0;
}

.td-aff-table thead th {
  background: #f8fafc;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--td-aff-muted);
  border-bottom: 1px solid #e8edf5;
  padding: 0.75rem 1rem;
}

.td-aff-table tbody td {
  padding: 0.85rem 1rem;
  vertical-align: middle;
  border-bottom: 1px solid #f1f5f9;
}

.td-aff-sidebar-code__value {
  font-weight: 700;
  color: var(--td-aff-secondary);
  font-size: 0.78rem;
  line-height: 1.35;
  word-break: break-word;
  hyphens: auto;
}

/* —— MIVA-style affiliate shell (Performance + inner pages) —— */
.td-aff-portal .dashboard-main-wrapper {
  background: #eef2f7;
}

.td-aff-portal .dashboard-content {
  padding-top: 28px;
}

.td-aff-content-width {
  max-width: 1140px;
}

.td-aff-h1 {
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--td-aff-secondary);
  margin: 0;
}

.td-aff-kicker {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--td-aff-muted);
  margin: 0;
}

.td-aff-miva-card.dashboard-content-box {
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 2px 8px rgba(3, 19, 53, 0.04);
  padding: 1.5rem 1.75rem;
}

.td-aff-miva-card .dashboard-content-box__title {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--td-aff-secondary);
  margin-bottom: 0;
}

.td-aff-metric-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 1rem 0.75rem;
  text-align: center;
}

.td-aff-metric-box--highlight {
  background: rgba(3, 87, 238, 0.06);
  border-color: rgba(3, 87, 238, 0.22);
}

.td-aff-metric-box__label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--td-aff-muted);
  margin-bottom: 0.35rem;
}

.td-aff-metric-box__value {
  font-size: 1.85rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--td-aff-secondary);
  font-variant-numeric: tabular-nums;
}

.td-aff-metric-box__hint {
  font-size: 0.72rem;
  color: var(--td-aff-muted);
  margin-top: 0.4rem;
}

.td-aff-divider {
  border-top: 1px solid #e8edf5;
}

.td-aff-empty-box {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

.td-aff-empty-box--left {
  text-align: left;
  padding: 1.25rem 1.35rem;
}

.td-aff-empty-box--left .td-aff-empty-box__actions {
  margin-top: 0.75rem;
}

.td-aff-empty-box--left .td-aff-empty-box__actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.td-aff-chart-panel {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

.td-aff-wallet-tile {
  border-radius: 12px;
  padding: 1.1rem 1.15rem;
  border: 1px solid transparent;
}

.td-aff-wallet-tile__label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #475569;
  margin-bottom: 0.35rem;
}

.td-aff-wallet-tile__value {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--td-aff-secondary);
  font-variant-numeric: tabular-nums;
}

.td-aff-wallet-tile--green {
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.td-aff-wallet-tile--amber {
  background: #fffbeb;
  border-color: #fde68a;
}

.td-aff-wallet-tile--blue {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.td-aff-wallet-tile--slate {
  background: #f1f5f9;
  border-color: #e2e8f0;
}

.td-aff-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
  vertical-align: middle;
}

.td-aff-dot--clicks { background: #64748b; }
.td-aff-dot--apps { background: #dc2626; }
.td-aff-dot--enrol { background: #0ea5e9; }

.td-aff-compact-topbar {
  background: #fff;
  border-bottom: 1px solid #e8edf5;
}

/* Brand kit — MIVA-style shell */
.td-aff-brand-kit .td-aff-h1 {
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 800;
  color: var(--td-aff-secondary);
}

.td-aff-kit-hero--miva {
  padding: 2rem 1.75rem 1.75rem;
  box-shadow: 0 8px 24px rgba(3, 19, 53, 0.12);
}

.td-aff-kit-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 0.85rem;
  margin-top: 1.35rem;
  padding-top: 1.15rem;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.td-aff-kit-hero__copy {
  background: #fff;
  color: var(--td-aff-secondary);
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 0.55rem 1.15rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.td-aff-kit-hero__copy:hover {
  background: #f1f5f9;
  color: var(--td-aff-secondary);
}

.td-aff-kit-hero__code {
  font-size: 0.88rem;
  opacity: 0.92;
}

.td-aff-kit-hero__share {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  width: 100%;
}

@media (min-width: 768px) {
  .td-aff-kit-hero__share {
    width: auto;
    margin-left: auto;
  }
}

.td-aff-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.4rem 0.65rem;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid transparent;
  color: #fff;
}

.td-aff-share-btn--sm {
  font-size: 0.68rem;
  padding: 0.32rem 0.5rem;
  border-radius: 6px;
}

.td-aff-share-btn--wa { background: #25d366; }
.td-aff-share-btn--fb { background: #1877f2; }
.td-aff-share-btn--x { background: #0f1419; }
.td-aff-share-btn--in { background: #0a66c2; }

.td-aff-share-btn:hover {
  filter: brightness(1.05);
  color: #fff;
}

.td-aff-kit-section__head {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.td-aff-kit-section__icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eff6ff;
  border-radius: 10px;
  font-size: 1.1rem;
  line-height: 1;
}

.td-aff-kit-section__title {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--td-aff-secondary);
  margin: 0;
}

.td-aff-kit-link-row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.td-aff-kit-copy-btn,
.td-aff-kit-download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.td-aff-kit-search {
  border-radius: 999px;
  max-width: 100%;
}

.td-aff-kit-empty-panel {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  padding: 1.25rem 1.35rem 1.35rem;
}

.td-aff-graphic-card--placeholder .td-aff-graphic-card__placeholder {
  height: 140px;
  background: linear-gradient(135deg, #e2e8f0 0%, #f1f5f9 100%);
}

.td-aff-skeleton-line {
  height: 10px;
  background: #e2e8f0;
  border-radius: 4px;
  margin-bottom: 0.45rem;
}

.td-aff-skeleton-line--short {
  width: 55%;
}

.td-aff-caption-card__label {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--td-aff-muted);
}

.td-aff-caption-card--starter {
  border-color: rgba(3, 87, 238, 0.25);
  background: rgba(3, 87, 238, 0.04);
}

.td-aff-copy-toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--td-aff-secondary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.65rem 1.15rem;
  border-radius: 999px;
  box-shadow: 0 8px 24px rgba(3, 19, 53, 0.2);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 9999;
}

.td-aff-copy-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.td-referral-commission-card {
  background: #fff;
  border: 1px solid #e8edf5;
  border-radius: 16px;
  padding: 1.5rem 1.35rem;
  text-align: center;
  height: 100%;
  box-shadow: 0 8px 24px rgba(3, 19, 53, 0.05);
}

.td-referral-commission-card__label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--td-aff-muted);
  margin-bottom: 0.5rem;
}

.td-referral-commission-card__amount {
  font-size: clamp(1.75rem, 3vw, 2.25rem);
  font-weight: 800;
  color: var(--td-aff-secondary);
  margin-bottom: 0.35rem;
}

.td-referral-section--legal {
  padding-bottom: 5rem;
}

.td-referral-legal-list {
  max-width: 40rem;
  margin: 0 auto 1.25rem;
  padding-left: 1.15rem;
  color: var(--td-aff-muted);
  line-height: 1.6;
}

.td-referral-section--legal .td-referral-section__header {
  margin-bottom: 1.5rem;
}
