.owner-referral-modal[hidden] {
  display: none;
}

.owner-referral-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.owner-referral-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 22, 0.58);
  backdrop-filter: blur(6px);
}

.owner-referral-dialog {
  position: relative;
  z-index: 1;
  width: min(620px, 100%);
  max-height: min(900px, calc(100vh - 48px));
  overflow: auto;
  background: #ffffff;
  border: 1px solid #dfe4ee;
  border-radius: 14px;
  box-shadow: 0 24px 80px rgba(11, 18, 36, 0.22), 0 2px 8px rgba(11, 18, 36, 0.08);
}

.owner-referral-dialog__hero {
  position: relative;
  padding: 28px 38px 24px;
  background: linear-gradient(105deg, #f8f9fc 0%, #f8f6ea 56%, #fff4cf 100%);
  border-bottom: 1px solid #dde2ec;
}

.owner-referral-dialog__close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #dfe4ee;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: #18213b;
  cursor: pointer;
}

.owner-referral-dialog__close:hover {
  color: #0b1736;
  border-color: #cfd6e4;
  background: #ffffff;
}

.owner-referral-dialog__kicker {
  margin: 0 0 16px;
  color: #0d1a3b;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
}

.owner-referral-dialog__hero h2 {
  max-width: 540px;
  margin: 0;
  color: #182033;
  font-size: 28px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.28;
}

.owner-referral-dialog__hero h2 em {
  color: #071438;
  font-family: var(--font-display, var(--font-sans));
  font-style: italic;
  font-weight: 400;
}

.owner-referral-dialog__hero p:last-child {
  max-width: 540px;
  margin: 12px 0 0;
  color: #333b59;
  font-size: 13.5px;
  line-height: 1.45;
}

.owner-referral-dialog__body {
  padding: 26px 38px 30px;
  background: #ffffff;
}

.owner-referral-choice {
  display: grid;
  gap: 10px;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}

.owner-referral-choice legend,
.owner-referral-link label {
  margin: 0 0 10px;
  color: #737b99;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.owner-referral-option {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
  padding: 13px 16px;
  border: 2px solid #e4e8f0;
  border-radius: 12px;
  background: #ffffff;
  color: #202638;
  cursor: pointer;
  transition: background var(--dur), border-color var(--dur), box-shadow var(--dur);
}

.owner-referral-option:hover,
.owner-referral-option.is-selected {
  border-color: #111b3a;
  background: #f5f7ff;
}

.owner-referral-option.is-selected {
  box-shadow: inset 0 0 0 1px #111b3a;
}

.owner-referral-option input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: #0b1736;
}

.owner-referral-option__copy strong {
  display: block;
  color: #202638;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.35;
}

.owner-referral-option__copy span {
  display: block;
  margin-top: 5px;
  color: #727b9e;
  font-size: 13px;
  line-height: 1.45;
}

.owner-referral-link {
  margin-bottom: 18px;
}

.owner-referral-link__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.owner-referral-link__field {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #dfe4ee;
  border-radius: 10px;
  background: #f4f6fb;
  color: #202638;
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.owner-referral-copy {
  height: 44px;
  min-width: 104px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: #0b1736;
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.owner-referral-copy:hover {
  filter: brightness(1.04);
}

.owner-referral-share {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0 24px;
}

.owner-referral-share__button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #dfe4ee;
  border-radius: 12px;
  background: #ffffff;
  color: #333b59;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
}

.owner-referral-share__button:hover {
  border-color: #b9c1d2;
  color: #0b1736;
  background: #f8faff;
}

.owner-referral-note {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 18px;
  border: 1px solid #eceff6;
  border-radius: 12px;
  background: #f2f4fa;
  color: #747d9e;
}

.owner-referral-note svg {
  flex: 0 0 auto;
  margin-top: 3px;
  color: #008f67;
}

.owner-referral-note p {
  margin: 0;
  font-size: 13px;
  line-height: 1.48;
}

.owner-referral-note strong {
  color: #333b59;
  font-weight: 800;
}

.ll-referral-welcome,
.auth-referral-welcome {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 18px;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 24%, var(--border));
  border-radius: 8px;
  background: color-mix(in srgb, var(--primary) 6%, var(--surface));
  color: var(--ink-700);
  font-size: 13px;
  line-height: 1.45;
}

.auth-referral-welcome {
  display: flex;
  width: 100%;
  justify-content: center;
  text-align: center;
}

@media (max-width: 680px) {
  .owner-referral-modal {
    align-items: flex-end;
    padding: 0;
  }

  .owner-referral-dialog {
    width: 100%;
    max-height: calc(100vh - 18px);
    border-radius: 14px 14px 0 0;
  }

  .owner-referral-dialog__hero,
  .owner-referral-dialog__body {
    padding-left: 22px;
    padding-right: 22px;
  }

  .owner-referral-dialog__hero {
    padding-top: 32px;
  }

  .owner-referral-dialog__hero h2 {
    font-size: 24px;
  }

  .owner-referral-dialog__hero p:last-child {
    font-size: 13.5px;
  }

  .owner-referral-option {
    min-height: auto;
    padding: 14px;
  }

  .owner-referral-option__copy strong {
    font-size: 13.5px;
  }

  .owner-referral-option__copy span {
    font-size: 13.5px;
  }

  .owner-referral-link__row,
  .owner-referral-share {
    grid-template-columns: 1fr;
  }

  .owner-referral-copy {
    width: 100%;
  }
}
