/* Referral composition. Foundations and primitives come only from @grafx/tm-design-system v1. */
.tm-referral-shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 64px; }
.tm-referral-hero { position: relative; display: grid; max-width: 900px; gap: 12px; overflow: hidden; padding: 28px 0 48px; }
.tm-referral-hero::after { position: absolute; z-index: -1; top: -90px; right: 0; width: 360px; height: 260px; border-radius: 50%; background: radial-gradient(circle, color-mix(in srgb, var(--tm-purple) 16%, transparent), transparent 68%); content: ""; }
.tm-referral-hero .tmc-brand { margin-bottom: 30px; }
.tm-referral-hero h1 { max-width: 14ch; margin-bottom: 4px; }
.tm-referral-hero > p:last-child { max-width: 62ch; color: var(--tm-muted); }
.tm-referral-layout { display: grid; grid-template-columns: minmax(0,1.55fr) minmax(21rem,.6fr); gap: 18px; align-items: start; }
.tm-referral-layout--personal { grid-template-columns: repeat(12,minmax(0,1fr)); }
.tm-referral-layout--personal > * { grid-column: span 4; }
.tm-referral-layout--personal > .tm-span-2 { grid-column: span 8; }
.tm-referral-layout > .tm-full-width { grid-column: 1 / -1; }
.tm-field-row { display: flex; gap: 8px; align-items: end; }
.tm-field-row .tmc-field { flex: 1; }
.tm-live:empty { display: none; }
[data-referral-entry-form] { margin-block-end: var(--tm-space-4); }
.tm-referral-continuation { display: grid; gap: 10px; margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--tm-line); }
.tm-referral-continuation[hidden] { display: none; }
.tm-referral-continuation h3, .tm-referral-continuation p { margin: 0; }
.tm-referral-continuation .tmc-button { justify-self: start; }
.tm-live[data-state="error"] { color: var(--tm-danger, #a51d2d); }
.tm-live[data-state="success"] { color: var(--tm-success, #0f766e); }
.tmc-button[aria-disabled="true"] { cursor: not-allowed; opacity: .55; }
.tm-email-otp { width: min(520px, calc(100% - 24px)); }
.tm-email-otp > div { display: grid; gap: var(--tm-space-4); padding: var(--tm-space-6); }
.tm-email-otp form { display: grid; gap: var(--tm-space-4); padding: 0; }
.tm-email-otp [data-email-title], .tm-email-otp [data-email-intro] { margin: 0; }
.tm-email-otp [data-email-intro] { color: var(--tm-muted); }
.tm-email-otp form[hidden] { display: none; }
.tm-email-otp__status { min-height: 2.8em; margin: 0; padding: 12px; border-radius: 10px; background: var(--tm-panel-soft); overflow-wrap: anywhere; }
.tm-email-otp__status[data-state="success"] { color: #0f766e; }
.tm-email-otp__status[data-state="error"] { color: var(--tm-danger, #a51d2d); }
.tm-code-state { display: flex; align-items: center; gap: 8px; color: #0f766e; font-weight: 650; }
.tm-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.tm-code { overflow-wrap: anywhere; color: var(--tm-ink); font: 720 clamp(28px,5vw,52px)/1.1 Inter,sans-serif; letter-spacing: .035em; }
.tm-muted { color: var(--tm-muted); }
.tm-stats { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin: 0; }
.tm-stats div { padding: 14px; border-radius: 12px; background: var(--tm-panel-soft); }
.tm-stats dt { min-height: 2.8em; color: var(--tm-muted); font-size: 12px; }
.tm-stats dd { margin: 4px 0 0; color: var(--tm-ink); font-size: clamp(24px,4vw,36px); font-weight: 720; font-variant-numeric: tabular-nums; }
.tm-history, .tm-economic-history { margin: 0; padding: 0; list-style: none; }
.tm-history li { display: flex; gap: 16px; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--tm-line); }
.tm-history time { color: var(--tm-muted); text-align: right; }
.tm-economic-history { display: grid; gap: 16px; }
.tm-economic-history li { display: grid; gap: 8px; padding: 16px 0; border-bottom: 1px solid rgba(255,255,255,.16); }
.tm-economic-history dl { display: grid; gap: 5px; margin: 0; }
.tm-economic-history dl div { display: grid; grid-template-columns: minmax(8rem,.7fr) minmax(0,1.3fr); gap: 12px; }
.tm-economic-history dt { color: #aaa1b8; }
.tm-economic-history dd { margin: 0; overflow-wrap: anywhere; }
.tm-share-preview { overflow-wrap: anywhere; padding: 12px; border: 1px solid var(--tm-line); border-radius: 10px; background: var(--tm-panel-soft); }
.tm-link-button { padding: 0; border: 0; background: transparent; color: var(--tm-accent-strong); cursor: pointer; font-weight: 630; }
@media (max-width: 800px) {
  .tm-referral-layout, .tm-referral-layout--personal { grid-template-columns: 1fr; }
  .tm-referral-layout--personal > *, .tm-referral-layout--personal > .tm-span-2 { grid-column: auto; }
}
@media (max-width: 540px) {
  .tm-referral-shell { width: calc(100% - 24px); padding-top: 12px; }
  .tm-referral-hero .tmc-brand { margin-bottom: 16px; }
  .tm-field-row, .tm-history li { align-items: stretch; flex-direction: column; }
  .tm-history time { text-align: left; }
  .tm-stats, .tm-economic-history dl div { grid-template-columns: 1fr; }
}
