/* ── Profile Screen ────────────────────────────────────────────────── */

/* Profile sidebar */
.profile-sidebar {
  width: 220px; flex-shrink: 0;
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow: hidden;
  padding: 24px 0 8px;
}
.profile-sidebar::-webkit-scrollbar { width: 3px }
.profile-sidebar::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }

.avatar-section {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 20px 20px; margin-top: -24px; padding-top: 44px;
  border-bottom: 1px solid var(--border);
  position: relative; flex-shrink: 0;
}
.avatar-section > .profile-banner {
  -webkit-mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
  mask-image: linear-gradient(to bottom, black 40%, transparent 100%);
}
.profile-admin-badge {
  position: absolute;
  top: 8px; right: 8px;
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, rgba(236, 72, 153, 0.25), rgba(168, 85, 247, 0.25));
  color: #e879a8;
  border: 1px solid rgba(236, 72, 153, 0.35);
  backdrop-filter: blur(8px);
}
.profile-admin-badge svg {
  width: 12px; height: 12px; flex-shrink: 0;
}
.avatar-wrap { position: relative; margin-bottom: 12px }
.user-name { font-family: var(--ff-display); font-size: 17px; font-weight: 400; color: var(--cream); text-align: center }
.tier-badge {
  margin-top: 6px; padding: 4px 14px; border-radius: 99px;
  font-size: 11px; font-weight: 500; letter-spacing: 0.04em;
}
.tier-badge.premium { background: linear-gradient(135deg, var(--amber), #d97706); color: #fff }
.tier-badge.basic { background: var(--rose-bg); color: var(--rose) }
.tier-badge.free { background: var(--border2); color: var(--muted) }
.user-since { font-size: 10px; color: var(--muted2); margin-top: 8px; text-align: center }

/* Sidebar nav */
.sidebar-nav { padding: 12px 8px; overflow-y: auto; flex: 1; min-height: 0 }
.sidebar-nav::-webkit-scrollbar { width: 3px }
.sidebar-nav::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }
.sidebar-nav-label {
  font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--muted2); padding: 0 10px; margin-bottom: 6px; margin-top: 12px;
}
.sidebar-nav-label:first-child { margin-top: 4px }
.snav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s; font-size: 13px; color: var(--muted);
}
.snav-item:hover { background: var(--bg2); color: var(--cream) }
.snav-item.active { background: var(--rose-bg); color: var(--rose) }
.snav-item svg { width: 15px; height: 15px; flex-shrink: 0 }

/* Profile content */
.profile-content {
  flex: 1; overflow-y: auto; padding: 28px 36px;
  background: var(--bg2);
}
.profile-content::-webkit-scrollbar { width: 4px }
.profile-content::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }

.page-header { margin-bottom: 24px }
.page-title { font-family: var(--ff-display); font-size: 22px; font-weight: 400; color: var(--cream) }
.page-sub { font-size: 12px; color: var(--muted); margin-top: 3px }

.section {
  background: var(--bg3); border: 1px solid var(--border2);
  border-radius: 14px; padding: 20px 22px; margin-bottom: 16px;
}
.section-title { font-size: 11px; letter-spacing: 0.09em; text-transform: uppercase; color: var(--muted2); margin-bottom: 16px }
.section-title-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.section-title-row .section-title { margin-bottom: 0 }

/* Form */
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px }
.form-row.single { grid-template-columns: 1fr }
.form-textarea { resize: vertical; min-height: 72px; line-height: 1.6 }

/* ── Match Preferences Redesign ──────────────────────────────────── */

/* Empty state */
.pref-empty {
  display: flex; flex-direction: column; align-items: center;
  padding: 40px 24px; text-align: center;
}
.pref-empty svg {
  width: 36px; height: 36px; color: var(--muted2); margin-bottom: 14px;
}
.pref-empty-title {
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
}

/* 2-column category grid inside a section */
.pref-cat-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
.pref-cat-label {
  font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted2); margin-bottom: 8px;
}
.pref-img-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}

/* Image card — compact */
.pref-img-card {
  width: 88px; border-radius: 8px; overflow: hidden;
  border: 1px solid var(--rose-20); background: var(--bg2);
  transition: transform 0.15s, border-color 0.15s;
}
.pref-img-card:hover { transform: translateY(-2px); border-color: var(--rose-30) }
.pref-img-card img {
  width: 100%; aspect-ratio: 3/4; object-fit: cover; display: block;
}
.pref-img-label {
  padding: 4px 6px; text-align: center;
  font-size: 10px; color: var(--cream);
}

/* Text preference rows */
.pref-text-row {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border2);
}
.pref-text-row:last-child { border-bottom: none }
.pref-text-icon {
  width: 16px; height: 16px; color: var(--rose-dim); flex-shrink: 0;
}
.pref-text-icon svg { width: 16px; height: 16px }
.pref-text-label {
  font-size: 11px; color: var(--muted2); text-transform: uppercase;
  letter-spacing: 0.04em; white-space: nowrap;
}
.pref-text-val {
  margin-left: auto; font-size: 12px; color: var(--cream);
  text-align: right;
}

/* Outline button (complete onboarding) */
.pref-outline-btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 8px 20px; border-radius: 8px;
  background: transparent; border: 1px solid var(--rose-20);
  color: var(--rose); font-family: var(--ff-body); font-size: 12px;
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.pref-outline-btn:hover {
  background: var(--rose-bg); border-color: var(--rose-30);
}

/* Editable preference fields */
.pref-fields {
  display: flex; flex-direction: column; gap: 16px;
}
.pref-field {
  display: flex; flex-direction: column; gap: 6px;
}
.pref-field-label {
  font-size: 11px; color: var(--muted2); text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pref-select {
  appearance: none;
  background: var(--bg2); color: var(--cream);
  border: 1px solid var(--border2); border-radius: 8px;
  padding: 10px 32px 10px 12px; font-size: 13px;
  font-family: var(--ff-body); cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237a6d72' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  transition: border-color 0.15s;
}
.pref-select:hover { border-color: var(--rose-20) }
.pref-select:focus { border-color: var(--rose-30); outline: none }
.pref-select option { background: var(--bg2); color: var(--cream) }

/* Style tag chips */
.pref-chips {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.pref-chip {
  padding: 7px 14px; border-radius: 20px;
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--muted); font-size: 12px; font-family: var(--ff-body);
  cursor: pointer; transition: all 0.15s;
}
.pref-chip:hover { border-color: var(--rose-20); color: var(--cream) }
.pref-chip.selected {
  background: var(--rose-bg); border-color: var(--rose-30);
  color: var(--rose);
}
.pref-chip-hint {
  font-size: 11px; color: var(--muted2);
}
.saved-indicator {
  font-size: 0.75rem; color: var(--green); margin-left: 8px; transition: opacity 0.3s;
}
.saved-indicator.hidden { opacity: 0; }

/* Save row */
.pref-save-row {
  margin-top: 12px;
}
.pref-save-btn {
  padding: 10px 28px; border-radius: 8px;
  background: var(--rose); border: none;
  color: #fff; font-size: 13px; font-family: var(--ff-body);
  font-weight: 500; cursor: pointer; transition: opacity 0.15s;
}
.pref-save-btn:hover { opacity: 0.9 }
.pref-save-btn:disabled { opacity: 0.5; cursor: not-allowed }

/* ── Coach Profile Page ──────────────────────────────────────────── */

/* Skill list in profile */
.coach-profile-skill { margin-bottom: 14px }
.coach-profile-skill:last-child { margin-bottom: 0 }
.coach-profile-skill-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 5px;
}
.coach-profile-bar {
  height: 4px; border-radius: 2px;
  background: var(--border2); overflow: hidden;
}
.coach-profile-bar-fill {
  height: 100%; border-radius: 2px;
  transition: width 0.4s ease;
}
.coach-profile-empty {
  text-align: center; padding: 20px 0;
  font-size: 13px; color: var(--muted);
}

/* Action cards */
.coach-action-card {
  display: flex; align-items: center; gap: 14px;
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 14px; padding: 18px 20px; margin-bottom: 12px;
}
.coach-action-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--rose-bg); color: var(--rose);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.coach-action-icon svg { width: 18px; height: 18px }
.coach-action-icon--danger { background: var(--red-bg); color: var(--red) }
.coach-action-body { flex: 1; min-width: 0 }
.coach-action-title { font-size: 13px; color: var(--cream); margin-bottom: 2px }
.coach-action-desc {
  font-size: 11px; color: var(--muted); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.coach-action-btn { flex-shrink: 0; padding: 7px 16px; font-size: 12px }
.coach-action-btn--danger {
  border-color: rgba(239, 68, 68, 0.25); color: var(--red);
}
.coach-action-btn--danger:hover {
  background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.4);
}
.coach-action-card--danger { border-color: rgba(239, 68, 68, 0.12) }

/* Appearance box */
.appearance-box { background: var(--bg2); border: 1px solid var(--border2); border-radius: 9px; padding: 10px 12px }
.appearance-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 6px }
.appearance-label svg { width: 12px; height: 12px; color: var(--rose-dim) }
.appearance-text { font-size: 12px; color: var(--muted); line-height: 1.6 }

/* Resync button */
.appearance-resync-btn {
  display: flex; align-items: center; gap: 5px;
  padding: 5px 12px; border-radius: 7px;
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--muted); font-family: var(--ff-body); font-size: 11px;
  cursor: pointer; transition: all 0.15s;
}
.appearance-resync-btn:hover:not(:disabled) {
  border-color: var(--rose-30); background: var(--rose-bg); color: var(--rose);
}
.appearance-resync-btn:disabled { opacity: 0.4; cursor: not-allowed }
.appearance-resync-btn svg { width: 12px; height: 12px }
.appearance-resync-btn .spin { animation: resync-spin 1s linear infinite }
@keyframes resync-spin { to { transform: rotate(360deg) } }

/* Cooldown hint */
.appearance-cooldown {
  font-size: 11px; color: var(--muted2); margin-top: 8px;
}

/* Avatar option disabled state */
.avatar-preview-option--disabled { opacity: 0.5 }
.avatar-preview-option--disabled .setting-toggle { pointer-events: none }

/* Toggle group */
.toggle-group {
  display: flex; gap: 0; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 9px;
  overflow: hidden; margin-bottom: 14px;
}
.toggle-opt {
  flex: 1; padding: 8px; font-size: 12px; text-align: center;
  cursor: pointer; border: none; background: transparent;
  color: var(--muted); transition: all 0.15s; font-family: var(--ff-body);
  border-right: 1px solid var(--border2);
}
.toggle-opt:last-child { border-right: none }
.toggle-opt.active { background: var(--rose-bg); color: var(--rose) }
.toggle-opt:hover:not(.active) { color: var(--cream); background: var(--cream-04) }

/* Config row */
.config-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 9px;
  cursor: pointer; transition: all 0.15s; margin-bottom: 8px;
}
.config-row:last-child { margin-bottom: 0 }
.config-row:hover { border-color: var(--cream-12); background: var(--cream-04) }
.config-row-key { font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted2); margin-bottom: 2px }
.config-row-val { font-size: 13px; color: var(--cream) }
.config-row-arrow { color: var(--muted2); display: flex; align-items: center }
.config-row-arrow svg { width: 14px; height: 14px }

/* Account rows */
.account-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 9px;
  cursor: pointer; transition: all 0.15s; margin-bottom: 8px;
}
.account-row:last-child { margin-bottom: 0 }
.account-row:hover { border-color: var(--cream-12) }
.account-row-icon {
  width: 32px; height: 32px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.account-row-icon svg { width: 15px; height: 15px }
.account-row-icon.rose { background: var(--rose-bg); color: var(--rose) }
.account-row-icon.blue { background: rgba(96, 165, 250, 0.1); color: var(--blue) }
.account-row-icon.amber { background: var(--yellow-bg); color: var(--yellow) }
.account-row-icon.red { background: var(--red-bg); color: var(--red) }
.account-row-body { flex: 1 }
.account-row-title { font-size: 13px; color: var(--cream) }
.account-row-sub { font-size: 11px; color: var(--muted); margin-top: 1px }
.account-row-arrow { color: var(--muted2) }
.account-row-arrow svg { width: 14px; height: 14px }

/* ── Plan & Tokens Page ──────────────────────────────────────────── */

/* Token balance bar */
.plan-page-tokens {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 12px; margin-bottom: 20px;
}
.plan-tokens-left {
  display: flex; align-items: center; gap: 12px;
}
.plan-tokens-left svg { width: 20px; height: 20px; color: var(--amber); flex-shrink: 0 }
.plan-tokens-info { display: flex; flex-direction: column }
.plan-tokens-val {
  font-family: var(--ff-display); font-size: 20px; font-weight: 400;
  color: var(--cream); line-height: 1;
}
.plan-tokens-label { font-size: 11px; color: var(--muted); margin-top: 2px }
.plan-tokens-topup {
  padding: 7px 16px; border-radius: 8px;
  background: var(--rose-bg); border: 1px solid rgba(194, 105, 122, 0.25);
  color: var(--rose); font-size: 12px; font-family: var(--ff-body);
  cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.plan-tokens-topup:hover { background: var(--rose-15) }

/* Token top-up packs */
.topup-subtitle {
  font-size: 13px; color: var(--muted); margin-bottom: 12px;
}
.topup-upsell {
  display: flex; align-items: center; gap: 8px;
  background: var(--rose-bg); border: 1px solid rgba(194, 105, 122, 0.15);
  border-radius: 10px; padding: 10px 14px; margin-bottom: 16px;
  font-size: 12px; color: var(--rose);
}
.topup-upsell svg { width: 16px; height: 16px; flex-shrink: 0 }
.topup-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px;
  margin-bottom: 24px;
}
.topup-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 14px; padding: 20px 16px; text-align: center;
  position: relative; cursor: pointer;
  display: flex; flex-direction: column; align-items: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.topup-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
}
.topup-card.highlight {
  border-color: var(--rose-20);
  background: linear-gradient(135deg, rgba(194, 105, 122, 0.06), var(--bg3));
}
.topup-badge {
  position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
  padding: 3px 12px; border-radius: 99px;
  font-size: 10px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.5px; white-space: nowrap;
}
.topup-badge.rose { background: var(--rose); color: var(--bg) }
.topup-badge.amber { background: var(--amber); color: var(--bg) }
.topup-card-tokens {
  font-size: 28px; font-weight: 700; color: var(--cream);
  font-family: var(--ff-display); line-height: 1;
}
.topup-card-label {
  font-size: 12px; color: var(--muted); margin: 4px 0 8px;
}
.topup-card-original {
  font-size: 11px; color: var(--muted); text-decoration: line-through;
}
.topup-card-discount {
  font-size: 11px; color: var(--rose); font-weight: 600; margin-bottom: 4px;
}
.topup-card-btn {
  margin-top: 8px; padding: 8px 18px; border-radius: 8px;
  background: var(--rose-bg); border: 1px solid rgba(194, 105, 122, 0.25);
  color: var(--rose); font-size: 13px; font-weight: 600;
  font-family: var(--ff-body); cursor: pointer;
  transition: all 0.15s; width: 100%;
}
.topup-card-btn:hover { background: var(--rose-15) }
.topup-card.highlight .topup-card-btn {
  background: var(--rose); color: var(--bg);
}
.topup-card.highlight .topup-card-btn:hover {
  filter: brightness(1.1);
}
.topup-loading, .topup-error {
  grid-column: 1 / -1; text-align: center;
  padding: 20px; color: var(--muted); font-size: 13px;
}

/* Hero banner (Free users) */
.plan-hero {
  background: radial-gradient(ellipse at 50% 0%, rgba(194, 105, 122, 0.15), transparent 70%);
  border: 1px solid var(--border2); border-radius: 14px;
  padding: 28px 20px; text-align: center; margin-bottom: 20px;
}
.plan-hero-title {
  font-family: var(--ff-display); font-size: 22px; font-weight: 400;
  color: var(--cream); margin-bottom: 6px;
}
.plan-hero-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--rose), var(--rose-l));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.plan-hero-sub { font-size: 13px; color: var(--muted) }

/* Locked features strip (Free users) */
.plan-locked-strip {
  display: flex; justify-content: center; gap: 24px;
  padding: 16px 0; border-top: 1px solid var(--border2);
  border-bottom: 1px solid var(--border2); margin-bottom: 20px;
}
.plan-locked-item {
  display: flex; flex-direction: column; align-items: center;
  gap: 6px; font-size: 11px; color: var(--muted2);
}
.plan-locked-item svg { width: 18px; height: 18px; opacity: 0.6 }

/* Upgrade grid (Free users — 2 columns) */
.plan-upgrade-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}

/* Upsell card */
.plan-upsell-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 16px; padding: 24px 20px; position: relative;
  display: flex; flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}
.plan-upsell-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}
.plan-upsell-card.rose {
  border-color: var(--rose-20);
  background: linear-gradient(135deg, rgba(194, 105, 122, 0.05), var(--bg3));
}
.plan-upsell-card.amber {
  border-color: var(--amber-20);
  background: linear-gradient(135deg, var(--amber-bg), var(--bg3));
}
.plan-upsell-card.full { width: 100% }

/* Tier badge */
.plan-badge {
  position: absolute; top: 12px; right: 12px;
  padding: 3px 10px; border-radius: 4px;
  font-size: 0.65rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; white-space: nowrap;
}
.plan-badge-neutral { background: var(--bg2); color: var(--dim) }
.plan-badge-gold { background: linear-gradient(135deg, #d4a853, #f0d48a); color: #1a1318 }

/* Card name */
.plan-card-name {
  font-family: var(--ff-display); font-size: 20px; font-weight: 400;
  color: var(--cream); margin-bottom: 6px;
}
.plan-card-name .crown-icon {
  display: inline; vertical-align: middle; margin-right: 2px;
}
.plan-card-name .crown-icon svg { width: 16px; height: 16px; color: var(--amber) }

/* Price area */
.plan-price-area {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-bottom: 8px;
}
.plan-price-gradient {
  font-family: var(--ff-display); font-size: 32px; font-weight: 400;
  background: linear-gradient(135deg, var(--rose), var(--rose-l));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.plan-price-gradient.amber {
  background: linear-gradient(135deg, var(--amber), #fbbf24);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.plan-price-period { font-size: 12px; color: var(--muted) }

/* Inline billing toggle */
.plan-inline-toggle {
  display: inline-flex; background: var(--bg2);
  border-radius: 7px; overflow: hidden; border: 1px solid var(--border2);
}
.plan-inline-toggle button {
  font-size: 10px; font-family: var(--ff-body); padding: 4px 10px;
  border: none; background: transparent; color: var(--muted);
  cursor: pointer; transition: all 0.15s;
}
.plan-inline-toggle button.active { background: var(--rose-bg); color: var(--rose) }

/* Save pill */
.plan-save-pill {
  display: inline-block; padding: 2px 8px; border-radius: 99px;
  font-size: 10px; font-weight: 500;
  background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border);
}

/* Card tagline */
.plan-card-tagline { font-size: 12px; color: var(--muted); margin-bottom: 16px }

/* Feature list */
.plan-feat-list {
  display: flex; flex-direction: column; gap: 0;
  margin-bottom: 18px; flex: 1;
}
.plan-feat-icon-row {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0; font-size: 13px; color: var(--cream);
}
.plan-feat-icon-row svg { width: 16px; height: 16px; flex-shrink: 0; color: var(--muted) }
.plan-feat-icon-row .feat-included { color: var(--green) }
.plan-feat-icon-row .feat-included svg { color: var(--green) }
.plan-feat-icon-row .feat-val { margin-left: auto; font-size: 13px; color: var(--cream) }
.plan-feat-delta { font-size: 11px; color: var(--muted); margin-left: 4px }
.plan-feat-new {
  display: inline-block; padding: 1px 6px; border-radius: 99px;
  font-size: 9px; font-weight: 600; letter-spacing: 0.04em;
  background: var(--amber-15); color: var(--amber); margin-left: 6px;
}

/* Shimmer CTA */
.plan-cta-shimmer {
  width: 100%; padding: 12px; border-radius: 12px;
  font-size: 14px; font-weight: 500; font-family: var(--ff-body);
  border: none; cursor: pointer; position: relative;
  overflow: hidden; transition: all 0.2s; color: #fff; text-align: center;
}
.plan-cta-shimmer.rose { background: var(--rose) }
.plan-cta-shimmer.amber { background: linear-gradient(135deg, var(--amber), #d97706) }
.plan-cta-shimmer::after {
  content: ''; position: absolute; top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(105deg, transparent 40%, rgba(255,255,255,0.15) 50%, transparent 60%);
  transform: translateX(-100%); animation: plan-shimmer 3s infinite;
}
.plan-cta-shimmer:hover { filter: brightness(1.1); transform: translateY(-1px) }

/* Status card (Basic users) */
.plan-status-card {
  background: var(--bg2); border: 1px solid var(--rose-15);
  border-radius: 14px; padding: 18px 20px; margin-bottom: 20px;
}
.plan-status-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.plan-status-tier {
  font-family: var(--ff-display); font-size: 17px; font-weight: 400; color: var(--cream);
}
.plan-status-active {
  padding: 3px 10px; border-radius: 99px;
  font-size: 10px; font-weight: 500;
  background: var(--rose-bg); color: var(--rose);
}
.plan-status-meta {
  display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 14px;
  font-size: 12px; color: var(--muted);
}
.plan-status-meta-item { display: flex; align-items: center; gap: 5px }
.plan-status-meta-item svg { width: 13px; height: 13px; opacity: 0.6 }
.plan-status-benefits { display: flex; flex-wrap: wrap; gap: 8px }
.plan-status-benefit {
  display: flex; align-items: center; gap: 6px;
  background: var(--bg2); border-radius: 8px; padding: 6px 10px;
  font-size: 12px; color: var(--muted);
}
.plan-status-benefit svg { width: 14px; height: 14px; color: var(--rose-dim) }

/* Celebration card (Premium users) */
.plan-celebrate {
  background: var(--bg2); border: 1px solid var(--amber-20);
  border-radius: 16px; padding: 28px 24px; text-align: center;
  margin-bottom: 20px; box-shadow: 0 0 24px var(--amber-bg);
  animation: plan-glow 3s ease-in-out infinite;
}
.plan-celebrate-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: var(--amber-15); display: inline-flex;
  align-items: center; justify-content: center; margin-bottom: 14px;
}
.plan-celebrate-icon svg { width: 24px; height: 24px; color: var(--amber) }
.plan-celebrate-title {
  font-family: var(--ff-display); font-size: 20px; font-weight: 400;
  color: var(--cream); margin-bottom: 6px;
}
.plan-celebrate-title em {
  font-style: normal;
  background: linear-gradient(135deg, var(--amber), #fbbf24);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.plan-celebrate-sub { font-size: 13px; color: var(--muted) }
.plan-celebrate .plan-status-meta {
  justify-content: center; margin-top: 16px; margin-bottom: 0;
  padding-top: 14px; border-top: 1px solid var(--amber-15);
}

/* Perks grid (Premium users) */
.plan-perks-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 10px; margin-bottom: 8px;
}
.plan-perk {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 14px 8px; text-align: center;
}
.plan-perk svg { width: 20px; height: 20px; color: var(--amber); margin-bottom: 6px }
.plan-perk-val {
  font-family: var(--ff-display); font-size: 18px; font-weight: 400;
  color: var(--cream); margin-bottom: 2px;
}
.plan-perk-label {
  font-size: 10px; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.04em;
}

/* Manage section */
.plan-manage { margin-top: 28px; text-align: center }
.plan-manage-btn {
  display: inline-block; padding: 10px 28px; border-radius: 10px;
  font-size: 13px; font-weight: 500; font-family: var(--ff-body);
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--cream); cursor: pointer; transition: all 0.15s;
}
.plan-manage-btn:hover { background: var(--bg2); border-color: var(--border) }
.plan-cancel-link {
  display: block; margin-top: 12px;
  font-size: 11px; color: var(--muted2); text-decoration: underline;
  cursor: pointer; transition: color 0.15s; background: none; border: none;
  font-family: var(--ff-body);
}
.plan-cancel-link:hover { color: var(--red-light) }
.plan-manage-btn.secondary {
  margin-left: 8px; background: transparent; border-color: var(--border);
  color: var(--muted);
}
.plan-manage-btn.secondary:hover { background: var(--bg2); color: var(--cream) }
.plan-cancel-notice {
  margin-bottom: 12px; padding: 10px 16px; border-radius: 10px;
  background: var(--bg2); border: 1px solid var(--border2);
  font-size: 12px; color: var(--muted); text-align: center;
}
.plan-payment-warning {
  margin-bottom: 12px; padding: 10px 16px; border-radius: 10px;
  background: rgba(237, 66, 69, 0.1); border: 1px solid rgba(237, 66, 69, 0.3);
  font-size: 12px; color: var(--red-light); text-align: center;
}

/* Plan animations */
@keyframes plan-shimmer {
  0% { transform: translateX(-100%); }
  50%, 100% { transform: translateX(100%); }
}
@keyframes plan-glow {
  0%, 100% { box-shadow: 0 0 20px var(--amber-bg); }
  50% { box-shadow: 0 0 30px var(--amber-15); }
}

/* Plan change modal — uses shared .modal-* from base.css */

/* Stripe Payment modal (Elements) */
.payment-modal-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--black-60); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
}
.payment-modal-overlay.open { opacity: 1 }
.payment-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 32px; width: 100%; max-width: 480px;
  transform: scale(0.95); transition: transform 0.25s;
}
.payment-modal-overlay.open .payment-modal { transform: scale(1) }
.payment-modal-title {
  font-family: var(--ff-display); font-size: 20px;
  color: var(--cream); margin-bottom: 20px;
}
#payment-element { min-height: 300px; margin-bottom: 16px }
#payment-errors {
  color: var(--red-light); font-size: 13px;
  min-height: 20px; margin-bottom: 12px;
}
.payment-modal-actions { display: flex; gap: 10px }
.payment-modal-actions button {
  flex: 1; padding: 11px; border-radius: 10px; font-size: 13px;
  font-family: var(--ff-body); cursor: pointer; transition: all 0.15s;
}
.payment-modal-cancel {
  background: transparent; border: 1px solid var(--border2); color: var(--muted);
}
.payment-modal-cancel:hover { color: var(--cream); border-color: var(--dim) }
.payment-modal-submit {
  background: var(--rose); border: none; color: #fff;
}
.payment-modal-submit:hover { background: var(--rose-hover) }
.payment-modal-submit:disabled { opacity: 0.5; cursor: not-allowed }

/* Save button */
.save-btn {
  width: 100%; padding: 11px; border-radius: 10px;
  background: var(--rose); color: #fff; border: none;
  font-family: var(--ff-body); font-size: 14px; font-weight: 400;
  cursor: pointer; transition: all 0.15s; margin-top: 4px;
}
.save-btn:hover { background: var(--rose-hover) }

/* Location buttons */
.loc-actions { display: flex; gap: 8px; margin-top: 12px }
.loc-save-btn, .loc-clear-btn {
  padding: 8px 20px; border-radius: 8px; font-family: var(--ff-body);
  font-size: 13px; font-weight: 400; cursor: pointer; transition: all 0.15s;
}
.loc-save-btn {
  background: var(--rose); color: #fff; border: none;
}
.loc-save-btn:hover { background: var(--rose-hover) }
.loc-clear-btn {
  background: transparent; color: var(--muted); border: 1px solid var(--border2);
}
.loc-clear-btn:hover { color: var(--text); border-color: var(--text-secondary) }

.loc-suggest {
  position: absolute; top: 100%; left: 0; right: 0; z-index: 20;
  background: var(--panel); border: 1px solid var(--border2); border-radius: 8px;
  max-height: 200px; overflow-y: auto; margin-top: 4px;
}
.loc-suggest.hidden { display: none; }
.loc-suggest-item {
  padding: 8px 12px; cursor: pointer; font-size: 13px; color: var(--text);
}
.loc-suggest-item:hover { background: var(--bg2); }

/* ── Privacy & Data — Stats Grid ──────────────────────────────────── */
.privacy-loading {
  display: flex; align-items: center; justify-content: center; padding: 24px 0;
}
.privacy-loading svg { width: 24px; height: 24px; color: var(--muted) }
.privacy-stats-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.privacy-stat {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 14px 12px; text-align: center;
}
.privacy-stat-val {
  font-family: var(--ff-display); font-size: 22px; font-weight: 400;
  color: var(--cream); margin-bottom: 2px;
}
.privacy-stat-label {
  font-size: 11px; color: var(--muted); text-transform: capitalize;
}

/* ── Privacy & Data — Companion Cards ────────────────────────────── */
.privacy-companion-list {
  display: flex; flex-direction: column; gap: 8px;
}
.privacy-companion-card {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 14px 16px;
  display: flex; align-items: center; gap: 14px;
  transition: border-color 0.15s;
}
.privacy-companion-card:hover { border-color: var(--cream-12) }
.privacy-companion-info { flex: 1; min-width: 0 }
.privacy-companion-name {
  font-size: 13px; font-weight: 500; color: var(--cream);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.privacy-companion-stage {
  font-size: 11px; color: var(--muted); text-transform: capitalize; margin-top: 1px;
}
.privacy-companion-counts {
  display: flex; gap: 12px; flex-shrink: 0;
}
.privacy-companion-counts span {
  font-size: 11px; color: var(--muted2);
  white-space: nowrap;
}
.privacy-companion-actions {
  display: flex; gap: 6px; flex-shrink: 0;
}
.privacy-mem-btn, .privacy-reset-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; border-radius: 8px; font-size: 11px;
  font-family: var(--ff-body); cursor: pointer; transition: all 0.15s;
  border: 1px solid var(--border2); background: transparent; color: var(--muted);
}
.privacy-mem-btn svg, .privacy-reset-btn svg {
  width: 12px; height: 12px; flex-shrink: 0;
}
.privacy-mem-btn:hover { color: var(--cream); border-color: var(--dim) }
.privacy-reset-btn {
  border-color: rgba(239, 68, 68, 0.2); color: var(--red);
}
.privacy-reset-btn:hover {
  background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.35);
}

/* ── Data Viewer Accordion ────────────────────────────────────────── */
.data-viewer-sections {
  display: flex; flex-direction: column; gap: 2px;
}
.data-viewer-section {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; overflow: hidden;
}
.data-viewer-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; cursor: pointer; transition: background 0.15s;
  font-size: 13px; font-weight: 500; color: var(--cream);
}
.data-viewer-header:hover { background: var(--bg3) }
.data-viewer-chevron {
  width: 14px; height: 14px; color: var(--muted);
  transition: transform 0.2s; flex-shrink: 0;
}
.data-viewer-body {
  padding: 0 16px 14px; max-height: 400px; overflow-y: auto;
}
.data-viewer-body.hidden { display: none }
.data-viewer-loading {
  display: flex; align-items: center; justify-content: center; padding: 16px 0;
}
.data-viewer-loading svg { width: 20px; height: 20px; color: var(--muted) }
.data-viewer-empty, .data-viewer-error {
  font-size: 12px; color: var(--muted); padding: 12px 0; text-align: center;
}
.data-viewer-table {
  display: flex; flex-direction: column; gap: 1px;
}
.data-viewer-row {
  display: flex; gap: 12px; padding: 6px 0;
  border-bottom: 1px solid var(--border2); font-size: 12px;
}
.data-viewer-row:last-child { border-bottom: none }
.data-viewer-key {
  color: var(--muted); min-width: 100px; flex-shrink: 0;
  word-break: break-word;
}
.data-viewer-val {
  color: var(--cream-80); flex: 1; word-break: break-word;
}
.data-viewer-card {
  background: var(--bg2); border-radius: 8px; padding: 12px;
  margin-bottom: 6px;
}
.data-viewer-card-title {
  font-size: 13px; font-weight: 500; color: var(--cream);
  margin-bottom: 8px;
}
.data-viewer-subtitle {
  font-size: 11px; font-weight: 600; color: var(--muted);
  text-transform: uppercase; letter-spacing: 0.5px;
  padding: 10px 0 4px; margin-top: 4px;
}

/* Granular deletion buttons */
.deletion-actions {
  display: flex; flex-wrap: wrap; gap: 8px;
}
.deletion-btn {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 12px; border-radius: 8px;
  background: transparent; border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--text-secondary); font-size: 12px;
  cursor: pointer; transition: all 0.15s ease;
}
.deletion-btn:hover {
  background: rgba(239, 68, 68, 0.08);
  border-color: rgba(239, 68, 68, 0.4);
  color: #ef4444;
}
.deletion-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.settings-btn.danger {
  background: #ef4444; color: #fff; border: none;
}
.settings-btn.danger:hover { background: #dc2626; }
.settings-btn.danger:disabled { background: #ef4444; cursor: not-allowed; }
.settings-btn.secondary {
  background: var(--panel); color: var(--text); border: 1px solid var(--border);
}
.settings-btn.secondary:hover { background: var(--panel-hover); }

/* Delete account button */
.delete-account-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px; border-radius: 10px; margin-top: 20px;
  background: transparent; border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--red); font-family: var(--ff-body); font-size: 13px;
  cursor: pointer; transition: all 0.15s;
}
.delete-account-btn:hover { background: rgba(239, 68, 68, 0.08); border-color: rgba(239, 68, 68, 0.4) }
.delete-account-btn svg { width: 15px; height: 15px; flex-shrink: 0 }

/* Delete account modal — uses shared .modal-* from base.css */
.delete-modal-list {
  font-size: 12px; color: var(--muted); line-height: 1.8;
  padding-left: 18px; margin-bottom: 20px;
}
.delete-modal-list li { margin-bottom: 2px }

/* ── Avatar Crop Tool ─────────────────────────────────────────────── */
.avatar-crop-container {
  position: relative; width: 100%; aspect-ratio: 1;
  overflow: hidden; border-radius: 12px; background: #111;
  margin-bottom: 12px; border: 1px solid var(--border2);
}
.avatar-crop-area {
  position: absolute; inset: 0;
  cursor: grab; touch-action: none;
}
.avatar-crop-area.dragging { cursor: grabbing }
.avatar-crop-img {
  position: absolute; transform-origin: 0 0;
  user-select: none; -webkit-user-drag: none; pointer-events: none;
}
.avatar-crop-guide {
  position: absolute; inset: 0; border-radius: 50%;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.15);
  pointer-events: none;
}
.avatar-crop-zoom {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
}
.avatar-crop-zoom svg { width: 16px; height: 16px; color: var(--muted); flex-shrink: 0 }
.avatar-crop-slider {
  flex: 1; height: 3px; -webkit-appearance: none; appearance: none;
  background: var(--border2); border-radius: 2px; outline: none;
}
.avatar-crop-slider::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--rose); cursor: pointer; border: 2px solid var(--bg2);
}
.avatar-crop-slider::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%;
  background: var(--rose); cursor: pointer; border: 2px solid var(--bg2);
}

/* ── Avatar Preview Modal ──────────────────────────────────────────── */
.avatar-preview-overlay {
  position: fixed; inset: 0; z-index: 500;
  background: var(--black-60); backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.avatar-preview-overlay.open { opacity: 1; pointer-events: all }
.avatar-preview-modal {
  background: var(--bg2); border: 1px solid var(--border);
  border-radius: 20px; padding: 28px; width: 100%; max-width: 400px;
  transform: scale(0.95); transition: transform 0.3s;
}
.avatar-preview-overlay.open .avatar-preview-modal { transform: scale(1) }
.avatar-preview-header {
  font-family: var(--ff-display); font-size: 18px; color: var(--cream);
  margin-bottom: 16px;
}
.avatar-preview-img-wrap {
  width: 100%; aspect-ratio: 1; border-radius: 12px;
  overflow: hidden; margin-bottom: 16px;
  background: var(--bg2); border: 1px solid var(--border2);
}
.avatar-preview-img {
  width: 100%; height: 100%; object-fit: cover;
}
.avatar-preview-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 14px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 9px;
  margin-bottom: 10px;
}
.avatar-preview-option-body { flex: 1; margin-right: 14px }
.avatar-preview-option-title { font-size: 13px; color: var(--cream) }
.avatar-preview-option-sub { font-size: 11px; color: var(--muted); margin-top: 2px }
.avatar-preview-disclaimer {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 9px 12px; border-radius: 8px;
  background: rgba(250, 204, 21, 0.06); border: 1px solid rgba(250, 204, 21, 0.15);
  font-size: 11px; color: var(--yellow); line-height: 1.5; margin-bottom: 10px;
}
.avatar-preview-disclaimer svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 1px }
.avatar-preview-actions { display: flex; gap: 10px; margin-top: 6px }
.avatar-preview-actions button {
  flex: 1; padding: 10px; border-radius: 10px; font-size: 13px;
  font-family: var(--ff-body); cursor: pointer; transition: all 0.15s;
}
.avatar-preview-cancel {
  background: transparent; border: 1px solid var(--border2); color: var(--muted);
}
.avatar-preview-cancel:hover { color: var(--cream); border-color: var(--dim) }
.avatar-preview-upload {
  background: var(--rose); border: none; color: #fff;
}
.avatar-preview-upload:hover { background: var(--rose-hover) }
.avatar-preview-upload:disabled { opacity: 0.5; cursor: not-allowed }

/* ── Export Data Modal — overlay/wrapper from shared .modal-* ─────── */

/* Loading state */
.export-loading {
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 0; gap: 12px;
}
.export-spinner {
  width: 36px; height: 36px; color: var(--rose);
  animation: resync-spin 1.2s linear infinite;
}
.export-loading-title {
  font-family: var(--ff-display); font-size: 17px; color: var(--cream);
}
.export-loading-sub {
  font-size: 12px; color: var(--muted);
}

/* Preview state */
.export-preview-header {
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px;
}
.export-preview-header svg {
  width: 22px; height: 22px; color: #34d399; flex-shrink: 0;
}
.export-preview-title {
  font-family: var(--ff-display); font-size: 17px; color: var(--cream);
}

.export-stats {
  display: flex; gap: 10px; margin-bottom: 14px;
}
.export-stat {
  flex: 1; padding: 10px 12px; border-radius: 9px;
  background: var(--bg2); border: 1px solid var(--border2);
  font-size: 11px; color: var(--muted); text-align: center;
}
.export-stat-val {
  display: block; font-family: var(--ff-display); font-size: 18px;
  font-weight: 400; color: var(--cream); margin-bottom: 2px;
}

.export-preview-code {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 9px; padding: 12px 14px; margin-bottom: 16px;
  font-family: 'SF Mono', 'Fira Code', monospace; font-size: 11px;
  color: var(--muted); line-height: 1.6;
  max-height: 200px; overflow-y: auto; white-space: pre-wrap; word-break: break-all;
}
.export-preview-code::-webkit-scrollbar { width: 3px }
.export-preview-code::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }

/* Export save-done state (applied on top of shared .modal-btn) */
.export-preview-save--done { background: #34d399 !important; border-color: #34d399 !important }

/* Export error state */
.export-error {
  display: flex; flex-direction: column; align-items: center;
  padding: 20px 0; text-align: center;
}
.export-error-icon {
  width: 48px; height: 48px; border-radius: 12px;
  background: rgba(250, 204, 21, 0.1); color: var(--yellow);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.export-error-icon svg { width: 24px; height: 24px }
.export-error-title {
  font-family: var(--ff-display); font-size: 17px; color: var(--cream);
  margin-bottom: 6px;
}
.export-error-msg {
  font-size: 12px; color: var(--muted); line-height: 1.6;
  margin-bottom: 18px; max-width: 300px;
}
/* Logout confirm modal — uses shared .modal-* from base.css */

/* ── Delete Conversations Modal — overlay/wrapper from shared .modal-* */
.delete-conv-summary {
  background: var(--bg2); border: 1px solid var(--border2);
  border-radius: 10px; padding: 12px 14px; margin-bottom: 14px;
}
.delete-conv-count {
  font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted2); margin-bottom: 10px;
}
.dconv-list {
  display: flex; flex-direction: column; gap: 8px;
  max-height: 180px; overflow-y: auto;
}
.dconv-list::-webkit-scrollbar { width: 3px }
.dconv-list::-webkit-scrollbar-thumb { background: var(--muted2); border-radius: 2px }
.dconv-companion {
  display: flex; align-items: center; gap: 10px;
}
.dconv-avatar {
  width: 32px; height: 32px; border-radius: 50%; overflow: hidden;
  background: var(--bg2); border: 1px solid var(--border2); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted);
}
.dconv-avatar img { width: 100%; height: 100%; object-fit: cover }
.dconv-name { font-size: 13px; color: var(--cream) }
.dconv-stage { font-size: 11px; color: var(--muted) }

/* ── Avatar Lightbox ──────────────────────────────────────────────── */
.avatar-lightbox {
  position: fixed; inset: 0; z-index: 600;
  display: flex; align-items: center; justify-content: center;
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.avatar-lightbox.open { opacity: 1; pointer-events: all }
.avatar-lightbox-backdrop {
  position: absolute; inset: 0;
  background: var(--black-60); backdrop-filter: blur(12px);
}
.avatar-lightbox-content {
  position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 16px;
  transform: scale(0.92); transition: transform 0.3s;
}
.avatar-lightbox.open .avatar-lightbox-content { transform: scale(1) }
.avatar-lightbox-close {
  position: absolute; top: -40px; right: -40px;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--cream-08); border: 1px solid var(--cream-12);
  color: var(--cream); display: flex; align-items: center;
  justify-content: center; cursor: pointer; transition: all 0.15s;
}
.avatar-lightbox-close:hover { background: var(--cream-15) }
.avatar-lightbox-close svg { width: 16px; height: 16px }
.avatar-lightbox-img {
  width: 280px; height: 280px; border-radius: 50%;
  object-fit: cover; border: 3px solid var(--border);
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.avatar-lightbox-change {
  display: flex; align-items: center; gap: 6px;
  padding: 8px 18px; border-radius: 9px;
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--muted); font-family: var(--ff-body); font-size: 12px;
  cursor: pointer; transition: all 0.15s;
}
.avatar-lightbox-change:hover {
  border-color: var(--rose-30); background: var(--rose-bg); color: var(--rose);
}
.avatar-lightbox-change svg { width: 14px; height: 14px }

/* ── Title Selector ─────────────────────────────────────────────── */
.title-selector-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: var(--bg2);
  border: 1px solid var(--border2); border-radius: 9px;
}
.title-selector-row .setting-row-body { flex: 1; margin-right: 14px }
.title-select {
  min-width: 180px; padding: 7px 12px; border-radius: 7px;
  background: var(--bg2); border: 1px solid var(--border2);
  color: var(--cream); font-family: var(--ff-body); font-size: 12px;
  cursor: pointer; transition: border-color 0.15s;
  appearance: none; -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center;
  padding-right: 28px;
}
.title-select:hover { border-color: var(--rose-30) }
.title-select:focus { border-color: var(--rose); outline: none }
.title-select option { background: var(--bg2); color: var(--cream) }
.title-empty-hint {
  font-size: 11px; color: var(--muted2); margin-top: 8px;
  display: flex; align-items: center; gap: 6px;
}
.title-empty-hint svg { width: 13px; height: 13px; flex-shrink: 0 }

/* ── Title Badge (sidebar / hiscore / public profile) ──────────── */
.user-title-badge {
  display: inline-flex; align-items: center; gap: 4px;
  margin-top: 8px; padding: 3px 10px; border-radius: 99px;
  font-size: 10px; font-weight: 500; letter-spacing: 0.03em;
  color: var(--muted);
}
.user-title-badge svg { width: 10px; height: 10px; flex-shrink: 0; color: var(--amber); opacity: 0.7 }

/* ── Public Profile Preview Card ─────────────────────────────────── */
.pp-preview-card {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: var(--bg2);
  border: 1px solid var(--border2);
  margin-bottom: 20px;
}
.pp-preview-hero {
  position: relative;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px 20px;
}
.pp-preview-hero > *:not(.profile-banner) {
  position: relative;
  z-index: 1;
}
.pp-preview-name {
  margin-top: 8px;
  font-family: var(--ff-display);
  font-size: 17px;
  font-weight: 400;
  color: var(--cream);
}
.pp-preview-title {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
}
.pp-preview-title svg {
  width: 12px;
  height: 12px;
  color: var(--amber);
  opacity: 0.7;
}
.pp-preview-title:empty { display: none }
.pp-preview-meta-caption {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted2);
  margin-top: 8px;
}
.pp-preview-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--muted2);
}
.pp-preview-meta-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--muted2);
}
.pp-preview-label {
  position: absolute;
  top: 10px;
  left: 12px;
  z-index: 2;
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted2);
  background: rgba(0,0,0,0.4);
  padding: 3px 8px;
  border-radius: 6px;
  backdrop-filter: blur(4px);
}

/* ── Preview Card Avatar Upload ────────────────────────────────────── */
.pp-preview-avatar-wrap {
  position: relative;
  cursor: pointer;
  display: inline-block;
  border-radius: 50%;
}
.pp-preview-avatar-edit {
  position: absolute; inset: 0; border-radius: 50%;
  background: var(--black-60);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.2s;
  z-index: 10;
}
.pp-preview-avatar-wrap:hover .pp-preview-avatar-edit { opacity: 1 }
.pp-preview-avatar-edit svg { width: 24px; height: 24px; color: var(--cream) }

/* Unsaved indicator */
.pp-save-btn { margin-top: 4px }
.pp-save-btn:disabled { opacity: 0.4; cursor: not-allowed }

/* Section selector active state overrides */
.section-selector-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.section-selector-label .section-title { margin-bottom: 0 }
.section-selector-current {
  font-size: 12px;
  color: var(--cream);
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-selector-current .tier-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Selector tooltip (frame & banner grids) */
.sel-tooltip {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  color: var(--cream);
  border: 1px solid var(--border2);
  font-size: 11px;
  line-height: 1.3;
  padding: 5px 9px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}
.sel-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--border2);
}
.sel-tooltip-lock {
  width: 11px;
  height: 11px;
  flex-shrink: 0;
  stroke: var(--muted);
}
.frame-selector-item:hover .sel-tooltip,
.banner-selector-item:hover .sel-tooltip,
.scene-selector-item:hover .sel-tooltip {
  opacity: 1;
}

/* ── Scene Selector Grid ─────────────────────────────────────────── */

.scene-selector-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  padding: 12px 16px 16px;
}

.scene-selector-item {
  position: relative;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s, opacity 0.2s;
  background: var(--surface);
  overflow: hidden;
}

.scene-selector-preview {
  width: 100%;
  height: 64px;
  border-radius: 8px 8px 0 0;
  position: relative;
}

.scene-selector-item:hover:not(.locked) {
  border-color: var(--rose-30);
}

.scene-selector-item.equipped {
  border-color: var(--rose);
}

.scene-selector-item.locked {
  opacity: 0.35;
  cursor: default;
}

.scene-sel-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px;
}

.scene-sel-name {
  font-size: 11px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.scene-sel-tier {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ── Sticker Slots Editor ────────────────────────────────────────── */

.sticker-slots-editor {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 0;
}

.ss-slot-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: 10px;
  border: 1px solid var(--border);
}

.ss-slot-num {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  min-width: 18px;
  text-align: center;
}

.ss-slot-preview {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg2);
  display: flex;
  align-items: center;
  justify-content: center;
}

.ss-slot-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ss-slot-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}
.ss-slot-empty svg {
  width: 18px;
  height: 18px;
  stroke: var(--muted);
  opacity: 0.4;
}

.ss-slot-name {
  flex: 1;
  font-size: 13px;
  color: var(--cream);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ss-slot-name--empty {
  color: var(--muted);
  font-style: italic;
}

.ss-slot-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ss-slot-change,
.ss-slot-remove {
  font-family: inherit;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}
.ss-slot-change:hover {
  border-color: var(--rose-30);
  background: var(--rose-10);
}
.ss-slot-remove {
  color: var(--muted);
}
.ss-slot-remove:hover {
  border-color: #f87171;
  color: #f87171;
  background: rgba(248, 113, 113, 0.08);
}

/* ── Sticker Slot Picker Modal ───────────────────────────────────── */

.ss-picker-overlay {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}
.ss-picker-overlay.open { opacity: 1 }

.ss-picker-modal {
  background: var(--bg2);
  border-radius: 14px;
  border: 1px solid var(--border);
  width: 90%;
  max-width: 480px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ss-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.ss-picker-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--cream);
}

.ss-picker-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--muted);
  padding: 4px;
}
.ss-picker-close svg { width: 18px; height: 18px }
.ss-picker-close:hover { color: var(--text) }

.ss-picker-body {
  overflow-y: auto;
  padding: 12px 16px 16px;
}

.ss-picker-group {
  margin-bottom: 16px;
}
.ss-picker-group:last-child { margin-bottom: 0 }

.ss-picker-group-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.ss-picker-group-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
}

.ss-picker-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 4px;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s, background 0.15s;
}
.ss-picker-item:hover {
  border-color: var(--rose-30);
  background: var(--bg2);
}
.ss-picker-item--used {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}
.ss-picker-item img {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 6px;
}
.ss-picker-item-name {
  font-size: 10px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.ss-picker-placeholder {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  background: var(--bg2);
}

/* Profile saved modal — uses shared .modal-* from base.css */

/* ── Sticker Collection ────────────────────────────────────────────── */

.sticker-empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 12px; padding: 60px 20px; color: var(--muted);
}
.sticker-empty-state svg { opacity: 0.4 }
.sticker-empty-text { font-size: 14px }

.sticker-companion-select {
  max-width: 300px; margin-bottom: 4px;
}
.sticker-collection-tabs {
  display: flex; gap: 8px; overflow-x: auto; padding: 0 0 8px;
  scrollbar-width: none;
}
.sticker-collection-tabs::-webkit-scrollbar { display: none }

.sticker-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 14px; border-radius: 20px;
  background: var(--panel); border: 1px solid var(--border);
  color: var(--muted); font-size: 13px; cursor: pointer;
  white-space: nowrap; transition: all 0.15s;
  font-family: inherit;
}
.sticker-tab:hover { border-color: var(--rose-30); color: var(--text) }
.sticker-tab.active {
  background: var(--rose-10); border-color: var(--rose);
  color: var(--rose);
}
.sticker-tab-avatar {
  width: 22px; height: 22px; border-radius: 50%; object-fit: cover;
}
.sticker-tab-name { font-weight: 500 }
.sticker-tab-count { font-size: 11px; opacity: 0.7 }
.sticker-tab.unmatched { opacity: 0.65 }
.sticker-tab.unmatched .sticker-tab-avatar { filter: grayscale(0.5) }
.sticker-tab-unmatched {
  font-size: 10px; opacity: 0.6; font-style: italic;
}

.sticker-progress {
  height: 3px; background: var(--border); border-radius: 2px;
  margin: 4px 0 2px; overflow: hidden;
}
.sticker-progress-bar {
  height: 100%; background: var(--rose); border-radius: 2px;
  transition: width 0.3s;
}
.sticker-progress-label {
  font-size: 12px; color: var(--muted); margin-bottom: 16px;
}

.sticker-collection-grid {
  display: grid; grid-template-columns: repeat(5, 1fr);
  gap: 10px;
}

.sticker-collection-item {
  aspect-ratio: 1; border-radius: 12px;
  border: 1px solid var(--border); background: var(--panel);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; padding: 8px; transition: border-color 0.15s;
  overflow: hidden;
}
.sticker-collection-item:not(.locked):hover { border-color: var(--rose-30) }
.sticker-collection-item img {
  width: 100%; height: auto; max-height: 70%; object-fit: contain;
}
.sticker-collection-label {
  font-size: 10px; color: var(--muted); text-align: center;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  width: 100%;
}
.sticker-collection-item.locked {
  opacity: 0.35; border-style: dashed; cursor: default;
}
.sticker-collection-item.locked svg {
  width: 28px; height: 28px; stroke: var(--muted);
}

/* ── Profile Color Swatches ───────────────────────────────────────── */
.pp-color-swatches {
  display: flex; gap: 8px; flex-wrap: wrap; padding: 4px 0;
}
.pp-color-swatch {
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.2);
  transition: transform 0.15s ease, border-color 0.15s ease;
}
.pp-color-swatch:hover { transform: scale(1.15); }
.pp-color-swatch.pp-color-active {
  border-color: var(--cream);
  box-shadow: 0 0 0 1px rgba(240, 228, 232, 0.15);
}

/* ── Vibe Tags ────────────────────────────────────────────────────── */
.pp-vibe-category-label {
  font-size: 10px; font-weight: 600; letter-spacing: 1.4px;
  text-transform: uppercase; color: var(--muted); margin: 16px 0 8px;
}
.pp-vibe-category-label:first-of-type { margin-top: 4px; }
.pp-vibe-tag-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-vibe-tag {
  padding: 6px 14px; border-radius: 999px; font-size: 12px;
  font-weight: 500; cursor: pointer;
  border: 1px solid var(--cream-08); background: transparent;
  color: var(--dim); transition: all 0.15s ease;
  font-family: var(--ff-body);
}
.pp-vibe-tag:hover { border-color: var(--rose-30); color: var(--cream); }
.pp-vibe-tag.active {
  background: var(--accent-bg); border-color: var(--accent-border);
  color: var(--accent);
}

/* ── Hero Badges ──────────────────────────────────────────────────── */
.pp-hero-badge-grid { display: flex; flex-wrap: wrap; gap: 6px; }
.pp-hero-badge-btn {
  padding: 8px 16px; border-radius: 10px; font-size: 12px;
  font-weight: 500; cursor: pointer;
  border: 1px solid var(--cream-08); background: rgba(20, 14, 20, 0.5);
  color: var(--dim); transition: all 0.15s ease;
  font-family: var(--ff-display);
}
.pp-hero-badge-btn:hover { border-color: var(--gold-accent-border); color: var(--cream); }
.pp-hero-badge-btn.active {
  background: var(--gold-accent-bg); border-color: var(--gold-accent-border);
  color: var(--gold-accent);
}

/* Sidebar footer */
.sidebar-footer {
  padding: 8px 8px 0; flex-shrink: 0;
  border-top: 1px solid var(--border);
}
.sidebar-logout { color: var(--muted2) }
.sidebar-logout:hover { color: var(--red); background: rgba(239, 68, 68, 0.06) }

/* ══════════════════════════════════════════════════════════════════════
   My Creations Section
   ══════════════════════════════════════════════════════════════════════ */

/* Slot indicator bar */
.mc-slot-bar-section { padding: 14px 18px; }
.mc-slot-info { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.mc-slot-label { font-size: 13px; color: var(--dim); }
.mc-slot-full { font-size: 11px; color: var(--accent); font-weight: 600; }
.mc-slot-track { height: 6px; background: var(--bg2); border: 1px solid var(--border2); border-radius: 3px; overflow: hidden; }
.mc-slot-fill { height: 100%; background: var(--green-solid); border-radius: 3px; transition: width 0.3s; }
.mc-slot-fill.full { background: var(--accent); }

/* Sub-tabs */
.mc-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--border2); margin-bottom: 16px; }
.mc-tab {
  padding: 10px 20px; font-size: 13px; font-weight: 500; color: var(--muted);
  background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; transition: color 0.2s, border-color 0.2s;
}
.mc-tab:hover { color: var(--fg); }
.mc-tab.active { color: var(--fg); border-bottom-color: var(--accent); }

/* Card grid */
.mc-grid { display: flex; flex-direction: column; gap: 12px; }
.mc-empty { color: var(--muted); font-size: 13px; text-align: center; padding: 40px 0; }

/* Card */
.mc-card {
  position: relative; display: flex; gap: 14px; padding: 14px;
  background: var(--bg3); border: 1px solid var(--border2); border-radius: 12px;
  transition: border-color 0.2s;
}
.mc-card:hover { border-color: var(--border); }
.mc-card-img {
  width: 80px; height: 80px; border-radius: 8px; flex-shrink: 0;
  background: var(--bg2) center/cover no-repeat;
}
.mc-card-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.mc-card-name { font-size: 14px; font-weight: 600; color: var(--fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 70px; }
.mc-card-tagline { font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.mc-card-actions { display: flex; gap: 6px; margin-top: 8px; align-items: center; }

/* Badges — positioned top-right of card */
.mc-badge { position: absolute; top: 12px; right: 12px; font-size: 10px; font-weight: 600; padding: 2px 8px; border-radius: 10px; text-transform: uppercase; letter-spacing: 0.5px; }
.mc-badge-pub { color: var(--green-solid); background: var(--green-bg); }
.mc-badge-pending { color: var(--yellow); background: var(--yellow-bg); }
.mc-badge-priv { color: var(--muted); background: var(--cream-06); }

.mc-genre, .mc-tone { font-size: 11px; color: var(--dim); background: var(--cream-04); padding: 1px 6px; border-radius: 4px; }
.mc-plays { font-size: 11px; color: var(--muted2); }

/* Buttons */
.mc-btn {
  padding: 6px 14px; border-radius: 8px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border2); background: var(--bg2); color: var(--dim);
  cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mc-btn:hover:not(:disabled) { background: var(--bg); color: var(--fg); border-color: var(--border); }
.mc-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mc-btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.mc-btn-primary:hover:not(:disabled) { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.mc-btn-accent { background: transparent; color: var(--accent); border-color: var(--accent-border); }
.mc-btn-accent:hover:not(:disabled) { background: var(--accent-bg); }
.mc-btn-muted { color: var(--muted2); border-color: var(--border2); }
.mc-btn-danger {
  margin-left: auto; color: var(--muted); border-color: transparent; background: transparent;
  padding: 6px; border-radius: 6px; display: flex; align-items: center; justify-content: center;
}
.mc-btn-danger:hover:not(:disabled) { background: var(--red-bg); color: var(--red); }
.mc-btn-sm { padding: 4px 10px; font-size: 11px; }

/* Skeleton loading */
.mc-skeleton { pointer-events: none; }
.mc-skel-img { width: 80px; height: 80px; border-radius: 8px; background: var(--bg2); animation: mc-pulse 1.5s ease-in-out infinite; }
.mc-skel-body { flex: 1; display: flex; flex-direction: column; gap: 8px; padding: 8px 0; }
.mc-skel-line { height: 12px; border-radius: 4px; background: var(--bg2); animation: mc-pulse 1.5s ease-in-out infinite; }
.mc-skel-line.w60 { width: 60%; }
.mc-skel-line.w40 { width: 40%; }
@keyframes mc-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 0.7; } }
