/* Premium affiliate member portal
   All layout and component rules are intentionally scoped to the portal state. */

body.premium-portal-active {
  --premium-bg: #050713;
  --premium-bg-raised: #090d1d;
  --premium-sidebar-bg: rgba(7, 10, 25, 0.97);
  --premium-panel: rgba(15, 20, 43, 0.88);
  --premium-panel-strong: #11172f;
  --premium-panel-hover: #161d3a;
  --premium-border: rgba(144, 163, 218, 0.17);
  --premium-border-strong: rgba(145, 185, 255, 0.3);
  --premium-text: #f5f8ff;
  --premium-text-soft: #c6cfe5;
  --premium-muted: #8f9ab9;
  --premium-cyan: #58e6ed;
  --premium-cyan-soft: rgba(88, 230, 237, 0.14);
  --premium-magenta: #fa5fb8;
  --premium-magenta-soft: rgba(250, 95, 184, 0.13);
  --premium-violet: #936cff;
  --premium-violet-soft: rgba(147, 108, 255, 0.15);
  --premium-success: #71edbd;
  --premium-danger: #ff7890;
  --premium-warning: #ffd173;
  --premium-radius-lg: 18px;
  --premium-radius-md: 13px;
  --premium-shadow: 0 18px 55px rgba(0, 0, 0, 0.32);
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--premium-text);
  background:
    radial-gradient(circle at 82% -8%, rgba(110, 75, 255, 0.16), transparent 31rem),
    radial-gradient(circle at 18% 105%, rgba(39, 210, 222, 0.09), transparent 27rem),
    var(--premium-bg);
}

body.premium-portal-active #topbar,
body.premium-portal-active > .topbar,
body.premium-portal-active .site-footer,
body.premium-portal-active > .ambient {
  display: none !important;
}

body.premium-portal-active #app {
  width: 100%;
  max-width: none;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  padding: 0;
}

body.premium-portal-active .premium-affiliate-shell,
body.premium-portal-active .premium-affiliate-shell *,
body.premium-portal-active .premium-affiliate-shell *::before,
body.premium-portal-active .premium-affiliate-shell *::after {
  box-sizing: border-box;
}

body.premium-portal-active .premium-affiliate-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
  width: 100%;
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
  overflow: clip;
  color: var(--premium-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

body.premium-portal-active .premium-affiliate-shell::after {
  position: fixed;
  z-index: -1;
  top: 6%;
  right: 4%;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(91, 67, 216, 0.08);
  filter: blur(90px);
  content: "";
  pointer-events: none;
}

body.premium-portal-active .premium-affiliate-shell :where(a, button, input, select, textarea) {
  font: inherit;
}

body.premium-portal-active .premium-affiliate-shell :where(a, button) {
  -webkit-tap-highlight-color: transparent;
}

body.premium-portal-active .premium-affiliate-shell :where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid rgba(88, 230, 237, 0.78);
  outline-offset: 3px;
}

body.premium-portal-active .premium-affiliate-shell a {
  color: inherit;
  text-decoration: none;
}

/* Sidebar */

body.premium-portal-active .premium-affiliate-shell .premium-sidebar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 248px;
  height: 100vh;
  height: 100dvh;
  min-height: 0;
  padding: 22px 14px 16px;
  overflow: hidden auto;
  border-right: 1px solid var(--premium-border);
  background:
    linear-gradient(180deg, rgba(17, 19, 47, 0.68), transparent 24%),
    var(--premium-sidebar-bg);
  box-shadow: 16px 0 42px rgba(0, 0, 0, 0.18);
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 163, 218, 0.24) transparent;
}

body.premium-portal-active .premium-affiliate-shell .premium-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 50px;
  margin: 0 5px 23px;
  padding: 5px 3px;
}

body.premium-portal-active .premium-affiliate-shell .premium-brand-mark {
  position: relative;
  display: grid;
  flex: 0 0 40px;
  place-items: center;
  width: 40px;
  height: 40px;
  overflow: hidden;
  border: 1px solid rgba(119, 247, 244, 0.38);
  border-radius: 12px;
  background: linear-gradient(135deg, var(--premium-cyan), #4d91ef 47%, var(--premium-violet));
  box-shadow: 0 0 24px rgba(88, 230, 237, 0.22), inset 0 1px rgba(255, 255, 255, 0.45);
  color: #06101e;
  font-size: 0.68rem;
  font-weight: 950;
  letter-spacing: -0.02em;
}

body.premium-portal-active .premium-affiliate-shell .premium-brand-mark::after {
  position: absolute;
  top: -45%;
  left: -70%;
  width: 65%;
  height: 190%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  content: "";
  transform: rotate(22deg);
  animation: premium-brand-sheen 7s ease-in-out infinite;
}

body.premium-portal-active .premium-affiliate-shell .premium-brand-mark img,
body.premium-portal-active .premium-affiliate-shell .premium-brand-mark svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 25px;
  height: 25px;
  object-fit: contain;
}

body.premium-portal-active .premium-affiliate-shell .premium-brand-copy {
  display: grid;
  min-width: 0;
  line-height: 1.08;
}

body.premium-portal-active .premium-affiliate-shell .premium-brand-copy strong {
  overflow: hidden;
  color: var(--premium-text);
  font-size: 0.95rem;
  font-weight: 850;
  letter-spacing: -0.025em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-brand-copy small {
  margin-top: 5px;
  color: var(--premium-cyan);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.premium-portal-active .premium-affiliate-shell .premium-sidebar-nav {
  display: grid;
  gap: 19px;
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-section {
  display: grid;
  gap: 5px;
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-section > :first-child:not(.premium-nav-link) {
  margin: 0 10px 5px;
  color: #697491;
  font-size: 0.61rem;
  font-weight: 850;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 42px;
  padding: 9px 11px;
  border: 1px solid transparent;
  border-radius: 11px;
  color: var(--premium-muted);
  font-size: 0.78rem;
  font-weight: 720;
  letter-spacing: 0.005em;
  transition: color 160ms ease, background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-link-sub {
  min-height: 34px;
  margin-left: 18px;
  padding: 7px 10px;
  border-left: 1px solid rgba(103, 223, 239, 0.18);
  border-radius: 0 9px 9px 0;
  font-size: 0.71rem;
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-link-sub svg {
  width: 16px;
  height: 16px;
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-link :where(svg, i) {
  display: grid;
  flex: 0 0 19px;
  place-items: center;
  width: 19px;
  height: 19px;
  color: #7783a5;
  font-style: normal;
  transition: color 160ms ease, filter 160ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-link:hover {
  border-color: rgba(136, 157, 215, 0.13);
  background: rgba(255, 255, 255, 0.035);
  color: var(--premium-text-soft);
  transform: translateX(2px);
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-link:hover :where(svg, i) {
  color: var(--premium-cyan);
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-link.is-active {
  border-color: rgba(103, 223, 239, 0.23);
  background: linear-gradient(100deg, rgba(64, 210, 224, 0.17), rgba(120, 82, 231, 0.09));
  box-shadow: inset 3px 0 var(--premium-cyan), 0 8px 22px rgba(0, 0, 0, 0.16);
  color: var(--premium-text);
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-link.is-active :where(svg, i) {
  color: var(--premium-cyan);
  filter: drop-shadow(0 0 7px rgba(88, 230, 237, 0.45));
}

body.premium-portal-active .premium-affiliate-shell .premium-nav-link [data-count] {
  min-width: 19px;
  margin-left: auto;
  padding: 2px 6px;
  border: 1px solid rgba(250, 95, 184, 0.26);
  border-radius: 999px;
  background: var(--premium-magenta-soft);
  color: #ff9bd1;
  font-size: 0.6rem;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
}

body.premium-portal-active .premium-affiliate-shell .premium-sidebar-account {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 58px;
  margin-top: auto;
  padding: 11px;
  border: 1px solid var(--premium-border);
  border-radius: var(--premium-radius-md);
  background: linear-gradient(135deg, rgba(24, 31, 63, 0.82), rgba(12, 16, 34, 0.82));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.03);
  color: var(--premium-text-soft);
}

body.premium-portal-active .premium-affiliate-shell .premium-sidebar-account > :first-child {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  overflow: hidden;
  border: 1px solid rgba(146, 108, 255, 0.45);
  border-radius: 10px;
  background: var(--premium-violet-soft);
  color: #cfbdff;
  font-size: 0.7rem;
  font-weight: 850;
}

body.premium-portal-active .premium-affiliate-shell .premium-sidebar-account > :first-child img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.premium-portal-active .premium-affiliate-shell .premium-sidebar-account strong,
body.premium-portal-active .premium-affiliate-shell .premium-sidebar-account small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-sidebar-account strong {
  color: var(--premium-text);
  font-size: 0.72rem;
}

body.premium-portal-active .premium-affiliate-shell .premium-sidebar-account small {
  margin-top: 2px;
  color: var(--premium-muted);
  font-size: 0.61rem;
}

/* Main workspace and topbar */

body.premium-portal-active .premium-affiliate-shell .premium-main {
  min-width: 0;
  min-height: 100vh;
  min-height: 100dvh;
}

body.premium-portal-active .premium-affiliate-shell .premium-topbar {
  position: sticky;
  z-index: 25;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 68px;
  padding: 11px clamp(20px, 2.4vw, 34px);
  border-bottom: 1px solid var(--premium-border);
  background: rgba(6, 9, 21, 0.82);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.13);
  -webkit-backdrop-filter: blur(18px) saturate(130%);
  backdrop-filter: blur(18px) saturate(130%);
}

body.premium-portal-active .premium-affiliate-shell .premium-topbar-left,
body.premium-portal-active .premium-affiliate-shell .premium-topbar-actions {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
}

body.premium-portal-active .premium-affiliate-shell .premium-topbar-left {
  flex: 1 1 330px;
}

body.premium-portal-active .premium-affiliate-shell .premium-topbar-actions {
  flex: 0 0 auto;
  justify-content: flex-end;
}

body.premium-portal-active .premium-affiliate-shell .premium-icon-button,
body.premium-portal-active .premium-affiliate-shell .premium-mobile-toggle {
  position: relative;
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 39px;
  height: 39px;
  padding: 0;
  border: 1px solid var(--premium-border);
  border-radius: 11px;
  background: rgba(18, 24, 49, 0.7);
  color: var(--premium-text-soft);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease, transform 160ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-icon-button:hover,
body.premium-portal-active .premium-affiliate-shell .premium-mobile-toggle:hover {
  border-color: rgba(88, 230, 237, 0.42);
  background: var(--premium-cyan-soft);
  color: var(--premium-cyan);
  transform: translateY(-1px);
}

body.premium-portal-active .premium-affiliate-shell .premium-icon-button[data-count]::after {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  place-items: center;
  border: 2px solid var(--premium-bg);
  border-radius: 999px;
  background: var(--premium-magenta);
  color: #170714;
  content: attr(data-count);
  font-size: 0.54rem;
  font-weight: 900;
}

body.premium-portal-active .premium-affiliate-shell .premium-mobile-toggle {
  display: none;
}

body.premium-portal-active .premium-affiliate-shell .premium-offer-access {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 39px;
  padding: 8px 14px;
  border: 1px solid rgba(88, 230, 237, 0.33);
  border-radius: 11px;
  background: linear-gradient(105deg, rgba(54, 216, 225, 0.2), rgba(121, 81, 232, 0.18));
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.07), 0 8px 22px rgba(0, 0, 0, 0.13);
  color: #dfffff;
  font-size: 0.71rem;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-offer-access:hover {
  border-color: rgba(88, 230, 237, 0.7);
  box-shadow: 0 0 24px rgba(88, 230, 237, 0.13);
  transform: translateY(-1px);
}

body.premium-portal-active .premium-affiliate-shell .premium-search {
  position: relative;
  display: flex;
  flex: 1 1 290px;
  max-width: 390px;
  min-width: 170px;
  align-items: center;
}

body.premium-portal-active .premium-affiliate-shell .premium-search > :where(svg, i) {
  position: absolute;
  z-index: 1;
  left: 13px;
  width: 16px;
  height: 16px;
  color: #737f9e;
  pointer-events: none;
}

body.premium-portal-active .premium-affiliate-shell .premium-search input {
  width: 100%;
  min-height: 39px;
  padding: 8px 39px 8px 39px;
  border: 1px solid var(--premium-border);
  border-radius: 11px;
  outline: none;
  background: rgba(14, 19, 40, 0.72);
  color: var(--premium-text);
  font-size: 0.72rem;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-search input::placeholder {
  color: #707b99;
  opacity: 1;
}

body.premium-portal-active .premium-affiliate-shell .premium-search input:focus {
  border-color: rgba(88, 230, 237, 0.52);
  background: rgba(17, 24, 49, 0.94);
  box-shadow: 0 0 0 3px rgba(88, 230, 237, 0.09);
}

body.premium-portal-active .premium-affiliate-shell .premium-search kbd {
  position: absolute;
  right: 9px;
  padding: 2px 5px;
  border: 1px solid rgba(147, 163, 207, 0.2);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.035);
  color: #77829d;
  font: 600 0.57rem/1.3 inherit;
  pointer-events: none;
}

body.premium-portal-active .premium-affiliate-shell .premium-balance,
body.premium-portal-active .premium-affiliate-shell .premium-clock {
  display: grid;
  align-content: center;
  min-height: 39px;
  padding: 4px 11px;
  border-left: 1px solid var(--premium-border);
  line-height: 1.18;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-balance small,
body.premium-portal-active .premium-affiliate-shell .premium-clock small {
  color: var(--premium-muted);
  font-size: 0.54rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

body.premium-portal-active .premium-affiliate-shell .premium-balance strong,
body.premium-portal-active .premium-affiliate-shell .premium-clock strong,
body.premium-portal-active .premium-affiliate-shell .premium-balance time,
body.premium-portal-active .premium-affiliate-shell .premium-clock time {
  margin-top: 3px;
  color: var(--premium-text);
  font-size: 0.71rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

body.premium-portal-active .premium-affiliate-shell .premium-balance strong {
  color: var(--premium-success);
}

body.premium-portal-active .premium-affiliate-shell .premium-account-chip {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 138px;
  min-height: 42px;
  padding: 5px 8px 5px 6px;
  border: 1px solid var(--premium-border);
  border-radius: 12px;
  background: rgba(17, 23, 46, 0.76);
  color: var(--premium-text-soft);
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-account-chip:hover {
  border-color: var(--premium-border-strong);
  background: rgba(23, 30, 59, 0.94);
}

body.premium-portal-active .premium-affiliate-shell .premium-account-chip > :first-child {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  overflow: hidden;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(88, 230, 237, 0.3), rgba(147, 108, 255, 0.4));
  color: #ebfaff;
  font-size: 0.65rem;
  font-weight: 850;
}

body.premium-portal-active .premium-affiliate-shell .premium-account-chip > :first-child img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

body.premium-portal-active .premium-affiliate-shell .premium-account-chip strong,
body.premium-portal-active .premium-affiliate-shell .premium-account-chip small {
  display: block;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-account-chip strong {
  color: var(--premium-text);
  font-size: 0.68rem;
}

body.premium-portal-active .premium-affiliate-shell .premium-account-chip small {
  margin-top: 2px;
  color: var(--premium-muted);
  font-size: 0.57rem;
}

/* Content */

body.premium-portal-active .premium-affiliate-shell .premium-content {
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  padding: 28px clamp(20px, 2.4vw, 34px) 48px;
}

body.premium-portal-active .premium-affiliate-shell .premium-route-content {
  min-width: 0;
  animation: premium-route-in 260ms ease both;
}

body.premium-portal-active .premium-affiliate-shell .premium-page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

body.premium-portal-active .premium-affiliate-shell .premium-page-heading h1 {
  margin: 3px 0 0;
  color: var(--premium-text);
  font-size: clamp(1.55rem, 2.6vw, 2.15rem);
  font-weight: 820;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

body.premium-portal-active .premium-affiliate-shell .premium-page-heading p {
  max-width: 680px;
  margin: 7px 0 0;
  color: var(--premium-muted);
  font-size: 0.76rem;
  line-height: 1.55;
}

body.premium-portal-active .premium-affiliate-shell .premium-page-heading > :first-child > small {
  color: var(--premium-cyan);
  font-size: 0.6rem;
  font-weight: 850;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-period {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -4px 0 18px;
  padding: 11px 13px;
  border: 1px solid rgba(91, 224, 255, 0.2);
  border-radius: 14px;
  background: linear-gradient(110deg, rgba(11, 24, 58, 0.92), rgba(18, 19, 55, 0.84));
  box-shadow: 0 12px 30px rgba(1, 5, 22, 0.28);
}

body.premium-portal-active .premium-affiliate-shell .premium-report-period > div:first-child small,
body.premium-portal-active .premium-affiliate-shell .premium-report-period > div:first-child strong {
  display: block;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-period > div:first-child small {
  color: var(--premium-cyan);
  font-size: 0.52rem;
  font-weight: 850;
  letter-spacing: 0.14em;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-period > div:first-child strong {
  margin-top: 3px;
  color: var(--premium-text);
  font-size: 0.76rem;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-period-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-period-buttons button {
  min-height: 31px;
  padding: 6px 11px;
  border: 1px solid rgba(146, 170, 230, 0.2);
  border-radius: 9px;
  background: rgba(17, 29, 65, 0.72);
  color: var(--premium-muted);
  font: inherit;
  font-size: 0.64rem;
  font-weight: 780;
  cursor: pointer;
  transition: 160ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-period-buttons button:hover,
body.premium-portal-active .premium-affiliate-shell .premium-report-period-buttons button.is-active {
  border-color: rgba(92, 232, 255, 0.52);
  background: linear-gradient(135deg, rgba(53, 200, 210, 0.22), rgba(102, 93, 235, 0.2));
  color: #efffff;
  box-shadow: 0 0 20px rgba(68, 220, 240, 0.12);
}

@media (max-width: 720px) {
  body.premium-portal-active .premium-affiliate-shell .premium-report-period {
    align-items: stretch;
    flex-direction: column;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-report-period-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

body.premium-portal-active .premium-affiliate-shell .premium-realtime-pill {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(113, 237, 189, 0.24);
  border-radius: 999px;
  background: rgba(77, 207, 163, 0.08);
  color: #a5f7d7;
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-realtime-pill::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--premium-success);
  box-shadow: 0 0 0 0 rgba(113, 237, 189, 0.5);
  content: "";
  animation: premium-live-pulse 2s ease-out infinite;
}

/* Metrics */

body.premium-portal-active .premium-affiliate-shell .premium-metrics-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 14px;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 13px;
  min-width: 0;
  min-height: 117px;
  padding: 17px;
  overflow: hidden;
  border: 1px solid var(--premium-border);
  border-radius: var(--premium-radius-md);
  background:
    linear-gradient(145deg, rgba(24, 31, 63, 0.72), rgba(12, 16, 34, 0.88)),
    var(--premium-panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035), 0 12px 35px rgba(0, 0, 0, 0.15);
  transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card::after {
  position: absolute;
  right: -34px;
  bottom: -42px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--premium-cyan);
  content: "";
  filter: blur(40px);
  opacity: 0.08;
  pointer-events: none;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card:nth-child(2)::after {
  background: var(--premium-violet);
  opacity: 0.11;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card:nth-child(3)::after {
  background: var(--premium-magenta);
  opacity: 0.1;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card:nth-child(4)::after {
  background: var(--premium-success);
  opacity: 0.09;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card:hover {
  border-color: var(--premium-border-strong);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.05), 0 17px 38px rgba(0, 0, 0, 0.23);
  transform: translateY(-2px);
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-icon {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(88, 230, 237, 0.18);
  border-radius: 11px;
  background: var(--premium-cyan-soft);
  color: var(--premium-cyan);
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card:nth-child(2) .premium-metric-icon {
  border-color: rgba(147, 108, 255, 0.21);
  background: var(--premium-violet-soft);
  color: #bda7ff;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card:nth-child(3) .premium-metric-icon {
  border-color: rgba(250, 95, 184, 0.2);
  background: var(--premium-magenta-soft);
  color: #ff91ca;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card:nth-child(4) .premium-metric-icon {
  border-color: rgba(113, 237, 189, 0.2);
  background: rgba(113, 237, 189, 0.1);
  color: var(--premium-success);
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-icon :where(svg, i) {
  width: 18px;
  height: 18px;
  font-style: normal;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card > :last-child {
  min-width: 0;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-card :where(p, small) {
  display: block;
  margin: 0;
  color: var(--premium-muted);
  font-size: 0.63rem;
  font-weight: 650;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-value {
  display: block;
  margin: 6px 0 4px;
  overflow: hidden;
  color: var(--premium-text);
  font-size: clamp(1.28rem, 2vw, 1.68rem);
  font-weight: 840;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.045em;
  line-height: 1.05;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-change {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--premium-success);
  font-size: 0.61rem;
  font-weight: 780;
  font-variant-numeric: tabular-nums;
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-change.is-negative,
body.premium-portal-active .premium-affiliate-shell .premium-metric-change[data-direction="down"] {
  color: var(--premium-danger);
}

body.premium-portal-active .premium-affiliate-shell .premium-metric-change.is-neutral,
body.premium-portal-active .premium-affiliate-shell .premium-metric-change[data-direction="flat"] {
  color: var(--premium-muted);
}

/* Compact period strip inspired by network dashboards. It is additive to the
   existing real-time cards and reads only the member's private aggregates. */
body.premium-portal-active .premium-affiliate-shell .premium-period-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 14px;
}

body.premium-portal-active .premium-affiliate-shell .premium-period-card {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 13px 15px;
  border: 1px solid var(--premium-border);
  border-radius: var(--premium-radius-md);
  background: rgba(18, 25, 51, 0.66);
}

body.premium-portal-active .premium-affiliate-shell .premium-period-card small {
  color: var(--premium-muted);
  font-size: 0.65rem;
  font-weight: 760;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

body.premium-portal-active .premium-affiliate-shell .premium-period-card strong {
  color: var(--premium-success);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

body.premium-portal-active .premium-affiliate-shell .premium-period-card span {
  overflow: hidden;
  color: var(--premium-muted);
  font-size: 0.66rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-period-card span b {
  color: var(--premium-text);
}

/* Analytics, charts, and cards */

body.premium-portal-active .premium-affiliate-shell .premium-analytics-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.75fr);
  gap: 14px;
  align-items: start;
}

body.premium-portal-active .premium-affiliate-shell .premium-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--premium-border);
  border-radius: var(--premium-radius-lg);
  background:
    linear-gradient(145deg, rgba(19, 26, 53, 0.82), rgba(10, 14, 31, 0.91)),
    var(--premium-panel);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.035), var(--premium-shadow);
}

body.premium-portal-active .premium-affiliate-shell .premium-card::before {
  position: absolute;
  top: 0;
  right: 16%;
  left: 16%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(102, 223, 239, 0.28), rgba(164, 108, 255, 0.24), transparent);
  content: "";
  pointer-events: none;
}

body.premium-portal-active .premium-affiliate-shell .premium-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--premium-border);
}

body.premium-portal-active .premium-affiliate-shell .premium-card-head h2,
body.premium-portal-active .premium-affiliate-shell .premium-card-head h3 {
  margin: 0;
  color: var(--premium-text);
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: -0.015em;
}

body.premium-portal-active .premium-affiliate-shell .premium-card-head p,
body.premium-portal-active .premium-affiliate-shell .premium-card-head small {
  display: block;
  margin: 3px 0 0;
  color: var(--premium-muted);
  font-size: 0.61rem;
}

body.premium-portal-active .premium-affiliate-shell .premium-chart-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--premium-border);
  border-radius: 9px;
  background: rgba(5, 8, 20, 0.6);
}

body.premium-portal-active .premium-affiliate-shell .premium-chart-tab {
  min-width: 34px;
  min-height: 27px;
  padding: 5px 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--premium-muted);
  font-size: 0.6rem;
  font-weight: 780;
  cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease, box-shadow 150ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-chart-tab:hover {
  color: var(--premium-text-soft);
}

body.premium-portal-active .premium-affiliate-shell .premium-chart-tab.is-active,
body.premium-portal-active .premium-affiliate-shell .premium-chart-tab[aria-selected="true"] {
  background: linear-gradient(115deg, rgba(88, 230, 237, 0.2), rgba(147, 108, 255, 0.2));
  box-shadow: inset 0 0 0 1px rgba(105, 210, 237, 0.18);
  color: var(--premium-text);
}

body.premium-portal-active .premium-affiliate-shell .premium-chart {
  position: relative;
  min-height: 280px;
  padding: 18px;
  overflow: hidden;
  background:
    linear-gradient(rgba(136, 154, 204, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(136, 154, 204, 0.045) 1px, transparent 1px);
  background-position: 18px 18px;
  background-size: calc((100% - 36px) / 6) 52px;
}

body.premium-portal-active .premium-affiliate-shell .premium-chart::after {
  position: absolute;
  right: 12%;
  bottom: 4%;
  width: 220px;
  height: 120px;
  border-radius: 50%;
  background: rgba(88, 230, 237, 0.06);
  content: "";
  filter: blur(45px);
  pointer-events: none;
}

body.premium-portal-active .premium-affiliate-shell .premium-chart-svg {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 244px;
  overflow: visible;
}

body.premium-portal-active .premium-affiliate-shell .premium-chart-svg [data-line],
body.premium-portal-active .premium-affiliate-shell .premium-chart-svg .premium-chart-line {
  fill: none;
  stroke: var(--premium-cyan);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.5;
  filter: drop-shadow(0 0 5px rgba(88, 230, 237, 0.38));
}

body.premium-portal-active .premium-affiliate-shell .premium-chart-svg [data-area],
body.premium-portal-active .premium-affiliate-shell .premium-chart-svg .premium-chart-area {
  fill: rgba(88, 230, 237, 0.1);
}

body.premium-portal-active .premium-affiliate-shell .premium-chart-svg text {
  fill: var(--premium-muted);
  font-family: inherit;
  font-size: 10px;
}

/* Reporting table */

body.premium-portal-active .premium-affiliate-shell .premium-table-wrap {
  width: 100%;
  min-width: 0;
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(145, 163, 218, 0.25) transparent;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table {
  width: 100%;
  min-width: 630px;
  border-collapse: collapse;
  color: var(--premium-text-soft);
  font-size: 0.7rem;
  font-variant-numeric: tabular-nums;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table th,
body.premium-portal-active .premium-affiliate-shell .premium-report-table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(144, 163, 218, 0.105);
  text-align: left;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table th {
  position: sticky;
  z-index: 2;
  top: 0;
  background: rgba(11, 15, 33, 0.97);
  color: var(--premium-muted);
  font-size: 0.57rem;
  font-weight: 820;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table tbody tr {
  transition: background-color 140ms ease;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table tbody tr:hover {
  background: rgba(88, 230, 237, 0.035);
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table tbody tr:last-child td {
  border-bottom: 0;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table td:first-child {
  color: var(--premium-text);
  font-weight: 720;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table td:last-child,
body.premium-portal-active .premium-affiliate-shell .premium-report-table th:last-child {
  text-align: right;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table .is-positive {
  color: var(--premium-success);
  font-weight: 750;
}

body.premium-portal-active .premium-affiliate-shell .premium-report-table .is-negative {
  color: var(--premium-danger);
  font-weight: 750;
}

/* Signed provider chargeback center */
body.premium-portal-active .premium-affiliate-shell .premium-chargeback-metrics {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-metrics .premium-metric-card {
  border-color: rgba(255, 92, 137, 0.22);
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-metrics .premium-metric-icon {
  color: #ff87a8;
  background: linear-gradient(145deg, rgba(255, 76, 132, 0.22), rgba(196, 72, 255, 0.14));
  box-shadow: inset 0 0 0 1px rgba(255, 119, 160, 0.18);
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-metrics .premium-metric-value {
  color: #ff93ae;
}

body.premium-portal-active .premium-affiliate-shell .premium-realtime-danger {
  border-color: rgba(255, 100, 142, 0.38);
  color: #ff9bb5;
  background: rgba(139, 24, 69, 0.24);
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-note {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  margin: 14px 0;
  padding: 17px 18px;
  border: 1px solid rgba(255, 108, 150, 0.25);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(91, 21, 59, 0.38), rgba(28, 25, 77, 0.48));
  color: #dbe5ff;
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-note > span {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 13px;
  color: #ff91ad;
  background: rgba(255, 88, 137, 0.15);
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-note svg {
  width: 23px;
  height: 23px;
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-note :where(strong, p) {
  margin: 0;
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-note strong {
  color: #fff;
  font-size: 0.93rem;
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-note p {
  margin-top: 5px;
  color: #aebcda;
  font-size: 0.78rem;
  line-height: 1.55;
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-card {
  margin-top: 0;
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-table code {
  color: #b9c8e7;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

body.premium-portal-active .premium-affiliate-shell .premium-chargeback-status {
  display: inline-flex;
  align-items: center;
  padding: 5px 8px;
  border: 1px solid rgba(255, 104, 147, 0.28);
  border-radius: 999px;
  color: #ff99b4;
  background: rgba(143, 27, 70, 0.22);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: capitalize;
}

body.premium-portal-active .premium-affiliate-shell .premium-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  padding: 36px 24px;
  color: var(--premium-muted);
  text-align: center;
}

body.premium-portal-active .premium-affiliate-shell .premium-empty > div {
  max-width: 360px;
}

body.premium-portal-active .premium-affiliate-shell .premium-empty :where(svg, i) {
  display: grid;
  width: 42px;
  height: 42px;
  margin: 0 auto 13px;
  place-items: center;
  border: 1px solid var(--premium-border);
  border-radius: 12px;
  background: rgba(147, 108, 255, 0.09);
  color: #b9a3ff;
  font-style: normal;
}

body.premium-portal-active .premium-affiliate-shell .premium-empty h2,
body.premium-portal-active .premium-affiliate-shell .premium-empty h3 {
  margin: 0 0 6px;
  color: var(--premium-text-soft);
  font-size: 0.91rem;
}

body.premium-portal-active .premium-affiliate-shell .premium-empty p {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.55;
}

/* Legacy member-shell compatibility inside the premium portal. */

body.premium-portal-active .premium-affiliate-shell.member-persistent-shell,
body.premium-portal-active .premium-affiliate-shell .member-persistent-shell {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
}

body.premium-portal-active .premium-affiliate-shell .member-route-content,
body.premium-portal-active .premium-affiliate-shell.member-persistent-shell .member-route-content {
  min-width: 0;
}

body.premium-portal-active .premium-affiliate-shell .member-route-actions,
body.premium-portal-active .premium-affiliate-shell.member-persistent-shell .member-route-actions {
  display: none !important;
}

/* Responsive layout */

@media (max-width: 1100px) {
  body.premium-portal-active .premium-affiliate-shell {
    grid-template-columns: 218px minmax(0, 1fr);
  }

  body.premium-portal-active .premium-affiliate-shell .premium-sidebar {
    width: 218px;
    padding-right: 11px;
    padding-left: 11px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.premium-portal-active .premium-affiliate-shell .premium-period-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.premium-portal-active .premium-affiliate-shell .premium-analytics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  body.premium-portal-active .premium-affiliate-shell .premium-clock {
    display: none;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-account-chip {
    min-width: 42px;
    grid-template-columns: 32px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-account-chip > :not(:first-child) {
    display: none;
  }
}

@media (max-width: 900px) {
  body.premium-portal-active .premium-affiliate-shell {
    grid-template-columns: minmax(0, 1fr);
    overflow: visible;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-sidebar {
    position: fixed;
    z-index: 80;
    top: 0;
    bottom: 0;
    left: 0;
    width: min(284px, calc(100vw - 54px));
    height: 100vh;
    height: 100dvh;
    padding: 20px 14px 16px;
    border-right-color: rgba(145, 185, 255, 0.25);
    box-shadow: 28px 0 70px rgba(0, 0, 0, 0.56);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms ease;
  }

  body.premium-portal-active .premium-affiliate-shell.is-sidebar-open .premium-sidebar,
  body.premium-portal-active.premium-sidebar-open .premium-affiliate-shell .premium-sidebar {
    transform: translateX(0);
    visibility: visible;
  }

  body.premium-portal-active .premium-affiliate-shell::before {
    position: fixed;
    z-index: 70;
    inset: 0;
    background: rgba(1, 3, 10, 0.68);
    content: "";
    opacity: 0;
    pointer-events: none;
    transition: opacity 220ms ease;
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
  }

  body.premium-portal-active .premium-affiliate-shell.is-sidebar-open::before,
  body.premium-portal-active.premium-sidebar-open .premium-affiliate-shell::before {
    opacity: 1;
    pointer-events: auto;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-mobile-toggle {
    display: inline-grid;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-topbar {
    padding-right: 18px;
    padding-left: 18px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-content {
    padding-right: 18px;
    padding-left: 18px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-balance {
    display: none;
  }
}

@media (max-width: 640px) {
  body.premium-portal-active .premium-affiliate-shell .premium-topbar {
    min-height: 62px;
    gap: 8px;
    padding: 10px 12px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-topbar-left,
  body.premium-portal-active .premium-affiliate-shell .premium-topbar-actions {
    gap: 7px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-search {
    flex-basis: auto;
    min-width: 0;
    max-width: none;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-search input {
    padding-right: 12px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-search kbd,
  body.premium-portal-active .premium-affiliate-shell .premium-offer-access,
  body.premium-portal-active .premium-affiliate-shell .premium-topbar-actions .premium-icon-button:first-of-type {
    display: none;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-account-chip {
    min-width: 39px;
    min-height: 39px;
    padding: 3px;
    grid-template-columns: 31px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-account-chip > :first-child {
    width: 31px;
    height: 31px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-content {
    padding: 21px 12px 36px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 11px;
    margin-bottom: 16px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-page-heading h1 {
    font-size: 1.55rem;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-realtime-pill {
    min-height: 27px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-metrics-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 9px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-metric-card {
    min-height: 98px;
    padding: 14px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-period-summary {
    grid-template-columns: 1fr;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-card {
    border-radius: 14px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-card-head {
    min-height: 58px;
    align-items: flex-start;
    padding: 13px 14px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-chart-tabs {
    flex: 0 0 auto;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-chart {
    min-height: 228px;
    padding: 13px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-chart-svg {
    height: 202px;
  }

  body.premium-portal-active .premium-affiliate-shell .premium-report-table th,
  body.premium-portal-active .premium-affiliate-shell .premium-report-table td {
    padding: 11px 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.premium-portal-active .premium-affiliate-shell,
  body.premium-portal-active .premium-affiliate-shell *,
  body.premium-portal-active .premium-affiliate-shell *::before,
  body.premium-portal-active .premium-affiliate-shell *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@keyframes premium-live-pulse {
  70% {
    box-shadow: 0 0 0 7px rgba(113, 237, 189, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(113, 237, 189, 0);
  }
}

@keyframes premium-brand-sheen {
  0%,
  72% {
    transform: translateX(0) rotate(22deg);
  }

  88%,
  100% {
    transform: translateX(330%) rotate(22deg);
  }
}

@keyframes premium-route-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

body.premium-portal-active .premium-affiliate-shell .premium-member-uid {
  display: block;
  max-width: 145px;
  margin-top: 3px;
  overflow: hidden;
  color: #79e8cf;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.62rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-lead-table {
  min-width: 1050px;
}

body.premium-portal-active .premium-affiliate-shell .premium-lead-table code {
  color: #c7d8ff;
  font-size: 0.72rem;
  overflow-wrap: anywhere;
}

body.premium-portal-active .premium-affiliate-shell .premium-lead-status {
  display: inline-flex;
  padding: 5px 9px;
  border: 1px solid rgba(93, 232, 187, 0.35);
  border-radius: 999px;
  background: rgba(57, 196, 153, 0.12);
  color: #75f0c6;
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
}

body.premium-portal-active .premium-affiliate-shell .premium-lead-status.is-reversed {
  border-color: rgba(255, 111, 150, 0.38);
  background: rgba(255, 86, 137, 0.12);
  color: #ff8faa;
}

body.premium-portal-active .premium-affiliate-shell .premium-subid-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

body.premium-portal-active .premium-affiliate-shell .premium-subid-note {
  margin: 14px 0;
  border-color: rgba(90, 232, 202, 0.28);
  background: linear-gradient(135deg, rgba(32, 181, 159, 0.12), rgba(78, 111, 237, 0.08));
}

body.premium-portal-active .premium-affiliate-shell .premium-subid-table {
  min-width: 1080px;
}

body.premium-portal-active .premium-affiliate-shell .premium-subid-label {
  display: inline-flex;
  max-width: 190px;
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid rgba(103, 239, 204, 0.28);
  border-radius: 999px;
  background: rgba(58, 214, 174, 0.1);
  color: #82f4d1;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-subid-provider {
  display: inline-flex;
  align-items: center;
  max-width: 170px;
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid rgba(151, 132, 255, 0.34);
  border-radius: 999px;
  background: rgba(116, 91, 224, 0.13);
  color: #cbbcff;
  font-size: 0.72rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-copy-link {
  padding: 7px 10px;
  border: 1px solid rgba(112, 161, 255, 0.38);
  border-radius: 9px;
  background: rgba(45, 77, 143, 0.24);
  color: #d9e6ff;
  cursor: pointer;
  font: inherit;
  font-size: 0.7rem;
  font-weight: 800;
  white-space: nowrap;
}

body.premium-portal-active .premium-affiliate-shell .premium-copy-link:hover,
body.premium-portal-active .premium-affiliate-shell .premium-copy-link:focus-visible {
  border-color: #72efcd;
  color: #8df5d7;
}

@media (max-width: 1180px) {
  body.premium-portal-active .premium-affiliate-shell .premium-subid-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  body.premium-portal-active .premium-affiliate-shell .premium-subid-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Light mode: the same information architecture with a high-contrast,
   low-glare palette. All rules stay scoped to the member portal. */
body.premium-portal-active.premium-light {
  --premium-bg: #eef3f9;
  --premium-bg-raised: #f8fbff;
  --premium-sidebar-bg: rgba(255, 255, 255, 0.98);
  --premium-panel: rgba(255, 255, 255, 0.94);
  --premium-panel-strong: #ffffff;
  --premium-panel-hover: #f1f6fc;
  --premium-border: rgba(38, 70, 108, 0.16);
  --premium-border-strong: rgba(32, 122, 151, 0.34);
  --premium-text: #17263d;
  --premium-text-soft: #405570;
  --premium-muted: #647891;
  --premium-cyan: #087f96;
  --premium-cyan-soft: rgba(8, 127, 150, 0.11);
  --premium-magenta: #bf3f85;
  --premium-magenta-soft: rgba(191, 63, 133, 0.1);
  --premium-violet: #6645c3;
  --premium-violet-soft: rgba(102, 69, 195, 0.11);
  --premium-success: #087d5b;
  --premium-danger: #c53c56;
  --premium-warning: #9a6500;
  background: linear-gradient(145deg, #f8fbff, #e9f0f8);
}

/* The legacy reward-art layer sits outside the member shell. Keep it out of
   light mode so the portal remains readable instead of placing white cards
   over the old dark artwork. */
body.premium-portal-active.premium-light .reward-art-rotator,
body.premium-portal-active.premium-light .ilc-site-watermark {
  display: none !important;
}

body.premium-portal-active.premium-light #app,
body.premium-portal-active.premium-light .premium-main {
  background: transparent;
}

body.premium-portal-active.premium-light .premium-page-heading h1,
body.premium-portal-active.premium-light .premium-card-head h2,
body.premium-portal-active.premium-light .premium-card-head h3,
body.premium-portal-active.premium-light .premium-metric-value,
body.premium-portal-active.premium-light .premium-period-card span b {
  color: #17263d;
}

body.premium-portal-active.premium-light .premium-affiliate-shell {
  color: var(--premium-text);
}

body.premium-portal-active.premium-light .premium-affiliate-shell::after {
  background: rgba(65, 150, 180, 0.08);
}

body.premium-portal-active.premium-light .premium-sidebar {
  border-right-color: var(--premium-border);
  background: var(--premium-sidebar-bg);
  box-shadow: 8px 0 28px rgba(32, 67, 105, 0.06);
}

body.premium-portal-active.premium-light .premium-topbar {
  border-bottom-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 24px rgba(31, 63, 99, 0.07);
}

body.premium-portal-active.premium-light .premium-nav-link {
  color: #536b85;
}

body.premium-portal-active.premium-light .premium-nav-link:hover {
  border-color: rgba(8, 127, 150, 0.2);
  background: #eef7fb;
  color: var(--premium-text);
}

body.premium-portal-active.premium-light .premium-nav-link.is-active {
  border-color: rgba(8, 127, 150, 0.28);
  background: linear-gradient(100deg, rgba(8, 127, 150, 0.13), rgba(102, 69, 195, 0.08));
  color: var(--premium-text);
}

body.premium-portal-active.premium-light .premium-search,
body.premium-portal-active.premium-light .premium-icon-button,
body.premium-portal-active.premium-light .premium-account-chip {
  border-color: var(--premium-border);
  background: #f7faff;
  color: var(--premium-text-soft);
}

body.premium-portal-active.premium-light .premium-search input {
  color: var(--premium-text);
}

body.premium-portal-active.premium-light .premium-search input::placeholder {
  color: #8192a8;
}

body.premium-portal-active.premium-light .premium-offer-access {
  border-color: rgba(8, 127, 150, 0.34);
  background: linear-gradient(105deg, rgba(8, 127, 150, 0.12), rgba(102, 69, 195, 0.1));
  color: #075f74;
}

body.premium-portal-active.premium-light .premium-card,
body.premium-portal-active.premium-light .premium-metric-card,
body.premium-portal-active.premium-light .premium-period-card {
  border-color: var(--premium-border);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 30px rgba(35, 67, 101, 0.08);
}

body.premium-portal-active.premium-light .premium-metric-card:hover,
body.premium-portal-active.premium-light .premium-period-card:hover {
  box-shadow: 0 16px 32px rgba(35, 67, 101, 0.13);
}

body.premium-portal-active.premium-light .premium-metric-card::after {
  opacity: 0.05;
}

body.premium-portal-active.premium-light .premium-chart {
  background:
    linear-gradient(rgba(83, 119, 157, 0.12) 1px, transparent 1px),
    linear-gradient(90deg, rgba(83, 119, 157, 0.09) 1px, transparent 1px),
    #f4f8fd;
}

body.premium-portal-active.premium-light .premium-chart-tabs {
  border-color: rgba(38, 70, 108, 0.18);
  background: #edf3fa;
}

body.premium-portal-active.premium-light .premium-chart-tab {
  color: #536b85;
}

body.premium-portal-active.premium-light .premium-chart-tab:hover {
  color: #17263d;
  background: #e1edf7;
}

body.premium-portal-active.premium-light .premium-chart-tab.is-active,
body.premium-portal-active.premium-light .premium-chart-tab[aria-selected="true"] {
  color: #17263d;
  background: linear-gradient(115deg, rgba(8, 127, 150, 0.18), rgba(102, 69, 195, 0.14));
  box-shadow: inset 0 0 0 1px rgba(8, 127, 150, 0.2);
}

body.premium-portal-active.premium-light .premium-report-table thead {
  background: #f3f7fc;
}

body.premium-portal-active.premium-light .premium-report-table tbody tr {
  border-top-color: rgba(38, 70, 108, 0.1);
}

body.premium-portal-active.premium-light .premium-report-table tbody tr:hover {
  background: #f5f9fe;
}

body.premium-portal-active.premium-light .premium-empty {
  color: var(--premium-muted);
}

body.premium-portal-active.premium-light .premium-realtime-pill {
  border-color: rgba(8, 127, 150, 0.24);
  background: rgba(8, 127, 150, 0.08);
  color: #076d82;
}

body.premium-portal-active.premium-light .premium-period-card strong {
  color: var(--premium-success);
}

/* Nixwall-inspired publisher workspace. It only changes the presentation and
   navigation; Firestore member, payment, tracking and ledger data remain in
   their existing collections so hidden areas are recoverable later. */
body.premium-portal-active.premium-light .premium-affiliate-shell {
  grid-template-columns: 192px minmax(0, 1fr);
  background: #eef3f8;
}

body.premium-portal-active.premium-light .premium-sidebar {
  padding: 20px 10px 14px;
}

body.premium-portal-active.premium-light .premium-brand {
  justify-content: center;
  min-height: 74px;
  margin: -20px -10px 14px;
  padding: 14px 12px;
  border-bottom: 1px solid #e2eaf3;
}

body.premium-portal-active.premium-light .premium-brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  box-shadow: none;
}

body.premium-portal-active.premium-light .premium-brand-copy strong {
  color: #1b3151;
  font-size: .72rem;
}

body.premium-portal-active.premium-light .premium-brand-copy small,
body.premium-portal-active.premium-light .premium-nav-section > span {
  color: #8998aa;
}

body.premium-portal-active.premium-light .premium-nav-section {
  margin: 12px 0 0;
}

body.premium-portal-active.premium-light .premium-nav-section > span {
  padding: 0 8px 6px;
  font-size: .53rem;
}

body.premium-portal-active.premium-light .premium-nav-link {
  min-height: 33px;
  margin: 1px 0;
  padding: 7px 10px;
  border: 0;
  border-radius: 5px;
  color: #425b78;
  font-size: .66rem;
}

body.premium-portal-active.premium-light .premium-nav-link:hover {
  background: #edf4ff;
  color: #2863c9;
}

body.premium-portal-active.premium-light .premium-nav-link.is-active {
  border: 0;
  background: #3e7cf1;
  box-shadow: none;
  color: #fff;
}

body.premium-portal-active.premium-light .premium-nav-link svg { width: 15px; height: 15px; }

body.premium-portal-active.premium-light .premium-sidebar-account {
  margin: auto 2px 0;
  padding: 9px;
  border: 0;
  border-radius: 7px;
  background: #eef3f9;
  box-shadow: none;
}

body.premium-portal-active.premium-light .premium-topbar {
  min-height: 58px;
  padding: 8px clamp(18px, 2.5vw, 34px);
  background: rgba(255, 255, 255, .96);
}

body.premium-portal-active.premium-light .premium-topbar-left { flex-basis: 220px; }
body.premium-portal-active.premium-light .premium-search,
body.premium-portal-active.premium-light .premium-topbar-left > .premium-icon-button,
body.premium-portal-active.premium-light .premium-offer-access { display: none; }
body.premium-portal-active.premium-light .premium-topbar-actions { gap: 6px; }
body.premium-portal-active.premium-light .premium-balance,
body.premium-portal-active.premium-light .premium-clock { border-left: 0; }

body.premium-portal-active.premium-light .premium-content {
  max-width: 1120px;
  padding: 28px clamp(20px, 3.2vw, 46px) 52px;
}

body.premium-portal-active.premium-light .nixwall-page-heading { margin: 0 0 16px; }
body.premium-portal-active.premium-light .nixwall-page-heading h1 { font-size: 1.05rem; letter-spacing: -.02em; }

body.premium-portal-active.premium-light .nixwall-metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

body.premium-portal-active.premium-light .nixwall-metric-grid > article {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 76px;
  padding: 14px;
  border-radius: 5px;
  background: #202f48;
  box-shadow: 0 8px 20px rgba(30, 49, 75, .08);
}

body.premium-portal-active.premium-light .nixwall-metric-grid small {
  display: block;
  color: #d8e5fa;
  font-size: .58rem;
  font-weight: 750;
}

body.premium-portal-active.premium-light .nixwall-metric-grid strong {
  display: block;
  margin-top: 4px;
  color: #fff;
  font-size: 1rem;
  font-variant-numeric: tabular-nums;
}

body.premium-portal-active.premium-light .nixwall-metric-symbol {
  display: grid;
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #dce8ff;
  color: #376ce2;
  font-size: 1rem;
  font-weight: 900;
}
body.premium-portal-active.premium-light .nixwall-metric-symbol.is-green { background: #dcf7e9; color: #0d9c64; }
body.premium-portal-active.premium-light .nixwall-metric-symbol.is-violet { background: #eee1ff; color: #8a49db; }
body.premium-portal-active.premium-light .nixwall-metric-symbol.is-red { background: #ffe0e4; color: #e04d61; }

body.premium-portal-active.premium-light .nixwall-performance-card { border-radius: 5px; }
body.premium-portal-active.premium-light .nixwall-performance-card .premium-card-head { min-height: 48px; padding: 11px 14px; }
body.premium-portal-active.premium-light .nixwall-performance-card .premium-card-head h2 { color: #fa8c21; font-size: .72rem; }
body.premium-portal-active.premium-light .nixwall-performance-card .premium-card-head p { color: #7287a0; }
body.premium-portal-active.premium-light .nixwall-performance-card .premium-chart { min-height: 238px; }

body.premium-portal-active.premium-light .nixwall-dashboard-bottom {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 16px;
}
body.premium-portal-active.premium-light .nixwall-dashboard-bottom .premium-card { border-radius: 5px; }
body.premium-portal-active.premium-light .nixwall-dashboard-bottom .premium-card-head { min-height: 48px; padding: 11px 14px; }
body.premium-portal-active.premium-light .nixwall-dashboard-bottom .premium-card-head h2 { color: #fa8c21; font-size: .72rem; }

body.premium-portal-active.premium-light .nixwall-feed { min-height: 130px; padding: 10px 14px; }
body.premium-portal-active.premium-light .nixwall-feed > p { margin: 18px 0; color: #7287a0; font-size: .72rem; }
body.premium-portal-active.premium-light .nixwall-feed article {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid #edf1f6;
}
body.premium-portal-active.premium-light .nixwall-feed article:last-child { border-bottom: 0; }
body.premium-portal-active.premium-light .nixwall-feed b,
body.premium-portal-active.premium-light .nixwall-feed small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
body.premium-portal-active.premium-light .nixwall-feed b { color: #263b59; font-size: .7rem; }
body.premium-portal-active.premium-light .nixwall-feed small { margin-top: 2px; color: #8293a8; font-size: .61rem; }
body.premium-portal-active.premium-light .nixwall-feed strong { color: #0d9c64; font-size: .68rem; }
body.premium-portal-active.premium-light .nixwall-feed-icon,
body.premium-portal-active.premium-light .nixwall-rank { display: grid; width: 20px; height: 20px; place-items: center; border-radius: 6px; background: #def7e9; color: #0a9961; font-size: .64rem; font-weight: 900; }
body.premium-portal-active.premium-light .nixwall-rank { background: #e7efff; color: #376ce2; }

@media (max-width: 900px) {
  body.premium-portal-active.premium-light .nixwall-metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  body.premium-portal-active.premium-light .premium-affiliate-shell { grid-template-columns: 1fr; }
  body.premium-portal-active.premium-light .premium-topbar-left > .premium-icon-button { display: inline-grid; }
  body.premium-portal-active.premium-light .premium-mobile-toggle { display: inline-grid; }
  body.premium-portal-active.premium-light .nixwall-dashboard-bottom { grid-template-columns: 1fr; }
}

/* Pending conversion offer identity */
body.premium-portal-active .premium-affiliate-shell .pending-conversions-table {
  min-width: 1080px;
}
body.premium-portal-active .premium-affiliate-shell .pending-conversions-table td {
  vertical-align: middle;
}
body.premium-portal-active .premium-affiliate-shell .pending-offer-cell {
  min-width: 300px;
  white-space: normal;
}
body.premium-portal-active .premium-affiliate-shell .pending-offer-title {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  max-width: 390px;
}
body.premium-portal-active .premium-affiliate-shell .pending-offer-icon {
  display: grid;
  flex: 0 0 25px;
  width: 25px;
  height: 25px;
  place-items: center;
  border: 1px solid rgba(91, 233, 194, .35);
  border-radius: 8px;
  background: linear-gradient(135deg, #1e4c60, #263a74);
  color: #79f4ca;
  font-size: .68rem;
  font-weight: 900;
}
body.premium-portal-active .premium-affiliate-shell .pending-offer-title > div {
  min-width: 0;
}
body.premium-portal-active .premium-affiliate-shell .pending-offer-title b {
  display: -webkit-box;
  overflow: hidden;
  color: var(--premium-text);
  font-size: .74rem;
  line-height: 1.35;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
body.premium-portal-active .premium-affiliate-shell .pending-offer-title small {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
  color: var(--premium-muted);
  font-size: .6rem;
  line-height: 1.25;
  white-space: normal;
}
body.premium-portal-active .premium-affiliate-shell .pending-offer-title small em {
  padding: 3px 6px;
  border: 1px solid rgba(91, 233, 194, .28);
  border-radius: 999px;
  background: rgba(91, 233, 194, .08);
  color: #79f4ca;
  font-style: normal;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .04em;
}
body.premium-portal-active .premium-affiliate-shell .pending-conversions-table code {
  display: block;
  max-width: 185px;
  overflow: hidden;
  color: #aebce0;
  font-size: .58rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
