/* =========================================================
   PULSE — components.css
   ========================================================= */

.clay { background: var(--surface); border-radius: var(--r-lg); box-shadow: var(--clay-raised); }

.clay-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--surface); color: var(--text);
  font-weight: 600; font-size: var(--f-sm);
  box-shadow: var(--clay-raised);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.clay-btn:active { box-shadow: var(--clay-press); transform: scale(0.98); }
.clay-btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }
.clay-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.clay-btn.block { width: 100%; }
.clay-btn.following, .clay-btn.added { background: var(--bg-2); color: var(--text); }

.clay-input {
  width: 100%; padding: 14px 18px; border-radius: var(--r-md);
  background: var(--bg-2); border: 1px solid var(--border);
  color: var(--text); box-shadow: var(--clay-inset); outline: none;
  font-size: var(--f-md);
  transition: box-shadow var(--dur) var(--ease);
}
.clay-input:focus { box-shadow: var(--clay-inset), 0 0 0 3px color-mix(in srgb, var(--primary) 30%, transparent); }
.clay-input::placeholder { color: var(--text-2); }

.icon-btn {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: var(--r-pill); background: var(--surface);
  box-shadow: var(--clay-raised); transition: transform var(--dur) var(--ease);
  flex-shrink: 0;
}
.icon-btn:active { transform: scale(0.94); }
.icon-btn.primary { background: linear-gradient(135deg, var(--primary), var(--primary-2)); color: #fff; }

.auth-wrap {
  min-height: 100dvh; display: grid; place-items: center; padding: var(--s-5);
  background:
    radial-gradient(circle at 20% 10%, color-mix(in srgb, var(--primary) 12%, transparent), transparent 40%),
    radial-gradient(circle at 80% 90%, color-mix(in srgb, var(--accent-pink) 10%, transparent), transparent 40%),
    var(--bg);
}
.auth-card { width: 100%; max-width: 420px; padding: var(--s-6); display: flex; flex-direction: column; gap: var(--s-4); }
.auth-logo { text-align: center; }
.auth-logo h1 { font-size: var(--f-xl); margin: 0; }
.brand { color: var(--primary); }
.tagline { color: var(--text-2); font-size: var(--f-sm); margin: 4px 0 0; }
.divider { display: flex; align-items: center; gap: var(--s-3); color: var(--text-2); font-size: var(--f-xs); }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.auth-form { display: flex; flex-direction: column; gap: var(--s-3); }
.field { display: flex; flex-direction: column; gap: 6px; font-size: var(--f-sm); }
.field span { color: var(--text-2); font-weight: 500; }
.error { color: #ef4444; font-size: var(--f-sm); padding: 10px 14px; border-radius: var(--r-sm); background: color-mix(in srgb, #ef4444 12%, transparent); }
.auth-links { display: flex; justify-content: space-between; font-size: var(--f-sm); }

.avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  display: grid; place-items: center;
  color: #fff; font-weight: 700; font-size: var(--f-md);
  flex-shrink: 0; overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-sm { width: 36px; height: 36px; font-size: var(--f-sm); }
.avatar.frame-gold { box-shadow: 0 0 0 3px #FBBF24, 0 0 14px rgba(251,191,36,0.6); }
.avatar.frame-neon { box-shadow: 0 0 0 3px #22D3EE, 0 0 16px rgba(34,211,238,0.7); }
.avatar.frame-fire { box-shadow: 0 0 0 3px #F97316, 0 0 16px rgba(249,115,22,0.8); }
.avatar.frame-ice  { box-shadow: 0 0 0 3px #93C5FD, 0 0 14px rgba(147,197,253,0.7); }

.post { padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--clay-raised); }
.post-head { display: flex; align-items: center; gap: var(--s-3); margin-bottom: var(--s-3); position: relative; }
.post-meta { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.post-meta strong { font-size: var(--f-sm); }
.post-meta span { font-size: var(--f-xs); color: var(--text-2); }
.post-body { font-size: var(--f-md); line-height: 1.5; white-space: pre-wrap; word-wrap: break-word; }
.post-actions { display: flex; gap: var(--s-2); margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--border); }
.post-action {
  display: flex; align-items: center; gap: 6px;
  color: var(--text-2); font-size: var(--f-sm); font-weight: 500;
  padding: 6px 10px; border-radius: var(--r-pill);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
.post-action:hover { background: var(--bg-2); }
.post-action.liked { color: var(--accent-pink); }
.post-action.liked svg { fill: currentColor; }
.post-more { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; color: var(--text-2); }
.post-more:hover { background: var(--bg-2); }

.post-media { margin-top: var(--s-3); border-radius: var(--r-md); overflow: hidden; max-height: 480px; background: var(--bg-2); }
.post-media img, .post-media video { width: 100%; height: auto; display: block; }

.post-link-preview { display: flex; gap: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: var(--bg-2); margin-top: var(--s-3); border: 1px solid var(--border); }
.post-link-preview a { color: var(--primary); word-break: break-all; }

.poll-wrap { margin-top: var(--s-3); display: flex; flex-direction: column; gap: 6px; }
.poll-option {
  padding: 10px 14px; border-radius: var(--r-md); background: var(--bg-2);
  cursor: pointer; font-size: var(--f-sm); position: relative; overflow: hidden;
  border: 1px solid transparent; transition: all var(--dur) var(--ease);
}
.poll-option:hover { border-color: var(--primary); }
.poll-option.voted { border-color: var(--primary); }
.poll-option .poll-bar { position: absolute; top: 0; left: 0; bottom: 0; background: color-mix(in srgb, var(--primary) 20%, transparent); z-index: 0; transition: width 300ms var(--ease); }
.poll-option span { position: relative; z-index: 1; display: flex; justify-content: space-between; }
.poll-option span em { font-style: normal; color: var(--text-2); font-weight: 600; }

.event-card { margin-top: var(--s-3); padding: var(--s-3); border-radius: var(--r-md); background: var(--bg-2); border: 1px solid var(--border); }
.event-card h4 { margin: 0 0 4px; font-size: var(--f-md); }
.event-card .event-meta { color: var(--text-2); font-size: var(--f-xs); margin-bottom: 8px; }

.skeleton { padding: var(--s-4); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--clay-raised); }
.sk-line { height: 14px; border-radius: var(--r-pill); background: var(--bg-2); margin-bottom: var(--s-2); animation: shimmer 1.4s infinite linear; }
.sk-line.short { width: 40%; }
.sk-line.medium { width: 70%; }
.sk-head { display: flex; gap: var(--s-3); align-items: center; margin-bottom: var(--s-3); }
.sk-avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-2); animation: shimmer 1.4s infinite linear; }
.sk-col { flex: 1; }
@keyframes shimmer { 0% { opacity: 0.5; } 50% { opacity: 1; } 100% { opacity: 0.5; } }

.empty-state { text-align: center; padding: var(--s-7) var(--s-4); color: var(--text-2); }
.empty-state h3 { color: var(--text); margin: 0 0 var(--s-2); }

.modal { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: var(--s-4); }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(6px); animation: fadeIn 160ms var(--ease); }
.modal-card { position: relative; width: 100%; max-width: 400px; padding: var(--s-5); border-radius: var(--r-xl); display: flex; flex-direction: column; gap: var(--s-3); animation: modalPop 220ms var(--ease); }
@keyframes modalPop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-card h3 { margin: 0; font-size: var(--f-lg); }
.modal-message { margin: 0; font-size: var(--f-sm); color: var(--text-2); line-height: 1.5; white-space: pre-wrap; }
.modal-actions { display: flex; gap: var(--s-2); justify-content: flex-end; margin-top: var(--s-2); }
.modal-actions .clay-btn { min-width: 90px; }

.toast {
  position: fixed; bottom: calc(var(--nav-h) + var(--s-5));
  left: 50%; transform: translateX(-50%);
  padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--text); color: var(--bg);
  font-size: var(--f-sm); font-weight: 600;
  box-shadow: var(--clay-raised); z-index: 400;
  animation: slideUp 200ms var(--ease); max-width: 90vw; text-align: center;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.notif-badge {
  position: absolute; top: 0; right: 0;
  background: #ef4444; color: #fff;
  font-size: 10px; font-weight: 700;
  padding: 2px 6px; border-radius: 999px;
  min-width: 16px; text-align: center; line-height: 1.4;
}

/* ===========================================================
   BADGES — single clean block
   =========================================================== */

.user-badge {
  display: inline-flex; align-items: center; justify-content: center;
  width: 15px; height: 15px; margin-left: 4px;
  vertical-align: middle; cursor: pointer; flex-shrink: 0;
}
.user-badge svg { width: 100%; height: 100%; display: block; }
.user-badge img { width: 100%; height: 100%; object-fit: contain; display: block; }

.badge-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px 5px 8px; border-radius: var(--r-pill);
  background: var(--bg-2); font-size: 12px; font-weight: 700;
  cursor: pointer; margin-top: 6px;
  transition: background var(--dur) var(--ease);
}
.badge-chip:hover { background: var(--surface); box-shadow: var(--clay-raised); }
.badge-chip svg { width: 15px; height: 15px; flex-shrink: 0; }
.badge-chip img { width: 15px; height: 15px; object-fit: contain; display: block; flex-shrink: 0; }

.profile-badge-row {
  margin: var(--s-2) 0 0;
  display: flex; justify-content: center; gap: 6px; flex-wrap: wrap;
}

.badge-detail { display: flex; gap: var(--s-3); padding: var(--s-4); border-radius: var(--r-lg); background: var(--bg-2); align-items: center; }
.badge-detail-icon { width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center; background: var(--surface); flex-shrink: 0; }
.badge-detail-icon svg { width: 28px; height: 28px; }
.badge-detail strong { display: block; font-size: var(--f-md); }
.badge-detail span { font-size: var(--f-xs); color: var(--text-2); }

.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  display: grid; place-items: center;
  color: #fff; font-size: 36px; font-weight: 800;
  overflow: hidden;
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-avatar.frame-gold { box-shadow: 0 0 0 4px #FBBF24, 0 0 22px rgba(251,191,36,0.7); }
.profile-avatar.frame-neon { box-shadow: 0 0 0 4px #22D3EE, 0 0 22px rgba(34,211,238,0.8); }
.profile-avatar.frame-fire { box-shadow: 0 0 0 4px #F97316, 0 0 22px rgba(249,115,22,0.85); }
.profile-avatar.frame-ice  { box-shadow: 0 0 0 4px #93C5FD, 0 0 22px rgba(147,197,253,0.8); }

/* ===========================================================
   View wrapper
   =========================================================== */
.view { display: flex; flex-direction: column; gap: var(--s-4); }

/* ===========================================================
   Topbar / back button
   =========================================================== */
.topbar-left {
  display: flex; align-items: center; gap: var(--s-2);
  min-width: 0;
}
.topbar-left h2 {
  margin: 0; font-size: var(--f-lg); font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
#btn-back { width: 38px; height: 38px; }

/* ===========================================================
   Profile
   =========================================================== */
.profile-card {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--s-2); padding: var(--s-6) var(--s-4);
  text-align: center;
}
.profile-card h3 { margin: var(--s-3) 0 0; font-size: var(--f-xl); font-weight: 800; }
.profile-card .handle { color: var(--text-2); margin: 0; font-size: var(--f-sm); }
.profile-card .bio {
  color: var(--text); margin: var(--s-2) 0 0; font-size: var(--f-sm);
  max-width: 40ch; line-height: 1.5;
}
.profile-stats {
  display: flex; gap: var(--s-6); margin-top: var(--s-4); justify-content: center;
}
.profile-stats > div { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.profile-stats strong { font-size: var(--f-lg); font-weight: 800; }
.profile-stats span { font-size: var(--f-xs); color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }
.profile-actions {
  display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: center;
}
.profile-actions .clay-btn.following {
  background: var(--bg-2); color: var(--text); box-shadow: var(--clay-inset);
}

/* XP bar */
.xp-bar-wrap { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); }
.xp-label { display: flex; justify-content: space-between; font-size: var(--f-sm); font-weight: 600; }
.xp-label span:last-child { color: var(--text-2); }
.xp-bar {
  height: 12px; border-radius: var(--r-pill); background: var(--bg-2);
  box-shadow: var(--clay-inset); overflow: hidden;
}
.xp-bar-fill {
  height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 300ms var(--ease);
}

/* Achievements */
.achievements-wrap { display: flex; flex-direction: column; gap: var(--s-3); margin-top: var(--s-2); }
.achievements-wrap h4 { margin: 0; font-size: var(--f-md); font-weight: 700; }
.achievements-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-3);
}
.achievement {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  gap: 6px; padding: var(--s-3);
  border-radius: var(--r-md); background: var(--surface);
  box-shadow: var(--clay-raised); opacity: 0.55;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.achievement.unlocked { opacity: 1; }
.achievement .ico {
  width: 44px; height: 44px; display: grid; place-items: center;
  border-radius: 50%; background: var(--bg-2); color: var(--text-2);
}
.achievement.unlocked .ico {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}
.achievement .ico svg { width: 22px; height: 22px; }
.achievement .nm { font-size: var(--f-sm); font-weight: 700; }
.achievement .req { font-size: 11px; color: var(--text-2); }

/* ===========================================================
   Settings
   =========================================================== */
.settings-section { display: flex; flex-direction: column; gap: var(--s-2); }
.settings-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--text-2); font-weight: 700; margin: var(--s-3) 0 0 var(--s-2);
}
.settings-group { padding: var(--s-2); display: flex; flex-direction: column; }
.settings-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--s-3); border-radius: var(--r-md); cursor: pointer;
  transition: background var(--dur) var(--ease); gap: var(--s-3);
}
.settings-row:hover { background: var(--bg-2); }
.settings-row.no-click { cursor: default; }
.settings-row.no-click:hover { background: transparent; }
.settings-label { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.settings-label strong { font-size: var(--f-sm); font-weight: 600; }
.settings-label span { font-size: var(--f-xs); color: var(--text-2); }
.settings-chev { color: var(--text-2); font-size: var(--f-lg); line-height: 1; }
.settings-choices { display: flex; gap: 6px; padding: 0 var(--s-3) var(--s-2); }
.settings-choices button {
  flex: 1; padding: 10px; border-radius: var(--r-md);
  background: var(--bg-2); font-weight: 700; font-size: var(--f-sm);
  box-shadow: var(--clay-inset); transition: all var(--dur) var(--ease);
}
.settings-choices button.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: var(--clay-raised);
}
.settings-toggle {
  width: 48px; height: 28px; border-radius: var(--r-pill);
  background: var(--bg-2); box-shadow: var(--clay-inset);
  position: relative; transition: background var(--dur) var(--ease);
  flex-shrink: 0;
}
.settings-toggle span {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--surface); box-shadow: var(--clay-raised);
  transition: transform var(--dur) var(--ease);
}
.settings-toggle[aria-checked="true"] {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.settings-toggle[aria-checked="true"] span { transform: translateX(20px); }

.theme-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: var(--s-2); padding: var(--s-2) var(--s-3) var(--s-3);
}
.theme-swatch {
  padding: 10px 8px; border-radius: var(--r-md);
  background: var(--bg-2); font-size: 11px; font-weight: 600;
  text-transform: capitalize; box-shadow: var(--clay-inset);
  transition: all var(--dur) var(--ease);
}
.theme-swatch.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: var(--clay-raised);
}

/* ===========================================================
   Store
   =========================================================== */
.store-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 6px; scrollbar-width: none;
}
.store-tabs::-webkit-scrollbar { display: none; }
.store-tab {
  padding: 8px 14px; border-radius: var(--r-pill); background: var(--bg-2);
  font-size: var(--f-sm); font-weight: 600; white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.store-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: var(--clay-raised);
}
.store-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: var(--s-3); margin-top: var(--s-4);
}
.store-card {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: var(--s-4) var(--s-3); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--clay-raised);
}
.store-card .preview {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--bg-2); display: grid; place-items: center;
  font-size: 28px; margin-bottom: var(--s-2); overflow: hidden;
}
.store-card strong { font-size: var(--f-sm); }
.store-card span { color: var(--text-2); font-size: var(--f-xs); }
.store-card .store-cta {
  margin-top: var(--s-2); padding: 8px 16px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; font-size: var(--f-xs); font-weight: 700; cursor: pointer;
}
.store-card.owned .store-cta {
  background: var(--bg-2); color: var(--text); box-shadow: var(--clay-inset);
}
.store-card.equipped .store-cta {
  background: linear-gradient(135deg, #84CC16, #22C55E); color: #fff;
}
.coin-pill {
  padding: 6px 14px; border-radius: var(--r-pill);
  background: linear-gradient(135deg, #FBBF24, #F59E0B); color: #fff;
  font-weight: 700; font-size: var(--f-sm); box-shadow: var(--clay-raised);
}

/* ===========================================================
   Chats
   =========================================================== */
.chats-list { display: flex; flex-direction: column; gap: var(--s-2); }
.chat-row, .ai-chat-card {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--clay-raised);
  cursor: pointer; transition: transform var(--dur) var(--ease);
}
.chat-row:active, .ai-chat-card:active { transform: scale(0.98); }
.ai-chat-card {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}
.ai-chat-card .avatar { background: rgba(255,255,255,0.25); }
.ai-chat-card .chat-info strong { color: #fff; }
.ai-chat-card .chat-info span,
.ai-chat-card .chat-status { color: rgba(255,255,255,0.85); }
.chat-info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.chat-info strong {
  font-size: var(--f-sm);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-info span {
  font-size: var(--f-xs); color: var(--text-2);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.chat-status { font-size: var(--f-xs); color: var(--text-2); flex-shrink: 0; }

/* Chat list skeleton */
.skeleton-row {
  pointer-events: none;
  background: var(--surface);
  opacity: 0.7;
}
.skeleton-row .sk-avatar {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--bg-2);
  animation: pulse 1.4s ease-in-out infinite;
}
.skeleton-row .chat-info { display: flex; flex-direction: column; gap: 6px; }
.skeleton-row .sk-line {
  height: 12px; border-radius: var(--r-pill);
  background: var(--bg-2);
  animation: pulse 1.4s ease-in-out infinite;
}
.skeleton-row .sk-line.short { width: 40%; }
.skeleton-row .sk-line.medium { width: 65%; }
@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

/* ===========================================================
   Communities
   =========================================================== */
.communities-list { display: flex; flex-direction: column; gap: var(--s-2); }
.community-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--clay-raised);
  transition: transform var(--dur) var(--ease);
}
.community-row:active { transform: scale(0.98); }

.community-hero { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-3); }
.community-banner {
  height: 120px; border-radius: var(--r-lg);
  background-size: cover; background-position: center;
  box-shadow: var(--clay-inset);
}
.community-head { display: flex; align-items: center; gap: var(--s-3); }
.community-avatar { width: 64px; height: 64px; font-size: 24px; }
.community-info { flex: 1; min-width: 0; }
.community-info h3 { margin: 0; font-size: var(--f-lg); font-weight: 800; }
.community-info .handle { color: var(--text-2); font-size: var(--f-xs); margin: 2px 0 0; }
.community-desc { color: var(--text); font-size: var(--f-sm); margin: var(--s-2) 0 0; line-height: 1.5; }
.community-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.community-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 6px; scrollbar-width: none;
  margin-top: var(--s-3);
}
.community-tabs::-webkit-scrollbar { display: none; }
.community-tab {
  padding: 8px 14px; border-radius: var(--r-pill); background: var(--bg-2);
  font-size: var(--f-sm); font-weight: 600; white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.community-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: var(--clay-raised);
}
.members-list { display: flex; flex-direction: column; gap: var(--s-2); }

/* ===========================================================
   Notifications
   =========================================================== */
.notif-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--clay-raised);
  margin-bottom: var(--s-2);
  cursor: pointer;
}
.notif-row:hover { background: var(--bg-2); }
.notif-row.unread { border-left: 4px solid var(--primary); }
.notif-row .info { display: flex; flex-direction: column; flex: 1; min-width: 0; gap: 2px; }
.notif-row .info strong { font-size: var(--f-sm); }
.notif-row .info span { font-size: var(--f-xs); color: var(--text-2); }

/* ===========================================================
   Create post
   =========================================================== */
.post-type-tabs {
  display: flex; gap: 6px; overflow-x: auto;
  padding-bottom: 6px; scrollbar-width: none;
}
.post-type-tabs::-webkit-scrollbar { display: none; }
.post-type-tab {
  padding: 8px 14px; border-radius: var(--r-pill); background: var(--bg-2);
  font-size: var(--f-sm); font-weight: 600; white-space: nowrap;
  transition: all var(--dur) var(--ease);
}
.post-type-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff; box-shadow: var(--clay-raised);
}

/* ===========================================================
   Search
   =========================================================== */
.search-tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); padding-bottom: 4px; }
.search-tab {
  padding: 8px 14px; border-radius: var(--r-pill);
  font-size: var(--f-sm); font-weight: 600; color: var(--text-2);
  transition: all var(--dur) var(--ease);
}
.search-tab.active { background: var(--primary); color: #fff; }
.search-results { display: flex; flex-direction: column; gap: var(--s-2); }
.search-card {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--clay-raised);
}
.search-card .info { flex: 1; min-width: 0; }
.search-card .info strong { display: block; font-size: var(--f-sm); }
.search-card .info span { display: block; font-size: var(--f-xs); color: var(--text-2); }
.search-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text-2); margin: var(--s-3) 0 var(--s-2); font-weight: 700;
}

/* ===========================================================
   Leaderboard
   =========================================================== */
.lb-list { display: flex; flex-direction: column; gap: var(--s-2); }
.lb-row {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3); border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--clay-raised);
  transition: transform var(--dur) var(--ease);
}
.lb-row:active { transform: scale(0.98); }
.lb-row.top-1 { background: linear-gradient(135deg, rgba(251,191,36,0.14), var(--surface)); }
.lb-row.top-2 { background: linear-gradient(135deg, rgba(148,163,184,0.14), var(--surface)); }
.lb-row.top-3 { background: linear-gradient(135deg, rgba(217,119,6,0.14), var(--surface)); }
.lb-row.is-me { outline: 2px solid color-mix(in srgb, var(--primary) 50%, transparent); }
.lb-rank {
  width: 36px; height: 36px; display: grid; place-items: center;
  font-size: 20px; font-weight: 800; flex-shrink: 0;
}
.lb-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.lb-info strong { font-size: var(--f-sm); display: flex; align-items: center; }
.lb-info span { font-size: var(--f-xs); color: var(--text-2); }
.lb-xp {
  text-align: right; font-size: var(--f-md); font-weight: 800;
  color: var(--primary); flex-shrink: 0;
}
.lb-xp small {
  display: block; font-size: 10px; font-weight: 600; color: var(--text-2);
}

/* ===========================================================
   View titles
   =========================================================== */
.view-title { font-size: var(--f-xl); font-weight: 700; margin: var(--s-2) 0; }
.view-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin: var(--s-2) 0; gap: var(--s-3);
}
.view-title-row .view-title { margin: 0; }

/* ===========================================================
   Feed utilities
   =========================================================== */
.feed-list { display: flex; flex-direction: column; gap: var(--s-4); }
.feed-sentinel { height: 40px; display: grid; place-items: center; color: var(--text-2); font-size: var(--f-sm); }
.tag-link { color: var(--primary); font-weight: 600; }
.tag-link:hover { text-decoration: underline; }

/* ===========================================================
   Chat detail
   =========================================================== */
.chat-view { display: flex; flex-direction: column; gap: var(--s-3); }
.chat-header {
  display: flex; align-items: center; gap: var(--s-3);
  padding: var(--s-3); border-radius: var(--r-lg);
}
.chat-header .chat-info { flex: 1; min-width: 0; }
.chat-header .chat-info strong { font-size: var(--f-md); }
.chat-header .chat-info span { font-size: var(--f-xs); color: var(--text-2); }
.chat-header:active { transform: scale(0.99); }

.messages-list {
  display: flex; flex-direction: column; gap: var(--s-2);
  min-height: 200px; max-height: 55vh; overflow-y: auto;
  padding: var(--s-2);
}

.msg {
  display: flex; gap: var(--s-2); align-items: flex-end;
  max-width: 78%;
}
.msg.mine { align-self: flex-end; flex-direction: row-reverse; margin-left: auto; }
.msg-bubble {
  padding: 10px 14px; border-radius: var(--r-lg);
  background: var(--surface); box-shadow: var(--clay-raised);
  position: relative; min-width: 80px; max-width: 100%;
}
.msg.mine .msg-bubble {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}
.msg-author { font-size: 11px; font-weight: 700; color: var(--text-2); margin-bottom: 2px; }
.msg.mine .msg-author { color: rgba(255,255,255,0.85); }
.msg-content { font-size: var(--f-sm); line-height: 1.4; word-break: break-word; }
.msg-content img, .msg-content video { width: 100%; max-width: 260px; border-radius: var(--r-md); display: block; margin-top: 6px; }
.msg-audio { width: 100%; max-width: 220px; }
.msg-media { width: 100%; max-width: 260px; border-radius: var(--r-md); display: block; }
.msg-meta {
  display: flex; justify-content: flex-end; gap: 6px; align-items: center;
  margin-top: 4px; font-size: 10px; color: var(--text-2);
}
.msg.mine .msg-meta { color: rgba(255,255,255,0.8); }
.msg-edited { font-style: italic; opacity: 0.8; }
.msg-reactions { display: inline-flex; gap: 4px; }
.reaction-chip {
  padding: 2px 6px; border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  font-size: 11px; font-weight: 700;
}
.msg-actions {
  display: none; gap: 4px; position: absolute;
  top: -30px; right: 0;
  background: var(--surface); border-radius: var(--r-pill);
  box-shadow: var(--clay-raised); padding: 4px;
}
.msg:hover .msg-actions { display: flex; }
.msg-actions button {
  width: 26px; height: 26px; display: grid; place-items: center;
  border-radius: 50%; color: var(--text-2); font-size: 12px;
  transition: background var(--dur) var(--ease);
}
.msg-actions button:hover { background: var(--bg-2); color: var(--text); }

.reply-preview {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  border-radius: var(--r-md);
  background: var(--bg-2); box-shadow: var(--clay-inset);
  border-left: 3px solid var(--primary);
}
.reply-body { flex: 1; min-width: 0; font-size: var(--f-sm); }
.reply-body strong { color: var(--primary); }
.reply-body span { color: var(--text-2); margin-left: 4px; }

.msg-reply {
  display: block;
  padding: 6px 10px;
  margin-bottom: 6px;
  border-radius: 8px;
  border-left: 3px solid var(--primary);
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  font-size: 11px;
  line-height: 1.3;
  color: var(--text-2);
}
.msg.mine .msg-reply {
  background: rgba(255,255,255,0.15);
  border-left-color: rgba(255,255,255,0.6);
  color: rgba(255,255,255,0.9);
}
.msg-reply strong { color: var(--primary); margin-right: 4px; }
.msg.mine .msg-reply strong { color: #fff; }

.composer {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2);
  border-radius: var(--r-pill);
  position: sticky; bottom: calc(var(--nav-h) + var(--s-3));
}
.composer .clay-input {
  flex: 1;
  border-radius: var(--r-pill);
  padding: 12px 18px;
}

/* Message ticks */
.msg-tick { font-size: 12px; margin-left: 4px; font-weight: 700; }
.msg-tick.sent { color: var(--text-2); }
.msg-tick.delivered { color: var(--text-2); }
.msg-tick.seen { color: #22C55E; }
.msg.mine .msg-tick.sent,
.msg.mine .msg-tick.delivered { color: rgba(255,255,255,0.75); }
.msg.mine .msg-tick.seen { color: #86EFAC; }

#load-older-wrap { display: flex; justify-content: center; }
#load-older-wrap .clay-btn { font-size: var(--f-xs); padding: 6px 14px; }

#chat-back-btn {
  width: 38px; height: 38px;
  margin-right: 4px;
}

/* Comments */
.comments-list { display: flex; flex-direction: column; gap: var(--s-2); }
.comment {
  display: flex; gap: var(--s-2);
  padding: var(--s-3); border-radius: var(--r-md);
  background: var(--surface); box-shadow: var(--clay-raised);
}
.comment-body { flex: 1; min-width: 0; }
.comment-head { display: flex; gap: var(--s-2); align-items: baseline; margin-bottom: 2px; }
.comment-head strong { font-size: var(--f-sm); }
.comment-head span { font-size: 11px; color: var(--text-2); }
.comment-text { font-size: var(--f-sm); line-height: 1.4; word-break: break-word; }
.comment-actions {
  display: flex; gap: var(--s-3); margin-top: 6px;
  font-size: 12px; color: var(--text-2);
}
.comment-actions button { font-weight: 600; }
.comment-actions button:hover { color: var(--primary); }
.comment.new-comment { animation: highlightNew 1.5s ease; }
@keyframes highlightNew {
  0% { background: color-mix(in srgb, var(--primary) 20%, transparent); }
  100% { background: var(--surface); }
}

/* ===========================================================
   Buy coins
   =========================================================== */
.coin-balance-card {
  padding: var(--s-6) var(--s-4);
  display: flex; flex-direction: column; align-items: center; gap: 4px;
}
.coin-balance-card strong {
  font-size: 44px; font-weight: 800;
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.coin-balance-card span {
  font-size: var(--f-sm); color: var(--text-2);
}

/* ===========================================================
   Fullscreen chat + Android keyboard
   =========================================================== */
body.chat-open .topbar,
body.chat-open .bottom-nav,
body.chat-open .fab { display: none !important; }

body.chat-open .app-main {
  padding: 0 !important;
  max-width: 100% !important;
}

.chat-view {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  padding: var(--s-2);
  padding-top: max(var(--s-2), env(safe-area-inset-top));
  background: var(--bg);
  z-index: 45;
  height: 100dvh;
  overflow: hidden;
}

.chat-view .chat-header { flex-shrink: 0; }

.chat-view .messages-list {
  flex: 1;
  min-height: 0;
  max-height: none;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.chat-view .composer {
  position: static;
  flex-shrink: 0;
  margin-bottom: var(--kb-h, 0);
  transition: margin-bottom 120ms ease-out;
}

.chat-view .chat-search-bar { flex-shrink: 0; }
.chat-view .reply-preview { flex-shrink: 0; }

/* ===========================================================
   Store select
   =========================================================== */
select.clay-input {
  appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236B6773' stroke-width='2'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
/* ===========================================================
   PWA standalone mode tweaks
   =========================================================== */

/* Add safe-area padding when installed (iPhone notch etc.) */
.pwa-standalone .topbar {
  padding-top: env(safe-area-inset-top);
  height: calc(var(--top-h) + env(safe-area-inset-top));
}
.pwa-standalone .app-main {
  padding-top: calc(var(--top-h) + env(safe-area-inset-top) + var(--s-4));
}
/* ===========================================================
   PULSE brand — logo everywhere
   =========================================================== */

/* Topbar brand */
.topbar-brand {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  margin-right: 8px;
}
.topbar-brand img {
  width: 32px;
  height: 32px;
  object-fit: contain;
}

/* Title with logo prefix */
.title-with-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}
.title-with-logo .title-logo {
  width: 28px;
  height: 28px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Empty state with logo */
.empty-state .empty-logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
}
.empty-state .empty-logo img {
  width: 56px;
  height: 56px;
  object-fit: contain;
}

/* Loading state with logo */
.loading-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 24px;
  color: var(--text-2);
}
.loading-state .loading-logo {
  width: 48px;
  height: 48px;
  animation: pulse-logo 1.6s ease-in-out infinite;
}
.loading-state .loading-logo img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}
@keyframes pulse-logo {
  0%, 100% { opacity: 0.55; transform: scale(0.96); }
  50% { opacity: 1; transform: scale(1.04); }
}

/* Small logo next to section titles */
.section-logo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.section-logo img {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex-shrink: 0;
}

/* Store / coin / ledger / settings / broadcast header logo */
.settings-section-title .section-logo img,
.view-title .section-logo img {
  width: 22px;
  height: 22px;
}

/* Feed mode toggle shouldn't crowd the logo */
.view-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

/* Watermark — small faded logo top-right of view wrappers (optional) */
.view-logo-watermark {
  position: absolute;
  top: 8px;
  right: 8px;
  opacity: 0.12;
  pointer-events: none;
  width: 64px;
  height: 64px;
  object-fit: contain;
}
/* ===========================================================
   Circle Orbit — spinning
   =========================================================== */

.view:has(.orbit-stage) {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--s-3);
}

.orbit-mode-toggle {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  background: var(--bg-2);
  border-radius: var(--r-pill);
  box-shadow: var(--clay-inset);
}
.orbit-mode-btn {
  padding: 6px 14px;
  border-radius: var(--r-pill);
  font-size: var(--f-xs);
  font-weight: 700;
  color: var(--text-2);
  transition: all var(--dur) var(--ease);
}
.orbit-mode-btn.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--clay-raised);
}

/* ---------------- Orbit stage ---------------- */
.orbit-stage {
  --orbit-radius: 170px;
  --orbit-center-size: 88px;
  --orbit-member-size: 52px;
  --spin-duration: 40s; /* change to speed up/slow down the whole orbit */

  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 12px auto;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}

/* ---------------- Decorative rings ---------------- */
.orbit-ring,
.orbit-ring-2 {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(var(--orbit-radius) * 2);
  height: calc(var(--orbit-radius) * 2);
  transform: translate(-50%, -50%);
  border-radius: 50%;
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--primary) 18%, transparent);
}
.orbit-ring-2 {
  width: calc(var(--orbit-radius) * 1.6);
  height: calc(var(--orbit-radius) * 1.6);
  border-style: dashed;
  border-color: color-mix(in srgb, var(--primary) 22%, transparent);
  animation: orbitSpin calc(var(--spin-duration) * 0.55) linear infinite;
}

/* ---------------- Center avatar ---------------- */
.orbit-center {
  position: relative;
  z-index: 3;
}
.orbit-center-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.orbit-center-avatar {
  width: var(--orbit-center-size);
  height: var(--orbit-center-size);
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 28px;
  font-weight: 800;
  box-shadow:
    0 0 0 4px var(--surface),
    0 0 0 6px color-mix(in srgb, var(--primary) 40%, transparent),
    0 12px 32px color-mix(in srgb, var(--primary) 35%, transparent);
}
.orbit-center-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.orbit-center-name {
  font-size: var(--f-sm);
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-align: center;
  max-width: 200px;
}

/* ---------------- Members wrapper (spins) ---------------- */
.orbit-members-wrap {
  position: absolute;
  inset: 0;
  pointer-events: none; /* let clicks pass through to the members */
  animation: orbitSpin var(--spin-duration) linear infinite;
}
.orbit-members-wrap .orbit-member {
  pointer-events: auto;
}

/* ---------------- Members on the ring ---------------- */
.orbit-member {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--orbit-member-size);
  height: var(--orbit-member-size);
  margin: calc(var(--orbit-member-size) / -2) 0 0 calc(var(--orbit-member-size) / -2);
  padding: 0;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  z-index: 2;
  transform:
    rotate(var(--angle))
    translate(0, calc(-1 * var(--orbit-radius)))
    rotate(calc(-1 * var(--angle)));
  transition: transform 400ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
.orbit-member:hover {
  transform:
    rotate(var(--angle))
    translate(0, calc(-1 * (var(--orbit-radius) + 8px)))
    rotate(calc(-1 * var(--angle)))
    scale(1.08);
}
.orbit-member:active {
  transform:
    rotate(var(--angle))
    translate(0, calc(-1 * (var(--orbit-radius) - 4px)))
    rotate(calc(-1 * var(--angle)))
    scale(0.96);
}

.orbit-member-inner {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  overflow: visible;
  background: linear-gradient(135deg, var(--primary), var(--accent-cyan));
  box-shadow: var(--clay-raised);
  color: #fff;
  font-weight: 700;
  font-size: 16px;
  /* Counter-rotate so the avatar stays upright while the ring spins */
  animation: orbitSpinReverse var(--spin-duration) linear infinite;
}
.orbit-member-inner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* Badge sits at bottom-right of the avatar and stays upright too */
.orbit-member .user-badge {
  position: absolute;
  bottom: -3px;
  right: -3px;
  width: 18px !important;
  height: 18px !important;
  margin: 0;
  background: var(--surface);
  border-radius: 50%;
  padding: 2px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.18);
  display: grid;
  place-items: center;
  z-index: 4;
}

/* ---------------- +N overflow ---------------- */
.orbit-overflow {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 700;
  font-size: var(--f-xs);
  box-shadow: var(--clay-raised);
  z-index: 5;
  cursor: pointer;
}
.orbit-overflow:active { transform: scale(0.96); }

/* ---------------- Hint ---------------- */
.orbit-hint {
  text-align: center;
  font-size: var(--f-xs);
  color: var(--text-2);
  padding: 8px 24px 24px;
  line-height: 1.5;
  max-width: 340px;
  margin: 0 auto;
}

/* ---------------- List view ---------------- */
.orbit-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
  margin-top: var(--s-3);
}
.orbit-list-row {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--clay-raised);
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.orbit-list-row:hover { background: var(--bg-2); }
.orbit-list-row:active { transform: scale(0.98); }
.orbit-list-row .info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.orbit-list-row .info strong { font-size: var(--f-sm); display: inline-flex; align-items: center; gap: 4px; }
.orbit-list-row .info span { font-size: var(--f-xs); color: var(--text-2); }

/* ---------------- Animations ---------------- */
@keyframes orbitSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes orbitSpinReverse {
  from { transform: rotate(0deg); }
  to { transform: rotate(-360deg); }
}

/* Respect users who disable motion */
@media (prefers-reduced-motion: reduce) {
  .orbit-members-wrap,
  .orbit-member-inner,
  .orbit-ring-2 {
    animation: none;
  }
}

/* ---------------- Responsive ---------------- */
@media (max-width: 420px) {
  .orbit-stage {
    --orbit-radius: 140px;
    --orbit-center-size: 76px;
    --orbit-member-size: 46px;
  }
  .orbit-center-avatar { font-size: 24px; }
  .orbit-member-inner { font-size: 14px; }
}
@media (max-width: 360px) {
  .orbit-stage {
    --orbit-radius: 118px;
    --orbit-center-size: 68px;
    --orbit-member-size: 42px;
  }
  .orbit-center-avatar { font-size: 22px; }
  .orbit-member-inner { font-size: 13px; }
  .orbit-member .user-badge { width: 15px !important; height: 15px !important; }
}
@media (min-width: 720px) {
  .orbit-stage {
    --orbit-radius: 190px;
    --orbit-center-size: 96px;
    --orbit-member-size: 56px;
  }
}
//* ===========================================================
   Pulse Bloom — container layout
   =========================================================== */

.bloom-view { display: flex; flex-direction: column; gap: var(--s-3); }

.bloom-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-width: 460px;
  margin: 0 auto;
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--clay-raised);
  background: var(--bg-2);
}

.bloom-room-layer {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center bottom;
  background-color: var(--bg-2);
}

/* The flower + vase stack sits at the bottom of the scene */
.bloom-vase-layer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  top: 20%;
  pointer-events: none;
  z-index: 3;
}

/* Hydration meter */
.bloom-water-indicator {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 6px;
  height: 60px;
  border-radius: 3px;
  background: rgba(0,0,0,0.35);
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.25);
  z-index: 5;
}
.bloom-water-fill {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, #3B82F6, #22D3EE);
  transition: height 500ms var(--ease);
}

/* Stats, actions, info, progress, picker — keep what you already have */
.bloom-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  padding: var(--s-3);
  text-align: center;
}
.bloom-stat { display: flex; flex-direction: column; gap: 2px; }
.bloom-stat strong { font-size: var(--f-md); font-weight: 800; }
.bloom-stat span { font-size: var(--f-xs); color: var(--text-2); text-transform: uppercase; letter-spacing: 0.05em; }

.bloom-actions { display: flex; flex-direction: column; gap: var(--s-2); }
.bloom-actions-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-2); }

.bloom-info {
  text-align: center;
  font-size: var(--f-xs);
  color: var(--text-2);
  padding: 0 12px;
}

.bloom-progress-wrap { padding: var(--s-3); display: flex; flex-direction: column; gap: 8px; }
.bloom-progress-label { display: flex; justify-content: space-between; font-size: var(--f-xs); font-weight: 600; }
.bloom-progress-label span:last-child { color: var(--text-2); }
.bloom-progress-bar {
  height: 10px; border-radius: var(--r-pill); background: var(--bg-2);
  box-shadow: var(--clay-inset); overflow: hidden;
}
.bloom-progress-fill {
  height: 100%; border-radius: var(--r-pill);
  background: linear-gradient(90deg, #84CC16, #22C55E);
  transition: width 500ms var(--ease);
}

.bloom-max {
  text-align: center;
  font-size: var(--f-sm);
  color: var(--primary);
  font-weight: 700;
  padding: 12px;
}

.bloom-picker-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--clay-raised);
  margin-bottom: 8px;
  text-align: left;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
  width: 100%;
}
.bloom-picker-row:hover:not(:disabled) { background: var(--bg-2); }
.bloom-picker-row:active:not(:disabled) { transform: scale(0.98); }
.bloom-picker-row.active { outline: 2px solid var(--primary); }
.bloom-picker-row:disabled { opacity: 0.5; cursor: not-allowed; }

.bloom-picker-preview {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background-color: var(--bg-2);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.bloom-picker-preview.vase { background-size: contain; background-repeat: no-repeat; }

.bloom-picker-label { flex: 1; min-width: 0; }
.bloom-picker-label strong { display: block; font-size: var(--f-sm); }
.bloom-picker-label span { display: block; font-size: var(--f-xs); color: var(--text-2); }
/* ===========================================================
   Bloom — video blend with clay aesthetic
   =========================================================== */

.bloom-room-video {
  /* Warm it up + lighten it to match the app palette */
  filter:
    saturate(1.15)
    brightness(1.15)
    contrast(0.92)
    sepia(0.15)
    blur(1px);
  opacity: 0.85;
}

/* Warm overlay that sits between the video and the flower —
   tints the whole scene toward Pulse's palette so nothing
   looks foreign */
.bloom-room-vignette {
  background:
    /* Pulse's primary violet, very subtle */
    radial-gradient(ellipse at 50% 80%,
      rgba(124,58,237,0.06) 0%,
      transparent 55%),
    /* Warm cream wash */
    linear-gradient(180deg,
      rgba(245,243,240,0.10) 0%,
      rgba(245,243,240,0.02) 40%,
      rgba(0,0,0,0.15) 100%),
    /* Bottom vignette so the vase grounds on the floor */
    radial-gradient(ellipse at center,
      transparent 45%,
      rgba(0,0,0,0.22) 90%,
      rgba(0,0,0,0.35) 100%);
}

/* Softer edge where the video meets the scene frame */
.bloom-scene::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 4;
  pointer-events: none;
  border-radius: var(--r-xl);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.30);
}
/* ===========================================================
   Moments
   =========================================================== */

.moments-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
}
.moments-tabs::-webkit-scrollbar { display: none; }

.moments-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  font-size: var(--f-xs);
  font-weight: 700;
  color: var(--text-2);
}
.moments-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--clay-raised);
}

.moments-list {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.moment-card {
  padding: var(--s-4);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--clay-raised);
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.moment-card:active { transform: scale(0.98); }

.moment-head {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  margin-bottom: var(--s-3);
}
.moment-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.moment-meta strong {
  font-size: var(--f-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.moment-meta span {
  font-size: var(--f-xs);
  color: var(--text-2);
}
.moment-saved {
  color: #FBBF24;
  font-size: 18px;
  flex-shrink: 0;
}

.moment-media {
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--bg-2);
  margin-bottom: var(--s-3);
}
.moment-media.large { max-height: 70vh; display: grid; place-items: center; }
.moment-media img,
.moment-media video {
  width: 100%;
  height: auto;
  display: block;
}
.moment-media.large img,
.moment-media.large video { max-height: 70vh; object-fit: contain; width: auto; }
.moment-media audio { width: 100%; }

.moment-body {
  font-size: var(--f-sm);
  line-height: 1.5;
  white-space: pre-wrap;
  word-wrap: break-word;
}
.moment-body.large { font-size: var(--f-md); padding: var(--s-2) 0; }

.moment-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-2);
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.moment-views {
  font-size: var(--f-xs);
  color: var(--text-2);
}

/* Single Moment view */
.moment-detail-card {
  padding: var(--s-4);
  border-radius: var(--r-xl);
  background: var(--surface);
  box-shadow: var(--clay-raised);
}
.moment-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--s-3) 0 0;
  font-size: var(--f-xs);
  color: var(--text-2);
}
.moment-timer {
  font-weight: 700;
  color: var(--primary);
}
.moment-audience {
  text-transform: capitalize;
}
.moment-detail-actions {
  display: flex;
  gap: var(--s-2);
  margin-top: var(--s-3);
  flex-wrap: wrap;
}

/* Create moment */
.create-moment-sub {
  color: var(--text-2);
  font-size: var(--f-sm);
  margin: 0 0 var(--s-3);
  line-height: 1.5;
}
.moment-picker {
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--bg-2);
  box-shadow: var(--clay-inset);
}
.aud-check {
  color: var(--primary);
  font-weight: 800;
  font-size: 18px;
  margin-left: 8px;
}
/* ===========================================================
   Pulse Replay
   =========================================================== */

.replay-view {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

.replay-hero {
  padding: var(--s-6) var(--s-4);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg,
    color-mix(in srgb, var(--primary) 12%, var(--surface)),
    color-mix(in srgb, var(--accent-pink) 12%, var(--surface)));
  box-shadow: var(--clay-raised);
  text-align: center;
}
.replay-month {
  font-size: var(--f-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 6px;
}
.replay-headline {
  font-size: var(--f-xl);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text);
}

.replay-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--s-2);
}
.replay-stat {
  padding: var(--s-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.replay-stat-icon {
  font-size: 22px;
  line-height: 1;
}
.replay-stat-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary);
  line-height: 1;
}
.replay-stat-label {
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  line-height: 1.3;
}

.replay-section-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  font-weight: 700;
  margin-top: var(--s-3);
  padding-left: 4px;
}

.replay-top-card {
  display: flex;
  gap: var(--s-3);
  padding: var(--s-3);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--clay-raised);
}
.replay-top-card.compact { padding: var(--s-3) var(--s-4); }
.replay-top-media {
  width: 90px;
  height: 90px;
  border-radius: var(--r-md);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-2);
}
.replay-top-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.replay-top-body { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.replay-top-body p { margin: 0; font-size: var(--f-sm); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.replay-top-meta { display: flex; gap: var(--s-3); font-size: var(--f-xs); color: var(--text-2); font-weight: 600; }
.replay-top-day { display: flex; flex-direction: column; gap: 2px; }
.replay-top-day strong { font-size: var(--f-md); }
.replay-top-day span { font-size: var(--f-xs); color: var(--text-2); }

.replay-quiet {
  padding: var(--s-4);
  text-align: center;
  color: var(--text-2);
  font-size: var(--f-sm);
  line-height: 1.5;
  border-radius: var(--r-md);
  background: var(--bg-2);
  box-shadow: var(--clay-inset);
}

.replay-footer {
  text-align: center;
  font-size: var(--f-xs);
  color: var(--text-2);
  opacity: 0.6;
  padding: var(--s-4) 0;
}



/* ===========================================================
   Moments v2 — three formats
   =========================================================== */

.moments-view { display: flex; flex-direction: column; gap: var(--s-3); }

.moments-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--s-3);
}
.moments-title {
  margin: 0;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.moments-subtitle {
  margin: 2px 0 0;
  font-size: var(--f-sm);
  color: var(--text-2);
}
.moments-new-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 24px;
  font-weight: 300;
  display: grid;
  place-items: center;
  box-shadow: var(--clay-raised);
  flex-shrink: 0;
}
.moments-new-btn:active { transform: scale(0.94); }

.moments-strip {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
  scrollbar-width: none;
}
.moments-strip::-webkit-scrollbar { display: none; }

.strip-item {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  background: transparent;
  padding: 0;
}
.strip-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 700;
  font-size: 18px;
  box-shadow: 0 0 0 3px var(--surface), var(--clay-raised);
}
.strip-avatar img { width: 100%; height: 100%; object-fit: cover; }
.strip-avatar.self-avatar {
  background: var(--bg-2);
  color: var(--primary);
  font-size: 26px;
  font-weight: 300;
  box-shadow: 0 0 0 3px var(--surface), var(--clay-inset);
}
.strip-name {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-2);
  max-width: 60px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.moments-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
}
.moments-tabs::-webkit-scrollbar { display: none; }
.moments-tab {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  font-size: var(--f-xs);
  font-weight: 700;
  color: var(--text-2);
  transition: all var(--dur) var(--ease);
}
.moments-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--clay-raised);
}

.moment-expiry {
  font-size: 10px;
  color: var(--text-2);
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------------- MOOD ---------------- */
.moment-card.mood {
  padding: 0;
  overflow: hidden;
  background: var(--surface);
  border-radius: var(--r-xl);
}
.moment-card.mood .moment-head { padding: var(--s-3) var(--s-4) 0; }
.moment-card.mood .moment-actions { padding: 0 var(--s-4) var(--s-3); border-top: none; margin-top: 0; }

.mood-body {
  padding: var(--s-6) var(--s-4);
  border-radius: var(--r-lg);
  margin: var(--s-3) var(--s-3) 0;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.mood-violet { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.mood-plum   { background: linear-gradient(135deg, #6b2f52, #a8638a); }
.mood-teal   { background: linear-gradient(135deg, #0f766e, #22d3ee); }
.mood-amber  { background: linear-gradient(135deg, #b45309, #f59e0b); }
.mood-forest { background: linear-gradient(135deg, #14532d, #22c55e); }
.mood-ink    { background: linear-gradient(135deg, #0f172a, #334155); }

.mood-eyebrow {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.75;
  margin-bottom: 12px;
}
.mood-title {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0;
  letter-spacing: -0.01em;
  word-break: break-word;
}

/* ---------------- WORLD ---------------- */
.moment-card.world .world-achievement {
  display: flex;
  gap: 12px;
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: linear-gradient(135deg, color-mix(in srgb, #FBBF24 15%, var(--bg-2)), var(--bg-2));
  margin-top: var(--s-3);
  align-items: center;
}
.world-ach-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
  box-shadow: var(--clay-raised);
}
.world-ach-body { flex: 1; min-width: 0; }
.world-ach-body strong { display: block; font-size: var(--f-sm); }
.world-ach-body span { font-size: var(--f-xs); color: var(--text-2); }

/* ---------------- Create — type tabs ---------------- */
.moment-type-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: var(--s-3);
}
.moment-type-tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 8px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  box-shadow: var(--clay-inset);
  transition: all var(--dur) var(--ease);
}
.moment-type-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--clay-raised);
}
.mt-icon { font-size: 20px; line-height: 1; }
.mt-label { font-size: var(--f-xs); font-weight: 700; }

.mood-themes {
  display: flex;
  gap: 8px;
  padding: var(--s-2) var(--s-3) var(--s-3);
}
.mood-theme {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  box-shadow: var(--clay-raised);
  transition: transform var(--dur) var(--ease), outline var(--dur) var(--ease);
}
.mood-theme[data-theme="violet"] { background: linear-gradient(135deg, #7c3aed, #a855f7); }
.mood-theme[data-theme="plum"]   { background: linear-gradient(135deg, #6b2f52, #a8638a); }
.mood-theme[data-theme="teal"]   { background: linear-gradient(135deg, #0f766e, #22d3ee); }
.mood-theme[data-theme="amber"]  { background: linear-gradient(135deg, #b45309, #f59e0b); }
.mood-theme[data-theme="forest"] { background: linear-gradient(135deg, #14532d, #22c55e); }
.mood-theme[data-theme="ink"]    { background: linear-gradient(135deg, #0f172a, #334155); }
.mood-theme.active { outline: 3px solid var(--primary); outline-offset: 2px; }

.world-source {
  padding: var(--s-3);
  border-radius: var(--r-md);
  background: var(--bg-2);
  box-shadow: var(--clay-inset);
}
.world-hint {
  margin: 10px 0 0;
  font-size: var(--f-xs);
  color: var(--text-2);
  text-align: center;
}

/* ---------------- Verify screen ---------------- */
.verify-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: var(--bg);
}
.verify-hint {
  font-size: var(--f-xs);
  color: var(--text-2);
  text-align: center;
  margin: 0;
}

/* ---------------- Passkey rows in settings ---------------- */
.passkey-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--bg-2);
  margin-top: 6px;
}
.passkey-row strong { font-size: var(--f-sm); display: block; }
.passkey-row span { font-size: 11px; color: var(--text-2); }
/* ===========================================================
   Mentions + Saved posts
   =========================================================== */
.mention-link { color: var(--primary); font-weight: 600; }
.mention-link:hover { text-decoration: underline; }

.post-action.save-btn { margin-left: auto; }
.post-action.save-btn.saved { color: var(--primary); }
/* ===========================================================
   Comment threading
   =========================================================== */
.comment-reply {
  margin-left: 40px;
  border-left: 2px solid color-mix(in srgb, var(--primary) 20%, transparent);
  padding-left: 12px;
}
/* ===========================================================
   Comment threading
   =========================================================== */
.comment-reply {
  margin-left: 40px;
  border-left: 2px solid color-mix(in srgb, var(--primary) 20%, transparent);
  padding-left: 12px;
}

/* ===========================================================
   Profile tabs
   =========================================================== */
.profile-tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  margin: var(--s-4) 0 var(--s-3);
  padding-bottom: 4px;
}
.profile-tab {
  padding: 8px 16px;
  border-radius: var(--r-pill);
  font-size: var(--f-sm);
  font-weight: 600;
  color: var(--text-2);
  transition: all var(--dur) var(--ease);
}
.profile-tab.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--clay-raised);
}

/* ===========================================================
   Circle chip (mutual follow indicator)
   =========================================================== */
.circle-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--primary) 15%, transparent);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  vertical-align: middle;
}

/* ===========================================================
   Mentions + Saved posts
   =========================================================== */
.mention-link { color: var(--primary); font-weight: 600; }
.mention-link:hover { text-decoration: underline; }
.post-action.save-btn { margin-left: auto; }
.post-action.save-btn.saved { color: var(--primary); }
/* ===========================================================
   Pulse Live — voice rooms
   =========================================================== */
.live-pill {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
}
@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}

.live-stage {
  padding: var(--s-4);
  margin-top: var(--s-3);
}
.live-speakers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: var(--s-4) var(--s-3);
}
.live-speaker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  transition: transform var(--dur) var(--ease);
}
.live-speaker-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), var(--accent-pink));
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  overflow: hidden;
  position: relative;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--primary) 50%, transparent);
  transition: box-shadow 200ms var(--ease), transform 200ms var(--ease);
}
.live-speaker-avatar img { width: 100%; height: 100%; object-fit: cover; }
.live-speaker.speaking .live-speaker-avatar {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 50%, transparent);
  transform: scale(1.03);
}
.live-speaker strong {
  font-size: var(--f-sm);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.live-speaker span {
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.live-muted-dot {
  position: absolute;
  bottom: -2px;
  right: -2px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  color: #ef4444;
  display: grid;
  place-items: center;
  font-size: 11px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}

.live-section-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  font-weight: 700;
  margin-top: var(--s-3);
}
.live-listeners {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
  margin-top: var(--s-2);
}
.live-listener-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: var(--clay-raised);
  font-size: var(--f-xs);
}
.live-listener-chip span { font-size: 12px; color: var(--text); }

.live-controls {
  display: flex;
  gap: var(--s-2);
  justify-content: center;
  padding: var(--s-3);
  margin-top: var(--s-4);
  position: sticky;
  bottom: calc(var(--nav-h) + var(--s-3));
}
.live-ctrl-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 16px;
  border-radius: var(--r-lg);
  background: var(--bg-2);
  font-size: 10px;
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--clay-inset);
  min-width: 72px;
  transition: transform var(--dur) var(--ease), background var(--dur) var(--ease);
}
.live-ctrl-btn:active { transform: scale(0.96); }
.live-ctrl-btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--clay-raised);
}
.live-ctrl-btn.danger { color: #ef4444; }
.live-ctrl-btn span:first-child { font-size: 18px; }
/* ===========================================================
   Beta pill
   =========================================================== */
.beta-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  margin-left: 6px;
  border-radius: var(--r-pill);
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  vertical-align: middle;
}
.beta-pill.small { font-size: 8px; padding: 2px 6px; }

/* ===========================================================
   Live cards
   =========================================================== */
.live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ef4444;
  margin-right: 6px;
  vertical-align: middle;
  animation: livePulse 1.6s infinite;
}
.live-pill.ended { background: var(--text-2); }

.live-own-chip {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--primary) 20%, transparent);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
}

/* ===========================================================
   Daily claim card
   =========================================================== */
.daily-claim-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  padding: var(--s-4);
  margin-top: var(--s-3);
}
.daily-claim-left {
  display: flex;
  align-items: center;
  gap: var(--s-3);
  min-width: 0;
  flex: 1;
}
.daily-claim-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FBBF24, #F59E0B);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex-shrink: 0;
  box-shadow: var(--clay-raised);
}
.daily-claim-left strong { display: block; font-size: var(--f-md); }
.daily-claim-left span { font-size: var(--f-xs); color: var(--text-2); }

.streak-card {
  padding: var(--s-3) var(--s-4);
  margin-top: var(--s-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.streak-card strong { display: block; font-size: var(--f-sm); }
.streak-card span { font-size: var(--f-xs); color: var(--text-2); }

/* ===========================================================
   Guestbook reactions
   =========================================================== */
.guestbook-actions {
  display: flex;
  gap: var(--s-3);
  margin-top: 6px;
}
.guestbook-react {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  color: var(--text-2);
  font-size: var(--f-xs);
  font-weight: 700;
  transition: all var(--dur) var(--ease);
}
.guestbook-react:hover { background: var(--surface); }
.guestbook-react.active { color: var(--accent-pink); }

/* ===========================================================
   Blocked / muted page
   =========================================================== */
.clay-btn.danger {
  color: #ef4444;
  box-shadow: var(--clay-raised);
}
.clay-btn.danger:hover { color: #dc2626; }

@keyframes livePulse {
  0%   { box-shadow: 0 0 0 0 rgba(239,68,68,0.7); }
  70%  { box-shadow: 0 0 0 8px rgba(239,68,68,0); }
  100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); }
}
/* ===========================================================
   Discovery cards (cold-start feed)
   =========================================================== */
.discovery-card {
  border-left: 3px solid color-mix(in srgb, var(--primary) 40%, transparent);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--primary) 4%, var(--surface)),
    var(--surface)
  );
}

.discovery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  gap: 8px;
}

.discovery-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.discovery-source {
  font-size: 11px;
  color: var(--text-2);
  font-weight: 600;
}

/* Weather */
.discovery-weather {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 0;
}
.discovery-weather-temp {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.discovery-emoji { font-size: 32px; line-height: 1; }
.discovery-weather-temp strong {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.discovery-weather-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.discovery-weather-info strong { font-size: var(--f-md); }
.discovery-weather-info span {
  font-size: var(--f-xs);
  color: var(--text-2);
}

/* Country */
.discovery-country {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 4px 0;
}
.discovery-flag {
  width: 72px;
  height: 48px;
  border-radius: 8px;
  background-size: cover;
  background-position: center;
  background-color: var(--bg-2);
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}
.discovery-country-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.discovery-country-body strong { font-size: var(--f-md); }
.discovery-country-body span {
  font-size: var(--f-xs);
  color: var(--text-2);
}

/* Joke */
.discovery-joke { padding: 4px 0; }
.discovery-joke-setup {
  font-size: var(--f-md);
  line-height: 1.5;
  margin: 0 0 10px;
  font-weight: 500;
}
.discovery-joke-punch {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--primary) 12%, transparent);
  color: var(--primary);
  font-size: var(--f-xs);
  font-weight: 700;
  cursor: pointer;
  transition: transform var(--dur) var(--ease);
}
.discovery-joke-punch:active { transform: scale(0.96); }
.discovery-joke-delivery {
  font-size: var(--f-md);
  line-height: 1.5;
  margin: 0;
  font-weight: 600;
  color: var(--primary);
  animation: fadeIn 200ms var(--ease);
}
/* ===========================================================
   Room — furniture ABOVE the room
   =========================================================== */
.room-catalog {
  order: -1;
  margin-bottom: var(--s-3);
}
.room-stage { order: 0; }
.room-hint { order: 1; }

/* ===========================================================
   Wiki actions
   =========================================================== */
.discovery-card.wiki .post-actions {
  margin-top: var(--s-3);
  padding-top: var(--s-3);
  border-top: 1px solid var(--border);
}
.discovery-card.wiki .post-action {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-2);
  font-size: var(--f-sm);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--r-pill);
  transition: background var(--dur) var(--ease);
}
.discovery-card.wiki .post-action:hover { background: var(--bg-2); }
.discovery-card.wiki .post-action.liked { color: var(--accent-pink); }

/* ===========================================================
   Icons everywhere — replace emoji sizing
   =========================================================== */
.discovery-badge svg,
.discovery-source svg {
  vertical-align: middle;
  margin-right: 2px;
}
.moments-tab svg { vertical-align: middle; margin-right: 2px; }
.store-tab svg { vertical-align: middle; margin-right: 4px; }
.moment-type-tab .mt-icon svg { width: 20px; height: 20px; }
.msg-author svg { vertical-align: middle; margin-left: 3px; }
.user-badge svg { width: 100%; height: 100%; display: block; }
.badge-chip svg { width: 14px; height: 14px; }

/* Welcome chat */
.msg-content { white-space: pre-wrap; }
/* ===========================================================
   Room — layout fix so catalog + stage share space cleanly
   =========================================================== */

.room-view {
  display: flex;
  flex-direction: column;
  gap: var(--s-3);
}

/* Catalog sits above the stage, but caps its height */
.room-catalog {
  flex-shrink: 0;
  max-height: 160px;
  overflow: hidden;
  margin-bottom: 0;
}
.room-catalog-scroll {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}
.room-catalog-scroll::-webkit-scrollbar { display: none; }

/* Room stage gets a fixed aspect but is capped so it can't overflow */
.room-stage {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-xl);
  overflow: hidden;
  background: linear-gradient(180deg, #f5f3f0 0%, #e8e2d6 100%);
  box-shadow: var(--clay-raised);
  flex-shrink: 0;
}

.room-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

.room-hint {
  text-align: center;
  font-size: var(--f-xs);
  color: var(--text-2);
  padding: 4px 12px;
  flex-shrink: 0;
}

/* Category tabs are compact */
.room-category-tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 0 2px 6px;
  scrollbar-width: none;
  flex-shrink: 0;
}
.room-category-tabs::-webkit-scrollbar { display: none; }

/* Room chips smaller so more fit */
.room-chip {
  min-width: 68px;
  padding: 8px 10px;
}
.room-chip-label { font-size: 11px; }
.room-chip-sub { font-size: 9px; }

/* Save row compact */
.room-save-row {
  padding: 4px 0 12px;
  flex-shrink: 0;
}
/* ===========================================================
   Orbit — 3D stage
   =========================================================== */
.orbit-3d-stage {
  position: relative;
  width: 100%;
  height: clamp(360px, 62vh, 640px);
  border-radius: var(--r-xl);
  overflow: hidden;
  background:
    radial-gradient(circle at 30% 20%,
      color-mix(in srgb, var(--primary) 18%, transparent),
      transparent 55%),
    radial-gradient(circle at 75% 85%,
      color-mix(in srgb, var(--accent-pink) 12%, transparent),
      transparent 60%),
    linear-gradient(180deg, #1a1425 0%, #0f0a18 100%);
  box-shadow: var(--clay-raised);
  touch-action: none;
  cursor: grab;
}
.orbit-3d-stage:active { cursor: grabbing; }
.orbit-3d-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

@media (min-width: 800px) {
  .orbit-3d-stage {
    height: clamp(460px, 68vh, 720px);
  }
}
/* ===========================================================
   Orbit — stats bar + tier chips + sheet + 3D
   =========================================================== */
.orbit-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 8px;
  padding: 12px 14px;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--clay-raised);
  margin-bottom: 12px;
}
.orbit-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
}
.orbit-stat strong {
  font-size: var(--f-lg);
  font-weight: 800;
  line-height: 1.1;
}
.orbit-stat span {
  font-size: 10px;
  color: var(--text-2);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 2px;
  text-align: center;
}
.orbit-insights-btn {
  align-self: center;
  padding: 8px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  font-size: var(--f-xs);
  font-weight: 700;
  color: var(--text);
  box-shadow: var(--clay-inset);
  cursor: pointer;
  border: none;
}
.orbit-insights-btn:hover { background: var(--surface); box-shadow: var(--clay-raised); }

/* Tier chips */
.orbit-tier-bar {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 8px;
  margin-bottom: 8px;
}
.orbit-tier-bar::-webkit-scrollbar { display: none; }
.orbit-tier-chip {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: var(--r-pill);
  background: var(--bg-2);
  font-size: var(--f-xs);
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  border: none;
  transition: all var(--dur) var(--ease);
}
.orbit-tier-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  box-shadow: var(--clay-raised);
}

/* 3D stage */
.orbit-3d-stage {
  position: relative;
  width: 100%;
  height: clamp(400px, 68vh, 680px);
  border-radius: var(--r-xl);
  overflow: hidden;
  background:
    radial-gradient(ellipse at 50% 55%,
      rgba(124, 58, 237, 0.22) 0%,
      rgba(124, 58, 237, 0.06) 30%,
      transparent 60%),
    radial-gradient(ellipse at 50% 120%,
      rgba(168, 85, 247, 0.24) 0%,
      transparent 70%),
    linear-gradient(180deg, #0f0a1a 0%, #06040c 100%);
  box-shadow: var(--clay-raised);
  touch-action: none;
  cursor: grab;
}
.orbit-3d-stage:active { cursor: grabbing; }
.orbit-3d-stage canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}
@media (min-width: 800px) {
  .orbit-3d-stage { height: clamp(480px, 72vh, 760px); }
}

/* 2D inner-ring marker */
.orbit-member.orbit-member-inner-tier .orbit-member-inner {
  box-shadow: 0 0 0 3px #a855f7, 0 0 14px rgba(168, 85, 247, 0.55);
}

/* List view tier titles + tags */
.orbit-list-title {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-2);
  font-weight: 700;
  padding: 8px 4px 4px;
}
.orbit-row-tag {
  display: inline-block;
  padding: 2px 8px;
  margin-left: 6px;
  border-radius: var(--r-pill);
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  vertical-align: middle;
}
.orbit-row-tag.inner { background: linear-gradient(135deg, #a855f7, #7c3aed); color: #fff; }
.orbit-row-tag.extended { background: var(--bg-2); color: var(--text-2); }

/* Member sheet */
.orbit-sheet-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  margin-bottom: 14px;
}
.orbit-sheet-tier {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--bg-2);
  color: var(--text-2);
  margin-top: 6px;
}
.orbit-tier-toggle.in-inner {
  background: var(--bg-2);
  color: var(--text);
  box-shadow: var(--clay-inset);
}
/* ===========================================================
   Live Orbit — online indicator
   =========================================================== */
.avatar-wrapper {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.online-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #22C55E;
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 0 rgba(34,197,94,0.7);
  animation: onlinePulse 2.4s ease-out infinite;
}
.online-dot.online-dot-lg {
  width: 16px;
  height: 16px;
}
@keyframes onlinePulse {
  0%   { box-shadow: 0 0 0 0 rgba(34,197,94,0.55); }
  70%  { box-shadow: 0 0 0 8px rgba(34,197,94,0); }
  100% { box-shadow: 0 0 0 0 rgba(34,197,94,0); }
}

.orbit-member-inner .online-dot {
  bottom: -2px;
  right: -2px;
  width: 13px;
  height: 13px;
  border-color: var(--surface);
}

.orbit-recent {
  color: var(--text-2);
  font-weight: 600;
}
.orbit-recent.online {
  color: #22C55E;
}

/* Circle-specific chip style */
.orbit-tier-chip.circle-chip {
  background: color-mix(in srgb, var(--primary) 12%, var(--bg-2));
  color: var(--primary);
}
.orbit-tier-chip.circle-chip.active {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
}
.orbit-tier-chip.new-circle-chip {
  background: transparent;
  border: 1px dashed var(--border);
  color: var(--text-2);
}
.orbit-tier-chip.new-circle-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}