.referral-page {
  --ref-purple: #8d34ff;
  --ref-blue: #007aff;
}
.referral-page .student-heading {
  margin-bottom: 22px;
}
.referral-page h2,
.ref-admin h2 {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.045em;
  margin: 0;
  font-weight: 700;
}
.ref-card {
  border: 1px solid #e6edf9;
  border-radius: 15px;
  background: #ffffffbd;
  min-width: 0;
}
.ref-hero {
  min-height: 188px;
  display: flex;
  align-items: center;
  position: relative;
  border-radius: 16px;
  background: linear-gradient(110deg, #fff9e6, #fff4f4 56%, #fff8df);
  padding: 28px 24px 30px;
  gap: 40px;
  overflow: hidden;
  margin-bottom: 15px;
  border: 1px solid #f7f2e9;
}
.ref-hero-icon {
  color: #ffa000;
  flex: none;
}
.ref-hero-icon > .si {
  width: 75px;
  height: 65px;
}
.ref-hero h2 {
  font-size: 29px;
  line-height: 34px;
  letter-spacing: -0.045em;
  position: relative;
  z-index: 1;
}
.ref-hero p {
  font-size: 18px;
  line-height: 24px;
  color: var(--muted);
  margin: 12px 0 0;
  letter-spacing: -0.02em;
  position: relative;
  z-index: 1;
}
.ref-hero > div {
  max-width: calc(100% - 385px);
}
.ref-hero img {
  position: absolute;
  right: 8px;
  bottom: 9px;
  width: 410px;
  height: 170px;
  object-fit: contain;
  pointer-events: none;
}
.ref-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.96fr) minmax(0, 1fr);
  gap: 15px;
}
.ref-grid > .ref-card {
  padding: 19px;
  min-height: 264px;
}
.ref-link > p {
  font-size: 16px;
  color: var(--muted);
  line-height: 22px;
  margin: 11px 0 18px;
  letter-spacing: -0.025em;
}
.ref-url {
  display: flex;
  align-items: center;
  background: #f3f6fb;
  border: 1px solid #e2eafa;
  border-radius: 11px;
  height: 55px;
  min-width: 0;
}
.ref-url input {
  border: 0;
  background: transparent;
  min-width: 0;
  width: 100%;
  font-size: 18px;
  letter-spacing: -0.035em;
  padding: 14px 18px;
  color: var(--ink);
  border-radius: 10px;
}
.ref-url button {
  width: 56px;
  height: 52px;
  border: 0;
  background: none;
  color: var(--ink);
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 10px;
}
.ref-url button:hover {
  background: #e9effc;
}
.ref-link-actions {
  display: grid;
  grid-template-columns: 1fr 1.08fr;
  gap: 14px;
  margin-top: 15px;
}
.ref-link-actions .btn {
  height: 57px;
  font-size: 18px;
  gap: 12px;
  font-weight: 500;
  border-radius: 11px;
  white-space: nowrap;
}
.ref-copy {
  background: #007aff;
  color: #fff;
  border: 1px solid #007aff;
}
.ref-copy:hover {
  background: #0068e4;
  transform: translateY(-1px);
}
.ref-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 15px;
}
.ref-section-head select {
  border: 1px solid #dfe6f5;
  border-radius: 9px;
  background: #ffffffa0;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  height: 38px;
  padding: 0 12px;
  max-width: 100%;
}
.ref-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
}
.ref-stat {
  height: 177px;
  border: 1px solid #e8edf9;
  border-radius: 13px;
  padding: 17px 22px;
}
.ref-icon {
  display: grid;
  place-items: center;
  width: 49px;
  height: 49px;
  border-radius: 18px;
  background: #f1eaff;
  color: #8d34ff;
}
.ref-icon > .si {
  width: 29px;
  height: 29px;
}
.ref-icon.blue {
  background: #e1efff;
  color: #007aff;
}
.ref-icon.green {
  background: #e2f8e9;
  color: #00a02b;
}
.ref-stat strong {
  display: block;
  font-size: 32px;
  line-height: 38px;
  letter-spacing: -0.045em;
  margin-top: 12px;
}
.ref-stat p {
  font-size: 16px;
  color: var(--muted);
  line-height: 20px;
  letter-spacing: -0.035em;
  margin: 6px 0 0;
}
.ref-grid > .ref-level,
.ref-grid > .ref-dynamics {
  min-height: 310px;
  padding-top: 17px;
}
.ref-level-stats {
  display: grid;
  grid-template-columns: 1fr 1.05fr 1.04fr;
  gap: 12px;
  margin-top: 20px;
}
.ref-level-stats > div {
  position: relative;
  min-height: 112px;
  padding: 21px 19px 16px;
  border: 1px solid #e9edf8;
  border-radius: 12px;
}
.ref-level-stats strong {
  display: block;
  font-size: 32px;
  line-height: 38px;
  letter-spacing: -0.055em;
  position: relative;
  z-index: 1;
}
.ref-level-stats p {
  font-size: 17px;
  color: var(--muted);
  margin: 5px 0 0;
  letter-spacing: -0.03em;
}
.ref-mini {
  position: absolute;
  right: 12px;
  top: 15px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  color: #8d34ff;
  background: #f1eaff;
}
.ref-mini > .si {
  width: 25px;
  height: 25px;
}
.ref-mini.amber {
  color: #ffa000;
  background: #fff3da;
}
.ref-mini.pink {
  color: #ff3d87;
  background: #ffebf2;
}
.ref-level-stats > div:last-child strong {
  font-size: 28px;
  letter-spacing: -0.04em;
}
.ref-rates {
  display: flex;
  align-items: center;
  gap: 30px;
  margin-top: 12px;
  border-radius: 11px;
  background: #fff8e9;
  min-height: 101px;
  padding: 16px 24px;
}
.ref-rates > .si {
  width: 48px;
  height: 48px;
  color: #ff9d00;
}
.ref-rates p {
  margin: 0;
  font-size: 20px;
  line-height: 31px;
  letter-spacing: -0.035em;
}
.ref-chart {
  height: 207px;
  position: relative;
  margin-top: 24px;
}
.ref-chart-data {
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
}
.ref-chart-data summary {
  cursor: pointer;
}
.ref-chart-data ul {
  padding-left: 20px;
}
.ref-terms {
  width: 100%;
  margin-top: 15px;
  display: flex;
  align-items: center;
  gap: 25px;
  text-align: left;
  color: var(--ink);
  padding: 12px 18px;
  min-height: 96px;
  cursor: pointer;
  transition:
    background 0.25s,
    transform 0.25s;
}
.ref-terms:hover {
  background: #faf8ff;
  transform: translateY(-1px);
}
.ref-terms-icon {
  display: grid;
  place-items: center;
  width: 70px;
  height: 70px;
  border-radius: 20px;
  background: #f2ecff;
  color: #8d34ff;
  flex: none;
}
.ref-terms-icon > .si {
  width: 48px;
  height: 48px;
}
.ref-terms b {
  display: block;
  font-size: 21px;
  line-height: 25px;
  letter-spacing: -0.045em;
}
.ref-terms small {
  display: block;
  font-size: 16px;
  color: var(--muted);
  line-height: 22px;
  margin-top: 5px;
  letter-spacing: -0.02em;
}
.ref-terms > .si {
  margin-left: auto;
  color: #7977a2;
}
.ref-wallet {
  margin-top: 16px;
  padding: 18px;
}
.ref-wallet summary {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  font-size: 18px;
  font-weight: 700;
}
.ref-wallet summary > .si {
  margin-left: auto;
}
.ref-wallet-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 15px;
}
.ref-wallet-values p,
.ref-wallet > p {
  color: var(--muted);
  font-size: 15px;
  line-height: 1.5;
}
.ref-wallet-values strong {
  display: block;
  color: var(--ink);
  font-size: 25px;
  margin-top: 8px;
}
.ref-wallet small {
  color: var(--muted);
}
.ref-table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 18px 0;
}
.ref-table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14px;
}
.ref-table td,
.ref-table th {
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e5ecf7;
  padding: 14px 10px;
  overflow-wrap: anywhere;
}
.ref-table th {
  color: var(--muted);
  font-weight: 400;
}
.ref-table td small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
}
.ref-admin-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
}
.ref-context {
  font-size: 14px;
  color: var(--muted);
}
.ref-rules h3 {
  margin: 25px 0 8px;
  font-size: 19px;
}
.ref-rules p {
  font-size: 15px;
  line-height: 1.65;
  color: #5a608a;
}
.ref-share-label {
  display: block;
}
.ref-share-label input {
  width: 100%;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid #dfe6f5;
  border-radius: 9px;
}
.ref-admin-section {
  padding: 24px;
  margin-bottom: 18px;
}
.ref-admin-section p {
  color: var(--muted);
  line-height: 1.6;
}
.ref-admin-section small {
  display: block;
}
.ref-admin-section label {
  display: block;
  font-size: 14px;
  margin: 15px 0;
}
.ref-admin-section input,
.ref-admin-section select,
.ref-admin-section textarea {
  display: block;
  width: 100%;
  border: 1px solid #dfe6f5;
  border-radius: 8px;
  font: inherit;
  padding: 11px;
  margin-top: 7px;
  background: #fff;
  color: var(--ink);
}
.ref-admin-section textarea {
  min-height: 90px;
}
.ref-admin-section form {
  max-width: 700px;
}
.ref-admin-section [role="alert"] {
  color: #a22548;
  padding: 12px 0;
}
.ref-participant {
  border-bottom: 1px solid #e3eaf6;
  padding: 17px 0;
}
.ref-participant summary {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
  cursor: pointer;
}
.ref-participant summary > span:last-child {
  margin-left: auto;
}
.ref-participant dl {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  font-size: 14px;
}
.ref-participant dd {
  margin: 0;
}
.ref-pagination {
  display: flex;
  gap: 20px;
  margin-top: 16px;
}
.ref-no-link {
  padding: 20px;
  background: #f7f9fe;
  border-radius: 12px;
}
@media (min-width: 1400px) {
  .referral-page .student-heading h1 {
    letter-spacing: -0.04em;
  }
}
@media (max-width: 1300px) {
  .ref-hero {
    gap: 23px;
  }
  .ref-hero > div {
    max-width: calc(100% - 340px);
  }
  .ref-hero h2 {
    font-size: 25px;
    line-height: 30px;
  }
  .ref-hero img {
    width: 340px;
    height: 150px;
  }
  .ref-hero-icon > .si {
    width: 55px;
  }
  .ref-hero p {
    font-size: 16px;
  }
  .ref-stat {
    padding: 17px;
  }
  .ref-level-stats > div {
    padding-left: 12px;
  }
  .ref-mini {
    right: 8px;
    top: 12px;
    width: 35px;
    height: 35px;
  }
  .ref-level-stats strong {
    font-size: 28px;
  }
  .ref-level-stats > div:last-child strong {
    font-size: 24px;
  }
  .ref-rates {
    padding: 16px;
    gap: 16px;
  }
  .ref-rates p {
    font-size: 18px;
  }
  .ref-section-head h2 {
    font-size: 19px;
  }
  .ref-section-head select {
    font-size: 12px;
    padding: 0 7px;
  }
}
@media (max-width: 1100px) {
  .ref-grid {
    grid-template-columns: 1fr;
  }
  .ref-grid > .ref-card {
    min-height: 0;
  }
  .ref-hero > div {
    max-width: calc(100% - 220px);
  }
  .ref-hero img {
    width: 260px;
    height: 130px;
    right: 8px;
    bottom: 0;
  }
  .ref-hero {
    padding: 23px 18px;
    gap: 18px;
    min-height: 195px;
  }
  .ref-hero-icon {
    display: none;
  }
  .ref-hero h2 {
    font-size: 24px;
    line-height: 29px;
  }
  .ref-desktop-break {
    display: none;
  }
  .ref-stat {
    height: 177px;
  }
  .ref-level-stats > div {
    padding-left: 19px;
  }
  .ref-mini {
    right: 16px;
    width: 44px;
    height: 44px;
  }
  .ref-chart {
    height: 220px;
  }
  .ref-link-actions .btn {
    font-size: 17px;
  }
  .ref-wallet-values {
    gap: 10px;
  }
  .ref-wallet-values strong {
    font-size: 21px;
  }
}
@media (max-width: 760px) {
  .ref-hero {
    display: block;
    min-height: 290px;
    padding: 22px 20px;
  }
  .ref-hero > div {
    max-width: 100%;
    position: relative;
    z-index: 1;
  }
  .ref-hero h2 {
    font-size: 23px;
    line-height: 29px;
  }
  .ref-hero p {
    max-width: 100%;
    font-size: 16px;
    margin-top: 10px;
  }
  .ref-hero img {
    width: 260px;
    height: 115px;
    right: 7px;
    bottom: 0;
  }
  .ref-grid {
    gap: 12px;
  }
  .ref-grid > .ref-card {
    padding: 18px 15px;
  }
  .ref-stats {
    gap: 8px;
  }
  .ref-stat {
    padding: 13px 11px;
    height: 157px;
  }
  .ref-stat strong {
    font-size: 28px;
    margin-top: 10px;
  }
  .ref-stat p {
    font-size: 14px;
    line-height: 19px;
  }
  .ref-icon {
    width: 42px;
    height: 42px;
    border-radius: 15px;
  }
  .ref-icon > .si {
    width: 25px;
    height: 25px;
  }
  .ref-section-head {
    align-items: start;
    gap: 10px;
  }
  .ref-section-head h2 {
    font-size: 19px;
    max-width: 55%;
    line-height: 25px;
  }
  .ref-section-head select {
    max-width: 52%;
    font-size: 11px;
    height: 36px;
    padding: 0 5px;
  }
  .ref-url input {
    font-size: 15px;
    padding: 12px;
  }
  .ref-url button {
    width: 42px;
  }
  .ref-link-actions {
    gap: 9px;
    grid-template-columns: 1fr 1fr;
  }
  .ref-link-actions .btn {
    font-size: 15px;
    gap: 6px;
    padding: 12px 6px;
    height: 52px;
  }
  .ref-link-actions .si {
    width: 23px;
    height: 23px;
  }
  .ref-level-stats {
    gap: 8px;
    margin-top: 16px;
  }
  .ref-level-stats > div {
    padding: 50px 10px 12px;
    min-height: 130px;
  }
  .ref-level-stats strong {
    font-size: 28px;
  }
  .ref-level-stats > div:last-child strong {
    font-size: 23px;
    line-height: 38px;
  }
  .ref-mini {
    top: 9px;
    left: 10px;
    width: 32px;
    height: 32px;
    border-radius: 10px;
  }
  .ref-mini > .si {
    width: 22px;
    height: 22px;
  }
  .ref-level-stats p {
    font-size: 14px;
    line-height: 20px;
  }
  .ref-rates {
    gap: 15px;
    min-height: 90px;
    padding: 14px;
  }
  .ref-rates > .si {
    width: 38px;
    height: 38px;
  }
  .ref-rates p {
    font-size: 17px;
    line-height: 28px;
  }
  .ref-chart {
    height: 205px;
    margin-top: 17px;
  }
  .ref-terms {
    gap: 13px;
    padding: 16px 13px;
    min-height: 110px;
  }
  .ref-terms-icon {
    width: 48px;
    height: 52px;
    border-radius: 14px;
  }
  .ref-terms-icon > .si {
    width: 34px;
    height: 34px;
  }
  .ref-terms b {
    font-size: 19px;
  }
  .ref-terms small {
    font-size: 14px;
    line-height: 20px;
  }
  .ref-terms > .si {
    width: 18px;
  }
  .ref-wallet {
    padding: 16px 13px;
  }
  .ref-wallet summary {
    font-size: 16px;
  }
  .ref-wallet-values {
    grid-template-columns: 1fr;
  }
  .ref-wallet-values p {
    margin: 10px 0;
  }
  .ref-wallet-values strong {
    margin-top: 2px;
  }
  .ref-participant summary {
    align-items: start;
    gap: 10px;
  }
  .ref-participant summary > span:last-child {
    margin-left: 0;
    width: 100%;
  }
  .ref-participant dl {
    grid-template-columns: 1fr;
  }
  .ref-admin-section {
    padding: 18px;
  }
  .ref-admin .student-heading h1 {
    font-size: 27px;
  }
}
.referral-page .ref-link > p {
  margin-bottom: 12px;
}
.referral-page .ref-link-actions {
  grid-template-columns: 1.05fr 1fr;
}
.referral-page .ref-link-actions .si {
  width: 26px;
  height: 26px;
}
.referral-page .ref-link-actions .btn-outline {
  color: var(--ink);
  border-color: #d8e2f4;
  background: #ffffff60;
}
.referral-page .ref-dynamics {
  position: relative;
}
.referral-page .ref-chart-data:not([open]) {
  position: absolute;
  bottom: 4px;
  left: 19px;
  margin-top: 0;
}
.referral-page .ref-chart-data[open] {
  position: relative;
}
@media (min-width: 1101px) {
  .referral-page .ref-statistics {
    padding-top: 15px;
    padding-bottom: 17px;
  }
  .referral-page .ref-hero > div,
  .referral-page .ref-hero-icon {
    transform: translateY(4px);
  }
}
@media (max-width: 760px) {
  .referral-page .ref-link-actions .si {
    width: 23px;
    height: 23px;
  }
  .referral-page .ref-chart-data:not([open]) {
    left: 15px;
  }
}
