.creator-profile-page {
  min-height: 100vh;
  background: linear-gradient(180deg, #fff5fa 0%, var(--dark) 28%);
  color: var(--text);
}

.cp-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 251, 253, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--glass-border);
}

.cp-back {
  color: var(--gold);
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cp-brand {
  font-weight: 800;
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.cp-loading,
.cp-error {
  text-align: center;
  padding: 80px 24px;
  color: var(--muted);
}

.cp-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 67, 164, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  margin: 0 auto 16px;
  animation: cp-spin 0.8s linear infinite;
}

@keyframes cp-spin {
  to { transform: rotate(360deg); }
}

.cp-hero {
  position: relative;
  padding-bottom: 24px;
}

.cp-cover {
  height: 160px;
  background: var(--gold-gradient);
  opacity: 0.85;
}

.cp-cover.has-image {
  background-size: cover;
  background-position: center;
  opacity: 1;
}

.cp-hero-inner {
  max-width: 520px;
  margin: -64px auto 0;
  padding: 0 20px;
  text-align: center;
}

.cp-avatar-wrap {
  position: relative;
  width: 128px;
  height: 128px;
  margin: 0 auto 14px;
}

.cp-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 5px solid #fff;
  box-shadow: 0 8px 32px rgba(255, 67, 164, 0.25);
}

.cp-verified {
  position: absolute;
  bottom: 4px;
  left: 4px;
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 3;
  filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.25));
}
.cp-verified .cp-ig-verified-svg {
  width: 32px;
  height: 32px;
}

.cp-name {
  font-size: 1.65rem;
  font-weight: 800;
  margin: 0 0 4px;
}

.cp-handle {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 0.95rem;
}

.cp-bio {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0 0 16px;
  font-size: 0.98rem;
}

.cp-stats {
  display: flex;
  justify-content: center;
  gap: 28px;
  margin-bottom: 20px;
}

.cp-stats strong {
  display: block;
  font-size: 1.2rem;
  color: var(--text);
}

.cp-stats span {
  font-size: 0.8rem;
  color: var(--muted);
}

.cp-msg-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  max-width: 320px;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  background: var(--gold-gradient);
  color: #fff;
  font-family: inherit;
  font-weight: 800;
  font-size: 1.05rem;
  cursor: pointer;
  box-shadow: var(--gold-glow);
  transition: transform 0.2s, box-shadow 0.2s;
}

.cp-msg-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(255, 67, 164, 0.35);
}

.cp-posts-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 8px 16px 48px;
}

.cp-section-title {
  font-size: 1.1rem;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

.cp-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
}

@media (min-width: 640px) {
  .cp-posts-grid {
    gap: 8px;
    grid-template-columns: repeat(3, 1fr);
  }
}

.cp-post-tile {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: 12px;
  overflow: hidden;
  background: var(--input-bg);
  border: none;
  padding: 0;
  cursor: pointer;
}

.cp-post-tile img,
.cp-post-tile video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.cp-post-play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.15);
  color: #fff;
  font-size: 2rem;
  pointer-events: none;
}

.cp-posts-empty {
  text-align: center;
  color: var(--muted);
  padding: 32px;
}

.cp-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.cp-modal.hidden {
  display: none;
}

.cp-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 10, 30, 0.65);
  backdrop-filter: blur(4px);
}

.cp-viewer-card,
.cp-message-card {
  position: relative;
  z-index: 2;
  background: var(--surface-elevated);
  border-radius: 20px;
  max-width: 420px;
  width: 100%;
  padding: 20px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}

.cp-viewer-card {
  max-width: min(420px, 92vw);
  padding: 12px;
}

.cp-viewer-media {
  width: 100%;
  max-height: 70vh;
  border-radius: 14px;
  object-fit: contain;
  background: #000;
}

.cp-viewer-caption {
  margin: 12px 4px 4px;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.cp-modal-close {
  position: absolute;
  top: 10px;
  left: 10px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: var(--input-bg);
  font-size: 1.4rem;
  cursor: pointer;
  z-index: 3;
  line-height: 1;
}

.cp-message-card h3 {
  margin: 8px 0 8px;
  text-align: center;
}

.cp-message-price {
  text-align: center;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 12px;
}

.cp-message-hint {
  text-align: center;
  color: var(--danger);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.cp-message-card textarea {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--input-border);
  padding: 12px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 12px;
  background: var(--input-bg);
}

.cp-send-btn {
  width: 100%;
  padding: 14px;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
  background: var(--gold-gradient);
  color: #fff;
}

.cp-message-status {
  text-align: center;
  margin-top: 10px;
  font-size: 0.9rem;
  color: var(--muted);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: #1a2332;
  color: #fff;
  padding: 12px 20px;
  border-radius: 12px;
  z-index: 200;
  opacity: 0;
  transition: 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.btn-gold {
  display: inline-block;
  padding: 12px 24px;
  border-radius: 12px;
  background: var(--gold-gradient);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
}

.hidden { display: none !important; }

.cp-action-row {
  display: flex;
  gap: 10px;
  justify-content: center;
  max-width: 360px;
  margin: 0 auto;
}

.cp-follow-btn {
  flex: 1;
  padding: 12px 16px;
  border-radius: 999px;
  border: 2px solid var(--gold);
  background: transparent;
  color: var(--gold);
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
}

.cp-follow-btn.following {
  background: var(--gold-gradient);
  color: #fff;
  border-color: transparent;
}

.cp-action-row .cp-msg-btn {
  flex: 1;
  max-width: none;
  margin: 0;
}

.cp-feed {
  max-width: 520px;
  margin: 0 auto;
  padding: 0 12px 40px;
}

.cp-post-card {
  background: var(--surface-elevated);
  border-radius: 16px;
  margin-bottom: 0;
  overflow: hidden;
  box-shadow: 0 8px 28px rgba(255, 67, 164, 0.08);
}

.cp-ig-post {
  border-bottom: 2px solid #ff43a4;
  margin-bottom: 0;
  padding-bottom: 4px;
}

.cp-ig-post:last-child {
  border-bottom: none;
}

.cp-ig-views {
  margin: 0 14px 6px;
  font-size: 0.82rem;
  color: #64748b;
}

.cp-post-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
}

.cp-post-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}

.cp-post-media-btn {
  display: block;
  width: 100%;
  border: none;
  padding: 0;
  position: relative;
  cursor: pointer;
  background: #000;
}

.cp-post-media-btn:not(.is-paid-locked) img {
  width: 100%;
  max-height: 70vh;
  object-fit: cover;
  display: block;
}

.cp-post-media-btn.is-paid-locked {
  overflow: hidden;
  min-height: 320px;
  aspect-ratio: 1;
}

.cp-post-actions {
  display: flex;
  gap: 16px;
  padding: 10px 14px;
}

.cp-act {
  border: none;
  background: none;
  font-family: inherit;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.cp-act.liked {
  color: #e91e8c;
}

.cp-post-caption {
  padding: 0 14px 14px;
  margin: 0;
  line-height: 1.5;
}

.cp-comments-list {
  max-height: 40vh;
  overflow-y: auto;
  margin-bottom: 12px;
}

.cp-comment {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.cp-comments-card textarea {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  padding: 10px;
  font-family: inherit;
}

.cp-avatar-btn {
  padding: 0;
  border: none;
  background: none;
  border-radius: 50%;
  cursor: pointer;
  display: block;
  width: 100%;
  height: 100%;
}

.cp-avatar-wrap.has-stories .cp-avatar-btn {
  padding: 4px;
  background: linear-gradient(135deg, #ff6bb8, #FF43A4, #c13584);
}

.cp-avatar-wrap.has-unviewed .cp-avatar-btn {
  background: linear-gradient(135deg, #ff6bb8, #FF43A4, #f09433, #bc1888);
  animation: cp-ring-pulse 2s ease infinite;
}

@keyframes cp-ring-pulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.15); }
}

.cp-inbox-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 2px solid var(--gold);
  background: var(--surface-elevated);
  color: var(--gold);
  cursor: pointer;
  font-size: 1.1rem;
}

.cp-stories-modal {
  background: #000;
}

.cp-stories-modal.hidden {
  display: none !important;
}

.cp-stories-viewer {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

.cp-story-media {
  max-width: 100%;
  max-height: 85vh;
  object-fit: contain;
}

.cp-stories-progress {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  gap: 4px;
  z-index: 5;
}

.cp-story-seg {
  flex: 1;
  height: 3px;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 2px;
  overflow: hidden;
}

.cp-story-seg.active::after {
  content: '';
  display: block;
  height: 100%;
  background: #fff;
  animation: cp-seg-fill 6s linear forwards;
}

.cp-story-seg.done {
  background: #fff;
}

@keyframes cp-seg-fill {
  from { width: 0; }
  to { width: 100%; }
}

.cp-stories-close {
  position: absolute;
  top: 24px;
  left: 16px;
  z-index: 6;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
}

.cp-stories-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.15);
  border: none;
  color: #fff;
  font-size: 2rem;
  width: 48px;
  height: 64px;
  cursor: pointer;
  z-index: 5;
}

.cp-stories-prev { right: 8px; }
.cp-stories-next { left: 8px; }

.cp-story-caption {
  position: absolute;
  bottom: 24px;
  left: 16px;
  right: 16px;
  color: #fff;
  text-align: center;
  z-index: 5;
}

.cp-inbox-list {
  max-height: 50vh;
  overflow-y: auto;
}

.cp-inbox-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.cp-inbox-reply {
  margin-top: 8px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(255, 67, 164, 0.08);
}

.cp-inbox-pending {
  color: var(--muted);
  font-size: 0.85rem;
}

/* ——— Messenger (full-screen chat) ——— */
.cp-messenger {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  flex-direction: column;
  background: #f5f0f4;
  animation: cp-messenger-in 0.28s ease;
}

.cp-messenger.hidden {
  display: none !important;
}

@keyframes cp-messenger-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cp-messenger-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 520px;
  margin: 0 auto;
  width: 100%;
  background: linear-gradient(180deg, #fff 0%, #faf5f8 100%);
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.12);
}

@media (min-width: 600px) {
  .cp-messenger {
    padding: 12px;
    background: rgba(20, 10, 30, 0.55);
    backdrop-filter: blur(8px);
  }
  .cp-messenger-panel {
    height: calc(100% - 24px);
    border-radius: 20px;
    overflow: hidden;
  }
}

.cp-chat-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.cp-chat-back {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  flex-shrink: 0;
}

.cp-chat-header-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  text-align: right;
}

.cp-chat-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--gold);
  flex-shrink: 0;
}

.cp-chat-header-info strong {
  display: block;
  font-size: 1rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cp-chat-header-info span {
  font-size: 0.8rem;
  color: var(--muted);
}

.cp-chat-v {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #fff;
  font-size: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cp-chat-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 10px 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(255, 107, 184, 0.12), rgba(255, 67, 164, 0.06));
  border: 1px solid rgba(255, 67, 164, 0.15);
  flex-shrink: 0;
  transition: opacity 0.2s;
}

.cp-chat-banner.dim {
  opacity: 0.5;
}

.cp-chat-banner-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--gold-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.cp-chat-banner strong {
  display: block;
  font-size: 0.9rem;
}

.cp-chat-banner p {
  margin: 2px 0 0;
  font-size: 0.8rem;
  color: var(--muted);
}

.cp-chat-login-bar {
  margin: 8px 14px 0;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(220, 53, 69, 0.08);
  color: var(--danger);
  font-size: 0.85rem;
  text-align: center;
  flex-shrink: 0;
}

.cp-chat-login-bar a {
  color: var(--gold);
  font-weight: 700;
}

.cp-chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background:
    radial-gradient(circle at 20% 80%, rgba(255, 67, 164, 0.04) 0%, transparent 50%),
    radial-gradient(circle at 80% 20%, rgba(255, 107, 184, 0.05) 0%, transparent 45%);
}

.cp-chat-thread {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cp-chat-welcome {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 32px 24px;
  color: var(--muted);
}

.cp-chat-welcome-icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  margin-bottom: 16px;
  box-shadow: 0 12px 32px rgba(255, 67, 164, 0.25);
}

.cp-chat-welcome p {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 1.05rem;
}

.cp-chat-welcome small {
  line-height: 1.5;
  max-width: 280px;
}

.cp-chat-day {
  text-align: center;
  margin: 12px 0 8px;
}

.cp-chat-day span {
  display: inline-block;
  padding: 4px 14px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.06);
  font-size: 0.75rem;
  color: var(--muted);
  font-weight: 600;
}

.cp-bubble {
  max-width: 85%;
  padding: 10px 14px 8px;
  border-radius: 18px;
  position: relative;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.cp-bubble p {
  margin: 0;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.cp-bubble time {
  display: block;
  font-size: 0.68rem;
  margin-top: 6px;
  opacity: 0.75;
}

.cp-bubble-meta {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  margin-bottom: 4px;
  opacity: 0.85;
}

.cp-bubble--out {
  align-self: flex-end;
  background: linear-gradient(135deg, #ff6bb8, #FF43A4);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.cp-bubble--in {
  align-self: flex-start;
  background: #fff;
  color: var(--text);
  border: 1px solid var(--border);
  border-bottom-left-radius: 4px;
}

.cp-bubble--status {
  align-self: center;
  max-width: 100%;
  background: transparent;
  box-shadow: none;
  padding: 4px;
}

.cp-bubble--status p {
  font-size: 0.8rem;
  color: var(--muted);
  text-align: center;
}

.cp-bubble--status i {
  margin-left: 4px;
}

.cp-chat-loading,
.cp-chat-error {
  text-align: center;
  padding: 40px;
  color: var(--muted);
}

.cp-chat-footer {
  flex-shrink: 0;
  padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0));
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid var(--glass-border);
  transition: opacity 0.2s;
}

.cp-chat-footer.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.cp-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  padding: 8px 10px;
  background: var(--input-bg);
  border-radius: 24px;
  border: 1px solid var(--input-border);
}

.cp-chat-composer textarea {
  flex: 1;
  border: none;
  background: transparent;
  resize: none;
  font-family: inherit;
  font-size: 1rem;
  line-height: 1.45;
  max-height: 120px;
  padding: 8px 4px;
  outline: none;
}

.cp-chat-send {
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: var(--gold-gradient);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.15s, opacity 0.15s;
}

.cp-chat-send:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
}

.cp-chat-send:not(:disabled):active {
  transform: scale(0.92);
}

.cp-chat-footer-note {
  margin: 8px 0 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--muted);
}
