/* Referral workspace: open canvas, invitation feature and a five-step ladder. */
body.account-redesign .main .ref-program-card {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
.account-redesign .ref-dashboard { --ref-highlight: #c4b5fd; --ref-line-height: 2px; --ref-tab-line-gap: 12px; }
.account-redesign .ref-dashboard .ref-page-heading { margin: 0 0 28px; }
.account-redesign .ref-dashboard .ref-page-heading h2 {
  font-size: clamp(26px, 3vw, 36px);
  font-weight: 500;
  letter-spacing: -.045em;
}
.account-redesign .ref-dashboard .ref-page-heading p { margin-top: 10px; font-size: 14px; }
.account-redesign .ref-section-tabs {
  position: relative;
  gap: 24px;
  margin-bottom: 30px;
  padding-bottom: var(--ref-tab-line-gap);
  border-bottom: 0;
}
.account-redesign .ref-section-tabs::before {
  content: "";
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  height: var(--ref-line-height);
  border-radius: 2px;
  pointer-events: none;
  background: linear-gradient(90deg, #10213c 0%, #10213c 38%, #243ca8 46%, #b82975 50%, #3458cc 54%, #10213c 62%, #10213c 100%);
  background-size: 300% 100%;
  background-position: 50% 0;
}
.account-redesign .ref-section-tabs button {
  position: relative;
  min-height: 32px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font: inherit;
  font-size: 13px;
}
.account-redesign .ref-section-tabs button[aria-selected=true] { background: transparent; color: var(--text); }
.account-redesign .ref-section-tabs button[aria-selected=true]::after {
  content: "";
  position: absolute;
  bottom: calc(-1 * var(--ref-tab-line-gap));
  inset-inline: 0;
  height: var(--ref-line-height);
  border-radius: 2px;
  background: var(--ref-highlight);
}
/* All three panels reserve the tallest panel's space to keep scrolling stable. */
.account-redesign .ref-dashboard .ref-section-panels {
  display: grid;
  align-items: start;
  overflow-anchor: none;
}
.account-redesign .ref-dashboard .ref-section-panels > [role=tabpanel] {
  grid-area: 1 / 1;
  min-width: 0;
}
.account-redesign .ref-dashboard .ref-section-panels > [role=tabpanel][hidden] {
  display: block !important;
  visibility: hidden;
  pointer-events: none;
}
.account-redesign .ref-overview-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 32px;
}
.account-redesign .ref-overview-card .ref-summary {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 24px;
  margin: 0;
  padding: 12px 0 12px 28px;
  border-left: 1px solid var(--line);
}
.account-redesign .ref-summary__metric { gap: 10px; }
.account-redesign .ref-summary span { font-size: 12px; }
.account-redesign .ref-summary strong { font-size: 30px; font-weight: 500; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.account-redesign .ref-dashboard .ref-overview-card .ref-invite-card {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  align-items: stretch;
  justify-content: center;
  gap: 28px;
  padding: 24px 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
  box-shadow: none !important;
}
.account-redesign .ref-dashboard .ref-overview-card .ref-rate {
  font-size: clamp(58px, 5vw, 72px);
  letter-spacing: -.065em;
  color: var(--ref-highlight);
}
.account-redesign .ref-dashboard .ref-invite-intro { flex-direction: column; align-items: flex-start; justify-content: center; gap: 14px; }
.account-redesign .ref-dashboard .ref-invite-intro h3 { font-size: 14px; font-weight: 400; max-width: 140px; line-height: 1.5; }
.account-redesign .ref-dashboard .ref-overview-card .ref-invite-tools { border: 0; padding: 0; }
.account-redesign .ref-dashboard .ref-invite-tools > label { font-size: 12px; margin-bottom: 12px; }
.account-redesign .ref-dashboard .ref-share { gap: 8px; }
.account-redesign .ref-dashboard .ref-share .input { height: 46px; background: color-mix(in srgb, var(--bg) 80%, transparent); border-color: var(--line); font-size: 12px; }
.account-redesign .ref-dashboard .ref-share .btn { min-height: 46px; font-size: 12px; letter-spacing: 0; border-radius: 10px; }
.account-redesign .ref-dashboard .ref-gear { height: 46px; width: 46px; background: transparent; }
html[data-theme] body.account-redesign .ref-dashboard #refLink,
html[data-theme] body.account-redesign .ref-dashboard .ref-gear {
  background: transparent !important;
  box-shadow: none !important;
}
.account-redesign .ref-dashboard #refPromoBonus { font-size: 12px; max-width: 520px; margin-bottom: 0; }
.account-redesign .ref-overview-card .ref-tier-card { grid-column: 1 / -1; padding-top: 12px; }
.account-redesign .ref-tier-heading { margin-bottom: 10px; }
.account-redesign .ref-tier-card h3 { font-size: 18px; font-weight: 500; }
.account-redesign .ref-tier-card #refTierProgress { margin-bottom: 18px; font-size: 12px; }
.account-redesign .ref-tier-card progress {
  appearance: none;
  border: 0;
  height: var(--ref-line-height);
  border-radius: 2px;
  background: linear-gradient(90deg, #10213c 0%, #10213c 38%, #243ca8 46%, #b82975 50%, #3458cc 54%, #10213c 62%, #10213c 100%);
  background-size: 300% 100%;
  background-position: 50% 0;
  overflow: hidden;
  accent-color: var(--ref-highlight);
}
.account-redesign .ref-tier-card progress::-webkit-progress-bar { background: transparent; }
.account-redesign .ref-tier-card progress::-webkit-progress-value { background: var(--ref-highlight); border-radius: 2px; }
.account-redesign .ref-tier-card progress::-moz-progress-bar { background: var(--ref-highlight); }
@media (prefers-reduced-motion: no-preference) {
  .account-redesign .ref-tier-card progress { animation: referral-level-sweep 1.4s linear infinite; }
  .account-redesign .ref-section-tabs::before { animation: referral-level-sweep 1.4s linear infinite reverse; }
}
@keyframes referral-level-sweep {
  from { background-position: 100% 0; }
  to { background-position: 0% 0; }
}
.account-redesign .ref-tier-card ol { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin-top: 20px; }
.account-redesign .ref-tier-card li {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 16px;
  min-width: 0;
  padding: 22px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: transparent;
}
.account-redesign .ref-tier-card li[aria-current=step] { border-color: color-mix(in srgb, var(--ref-highlight) 35%, transparent); background: color-mix(in srgb, var(--ref-highlight) 7%, transparent); }
.account-redesign .ref-tier-card li > strong { font-size: 13px; font-weight: 500; }
.account-redesign .ref-tier-card li > span { font-size: 15px; font-weight: 500; color: var(--text); }
.account-redesign .ref-tier-card li[aria-current=step] > span { color: var(--ref-highlight); }
.account-redesign .ref-tier-card li small { text-align: left; font-size: 11px; line-height: 1.6; }
.account-redesign .ref-tier-card li > small { margin-top: auto; }
/* Keep referral panels open over the site background, including chart overlays. */
.account-redesign :is(#refStatistics, #refFaq) :is(.card, .ref-periods, .ref-chart-empty, .ref-chart-tooltip) {
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
}
.account-redesign .ref-faq-list { padding: 0; }
.account-redesign .ref-faq-list details {
  padding-inline: clamp(16px, 2vw, 24px);
  overflow-wrap: anywhere;
}
.account-redesign .ref-faq-list details[open] { padding-bottom: 20px; }
.account-redesign .ref-faq-list summary { padding-block: 20px; font-size: 14px; line-height: 1.6; }
.account-redesign .ref-faq-list p { margin: 0; line-height: 1.8; max-width: 760px; }
html[data-theme=light] .account-redesign .ref-dashboard { --ref-highlight: #7054bb; }
@media (max-width: 1150px) {
  .account-redesign .ref-overview-card { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .account-redesign .ref-overview-card .ref-summary { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr); padding: 0 0 24px; border-left: 0; border-bottom: 1px solid var(--line); }
  .account-redesign .ref-dashboard .ref-overview-card .ref-invite-card { padding: 12px 0 0; }
  .account-redesign .ref-tier-card ol { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .account-redesign .ref-overview-card { grid-template-columns: minmax(0, 1fr); }
  .account-redesign .ref-overview-card .ref-summary { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 4px 0 16px; border: 0; }
  .account-redesign .ref-summary strong { font-size: 25px; }
  .account-redesign .ref-tier-card ol { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .account-redesign .ref-dashboard .ref-overview-card .ref-invite-card { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 0; }
  .account-redesign .ref-dashboard .ref-share { display: grid; grid-template-columns: minmax(0, 1fr) 46px; }
  .account-redesign .ref-dashboard .ref-share .input { grid-column: 1 / -1; width: 100%; }
  .account-redesign .ref-dashboard .ref-invite-intro { flex-direction: row; align-items: center; justify-content: flex-start; gap: 20px; }
  .account-redesign .ref-dashboard .ref-invite-intro h3 { font-size: 15px; }
}
