.math-referral-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
  margin: 22px 0;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid #b7e4cb;
  border-radius: 22px;
  background: linear-gradient(135deg, #f2fff7 0%, #ffffff 55%, #eef6ff 100%);
  box-shadow: 0 18px 44px rgba(15, 62, 46, .08);
  color: #102a23;
}

.math-referral-panel.is-compact {
  gap: 16px;
  margin: 12px 0 18px;
  padding: 14px 16px;
  border-radius: 15px;
  box-shadow: 0 10px 24px rgba(15, 62, 46, .06);
}

.math-referral-panel.is-compact .math-referral-kicker { font-size: 9px; }
.math-referral-panel.is-compact .math-referral-copy h3 { margin: 3px 0 2px; font-size: 18px; }
.math-referral-panel.is-compact .math-referral-copy p { font-size: 11px; line-height: 1.4; }
.math-referral-panel.is-compact .math-referral-progress { height: 7px; margin-top: 9px; }
.math-referral-panel.is-compact .math-referral-meta { margin-top: 6px; font-size: 10px; }
.math-referral-panel.is-compact .math-referral-actions { grid-template-columns: 1fr auto; min-width: 360px; }
.math-referral-panel.is-compact .math-referral-action,
.math-referral-panel.is-compact .math-referral-copy-link { min-height: 38px; padding: 8px 11px; border-radius: 9px; font-size: 11px; }

.math-referral-panel.is-loading { opacity: .72; }
.math-referral-copy { min-width: 0; }
.math-referral-kicker {
  color: #087a4a;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.math-referral-copy h3 { margin: 6px 0 7px; color: #102a23; font-size: clamp(20px, 3vw, 28px); }
.math-referral-copy p { max-width: 720px; margin: 0; color: #52645e; font-weight: 650; line-height: 1.55; }
.math-referral-progress { height: 10px; margin-top: 17px; overflow: hidden; border-radius: 999px; background: #dfe9e4; }
.math-referral-progress span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #079455, #12b76a); transition: width .25s ease; }
.math-referral-meta { display: flex; flex-wrap: wrap; gap: 8px 14px; margin-top: 9px; font-size: 12px; }
.math-referral-meta strong { color: #067647; }
.math-referral-meta span { color: #667085; }
.math-referral-link { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 10px; margin-top: 10px; color: #64748b; font-size: 12px; font-weight: 850; }
.math-referral-link input { width: 100%; min-width: 0; padding: 9px 11px; border: 1px solid #cbd5e1; border-radius: 10px; background: rgba(255, 255, 255, .88); color: #334155; font: inherit; font-weight: 650; }
.math-referral-actions { display: grid; gap: 9px; min-width: 230px; }
.math-referral-action,
.math-referral-copy-link {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  padding: 11px 16px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 900;
  text-align: center;
  text-decoration: none;
}
.math-referral-action.is-primary,
.math-referral-action.is-bonus { background: #087a4a; color: #fff; }
.math-referral-action.is-telegram { background: #229ed9; color: #fff; }
.math-referral-copy-link { border: 1px solid #cddad4; background: #fff; color: #344054; }

[data-math-theme="dark"] .math-referral-panel {
  border-color: #315c4c;
  background: linear-gradient(135deg, #102820, #172033 62%, #15243a);
  color: #f8fafc;
}
[data-math-theme="dark"] .math-referral-copy h3 { color: #f8fafc; }
[data-math-theme="dark"] .math-referral-copy p,
[data-math-theme="dark"] .math-referral-meta span { color: #cbd5e1; }
[data-math-theme="dark"] .math-referral-link input { border-color: #475569; background: #202b3d; color: #f8fafc; }
[data-math-theme="dark"] .math-referral-copy-link { border-color: #475569; background: #202b3d; color: #f8fafc; }

@media (max-width: 760px) {
  .math-referral-panel { grid-template-columns: 1fr; gap: 17px; }
  .math-referral-actions { min-width: 0; }
  .math-referral-panel.is-compact .math-referral-actions { grid-template-columns: 1fr; min-width: 0; }
  .math-referral-link { grid-template-columns: 1fr; gap: 5px; }
}

@media (prefers-reduced-motion: reduce) {
  .math-referral-progress span { transition: none; }
}
