:root {
  color-scheme: dark;
  --bg: #000;
  --panel: #070707;
  --panel-raised: #0d0d0e;
  --line: rgba(255, 255, 255, .13);
  --line-strong: rgba(255, 255, 255, .24);
  --text: #f7f7f7;
  --muted: #a1a1aa;
  --dim: #71717a;
  --green: #b7f7d2;
  --green-bg: rgba(34, 197, 94, .11);
  --green-line: rgba(134, 239, 172, .28);
  --yellow: #f8df97;
  --red: #fecaca;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% -12%, rgba(255, 255, 255, .09), transparent 42%),
    linear-gradient(rgba(255, 255, 255, .032) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .032) 1px, transparent 1px);
  background-size: auto, 42px 42px, 42px 42px;
  mask-image: linear-gradient(to bottom, black, rgba(0, 0, 0, .55) 62%, transparent);
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
}

.affiliate-shell {
  position: relative;
  z-index: 1;
  width: min(1420px, calc(100vw - 64px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 42px 0 56px;
}

.affiliate-card,
.section,
.kpi,
.secondary-stats {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(7, 7, 7, .94);
  box-shadow: 0 26px 90px rgba(0, 0, 0, .24);
}

.affiliate-loading {
  max-width: 600px;
  margin: 22vh auto 0;
  padding: 32px;
}

.portal-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  width: fit-content;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .08em;
  text-decoration: none;
  text-transform: uppercase;
}

.portal-brand:hover {
  color: var(--text);
}

.portal-brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  color: #000;
  background: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .03em;
}

.dashboard-brand {
  margin-bottom: 42px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 850;
  letter-spacing: .15em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 10px;
  font-size: clamp(42px, 4.8vw, 62px);
  font-weight: 830;
  letter-spacing: -.045em;
  line-height: .98;
  text-wrap: balance;
}

h2 {
  margin-bottom: 7px;
  font-size: 24px;
  font-weight: 810;
  letter-spacing: -.025em;
  line-height: 1.12;
}

h3 {
  margin: 0;
  font-size: 16px;
}

.muted {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.support-note,
.form-note,
.setup-help {
  color: var(--dim);
  font-size: 13px;
  line-height: 1.55;
}

.support-note a,
.setup-help a {
  color: var(--text);
  font-weight: 700;
  text-underline-offset: 3px;
}

.pill,
.discount-badge,
.secure-pill,
.ghost-button,
.primary-button {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 15px;
  color: var(--text);
  background: #090909;
  font-weight: 760;
  text-decoration: none;
  white-space: nowrap;
}

.discount-badge,
.secure-pill {
  border-color: var(--green-line);
  color: var(--green);
  background: var(--green-bg);
}

.ghost-button,
.primary-button {
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease, transform .15s ease;
}

.ghost-button:hover,
.primary-button:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.primary-button {
  border-color: #fff;
  color: #000;
  background: #fff;
}

.primary-button:hover {
  color: #000;
  background: #e8e8e8;
}

.primary-button:focus-visible,
.ghost-button:focus-visible,
.password-toggle:focus-visible,
.payout-disclosure summary:focus-visible,
.checklist-item button:focus-visible,
a:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
}

button:disabled {
  opacity: .58;
  cursor: wait;
  transform: none !important;
}

.compact-button {
  width: auto;
}

/* Access and setup states */

.access-state,
.setup-layout {
  display: grid;
  min-height: calc(100vh - 98px);
  place-items: center;
  margin: 0 auto;
}

.setup-layout {
  width: min(680px, 100%);
}

.access-state {
  width: min(650px, 100%);
}

.invite-access-state {
  width: min(620px, 100%);
}

body:has(.setup-layout)::before,
body:has(.invite-access-state)::before,
body:has(.setup-success)::before {
  display: none;
}

body:has(.access-state)::before {
  display: none;
}

body:has(.access-state) {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

body:has(.access-state) .affiliate-shell {
  width: 100%;
  padding: 0 24px;
}

.access-state {
  width: min(600px, 100%);
  min-height: 100svh;
}

.access-state .access-card {
  width: 100%;
  border-color: rgba(255, 255, 255, .14);
  border-radius: 16px;
  padding: 44px;
  background: #080808;
  box-shadow: none;
}

.access-state .access-card h1 {
  max-width: none;
  margin-bottom: 14px;
  font-size: clamp(40px, 5vw, 50px);
  font-weight: 950;
  letter-spacing: -.05em;
  line-height: .98;
}

.access-state .access-card .muted {
  max-width: 52ch;
  color: #99999f;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.55;
}

.access-state:not(.invite-access-state) .access-actions {
  grid-template-columns: 1fr;
}

.access-state .access-actions {
  margin-top: 28px;
}

.access-state .access-actions .primary-button,
.access-state .access-actions .ghost-button {
  min-height: 48px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
}

.access-state .access-card .support-note {
  margin: 24px 0 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 18px;
  color: #74747b;
  font-size: 12.5px;
}

.access-card {
  padding: clamp(28px, 5vw, 46px);
}

.setup-card {
  width: 100%;
  border-radius: 16px;
  padding: 46px 48px 40px;
  background: #080808;
  box-shadow: none;
}

.invite-access-state .access-card {
  width: 100%;
  border-radius: 16px;
  background: #080808;
  box-shadow: none;
}

.access-card h1 {
  max-width: 560px;
  font-size: clamp(38px, 6vw, 56px);
}

.access-card .muted {
  max-width: 60ch;
  font-size: 16px;
}

.access-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.invite-access-state .access-actions .primary-button,
.invite-access-state .access-actions .ghost-button {
  border-radius: 10px;
}

.access-card .support-note {
  margin: 22px 0 0;
}

.replacement-link-form {
  display: grid;
  gap: 10px;
  margin-top: 28px;
}

.replacement-link-form label {
  color: #d7d7dc;
  font-size: 13px;
  font-weight: 700;
}

.replacement-link-form input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 10px;
  padding: 0 14px;
  background: #111;
  color: #fff;
  font: inherit;
  outline: none;
}

.replacement-link-form input:focus {
  border-color: rgba(255, 255, 255, .55);
}

.replacement-link-form .primary-button {
  min-height: 48px;
  border-radius: 10px;
}

.replacement-link-status {
  min-height: 20px;
  margin: 2px 0 0;
  color: #a3a3aa;
  font-size: 12.5px;
  line-height: 1.45;
}

.replacement-link-status[data-state="success"] {
  color: #d9f99d;
}

.replacement-link-status[data-state="error"] {
  color: #fca5a5;
}

.access-login-link {
  display: inline-block;
  margin-top: 18px;
  color: #8c8c93;
  font-size: 13px;
  text-underline-offset: 3px;
}

.access-login-link:hover {
  color: #fff;
}

.setup-success {
  text-align: center;
}

.setup-header {
  display: block;
}

.setup-header h1 {
  max-width: none;
  margin-bottom: 13px;
  font-size: clamp(40px, 5vw, 50px);
  letter-spacing: -.04em;
  line-height: 1;
}

.setup-header .muted {
  max-width: 54ch;
  font-size: 15.5px;
  line-height: 1.55;
}

.setup-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 40px;
  margin: 30px 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 20px;
  background: #0c0c0c;
}

.setup-summary div {
  min-width: 0;
  padding: 12px 0;
}

.setup-summary div:nth-child(-n+2) {
  border-bottom: 1px solid rgba(255, 255, 255, .09);
}

.setup-summary dt,
.setup-summary dd {
  margin: 0;
}

.setup-summary dt {
  margin-bottom: 5px;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
}

.setup-summary dd {
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
  font-weight: 680;
  line-height: 1.35;
}

.affiliate-setup-form {
  display: grid;
  gap: 17px;
}

.setup-password-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.affiliate-setup-form label,
.payout-form label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 820;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.affiliate-setup-form label {
  gap: 9px;
  color: #c7c7cc;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.password-field {
  position: relative;
  display: block;
}

.password-field input {
  padding-right: 72px !important;
}

.password-toggle {
  position: absolute;
  top: 1px;
  right: 1px;
  bottom: 1px;
  width: 68px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0 9px 9px 0;
  color: var(--muted);
  background: transparent;
  font-size: 12px;
  font-weight: 680;
  cursor: pointer;
}

.password-toggle:hover {
  color: var(--text);
}

.affiliate-setup-form input,
.payout-form input,
.payout-form select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 0 13px;
  color: var(--text);
  background: #111;
  font: 550 15px/1.2 Inter, ui-sans-serif, system-ui, sans-serif;
  letter-spacing: 0;
  outline: none;
  text-transform: none;
}

.affiliate-setup-form input {
  min-height: 52px;
  border-radius: 10px;
  border-color: rgba(255, 255, 255, .2);
  background: #0d0d0d;
}

.affiliate-setup-form input:focus,
.payout-form input:focus,
.payout-form select:focus {
  border-color: rgba(255, 255, 255, .6);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .07);
}

.password-rules {
  display: flex;
  gap: 8px 20px;
  flex-wrap: wrap;
  color: var(--dim);
  font-size: 12.5px;
}

.password-rules span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.password-rules span::before {
  content: "";
  width: 7px;
  height: 7px;
  border: 1px solid var(--dim);
  border-radius: 50%;
}

.password-rules .is-met {
  color: var(--green);
}

.password-rules .is-met::before {
  border-color: var(--green);
  background: var(--green);
}

.setup-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 1px;
  border-radius: 10px;
  font-weight: 760;
}

.form-note {
  margin: 0;
  text-align: left;
}

.setup-help {
  margin: 0;
  text-align: left;
}

.setup-footer {
  display: grid;
  gap: 6px;
  margin-top: 25px;
  border-top: 1px solid rgba(255, 255, 255, .09);
  padding-top: 18px;
}

.setup-footer .form-note,
.setup-footer .setup-help {
  color: #707078;
  font-size: 12.5px;
  line-height: 1.5;
}

.setup-footer .setup-help a {
  color: #a8a8ae;
  font-weight: 650;
}

.affiliate-message,
.affiliate-error {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}

.affiliate-message {
  border-color: var(--green-line);
  color: var(--green);
  background: var(--green-bg);
}

.affiliate-error {
  border-color: rgba(254, 202, 202, .26);
  color: var(--red);
  background: rgba(127, 29, 29, .12);
}

/* Dashboard */

.affiliate-top {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 30px;
}

.affiliate-top .muted {
  max-width: 650px;
  font-size: 16px;
}

.affiliate-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.status-pill {
  text-transform: capitalize;
}

.status-pill span {
  width: 7px;
  height: 7px;
  margin-right: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, .1);
}

.summary-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.kpi {
  min-height: 138px;
  padding: 22px;
}

.kpi strong {
  display: block;
  margin-top: 18px;
  font-size: clamp(28px, 3vw, 35px);
  line-height: 1;
  letter-spacing: -.035em;
}

.kpi span {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.secondary-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 14px 0 20px;
}

.secondary-stats div {
  display: flex;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 20px;
  border-right: 1px solid var(--line);
}

.secondary-stats div:last-child {
  border-right: 0;
}

.secondary-stats span {
  color: var(--muted);
  font-size: 13px;
}

.secondary-stats strong {
  font-size: 18px;
}

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

.section {
  padding: 26px;
}

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

.section-head > div {
  min-width: 0;
}

.section-head .muted {
  max-width: 62ch;
}

.section-head.compact {
  margin-bottom: 12px;
}

.codes-section {
  grid-column: span 8;
}

.checklist-section {
  grid-column: span 4;
}

.payout-panel {
  grid-column: span 5;
}

.payout-form-section {
  grid-column: span 7;
  padding: 0;
  overflow: hidden;
}

.orders-section {
  grid-column: 1 / -1;
}

.code-grid {
  display: grid;
  gap: 10px;
}

.code-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px;
  background: rgba(255, 255, 255, .025);
}

.code-main {
  min-width: 0;
}

.code-card strong {
  display: block;
  margin-bottom: 8px;
  overflow-wrap: anywhere;
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: .035em;
  line-height: 1;
}

.code-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.copy-status {
  min-height: 20px;
  margin: 10px 2px -2px;
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
}

.checklist {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.checklist-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  min-height: 66px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 11px;
  background: rgba(255, 255, 255, .025);
}

.checkmark {
  display: inline-grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.checklist-item.is-complete .checkmark {
  border-color: var(--green-line);
  background: var(--green-bg);
}

.checklist-item > span:nth-child(2) {
  display: grid;
  gap: 4px;
}

.checklist-item small {
  color: var(--muted);
  line-height: 1.35;
}

.checklist-item button {
  border: 0;
  padding: 5px;
  color: var(--text);
  background: transparent;
  font-size: 12px;
  font-weight: 750;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.payout-steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.payout-steps li {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, .025);
  line-height: 1.35;
}

.payout-steps strong {
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: var(--green);
  background: var(--green-bg);
  font-size: 12px;
}

.payout-current {
  display: grid;
  gap: 4px;
  margin-top: 18px;
  border: 1px solid var(--green-line);
  border-radius: 12px;
  padding: 12px;
  color: var(--green);
  background: var(--green-bg);
}

.payout-current span {
  color: var(--muted);
  font-size: 13px;
}

.payout-disclosure > summary {
  display: flex;
  min-height: 112px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 24px 26px;
  cursor: pointer;
  list-style: none;
}

.payout-disclosure > summary::-webkit-details-marker {
  display: none;
}

.payout-disclosure > summary span:first-child {
  display: grid;
  gap: 6px;
}

.payout-disclosure > summary small {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.payout-disclosure > summary strong {
  font-size: 22px;
  letter-spacing: -.02em;
}

.summary-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 750;
}

.payout-disclosure[open] .summary-action::after {
  content: " details";
}

.payout-form-wrap {
  border-top: 1px solid var(--line);
  padding: 24px 26px 26px;
}

.payout-form-wrap > .muted {
  margin-bottom: 20px;
}

.payout-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.payout-form .field-wide,
.payout-form .payout-warning,
.payout-form .primary-button,
.payout-form .affiliate-message,
.payout-form .affiliate-error {
  grid-column: 1 / -1;
}

.payout-warning {
  display: grid;
  gap: 4px;
  border: 1px solid rgba(248, 223, 151, .2);
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--yellow);
  background: rgba(251, 191, 36, .06);
  font-size: 13px;
  line-height: 1.45;
}

.payout-warning span {
  color: var(--muted);
}

.payout-form .primary-button {
  width: 100%;
  min-height: 48px;
}

.empty {
  display: grid;
  gap: 5px;
  border: 1px dashed rgba(255, 255, 255, .2);
  border-radius: 14px;
  padding: 18px;
  color: var(--muted);
}

.empty strong {
  color: var(--text);
}

.table-wrap {
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  border-top: 1px solid rgba(255, 255, 255, .09);
  padding: 13px 11px;
  text-align: left;
  vertical-align: top;
}

th {
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: .11em;
  text-transform: uppercase;
}

td {
  color: #e9e9ec;
  font-size: 13.5px;
}

.status {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  font-weight: 760;
}

@media (max-width: 1080px) {
  .codes-section,
  .checklist-section,
  .payout-panel,
  .payout-form-section {
    grid-column: 1 / -1;
  }

  .checklist {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .checklist-item {
    grid-template-columns: 26px minmax(0, 1fr);
  }

  .checklist-item button {
    grid-column: 2;
    width: fit-content;
  }

  .payout-steps {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .affiliate-shell {
    width: min(calc(100vw - 24px), 1420px);
    padding: 18px 0 34px;
  }

  .setup-layout,
  .invite-access-state {
    min-height: calc(100svh - 52px);
  }

  .affiliate-top {
    align-items: flex-start;
    flex-direction: column;
  }

  .dashboard-brand {
    margin-bottom: 32px;
  }

  .affiliate-actions,
  .affiliate-actions .pill,
  .affiliate-actions .ghost-button {
    width: 100%;
  }

  .affiliate-actions {
    align-items: stretch;
  }

  .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kpi {
    min-height: 122px;
    padding: 18px;
  }

  .section {
    padding: 20px;
  }

  .section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .code-card {
    grid-template-columns: 1fr;
  }

  .code-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .code-actions .ghost-button,
  .code-actions .primary-button {
    width: 100%;
  }

  .checklist,
  .payout-steps {
    grid-template-columns: 1fr;
  }

  .payout-form {
    grid-template-columns: 1fr;
  }

  .payout-form .field-wide,
  .payout-form .payout-warning,
  .payout-form .primary-button,
  .payout-form .affiliate-message,
  .payout-form .affiliate-error {
    grid-column: 1;
  }

  .setup-password-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

@media (max-width: 520px) {
  .affiliate-card,
  .section,
  .kpi,
  .secondary-stats {
    border-radius: 16px;
  }

  h1 {
    font-size: clamp(38px, 11vw, 48px);
  }

  .access-card {
    padding: 28px 22px;
  }

  body:has(.access-state) .affiliate-shell {
    padding: 0 16px;
  }

  .access-state .access-card {
    padding: 30px 24px 26px;
  }

  .access-state .access-card h1 {
    font-size: clamp(36px, 11vw, 42px);
  }

  .access-state .access-card .muted {
    font-size: 14px;
  }

  .setup-card {
    padding: 30px 24px 26px;
  }

  .access-actions {
    grid-template-columns: 1fr;
  }

  .setup-header h1 {
    margin-bottom: 12px;
    font-size: clamp(36px, 11vw, 42px);
  }

  .setup-summary {
    grid-template-columns: 1fr;
    column-gap: 0;
    margin: 25px 0;
    padding: 5px 16px;
  }

  .setup-summary div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 18px;
    padding: 12px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .09);
  }

  .setup-summary div:last-child {
    border-bottom: 0;
  }

  .setup-summary dt {
    margin: 0;
  }

  .setup-summary dd {
    max-width: 62%;
    text-align: right;
  }

  .setup-footer {
    margin-top: 22px;
    padding-top: 16px;
  }

  .summary-row {
    gap: 10px;
  }

  .kpi {
    min-height: 112px;
    padding: 16px;
  }

  .kpi strong {
    margin-top: 13px;
    font-size: 27px;
  }

  .kpi span {
    margin-top: 9px;
    font-size: 12px;
  }

  .secondary-stats {
    grid-template-columns: 1fr;
  }

  .secondary-stats div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .secondary-stats div:last-child {
    border-bottom: 0;
  }

  .code-actions {
    grid-template-columns: 1fr;
  }

  .payout-disclosure > summary {
    min-height: 96px;
    padding: 20px;
  }

  .payout-disclosure > summary strong {
    font-size: 19px;
  }

  .payout-form-wrap {
    padding: 20px;
  }
}

/* Authenticated dashboard — storefront typography and restrained portal layout */

body:has(.affiliate-dashboard-shell)::before {
  display: none;
}

.affiliate-dashboard-shell {
  width: min(1240px, calc(100vw - 64px));
  padding: 64px 0 80px;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.affiliate-dashboard-shell button,
.affiliate-dashboard-shell input,
.affiliate-dashboard-shell select {
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.affiliate-dashboard-shell .affiliate-top {
  align-items: flex-start;
  gap: 40px;
  margin-bottom: 48px;
}

.affiliate-dashboard-shell .welcome-copy {
  min-width: 0;
}

.affiliate-dashboard-shell .welcome-copy h1 {
  max-width: 920px;
  margin-bottom: 14px;
  font-size: clamp(40px, 5vw, 56px);
  font-weight: 950;
  letter-spacing: -.05em;
  line-height: .96;
  text-wrap: balance;
}

.affiliate-dashboard-shell .welcome-copy .muted {
  max-width: 610px;
  color: #a3a3aa;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.55;
}

.affiliate-dashboard-shell .affiliate-actions {
  flex: 0 0 auto;
  gap: 18px;
  padding-top: 4px;
}

.affiliate-dashboard-shell .account-status {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 9px;
  color: #c9c9ce;
  font-size: 13px;
  font-weight: 650;
  text-transform: capitalize;
}

.affiliate-dashboard-shell .account-status span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #4ade80;
}

.affiliate-dashboard-shell .ghost-button,
.affiliate-dashboard-shell .primary-button {
  min-height: 44px;
  border-radius: 10px;
  padding: 0 17px;
  font-size: 13px;
  font-weight: 700;
}

.affiliate-dashboard-shell .ghost-button {
  border-color: rgba(255, 255, 255, .16);
  background: transparent;
}

.affiliate-dashboard-shell .earnings-section {
  margin-bottom: 56px;
}

.affiliate-dashboard-shell .summary-row {
  gap: 12px;
}

.affiliate-dashboard-shell .kpi,
.affiliate-dashboard-shell .secondary-stats,
.affiliate-dashboard-shell .section {
  border-color: rgba(255, 255, 255, .12);
  border-radius: 16px;
  background: #080808;
  box-shadow: none;
}

.affiliate-dashboard-shell .kpi {
  min-height: 118px;
  padding: 20px 22px;
}

.affiliate-dashboard-shell .kpi p {
  margin: 0;
  color: #a3a3aa;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.35;
}

.affiliate-dashboard-shell .kpi strong {
  margin-top: 14px;
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 750;
  letter-spacing: -.04em;
  line-height: 1;
}

.affiliate-dashboard-shell .kpi span {
  margin-top: 9px;
  color: #85858d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.affiliate-dashboard-shell .secondary-stats {
  margin: 12px 0 0;
}

.affiliate-dashboard-shell .secondary-stats div {
  min-height: 56px;
  padding: 12px 22px;
  border-color: rgba(255, 255, 255, .1);
}

.affiliate-dashboard-shell .secondary-stats span {
  color: #929299;
  font-size: 13px;
  font-weight: 550;
}

.affiliate-dashboard-shell .secondary-stats strong {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.affiliate-dashboard-shell .dashboard-sections {
  display: grid;
  gap: 56px;
}

.affiliate-dashboard-shell .dashboard-row {
  display: grid;
  align-items: start;
  gap: 24px;
}

.affiliate-dashboard-shell .affiliate-tools-row {
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
}

.affiliate-dashboard-shell .payout-row {
  grid-template-columns: minmax(330px, 5fr) minmax(0, 7fr);
}

.affiliate-dashboard-shell .section {
  padding: 24px;
}

.affiliate-dashboard-shell .codes-section,
.affiliate-dashboard-shell .checklist-section,
.affiliate-dashboard-shell .payout-panel,
.affiliate-dashboard-shell .payout-form-section,
.affiliate-dashboard-shell .orders-section {
  grid-column: auto;
}

.affiliate-dashboard-shell .payout-form-section {
  padding: 0;
  overflow: hidden;
}

.affiliate-dashboard-shell .section-head {
  margin-bottom: 20px;
}

.affiliate-dashboard-shell .section-head.compact {
  margin-bottom: 14px;
}

.affiliate-dashboard-shell .section-label,
.affiliate-dashboard-shell .code-label {
  margin: 0 0 8px;
  color: #929299;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.affiliate-dashboard-shell h2 {
  margin-bottom: 8px;
  font-size: 23px;
  font-weight: 750;
  letter-spacing: -.03em;
  line-height: 1.1;
}

.affiliate-dashboard-shell .section .muted {
  color: #929299;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.55;
}

.affiliate-dashboard-shell .code-grid {
  gap: 0;
}

.affiliate-dashboard-shell .code-card {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 28px;
  border: 0;
  border-top: 1px solid rgba(255, 255, 255, .1);
  border-radius: 0;
  padding: 22px 0 0;
  background: transparent;
}

.affiliate-dashboard-shell .code-card + .code-card {
  margin-top: 22px;
}

.affiliate-dashboard-shell .code-card strong {
  margin-bottom: 9px;
  font-size: clamp(28px, 3vw, 34px);
  font-weight: 750;
  letter-spacing: .015em;
}

.affiliate-dashboard-shell .code-actions {
  align-items: center;
  gap: 8px;
}

.affiliate-dashboard-shell .copy-status {
  min-height: 18px;
  margin: 12px 0 0;
  color: #86efac;
  font-size: 12px;
  font-weight: 600;
}

.affiliate-dashboard-shell .checklist {
  gap: 0;
  margin-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.affiliate-dashboard-shell .checklist-item {
  grid-template-columns: 20px minmax(0, 1fr) auto;
  min-height: 0;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  border-radius: 0;
  padding: 16px 0;
  background: transparent;
}

.affiliate-dashboard-shell .checklist-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.affiliate-dashboard-shell .checkmark {
  width: 18px;
  height: 18px;
  border-color: rgba(255, 255, 255, .24);
  color: #86efac;
  background: transparent;
  font-size: 10px;
}

.affiliate-dashboard-shell .checklist-item.is-complete .checkmark {
  border-color: rgba(134, 239, 172, .5);
  background: transparent;
}

.affiliate-dashboard-shell .checklist-item > span:nth-child(2) {
  gap: 4px;
}

.affiliate-dashboard-shell .checklist-item strong {
  font-size: 14px;
  font-weight: 650;
}

.affiliate-dashboard-shell .checklist-item small {
  color: #85858d;
  font-size: 12px;
  font-weight: 500;
}

.affiliate-dashboard-shell .checklist-item button {
  min-height: 44px;
  padding: 0 0 0 10px;
  font-size: 12px;
  font-weight: 650;
}

.affiliate-dashboard-shell [hidden] {
  display: none !important;
}

.affiliate-dashboard-shell .profile-links-panel {
  margin-top: 26px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  padding-top: 22px;
}

.affiliate-dashboard-shell .profile-links-head h3 {
  margin: 0 0 5px;
  color: #f5f5f5;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.015em;
}

.affiliate-dashboard-shell .profile-links-head p {
  margin: 0;
  color: #85858d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.affiliate-dashboard-shell .saved-profile-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.affiliate-dashboard-shell .saved-profile-links a {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, .15);
  border-radius: 9px;
  padding: 0 11px;
  color: #f0f0f0;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.affiliate-dashboard-shell .saved-profile-links a:hover,
.affiliate-dashboard-shell .saved-profile-links a:focus-visible {
  border-color: rgba(255, 255, 255, .42);
  background: rgba(255, 255, 255, .04);
}

.affiliate-dashboard-shell .profile-links-form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.affiliate-dashboard-shell .profile-links-form label {
  display: grid;
  gap: 7px;
  color: #c7c7cc;
  font-size: 12px;
  font-weight: 650;
}

.affiliate-dashboard-shell .profile-links-form input {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 9px;
  padding: 0 12px;
  color: #f5f5f5;
  background: #0d0d0d;
  font: inherit;
  font-size: 13px;
}

.affiliate-dashboard-shell .profile-links-form input:focus {
  border-color: rgba(255, 255, 255, .62);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .07);
}

.affiliate-dashboard-shell .profile-links-form .ghost-button {
  width: 100%;
  min-height: 44px;
  margin-top: 2px;
  border-radius: 9px;
}

.affiliate-dashboard-shell .profile-links-form .affiliate-message,
.affiliate-dashboard-shell .profile-links-form .affiliate-error {
  margin: 0;
  font-size: 12px;
}

.affiliate-dashboard-shell .payout-state,
.affiliate-dashboard-shell .orders-count {
  flex: 0 0 auto;
  color: #a3a3aa;
  font-size: 12px;
  font-weight: 600;
}

.affiliate-dashboard-shell .payout-current {
  margin-top: 20px;
  border-color: rgba(134, 239, 172, .28);
  border-radius: 10px;
  padding: 13px 14px;
  background: rgba(34, 197, 94, .05);
}

.affiliate-dashboard-shell .payout-history-section {
  margin-top: 24px;
}

.affiliate-dashboard-shell [data-dashboard-panel][hidden] {
  display: none !important;
}

.affiliate-dashboard-shell .affiliate-dashboard-tabs {
  display: flex;
  gap: 28px;
  margin: 0 0 24px;
  border-bottom: 1px solid rgba(255, 255, 255, .12);
}

.affiliate-dashboard-shell .affiliate-dashboard-tabs button {
  min-height: 42px;
  margin: 0 0 -1px;
  border: 0;
  border-bottom: 1px solid transparent;
  border-radius: 0;
  padding: 0 0 12px;
  background: transparent;
  color: #7f7f86;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.affiliate-dashboard-shell .affiliate-dashboard-tabs button[aria-selected="true"] {
  border-bottom-color: #fff;
  color: #f5f5f5;
}

.affiliate-dashboard-shell .affiliate-dashboard-tabs button:focus-visible {
  outline: 2px solid rgba(255, 255, 255, .7);
  outline-offset: 4px;
}

.affiliate-dashboard-shell .admin-view-status {
  color: #9a9aa1;
  font-size: 12px;
  font-weight: 650;
}

.affiliate-dashboard-shell .payout-tracking-link {
  color: #f5f5f5;
  font-weight: 700;
  text-underline-offset: 3px;
}

.affiliate-dashboard-shell .payout-tracking-link:hover,
.affiliate-dashboard-shell .payout-tracking-link:focus-visible {
  color: #fff;
}

.affiliate-dashboard-shell .payout-steps {
  gap: 0;
  margin-top: 22px;
  border-top: 1px solid rgba(255, 255, 255, .1);
}

.affiliate-dashboard-shell .payout-steps li {
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 0;
  gap: 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  border-radius: 0;
  padding: 15px 0;
  color: #a3a3aa;
  background: transparent;
  font-size: 13px;
  font-weight: 500;
}

.affiliate-dashboard-shell .payout-steps li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.affiliate-dashboard-shell .payout-steps strong {
  width: 20px;
  height: 20px;
  border: 1px solid rgba(255, 255, 255, .18);
  color: #b4b4ba;
  background: transparent;
  font-size: 11px;
  font-weight: 650;
}

.affiliate-dashboard-shell .payout-disclosure > summary {
  min-height: 102px;
  padding: 24px;
}

.affiliate-dashboard-shell .payout-disclosure > summary small {
  color: #929299;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.affiliate-dashboard-shell .payout-disclosure > summary strong {
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -.025em;
}

.affiliate-dashboard-shell .summary-action {
  min-height: 44px;
  border-color: rgba(255, 255, 255, .16);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 12px;
  font-weight: 650;
}

.affiliate-dashboard-shell .payout-disclosure[open] .summary-action {
  font-size: 0;
}

.affiliate-dashboard-shell .payout-disclosure[open] .summary-action::after {
  content: "Close";
  font-size: 12px;
}

.affiliate-dashboard-shell .payout-form-wrap {
  border-color: rgba(255, 255, 255, .1);
  padding: 24px;
}

.affiliate-dashboard-shell .payout-form-wrap > .muted {
  margin-bottom: 26px;
}

.affiliate-dashboard-shell .payout-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
}

.affiliate-dashboard-shell .payout-field-group {
  display: grid;
  min-width: 0;
  margin: 0;
  border: 0;
  padding: 0;
}

.affiliate-dashboard-shell .payout-field-group legend {
  width: 100%;
  margin: 0 0 14px;
  padding: 0 0 10px;
  border-bottom: 1px solid rgba(255, 255, 255, .1);
  color: #d7d7da;
  font-size: 14px;
  font-weight: 700;
}

.affiliate-dashboard-shell .payout-method-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.affiliate-dashboard-shell .payout-form .payout-method-option {
  display: flex;
  min-height: 72px;
  align-items: flex-start;
  gap: 11px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 10px;
  padding: 14px;
  background: #0d0d0d;
  cursor: pointer;
}

.affiliate-dashboard-shell .payout-method-option:has(input:checked) {
  border-color: rgba(255, 255, 255, .56);
  background: #121212;
}

.affiliate-dashboard-shell .payout-form .payout-method-option input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  min-height: 16px;
  margin: 2px 0 0;
  padding: 0;
  box-shadow: none;
  accent-color: #fff;
}

.affiliate-dashboard-shell .payout-form .payout-method-option input:focus {
  border-color: transparent;
  outline: none;
  box-shadow: none;
}

.affiliate-dashboard-shell .payout-form .payout-method-option:has(input:focus-visible) {
  outline: 2px solid rgba(255, 255, 255, .72);
  outline-offset: 2px;
}

.affiliate-dashboard-shell .payout-method-option span {
  display: grid;
  gap: 4px;
}

.affiliate-dashboard-shell .payout-method-option strong {
  color: #f4f4f4;
  font-size: 13px;
  font-weight: 700;
}

.affiliate-dashboard-shell .payout-method-option small,
.affiliate-dashboard-shell .payout-field-help {
  margin: 0;
  color: #85858d;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.affiliate-dashboard-shell .payout-field-help {
  margin-top: 10px;
}

.affiliate-dashboard-shell .payout-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.affiliate-dashboard-shell .payout-form label {
  gap: 9px;
  color: #c7c7cc;
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.affiliate-dashboard-shell .payout-form input,
.affiliate-dashboard-shell .payout-form select {
  min-height: 52px;
  border-color: rgba(255, 255, 255, .2);
  border-radius: 10px;
  background: #0d0d0d;
  font-size: 14px;
}

.affiliate-dashboard-shell .payout-form input:focus,
.affiliate-dashboard-shell .payout-form select:focus {
  border-color: rgba(255, 255, 255, .62);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, .07);
}

.affiliate-dashboard-shell .payout-form .payout-method-option input[type="radio"] {
  -webkit-appearance: radio;
  appearance: radio;
  width: 16px;
  height: 16px;
  min-height: 16px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.affiliate-dashboard-shell .payout-fields .field-wide {
  grid-column: 1 / -1;
}

.affiliate-dashboard-shell .payout-warning {
  gap: 5px;
  border-color: rgba(255, 255, 255, .11);
  border-radius: 10px;
  padding: 14px;
  color: #c7c7cc;
  background: #0b0b0b;
  font-size: 12.5px;
  font-weight: 500;
}

.affiliate-dashboard-shell .payout-warning span {
  color: #85858d;
}

.affiliate-dashboard-shell .payout-form .primary-button {
  min-height: 48px;
  border-radius: 10px;
}

.affiliate-dashboard-shell .orders-section .section-head {
  margin-bottom: 18px;
}

.affiliate-dashboard-shell .orders-section .empty {
  place-items: center;
  min-height: 112px;
  border: 1px solid rgba(255, 255, 255, .1);
  border-radius: 10px;
  padding: 24px;
  text-align: center;
}

.affiliate-dashboard-shell .orders-section .empty strong {
  font-size: 15px;
  font-weight: 700;
}

.affiliate-dashboard-shell .orders-section .empty span {
  max-width: 540px;
  font-size: 13px;
  line-height: 1.5;
}

.affiliate-dashboard-shell table {
  min-width: 760px;
}

.affiliate-dashboard-shell th {
  color: #85858d;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0;
  text-transform: none;
}

.affiliate-dashboard-shell td {
  color: #dedee1;
  font-size: 13px;
}

.affiliate-dashboard-shell .status {
  min-height: 24px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: 650;
}

@media (max-width: 1080px) {
  .affiliate-dashboard-shell {
    width: min(100vw - 48px, 1240px);
    padding-top: 52px;
  }

  .affiliate-dashboard-shell .summary-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .affiliate-dashboard-shell .dashboard-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .affiliate-dashboard-shell {
    width: calc(100vw - 32px);
    padding: 36px 0 52px;
  }

  .affiliate-dashboard-shell .affiliate-top {
    gap: 24px;
    margin-bottom: 36px;
  }

  .affiliate-dashboard-shell .welcome-copy h1 {
    font-size: clamp(36px, 11vw, 44px);
  }

  .affiliate-dashboard-shell .affiliate-actions {
    width: 100%;
    align-items: center;
    justify-content: space-between;
    padding: 0;
  }

  .affiliate-dashboard-shell .affiliate-actions .ghost-button {
    width: auto;
  }

  .affiliate-dashboard-shell .earnings-section {
    margin-bottom: 48px;
  }

  .affiliate-dashboard-shell .summary-row,
  .affiliate-dashboard-shell .secondary-stats {
    grid-template-columns: 1fr;
  }

  .affiliate-dashboard-shell .kpi {
    min-height: 108px;
  }

  .affiliate-dashboard-shell .secondary-stats div {
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, .1);
  }

  .affiliate-dashboard-shell .secondary-stats div:last-child {
    border-bottom: 0;
  }

  .affiliate-dashboard-shell .dashboard-sections {
    gap: 48px;
  }

  .affiliate-dashboard-shell .dashboard-row {
    gap: 16px;
  }

  .affiliate-dashboard-shell .section {
    padding: 20px;
  }

  .affiliate-dashboard-shell .code-card {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .affiliate-dashboard-shell .code-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .affiliate-dashboard-shell .code-actions .ghost-button,
  .affiliate-dashboard-shell .code-actions .primary-button {
    width: 100%;
  }

  .affiliate-dashboard-shell .checklist-item {
    grid-template-columns: 20px minmax(0, 1fr);
  }

  .affiliate-dashboard-shell .checklist-item button {
    grid-column: 2;
    width: fit-content;
    padding-left: 0;
  }

  .affiliate-dashboard-shell .payout-disclosure > summary,
  .affiliate-dashboard-shell .payout-form-wrap {
    padding: 20px;
  }

  .affiliate-dashboard-shell .payout-disclosure > summary {
    gap: 14px;
  }

  .affiliate-dashboard-shell .payout-fields {
    grid-template-columns: 1fr;
  }

  .affiliate-dashboard-shell .payout-method-options {
    grid-template-columns: 1fr;
  }

  .affiliate-dashboard-shell .payout-fields .field-wide {
    grid-column: 1;
  }

  .affiliate-dashboard-shell .orders-section .section-head {
    flex-direction: row;
  }

  .affiliate-dashboard-shell .orders-count {
    padding-top: 3px;
  }

  .affiliate-dashboard-shell .table-wrap {
    overflow: visible;
  }

  .affiliate-dashboard-shell table,
  .affiliate-dashboard-shell tbody,
  .affiliate-dashboard-shell tr,
  .affiliate-dashboard-shell td {
    display: block;
    width: 100%;
    min-width: 0;
  }

  .affiliate-dashboard-shell thead {
    display: none;
  }

  .affiliate-dashboard-shell tr {
    margin-top: 14px;
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: 10px 14px;
  }

  .affiliate-dashboard-shell td {
    display: grid;
    grid-template-columns: minmax(92px, .75fr) minmax(0, 1fr);
    gap: 14px;
    border-top: 1px solid rgba(255, 255, 255, .08);
    padding: 10px 0;
    overflow-wrap: anywhere;
  }

  .affiliate-dashboard-shell td:first-child {
    border-top: 0;
  }

  .affiliate-dashboard-shell td::before {
    content: attr(data-label);
    color: #85858d;
    font-size: 11px;
    font-weight: 650;
  }
}

/* Affiliate setup intentionally mirrors the square employee sign-in surface. */
body:has(.setup-layout)::before {
  display: block;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, .06), transparent 34%),
    linear-gradient(rgba(255, 255, 255, .055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .055) 1px, transparent 1px);
  background-size: auto, 34px 34px, 34px 34px;
  mask-image: none;
}

body:has(.setup-layout) .affiliate-shell {
  width: 100%;
  padding: 24px;
}

.setup-layout {
  width: min(410px, 100%);
  min-height: calc(100svh - 48px);
}

.setup-card {
  border: 1px solid rgba(255, 255, 255, .28);
  border-radius: 0;
  padding: 28px 24px;
  background: rgba(0, 0, 0, .96);
}

.setup-header h1 {
  margin-bottom: 8px;
  font-size: clamp(32px, 8vw, 40px);
  font-weight: 800;
  letter-spacing: -.035em;
  line-height: 1.02;
}

.setup-header .muted {
  font-size: 14px;
  line-height: 1.45;
}

.setup-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 20px;
  margin: 22px 0;
  border-radius: 0;
  padding: 6px 14px;
  background: #050505;
}

.setup-password-grid {
  grid-template-columns: 1fr;
  gap: 14px;
}

.affiliate-setup-form input,
.setup-submit,
.password-toggle {
  border-radius: 0;
}

.password-toggle {
  border-radius: 0;
}

.setup-footer {
  margin-top: 20px;
  padding-top: 15px;
}

.affiliate-dashboard-shell .profile-links-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.affiliate-dashboard-shell .profile-links-form .ghost-button,
.affiliate-dashboard-shell .profile-links-form .affiliate-message,
.affiliate-dashboard-shell .profile-links-form .affiliate-error {
  grid-column: 1 / -1;
}

.benefit-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 16px;
}

.benefit-status-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 22px;
  border: 1px solid #2a2a2d;
}

.benefit-status-grid > div {
  display: grid;
  gap: 6px;
  padding: 16px;
  border-right: 1px solid #2a2a2d;
}

.benefit-status-grid > div:last-child { border-right: 0; }
.benefit-status-grid span,
.benefit-history-row span,
.benefit-history-row small { color: #909097; font-size: 12px; }
.benefit-status-grid strong { font-size: 15px; }

.benefit-shipping form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.benefit-shipping label,
.benefit-note {
  display: grid;
  gap: 7px;
  color: #c9c9ce;
  font-size: 13px;
  font-weight: 650;
}

.benefit-shipping input,
.benefit-note textarea {
  width: 100%;
  border: 1px solid #38383d;
  border-radius: 0;
  padding: 12px 13px;
  background: #080808;
  color: #fff;
  font: inherit;
}

.benefit-shipping .field-wide { grid-column: 1 / -1; }
.benefit-picker,
.benefit-history { margin-top: 16px; }
.benefit-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 18px 0;
}

.benefit-product {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-height: 84px;
  border: 1px solid #303034;
  padding: 14px;
  background: #080808;
  cursor: pointer;
}

.benefit-product:has(input:checked) { border-color: #fff; background: #111; }
.benefit-product:has(input:disabled) { opacity: .52; cursor: not-allowed; }
.benefit-product span { display: grid; gap: 5px; }
.benefit-product small { color: #929299; line-height: 1.4; }
.benefit-note { margin: 0 0 14px; }
.benefit-history-row {
  display: grid;
  grid-template-columns: 100px 100px minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-top: 1px solid #242427;
  padding: 13px 0;
}
.benefit-warning { margin-top: 16px; border-left: 2px solid #fff; padding-left: 12px; color: #cfcfd3; }

@media (max-width: 640px) {
  body:has(.setup-layout) .affiliate-shell { padding: 12px; }
  .setup-layout { min-height: calc(100svh - 24px); }
  .setup-card { padding: 24px 20px; }
  .affiliate-dashboard-shell .profile-links-form { grid-template-columns: 1fr; }
  .affiliate-dashboard-shell .profile-links-form .ghost-button,
  .affiliate-dashboard-shell .profile-links-form .affiliate-message,
  .affiliate-dashboard-shell .profile-links-form .affiliate-error { grid-column: 1; }
  .benefit-grid,
  .benefit-product-grid,
  .benefit-status-grid { grid-template-columns: 1fr; }
  .benefit-status-grid > div { border-right: 0; border-bottom: 1px solid #2a2a2d; }
  .benefit-status-grid > div:last-child { border-bottom: 0; }
  .benefit-shipping form { grid-template-columns: 1fr; }
  .benefit-shipping .field-wide { grid-column: 1; }
  .benefit-history-row { grid-template-columns: 1fr 1fr; }
}

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