body:has(main .affiliate-page) {
  position: relative;
  isolation: isolate;
}
body:has(main .affiliate-page)::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0 0 auto;
  height: clamp(460px, 38vw, 580px);
  pointer-events: none;
  background:
    radial-gradient(55% 70% at 50% 0%, rgba(37, 99, 235, .24), transparent 72%),
    linear-gradient(rgba(90, 169, 255, .05) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, rgba(90, 169, 255, .05) 1px, transparent 1px) 0 0 / 48px 100%;
  -webkit-mask-image: linear-gradient(#000 35%, transparent 95%);
  mask-image: linear-gradient(#000 35%, transparent 95%);
}
.affiliate-page {
  --af-line: #233954;
  --af-surface: #111f33;
  --af-text: #eef4ff;
  --af-muted: #9eb5cf;
  width: min(100% - 32px, 1140px);
  margin: 0 auto;
  padding: clamp(28px, 4.5vw, 56px) 0 clamp(44px, 6vw, 76px);
  display: grid;
  gap: clamp(28px, 4vw, 44px);
  color: var(--af-text);
  overflow-wrap: anywhere;
}
.affiliate-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 12px;
  border: 1px solid #315480;
  border-radius: 999px;
  background: rgba(16, 36, 61, .85);
  color: #8fb9ef;
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.affiliate-eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: #66dbb7;
  box-shadow: 0 0 8px rgba(102, 219, 183, .7);
}
.affiliate-page h1 {
  font-size: clamp(1.9rem, 4.2vw, 3.1rem);
  line-height: 1.14;
  letter-spacing: -.02em;
  margin: 0 0 14px;
  text-wrap: balance;
  color: #f4f8ff;
}
.affiliate-page h2 {
  font-size: clamp(1.28rem, 2.1vw, 1.65rem);
  letter-spacing: -.015em;
  margin: 0 0 8px;
  color: #f2f7ff;
}
.affiliate-page p, .affiliate-page li { color: var(--af-muted); line-height: 1.62; margin: 0; }
.affiliate-page a { color: #8fb9ef; }
.affiliate-page :focus-visible { outline: 2px solid #8fb9ef; outline-offset: 3px; }

/* Hero */
.affiliate-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  align-items: center;
  gap: clamp(24px, 4vw, 48px);
  padding: clamp(22px, 3.8vw, 40px);
  border: 1px solid #2b476b;
  border-radius: 20px;
  background: radial-gradient(110% 130% at 94% 0%, rgba(52, 121, 213, .22), transparent 56%),
              radial-gradient(80% 90% at 0% 100%, rgba(102, 219, 183, .07), transparent 60%),
              linear-gradient(180deg, #13253d, #0d192a);
  box-shadow: 0 16px 40px rgba(3, 9, 18, .34);
}
.affiliate-hero p { max-width: 56ch; font-size: clamp(.96rem, 1.6vw, 1.08rem); }
.affiliate-actions { display: flex; gap: 12px 14px; flex-wrap: wrap; margin-top: 22px; align-items: center; }
.affiliate-page .affiliate-primary {
  border: 1px solid #5793dc;
  border-radius: 10px;
  background: linear-gradient(145deg, #3479d5, #2152a0);
  color: #fff;
  padding: 10px 20px;
  min-height: 44px;
  font-weight: 650;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 6px 18px rgba(33, 82, 160, .34);
  transition: filter .15s ease, transform .12s ease;
}
.affiliate-page .affiliate-primary:hover { filter: brightness(1.09); transform: translateY(-1px); }
.affiliate-page .affiliate-secondary-btn {
  border: 1px solid #2e4b6e;
  border-radius: 10px;
  background: rgba(16, 33, 55, .85);
  color: #d6e6fa;
  padding: 10px 18px;
  min-height: 44px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}
.affiliate-page .affiliate-secondary-btn:hover { border-color: #5fa3f7; background: #162c48; }
.affiliate-page .affiliate-text-link { font-size: .9rem; font-weight: 600; text-decoration: none; color: #9ec5f5; padding-inline: 4px; }
.affiliate-page .affiliate-text-link:hover { text-decoration: underline; }

/* Hero 2x2 Stat Tiles */
.affiliate-rules {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.affiliate-rules div {
  padding: 16px;
  border: 1px solid #243b57;
  border-radius: 14px;
  background: rgba(10, 20, 34, .78);
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  gap: 5px;
}
.affiliate-rules dt { color: #8da6c3; font-size: .82rem; line-height: 1.35; }
.affiliate-rules dd {
  margin: 0;
  color: #f2f7ff;
  font-size: clamp(1.3rem, 2.1vw, 1.62rem);
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.015em;
}
.affiliate-rules div:first-child dd { color: #66dbb7; }
.affiliate-rules div:nth-child(2) dd { color: #7cb8ff; }

/* Permanent Tiers */
.affiliate-tiers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}
.affiliate-tier-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  border: 1px solid var(--af-line);
  border-radius: 16px;
  padding: clamp(18px, 2.4vw, 24px);
  background: linear-gradient(180deg, #122238, #0e1a2b);
  box-shadow: 0 10px 26px rgba(3, 9, 18, .22);
  overflow: hidden;
}
.affiliate-tier-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #2b6cd1, #5fa3f7);
  opacity: .55;
}
.affiliate-tier-pro { border-color: #2f5585; }
.affiliate-tier-pro::before { opacity: .85; }
.affiliate-tier-elite {
  border-color: #2e675a;
  background: radial-gradient(100% 100% at 100% 0%, rgba(102, 219, 183, .12), transparent 60%), linear-gradient(180deg, #13263d, #0e1a2b);
}
.affiliate-tier-elite::before { background: linear-gradient(90deg, #3479d5, #66dbb7); opacity: 1; }
.affiliate-tier-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.affiliate-tier-head h3 { margin: 0; font-size: 1.06rem; color: #f2f7ff; font-weight: 700; }
.affiliate-tier-head b { font-size: 1.7rem; font-weight: 800; color: #7cb8ff; font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.affiliate-tier-elite .affiliate-tier-head b { color: #66dbb7; }
.affiliate-tier-badge {
  align-self: flex-start;
  margin-bottom: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #2e4b6e;
  background: #0c192a;
  color: #9bc4f7;
  font-size: .76rem;
  font-weight: 600;
}
.affiliate-tier-elite .affiliate-tier-badge { border-color: #245e50; background: #0e2622; color: #66dbb7; }
.affiliate-tier-card p { font-size: .92rem; }

/* How It Works Step Cards */
.affiliate-steps { display: grid; gap: 16px; }
.affiliate-steps ol {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin: 0;
  padding: 0;
  counter-reset: af-step;
  align-items: stretch;
}
.affiliate-steps li {
  position: relative;
  counter-increment: af-step;
  list-style: none;
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 24px 22px;
  border: 1px solid #243b57;
  border-radius: 16px;
  background: radial-gradient(90% 90% at 100% 0%, rgba(52, 121, 213, .12), transparent 60%),
              linear-gradient(180deg, #122238, #0e1a2b);
  box-shadow: 0 10px 26px rgba(3, 9, 18, .24);
  font-size: .94rem;
  color: #b2c5dc;
  line-height: 1.66;
  overflow: hidden;
  transition: border-color .16s ease, transform .14s ease, box-shadow .16s ease;
}
.affiliate-steps li:hover {
  border-color: #4680cf;
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(3, 9, 18, .32);
}
.affiliate-steps li::before {
  content: "0" counter(af-step);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  margin-bottom: 14px;
  border-radius: 10px;
  border: 1px solid #2f5482;
  background: linear-gradient(145deg, #163052, #10223b);
  color: #8fb9ef;
  font-size: .86rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  box-shadow: inset 0 1px 0 rgba(143, 185, 239, .22);
}
.affiliate-steps li::after {
  content: "";
  position: absolute;
  inset: 0 0 auto 0;
  height: 3px;
  background: linear-gradient(90deg, #2b6cd1, #5fa3f7);
  opacity: .65;
}
.affiliate-steps li:last-child {
  border-color: #275e51;
  background: radial-gradient(90% 90% at 100% 0%, rgba(102, 219, 183, .13), transparent 60%),
              linear-gradient(180deg, #13263d, #0e1a2b);
}
.affiliate-steps li:last-child::before {
  border-color: #256152;
  background: linear-gradient(145deg, #10332b, #0c221e);
  color: #66dbb7;
}
.affiliate-steps li:last-child::after {
  background: linear-gradient(90deg, #3479d5, #66dbb7);
  opacity: 1;
}

/* 12-Month Calculator */
.affiliate-calculator {
  display: grid;
  gap: 18px;
  border: 1px solid #2b476b;
  border-radius: 20px;
  padding: clamp(20px, 3.2vw, 32px);
  background: radial-gradient(90% 100% at 100% 0%, rgba(52, 121, 213, .16), transparent 58%),
              linear-gradient(180deg, #122339, #0d192a);
  box-shadow: 0 14px 36px rgba(3, 9, 18, .3);
}
.affiliate-calc-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.affiliate-calc-legend { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.affiliate-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid #263f5d;
  background: rgba(10, 20, 34, .78);
  font-size: .76rem;
  font-weight: 600;
  color: #b4c8e0;
}
.affiliate-legend-item i { width: 8px; height: 8px; border-radius: 999px; display: inline-block; }
.affiliate-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; align-items: stretch; }
.affiliate-fields label {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border: 1px solid #233954;
  border-radius: 12px;
  background: rgba(10, 20, 34, .72);
  color: #bfd2e8;
  font-size: .88rem;
  font-weight: 600;
}
.affiliate-fields input[type=number] {
  width: 100%;
  min-height: 44px;
  border: 1px solid #355478;
  border-radius: 9px;
  background: #091321;
  color: var(--af-text);
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color-scheme: dark;
  padding: 8px 12px;
}
.affiliate-fields input[type=range] { width: 100%; accent-color: #3479d5; min-height: 36px; cursor: pointer; margin: 0; }
.affiliate-calc-outputs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.affiliate-calc-outputs > div {
  padding: 16px 20px;
  border: 1px solid #243c59;
  border-radius: 14px;
  background: rgba(9, 19, 33, .85);
}
.affiliate-calc-outputs > div:last-child { border-color: #255b4e; background: linear-gradient(135deg, rgba(15, 41, 36, .65), rgba(9, 19, 33, .9)); }
.affiliate-calc-outputs span { display: block; font-size: .84rem; color: #94adc9; margin-bottom: 6px; font-weight: 500; }
.affiliate-calculator output {
  display: block;
  color: #8fb9ef;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.affiliate-calc-outputs > div:last-child output { color: #66dbb7; }
.affiliate-calc-bars {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 8px;
  align-items: end;
  height: 128px;
  padding: 14px 12px 8px;
  border: 1px solid #223853;
  border-radius: 14px;
  background: repeating-linear-gradient(0deg, transparent, transparent 28px, rgba(56, 88, 125, .14) 28px, rgba(56, 88, 125, .14) 29px), #091321;
}
.affiliate-calc-col { display: flex; flex-direction: column; align-items: center; justify-content: end; gap: 5px; height: 100%; }
.affiliate-calc-bar {
  width: 100%;
  max-width: 30px;
  min-height: 5px;
  border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, #4b8fe8, #275db3);
  transition: height .2s ease;
}
.affiliate-calc-bar.tier-pro { background: linear-gradient(180deg, #74b4ff, #3479d5); }
.affiliate-calc-bar.tier-elite { background: linear-gradient(180deg, #66dbb7, #2c9678); }
.affiliate-calc-col small { font-size: .72rem; color: #839cb9; font-variant-numeric: tabular-nums; }
.affiliate-page .affiliate-subdued { font-size: .9rem; color: #87a0bd; }

/* FAQ Accordion Cards with Tickrivo Chevron */
.affiliate-faq { display: grid; gap: 14px; }
.affiliate-faq-list { display: grid; gap: 10px; }
.affiliate-faq details {
  border: 1px solid var(--af-line);
  border-radius: 12px;
  background: linear-gradient(180deg, #112035, #0e1a2b);
  padding: 0 20px;
  transition: border-color .15s ease;
}
.affiliate-faq details:hover, .affiliate-faq details[open] { border-color: #34567e; }
.affiliate-faq summary {
  cursor: pointer;
  min-height: 54px;
  padding: 15px 0;
  font-weight: 650;
  font-size: .97rem;
  color: #eaf2ff;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.affiliate-faq summary::-webkit-details-marker { display: none; }
.affiliate-faq summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: 4px;
  margin-top: -3px;
  border-right: 1.8px solid #8fb9ef;
  border-bottom: 1.8px solid #8fb9ef;
  transform: rotate(45deg);
  transition: transform .2s ease, border-color .2s ease, margin-top .2s ease;
}
.affiliate-faq details[open] summary::after {
  transform: rotate(225deg);
  margin-top: 4px;
  border-color: #66dbb7;
}
.affiliate-faq details p { padding-bottom: 16px; max-width: 78ch; font-size: .93rem; }

/* Dedicated Disclaimer Note Card */
.affiliate-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid #223853;
  border-left: 3px solid #3479d5;
  border-radius: 12px;
  background: rgba(13, 25, 42, .82);
}
.affiliate-disclaimer-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: #132844;
  border: 1px solid #2a4970;
  color: #8fb9ef;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin-top: 1px;
}
.affiliate-disclaimer-icon svg {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.affiliate-disclaimer p {
  font-size: .86rem;
  line-height: 1.6;
  color: #8fa8c5;
}

/* Terms */
.affiliate-terms {
  max-width: 76ch;
  width: 100%;
  margin-inline: auto;
  padding: clamp(20px, 4vw, 38px);
  border: 1px solid var(--af-line);
  border-radius: 18px;
  background: linear-gradient(180deg, #112035, #0d1828);
}
.affiliate-terms h1 { margin-top: 14px; }
.affiliate-terms section { border-top: 1px solid #20344c; padding-top: 20px; margin-top: 22px; }
.affiliate-terms section p { margin-top: 6px; }

@media (max-width: 900px) {
  .affiliate-hero, .affiliate-steps ol, .affiliate-tiers { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .affiliate-page { width: min(100% - 24px, 1140px); }
  .affiliate-actions { display: grid; grid-template-columns: minmax(0, 1fr); }
  .affiliate-actions .affiliate-text-link { text-align: center; padding-block: 6px; }
  .affiliate-fields, .affiliate-calc-outputs, .affiliate-rules { grid-template-columns: minmax(0, 1fr); }
  .affiliate-page .affiliate-primary, .affiliate-page .affiliate-secondary-btn { width: 100%; }
  .affiliate-calc-bars { gap: 4px; padding: 12px 6px 6px; height: 112px; }
  .affiliate-faq details { padding: 0 14px; }
  .affiliate-disclaimer { padding: 14px; }
}
