/*
 * Profile experience styling
 * --------------------------
 * Keep the existing layout markup but restyle it to mirror the
 * glassy, premium aesthetic that powers the feed experience.
 */

/* ===== Theme surface tokens ===== */
body {
  --profile-accent: #6366f1;
  --profile-accent-soft: rgba(99, 102, 241, 0.12);
  --profile-highlight: #22d3ee;
  --profile-text: #0f172a;
  --profile-muted: #64748b;
  --profile-card-bg: rgba(255, 255, 255, 0.82);
  --profile-card-border: rgba(148, 163, 184, 0.28);
  --profile-card-shadow: 0 32px 70px -26px rgba(15, 23, 42, 0.45);
  --profile-surface: rgba(255, 255, 255, 0.62);
  --profile-panel-gradient: linear-gradient(165deg, rgba(99, 102, 241, 0.08), rgba(255, 255, 255, 0));
  --profile-radius-lg: 24px;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  margin: 0;
  color: var(--profile-text);
  background:
    radial-gradient(120% 120% at 0% 0%, rgba(99, 102, 241, 0.16), transparent 60%),
    radial-gradient(120% 120% at 100% 0%, rgba(14, 165, 233, 0.18), transparent 62%),
    linear-gradient(180deg, #f8fafc 0%, #eef2ff 48%, #e0f2fe 100%);
  background-attachment: fixed;
  position: relative;
  padding-bottom: 48px;
}

body::before,
body::after {
  content: "";
  position: fixed;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.55;
  pointer-events: none;
  z-index: -1;
  transition: opacity 0.3s ease;
}
  
body::before {
  top: -140px;
  left: -120px;
  background: rgba(99, 102, 241, 0.55);
}

body::after {
  bottom: -160px;
  right: -120px;
  background: rgba(14, 165, 233, 0.45);
}

body.dark {
  --profile-text: #e2e8f0;
  --profile-muted: #94a3b8;
  --profile-card-bg: rgba(2, 6, 23, 0.82);
  --profile-card-border: rgba(99, 102, 241, 0.35);
  --profile-card-shadow: 0 40px 95px -24px rgba(2, 6, 23, 0.85);
  --profile-surface: rgba(15, 23, 42, 0.72);
  --profile-panel-gradient: linear-gradient(165deg, rgba(99, 102, 241, 0.16), rgba(2, 6, 23, 0.7));
  background:
    radial-gradient(110% 110% at 0% 0%, rgba(99, 102, 241, 0.24), transparent 58%),
    radial-gradient(110% 110% at 100% 0%, rgba(6, 182, 212, 0.22), transparent 60%),
    linear-gradient(185deg, #020617 0%, #0f172a 52%, #111827 100%);
}

body.dark::before {
  background: rgba(79, 70, 229, 0.45);
  opacity: 0.42;
}

body.dark::after {
  background: rgba(6, 182, 212, 0.35);
  opacity: 0.38;
}

a {
  color: inherit;
}

  a:hover {
  color: var(--profile-accent);
}

  button {
  font-family: inherit;
}


/* ===== Profile header ===== */
.profile-header {
  width: 100%;
  margin: clamp(32px, 5vw, 56px) 0 0;
  padding: 0 clamp(24px, 4vw, 48px);
  box-sizing: border-box;
}

.profile-cover {
  position: relative;
  border-radius: var(--profile-radius-lg);
  overflow: hidden;
  height: clamp(220px, 32vw, 420px);
  background: #0f172a;
  box-shadow: var(--profile-card-shadow);
}

.profile-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(15, 23, 42, 0.15) 0%, rgba(15, 23, 42, 0.4) 100%);
  pointer-events: none;
}

.cover-actions {
  position: absolute;
  right: 18px;
  bottom: 18px;
  display: flex;
  gap: 10px;
  z-index: 5;
  pointer-events: auto;

}

.cover-actions button {
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.4);
  background: rgba(15, 23, 42, 0.45);
  color: #fff;
  font-weight: 500;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.cover-actions button:hover {
  transform: translateY(-1px);
  background: rgba(99, 102, 241, 0.55);
  border-color: rgba(255, 255, 255, 0.6);
}

.cover-actions .danger {
  background: rgba(239, 68, 68, 0.72);
  border-color: rgba(248, 113, 113, 0.72);
}

/* ===== Cover editor modal ===== */
#coverEditorModal .modal-content {
  width: min(820px, 100%);
  max-height: min(86vh, 780px);
}

#coverEditorModal .cover-editor__hint {
  margin: -6px 0 0;
  color: rgba(226, 232, 240, 0.78);
}

#coverEditorModal .cropper-wrap {
  width: 100%;
  aspect-ratio: 3 / 1;
  border-radius: 16px;
  overflow: hidden;
  background: #0b1020;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: inset 0 0 0 1px rgba(99, 102, 241, 0.12);
  position: relative;
}

#coverEditorModal .cropper-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

#coverEditorModal .cropper-container {
  width: 100% !important;
  height: 100% !important;
  touch-action: none;
}

#coverEditorModal .cover-editor__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

#coverEditorModal .cover-editor__file {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#coverEditorModal .cover-editor__pick {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.25);
  background: rgba(15, 23, 42, 0.35);
  color: #eaf0ff;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

#coverEditorModal .cover-editor__pick:hover,
#coverEditorModal .cover-editor__pick:focus-visible {
  transform: translateY(-1px);
  background: rgba(99, 102, 241, 0.22);
  border-color: rgba(99, 102, 241, 0.4);
}

#coverEditorModal .cover-editor__controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#coverEditorModal .cover-editor__fit {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.22);
}

#coverEditorModal .cover-editor__fit button {
  border-radius: 999px;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(226, 232, 240, 0.78);
  padding: 8px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

#coverEditorModal .cover-editor__fit button.is-active,
#coverEditorModal .cover-editor__fit button[aria-pressed="true"] {
  background: rgba(99, 102, 241, 0.28);
  color: rgba(226, 232, 240, 0.95);
}

#coverEditorModal .cover-editor__fit button:hover,
#coverEditorModal .cover-editor__fit button:focus-visible {
  transform: translateY(-1px);
}

#coverEditorModal .cover-editor__controls button {
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(15, 23, 42, 0.28);
  color: rgba(226, 232, 240, 0.92);
  padding: 8px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

#coverEditorModal .cover-editor__controls button:hover,
#coverEditorModal .cover-editor__controls button:focus-visible {
  transform: translateY(-1px);
  background: rgba(148, 163, 184, 0.14);
  border-color: rgba(148, 163, 184, 0.28);
}

#coverEditorModal .cover-editor__controls button.ghost {
  background: transparent;
}

#coverEditorModal .cover-editor__status {
  min-height: 1.2em;
}

#coverEditorModal .cropper-face,
#coverEditorModal .cropper-drag-box,
#coverEditorModal .cropper-view-box {
  cursor: grab;
}

#coverEditorModal .cropper-face:active,
#coverEditorModal .cropper-drag-box:active,
#coverEditorModal .cropper-view-box:active {
  cursor: grabbing;
}

.profile-identity {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: clamp(18px, 4vw, 36px);
  margin-top: clamp(-110px, -12vw, -140px);
  padding: 0 clamp(24px, 4vw, 48px);
  position: relative;
  z-index: 2;
}

.profile-action {
  --btn-radius: 999px;
  appearance: none;
  border: 1px solid transparent;
  border-radius: var(--btn-radius);
  padding: 10px 20px;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.1;
  cursor: pointer;
  transition:
    transform 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease,
    color 0.2s ease,
    border-color 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-action:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--profile-accent) 70%, #ffffff 30%);
  outline-offset: 2px;
}

.profile-action--primary {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 50%, #22d3ee 100%);
  color: #fff;
  border-color: rgba(99, 102, 241, 0.8);
  box-shadow: 0 16px 32px -18px rgba(79, 70, 229, 0.55);
}

.profile-action--primary:hover,
.profile-action--primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 22px 40px -16px rgba(79, 70, 229, 0.65);
}

.profile-action--secondary {
  background: color-mix(in srgb, var(--profile-card-bg) 85%, transparent);
  border-color: color-mix(in srgb, var(--profile-card-border) 65%, transparent);
  color: var(--profile-text);
}

.profile-action--secondary:hover,
.profile-action--secondary:focus-visible {
  background: color-mix(in srgb, var(--profile-accent-soft) 65%, transparent);
  border-color: color-mix(in srgb, var(--profile-accent) 35%, transparent);
  transform: translateY(-1px);
}

.profile-action--support {
  background: color-mix(in srgb, #0ea5e9 14%, transparent);
  border-color: color-mix(in srgb, #0ea5e9 35%, transparent);
  color: #0369a1;
}

.profile-action--support:hover,
.profile-action--support:focus-visible {
  background: color-mix(in srgb, #22d3ee 24%, transparent);
  border-color: color-mix(in srgb, #22d3ee 50%, transparent);
  transform: translateY(-1px);
}

.profile-action--danger {
  background: color-mix(in srgb, #ef4444 12%, transparent);
  border-color: color-mix(in srgb, #ef4444 45%, transparent);
  color: #b91c1c;
}

.profile-action--danger:hover,
.profile-action--danger:focus-visible {
  background: color-mix(in srgb, #ef4444 22%, transparent);
  transform: translateY(-1px);
}

.profile-action.follow-btn.following {
  background: color-mix(in srgb, var(--profile-card-bg) 75%, transparent);
  color: var(--profile-text);
  border-color: color-mix(in srgb, var(--profile-accent) 35%, transparent);
  box-shadow: none;
}

.profile-action.follow-btn.following:hover,
.profile-action.follow-btn.following:focus-visible {
  background: color-mix(in srgb, var(--profile-accent-soft) 55%, transparent);
}

.profile-avatar-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

.profile-avatar-frame {
  position: relative;
  width: clamp(150px, 20vw, 220px);
  aspect-ratio: 1;
  border-radius: 50%;
  padding: 6px;
  background: linear-gradient(140deg, rgba(45, 212, 191, 0.92), rgba(99, 102, 241, 0.92));
  box-shadow: 0 40px 80px -45px rgba(15, 23, 42, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.profile-avatar-frame--has-story {
  background: linear-gradient(135deg, #f472b6, #6366f1, #22d3ee);
  box-shadow: 0 36px 86px -46px rgba(99, 102, 241, 0.6);
}

.profile-avatar-frame--has-story[data-story-state="seen"] {
  background: linear-gradient(135deg, rgba(148, 163, 184, 0.55), rgba(59, 130, 246, 0.55));
}

.profile-avatar-frame--has-story[data-story-state="live"] {
  background: linear-gradient(135deg, #fb7185, #ef4444, #f97316);
  box-shadow: 0 42px 96px -48px rgba(239, 68, 68, 0.58);
}

.profile-avatar-frame--has-story::after {
  content: '';
  position: absolute;
  inset: 10px;
  border-radius: 50%;
  border: 3px solid color-mix(in srgb, var(--profile-card-bg, #0f172a) 70%, transparent);
  pointer-events: none;
}

.profile-avatar-card .nav-avatar {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 5px solid color-mix(in srgb, var(--profile-card-bg) 92%, #ffffff 8%);
  box-shadow: 0 22px 60px -32px rgba(15, 23, 42, 0.65);
  object-fit: cover;
  object-position: center;
}

.profile-avatar--has-story {
  border-color: color-mix(in srgb, rgba(148, 163, 184, 0.35) 40%, transparent);
  box-shadow: 0 24px 62px -30px rgba(99, 102, 241, 0.55);
}

.profile-identity__meta {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: clamp(18px, 3vw, 26px) clamp(20px, 3.5vw, 34px);
  border-radius: var(--profile-radius-lg);
  background: none;
  border: none;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  flex: 1 1 260px;
  min-width: 0;
}

.profile-identity__top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: clamp(12px, 2vw, 18px);
}

.profile-identity__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: clamp(10px, 2vw, 16px);
  margin-left: auto;
}

.profile-identity__title {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1 1 auto;
}

.profile-identity__meta .profile-name {
  margin: 0;
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
}

.profile-handle {
  margin: 0;
  color: var(--profile-muted);
  font-weight: 600;
  letter-spacing: 0.02em;
}

/* ===== Page layout ===== */
.profile-page {
  width: 100%;
  margin: clamp(24px, 4vw, 44px) 0 0;
  padding: 0 clamp(24px, 4vw, 48px);
  box-sizing: border-box;
  display: grid;
  grid-template-columns: minmax(240px, 280px) minmax(0, 1fr) minmax(240px, 280px);
  gap: clamp(18px, 3vw, 32px);
  align-items: flex-start;
}

.profile-sidebar,
.profile-main,
.profile-rightbar {
  background: var(--profile-panel-gradient) var(--profile-card-bg);
  color: var(--profile-text);
  border: 1px solid var(--profile-card-border);
  border-radius: var(--profile-radius-lg);
  box-shadow: var(--profile-card-shadow);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
}

.profile-sidebar,
.profile-rightbar {
  position: sticky;
  top: 140px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: clamp(18px, 2vw, 24px);
}

.profile-sidebar {
  align-items: stretch;
  text-align: left;
  gap: clamp(16px, 2.5vw, 28px);
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.profile-main {
  padding: clamp(22px, 3vw, 30px);
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 3vw, 28px);
}

.profile-name {
  font-size: clamp(1.6rem, 2vw, 2rem);
  font-weight: 700;
  margin: 0;
}

.profile-bio,
#profileBio,
#bioText,
#profileWebsite {
  color: var(--profile-muted);
  font-size: 0.95rem;
}

.linklike {
  background: none;
  border: 0;
  color: var(--profile-accent);
  font-weight: 600;
  cursor: pointer;
}

.profile-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.sidebar-card {
  background: color-mix(in srgb, var(--profile-card-bg) 94%, transparent);
  border: 1px solid var(--profile-card-border);
  border-radius: var(--profile-radius-lg);
  box-shadow: var(--profile-card-shadow);
  padding: clamp(18px, 2vw, 24px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sidebar-title {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--profile-muted);
  font-weight: 700;
}

.profile-bio {
  margin: 0;
  color: var(--profile-text);
  line-height: 1.6;
}

#bioEditor {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: var(--profile-radius-md);
  background: color-mix(in srgb, var(--profile-card-bg) 88%, transparent);
  border: 1px dashed var(--profile-card-border);
}

#bioEditor .row {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.profile-website {
  margin: 0;
}

.profile-website a {
  color: var(--profile-accent);
  font-weight: 600;
  text-decoration: none;
  display: inline-block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.profile-website a:hover,
.profile-website a:focus {
  text-decoration: underline;
}

.sidebar-stats .stats-grid {
  padding: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.sidebar-stats .stat-item {
  align-items: flex-start;
  text-align: left;
}

.sidebar-stats .stat-number {
  font-size: 1.6rem;
}

.follow-btn,
.block-btn,
.message-btn,
.donate-btn,
.share-btn {
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.18), rgba(34, 211, 238, 0.18));
  color: var(--profile-text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.follow-btn:hover,
.block-btn:hover,
.message-btn:hover,
.donate-btn:hover,
.share-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 32px -18px rgba(99, 102, 241, 0.65);
}

.block-btn {
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}

.block-btn.is-blocking {
  background: linear-gradient(120deg, rgba(248, 113, 113, 0.75), rgba(239, 68, 68, 0.75));
  color: #fff;
}

/* ===== Stats ===== */
.stats-grid {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 16px;
  border-radius: var(--profile-radius-lg);
  background: color-mix(in srgb, var(--profile-card-bg) 86%, transparent);
  border: 1px solid var(--profile-card-border);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.stat-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  align-items: center;
  text-align: center;
}

.stat-number {
  font-size: 1.45rem;
  font-weight: 700;
}

.stat-label {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--profile-muted);
}

/* ===== Tabs & view toggles ===== */
.profile-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--profile-card-bg) 80%, transparent);
  border: 1px solid var(--profile-card-border);
}

.profile-nav .tab,
.profile-nav .view-btn {
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid transparent;
  background: rgba(148, 163, 184, 0.12);
  color: var(--profile-muted);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.profile-nav .tab:hover,
.profile-nav .view-btn:hover {
  transform: translateY(-1px);
  color: var(--profile-text);
  background: rgba(99, 102, 241, 0.16);
}

.profile-nav .tab.active,
.profile-nav .view-btn.active {
  color: #fff;
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.9), rgba(34, 211, 238, 0.7));
  box-shadow: 0 12px 26px -20px rgba(99, 102, 241, 0.85);
}

.view-toggle {
  margin-left: auto;
  display: inline-flex;
  gap: 8px;
  padding: 4px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.05);
}

.add-post-btn {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  border: 1px solid var(--profile-card-border);
  background: rgba(99, 102, 241, 0.12);
  color: var(--profile-text);
  font-size: 1.25rem;
  cursor: pointer;
}

/* ===== Profile content ===== */
.profile-content {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(16px, 3vw, 24px);
}

.profile-content[data-type="song"] {
  grid-template-columns: minmax(0, 1fr);
}

.profile-content[data-type="song"] .post-card,
.profile-content[data-type="song"] .song-card {
  width: 100%;
}

.profile-books-panel {
  background: color-mix(in srgb, var(--profile-card-bg) 92%, transparent);
  border-radius: 18px;
  padding: clamp(20px, 3vw, 32px);
  margin-top: clamp(20px, 3vw, 32px);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.2);
}

.profile-books-panel.hidden {
  display: none;
}

.profile-books-panel .my-books-header {
  margin-bottom: 1.5rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(16px, 3vw, 28px);
  padding: clamp(18px, 3vw, 28px);
  border-radius: clamp(16px, 3vw, 24px);
  background:
    linear-gradient(
      135deg,
      color-mix(in srgb, var(--profile-accent) 18%, transparent),
      color-mix(in srgb, var(--profile-card-bg) 92%, transparent)
    );
  border: 1px solid color-mix(in srgb, var(--profile-card-border) 75%, transparent);
  box-shadow: var(--profile-card-shadow);
}

.profile-books-panel .my-books-header__user {
  min-width: 0;
}

.profile-books-panel .my-books-header__eyebrow {
  margin: 0 0 6px;
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--profile-muted);
}

.profile-books-panel .my-books-header__title {
  margin: 0;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  line-height: 1.2;
  color: var(--profile-text);
}

.profile-books-panel .my-books-header__subtitle {
  margin: 6px 0 0;
  color: color-mix(in srgb, var(--profile-muted) 85%, var(--profile-text));
  max-width: 52ch;
}

.profile-books-panel .my-books-controls {
  margin-top: 1.75rem;
}

.profile-books-panel .my-books-grid {
  margin-top: 1.5rem;
}

.profile-books-panel .my-books-stats {
  margin: 0;
}

.profile-books-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
}

.profile-books-panel .profile-books-actions {
  justify-self: end;
}

.profile-books-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  border: 1px solid color-mix(in srgb, var(--profile-card-bg) 60%, rgba(148, 163, 184, 0.4));
  border-radius: 999px;
  padding: 8px 18px;
  background: var(--profile-card-bg);
  color: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

body.dark .profile-books-action {
  background: color-mix(in srgb, var(--profile-card-bg) 40%, rgba(15, 23, 42, 0.92));
  border-color: color-mix(in srgb, var(--profile-card-bg) 20%, rgba(99, 102, 241, 0.55));
  color: #e2e8f0;
  box-shadow: inset 0 1px 0 rgba(99, 102, 241, 0.16);
}

.profile-books-action:hover,
.profile-books-action:focus-visible {
  border-color: color-mix(in srgb, var(--profile-card-bg) 45%, rgba(79, 70, 229, 0.65));
}

.profile-books-action--link {
  background: transparent;
  border: 1px solid color-mix(in srgb, var(--profile-card-bg) 60%, rgba(148, 163, 184, 0.4));
  color: var(--accent-color, #8b5cf6);
  padding: 8px 16px;
  text-decoration: none;
}

.profile-books-action--link:hover,
.profile-books-action--link:focus-visible {
  text-decoration: none;
}

@media (max-width: 720px) {
  .profile-books-panel .my-books-header {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }

  .profile-books-panel .profile-books-actions {
    justify-self: start;
  }
}

.profile-content.book-shelf-view {
  display: flex;
  flex-direction: column;
  gap: clamp(20px, 4vw, 32px);
}

.profile-content.book-shelf-view .book-shelf-section {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 2vw, 18px);
}

.profile-content.book-shelf-view .book-shelf-title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--profile-text);
}

.profile-content.book-shelf-view[data-view='cards'] .book-shelf-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: clamp(16px, 3vw, 24px);
}

.profile-content.book-shelf-view[data-view='feed'] .book-shelf-items {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profile-content.book-shelf-view .book-shelf-section.shelf-other .book-shelf-title {
  color: color-mix(in srgb, var(--profile-muted) 65%, var(--profile-text));
}

.profile-content.hidden {
  display: none !important;
}

body.pictures-tab-active #profileContent,
body.pictures-tab-active #coursesPanel,
body.pictures-tab-active #videosChannel,
body.pictures-tab-active #profileBooksPanel,
body.pictures-tab-active #profileIntelligencePanel,
body.pictures-tab-active #carouselPanel {
  display: none !important;
}

.profile-content .post-card,
.cards-grid .card,
#myCourses .card {
  background: var(--profile-card-bg);
  border: 1px solid var(--profile-card-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--profile-card-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.profile-content .post-card:hover,
.cards-grid .card:hover,
#myCourses .card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px -30px rgba(15, 23, 42, 0.65);
}

.post-media {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

.no-media-placeholder {
  width: 100%;
  height: 200px;
  display: grid;
  place-items: center;
  font-weight: 600;
  letter-spacing: 0.08em;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.65), rgba(34, 211, 238, 0.65));
  color: #fff;
}

.post-info {
  padding: 18px;
  color: var(--profile-text);
}

.post-info h4 {
  margin: 0 0 6px;
  font-size: 1.05rem;
}

.post-author,
.post-date {
  margin: 0;
  font-size: 0.85rem;
  color: var(--profile-muted);
}

.post-privacy-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.post-privacy-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  padding: 2px;
  border-radius: 999px;
  cursor: pointer;
  color: inherit;
}

.post-privacy-toggle:focus-visible {
  outline: 2px solid var(--profile-accent, #6366f1);
  outline-offset: 2px;
}

.post-privacy-icon {
  font-size: 0.9rem;
  opacity: 0.75;
}

.post-privacy-select {
  display: none;
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--profile-border, #e2e8f0) 70%, transparent);
  background: color-mix(in srgb, var(--profile-card-bg) 80%, transparent);
  color: var(--profile-text);
}

.post-privacy-control:hover .post-privacy-select,
.post-privacy-control:focus-within .post-privacy-select {
  display: inline-flex;
}

.post-privacy-select:focus-visible {
  outline: 2px solid var(--profile-accent, #6366f1);
  outline-offset: 2px;
}

.post-privacy-select:disabled {
  opacity: 0.6;
}

.post-content {
  margin-top: 10px;
  max-width: 70ch;
  width: 100%;
  font-size: 1.05rem;
  line-height: 1.65;
  letter-spacing: 0.004em;
  color: var(--profile-text);
}

.post-title__link {
  color: inherit;
  text-decoration: none;
}

.post-title__link:hover,
.post-title__link:focus-visible {
  color: var(--profile-accent, #6366f1);
  text-decoration: underline;
  outline: none;
}

.profile-main .feed-item .post-content {
  position: relative;
  margin-bottom: 12px;
}

.profile-main .feed-item .post-content[data-readmore-collapsed="true"] {
  max-height: var(--feed-readmore-max-height, 320px);
  overflow: hidden;
}

.profile-main .feed-item .post-content[data-readmore-collapsed="false"] {
  max-height: none;
  overflow: visible;
}

.profile-main .feed-item .post-content::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  pointer-events: none;
  background: linear-gradient(
    180deg,
    rgba(15, 23, 42, 0),
    var(--feed-readmore-fade, rgba(248, 250, 252, 0.96))
  );
  opacity: 0;
  transition: opacity 0.2s ease;
}

.profile-main .feed-item .post-content.is-clamped::after {
  opacity: 1;
}

.profile-main .feed-item .post-read-more-container {
  margin-top: 4px;
}

.profile-main .feed-item .post-read-more {
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--profile-accent) 35%, transparent);
  background: color-mix(in srgb, var(--profile-accent-soft, #6366f1) 18%, transparent);
  color: var(--profile-accent, #6366f1);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.profile-main .feed-item .post-read-more:hover,
.profile-main .feed-item .post-read-more:focus-visible {
  background: color-mix(in srgb, var(--profile-accent) 22%, transparent);
  border-color: color-mix(in srgb, var(--profile-accent) 55%, transparent);
  outline: none;
  transform: translateY(-1px);
}

.post-content.rich-text-card {
  position: relative;
  display: block;
}

.post-content.rich-text-card p {
  margin: 0 0 0.65rem;
  line-height: 1.7;
  color: inherit;
}

.post-content.rich-text-card ul,
.post-content.rich-text-card ol {
  margin: 0.4rem 0 0.4rem 1.2rem;
  padding-left: 0.75rem;
  display: grid;
  gap: 0.35rem;
}

.post-content.rich-text-card li::marker {
  color: var(--profile-accent, #6366f1);
}

.post-content.rich-text-card blockquote {
  margin: 0.75rem 0;
  padding: 0.7rem 1rem;
  border-left: 4px solid color-mix(in srgb, var(--profile-accent) 45%, transparent);
  background: color-mix(in srgb, var(--profile-card-bg) 88%, transparent);
  border-radius: 14px;
  color: var(--profile-muted);
}

.post-content.rich-text-card code {
  font-family: "JetBrains Mono", "Fira Code", "Menlo", monospace;
  font-size: 0.95em;
  background: color-mix(in srgb, var(--profile-accent-soft) 55%, transparent);
  padding: 0.15rem 0.4rem;
  border-radius: 6px;
}

.post-content.rich-text-card pre {
  margin: 0.8rem 0;
  padding: 0.85rem 1.1rem;
  border-radius: 16px;
  background: color-mix(in srgb, var(--profile-card-bg) 82%, transparent);
  color: var(--profile-text);
  overflow-x: auto;
  font-family: "JetBrains Mono", "Fira Code", "Menlo", monospace;
  font-size: 0.95em;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--profile-card-border) 65%, transparent);
}

.post-content.rich-text-card hr {
  margin: 1rem 0;
  border: none;
  border-top: 1px solid color-mix(in srgb, var(--profile-card-border) 72%, transparent);
}

.post-content.rich-text-card::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 42px;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--profile-card-bg));
  opacity: 0;
  transition: opacity 0.2s ease;
}

/* --- Carousel tab cards (profile.html) --- */
.carousel-panel__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.carousel-panel__header h2 {
  margin: 0;
  font-size: 1.25rem;
}

.carousel-panel__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

#carouselPanelStatus {
  flex-basis: 100%;
  margin: 0;
}

.carousel-feed.cards-grid {
  margin-top: 0;
}

.profile-carousel-card {
  background: var(--profile-card-bg);
  border: 1px solid var(--profile-card-border);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: var(--profile-card-shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.profile-carousel-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 28px 60px -30px rgba(15, 23, 42, 0.65);
}

.profile-carousel-card__header {
  padding: 16px 16px 12px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.profile-carousel-card__header h3 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 650;
  color: var(--profile-text);
  flex: 1 1 auto;
  min-width: 0;
}

.profile-carousel-card__header .count-badge {
  flex: 0 0 auto;
}

.profile-carousel-card__meta {
  flex-basis: 100%;
  margin: 0;
  font-size: 0.85rem;
  color: var(--profile-muted);
}

.profile-carousel-card__media {
  padding: 0 16px 16px;
}

.profile-carousel-card__media img.post-media,
.profile-carousel-card__media video.post-media {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.45);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14);
}

.profile-carousel-card__media .rito-gallery.post-media {
  width: 100%;
  height: 240px;
  border-radius: 18px;
  overflow: hidden;
  display: grid;
  grid-auto-flow: dense;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  background: linear-gradient(135deg, rgba(59, 130, 246, 0.18), rgba(15, 23, 42, 0.72));
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.14);
}

.profile-carousel-card__media .rito-gallery.post-media[data-count="1"] {
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.profile-carousel-card__media .rito-gallery.post-media[data-count="2"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: 1fr;
}

.profile-carousel-card__media .rito-gallery.post-media[data-count="3"] {
  grid-template-columns: 2fr 1fr;
  grid-template-rows: repeat(2, minmax(0, 1fr));
}

.profile-carousel-card__media .rito-gallery.post-media[data-count="3"] .rito-gallery__cell:nth-child(1) {
  grid-row: span 2;
}

.profile-carousel-card__media .rito-gallery__cell {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 14px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.55);
  padding: 0;
  margin: 0;
  cursor: pointer;
  position: relative;
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.profile-carousel-card__media .rito-gallery__cell:focus-visible,
.profile-carousel-card__media .rito-gallery__cell:hover {
  outline: none;
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.45);
  border-color: rgba(148, 163, 184, 0.35);
}

.profile-carousel-card__media .rito-gallery__cell > img,
.profile-carousel-card__media .rito-gallery__cell > video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-carousel-card__media .rito-gallery__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  font-weight: 750;
  letter-spacing: 0.08em;
}

.profile-carousel-card__media .rito-gallery__chip {
  position: absolute;
  top: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.75);
  color: #e2e8f0;
  font-size: 0.75rem;
  font-weight: 650;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.45);
}

@media (min-width: 900px) {
  .profile-carousel-card__media img.post-media,
  .profile-carousel-card__media video.post-media,
  .profile-carousel-card__media .rito-gallery.post-media {
    height: 280px;
  }
}

/* --- Profile Vitos tab composer (page.html parity) --- */
#profileContent #vito-composer {
  margin-bottom: 18px;
}

#profileContent #vito-composer .composer-box {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

#profileContent #vito-composer .field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

#profileContent #vito-composer .field.grow {
  flex: 1 1 auto;
  min-width: 0;
}

#profileContent #vito-composer .label {
  font-size: 0.9rem;
  font-weight: 650;
  color: color-mix(in srgb, var(--profile-muted) 70%, var(--profile-text));
}

#profileContent #vito-composer .row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-start;
}

#profileContent #vito-composer input[type="file"],
#profileContent #vito-composer select,
#profileContent #vito-composer textarea {
  width: 100%;
  box-sizing: border-box;
}

#profileContent #vito-composer select {
  min-width: 220px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid color-mix(in srgb, var(--profile-card-border) 70%, transparent);
  background: color-mix(in srgb, var(--profile-card-bg) 92%, rgba(255, 255, 255, 0.35));
  color: inherit;
}

body.dark #profileContent #vito-composer select {
  background: color-mix(in srgb, var(--profile-card-bg) 60%, rgba(2, 6, 23, 0.65));
}

#profileContent #vitoMediaPreview.media-preview {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--profile-card-border) 65%, transparent);
  background: rgba(15, 23, 42, 0.5);
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.12);
}

#profileContent #vitoMediaPreview.media-preview video {
  width: 100%;
  height: 320px;
  display: block;
  object-fit: cover;
}

@media (max-width: 720px) {
  #profileContent #vitoMediaPreview.media-preview video {
    height: 260px;
  }
  #profileContent #vito-composer select {
    min-width: 100%;
  }
}

.post-content.rich-text-card[data-readmore-collapsed="true"] {
  max-height: 12.5rem;
  overflow: hidden;
}

.post-content.rich-text-card[data-readmore-collapsed="false"] {
  max-height: none;
  overflow: visible;
}

.post-content.rich-text-card.is-clamped::after {
  opacity: 1;
}

.post-content.rich-text-card > :first-child {
  margin-top: 0;
}

.post-content.rich-text-card > :last-child {
  margin-bottom: 0;
}

.post-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-top: 1px solid color-mix(in srgb, var(--profile-card-border) 65%, transparent);
  background: color-mix(in srgb, var(--profile-card-bg) 90%, transparent);
}

.post-card-secondary-actions {
  margin-left: auto;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.post-card-actions .vote-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--profile-accent-soft) 65%, transparent);
  border: 1px solid color-mix(in srgb, var(--profile-accent) 32%, transparent);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

.post-card-actions .vote-btn {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  border: none;
  background: transparent;
  color: var(--profile-muted);
  font-size: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.post-card-actions .vote-btn:hover,
.post-card-actions .vote-btn:focus-visible {
  background: color-mix(in srgb, var(--profile-accent) 16%, transparent);
  color: var(--profile-accent);
  outline: none;
  transform: translateY(-1px);
}

.post-card-actions .vote-btn.voted {
  background: linear-gradient(135deg, var(--profile-accent), var(--profile-highlight));
  color: #fff;
  box-shadow: 0 12px 28px rgba(99, 102, 241, 0.35);
}

.post-card-actions .vote-count {
  min-width: 32px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--profile-text);
}

.post-card-action-btn {
  appearance: none;
  border: 1px solid color-mix(in srgb, var(--profile-card-border) 70%, transparent);
  border-radius: 999px;
  padding: 7px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--profile-card-bg) 84%, transparent);
  color: var(--profile-muted);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.post-card-action-btn:hover,
.post-card-action-btn:focus-visible {
  background: color-mix(in srgb, var(--profile-accent) 20%, transparent);
  color: var(--profile-text);
  border-color: color-mix(in srgb, var(--profile-accent) 40%, transparent);
  transform: translateY(-1px);
  outline: none;
}

.post-card-action-btn.save-post.saved {
  background: linear-gradient(135deg, rgba(250, 204, 21, 0.18), rgba(251, 191, 36, 0.28));
  color: #d97706;
  border-color: rgba(251, 191, 36, 0.42);
}

body.dark .post-card-actions {
  background: color-mix(in srgb, var(--profile-surface) 82%, transparent);
  border-top-color: color-mix(in srgb, var(--profile-card-border) 75%, transparent);
}

body.dark .post-card-actions .vote-actions {
  background: color-mix(in srgb, var(--profile-accent-soft) 80%, transparent);
  border-color: color-mix(in srgb, var(--profile-accent) 48%, transparent);
  box-shadow: inset 0 1px 0 rgba(15, 23, 42, 0.6);
}

body.dark .post-card-actions .vote-btn {
  color: var(--profile-muted);
}

body.dark .post-card-actions .vote-btn:hover,
body.dark .post-card-actions .vote-btn:focus-visible {
  color: var(--profile-highlight);
}

body.dark .post-card-action-btn {
  background: color-mix(in srgb, var(--profile-surface) 78%, transparent);
  border-color: color-mix(in srgb, var(--profile-card-border) 85%, transparent);
  color: var(--profile-muted);
}

body.dark .post-card-action-btn:hover,
body.dark .post-card-action-btn:focus-visible {
  color: var(--profile-highlight);
  border-color: color-mix(in srgb, var(--profile-accent) 55%, transparent);
}

.post-content.rich-text-card iframe,
.post-content.rich-text-card video,
.post-content.rich-text-card img {
  max-width: 100%;
  border-radius: 12px;
}

.no-posts {
  grid-column: 1 / -1;
  text-align: center;
  padding: 48px;
  color: var(--profile-muted);
  font-style: italic;
  border-radius: 20px;
  background: rgba(148, 163, 184, 0.12);
}

.profile-content[data-view="feed"] {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.profile-content[data-view="feed"] .feed-item {
  display: flex;
  gap: 16px;
  padding: 18px;
  border-radius: 20px;
  background: var(--profile-card-bg);
  border: 1px solid var(--profile-card-border);
  box-shadow: var(--profile-card-shadow);
}

.profile-content[data-view="feed"] .feed-item .body {
  min-width: 0;
}

.feed-item .avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid color-mix(in srgb, var(--profile-accent) 40%, transparent);
}

.feed-item .meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 0.85rem;
  color: var(--profile-muted);
}

.feed-item .media {
  width: 100%;
  border-radius: 14px;
  margin-top: 12px;
  overflow: hidden;
}

.profile-content[data-view="feed"] .feed-item audio,
.profile-content[data-view="feed"] .feed-item .post-audio,
.profile-content[data-view="feed"] .feed-item .song-player {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.profile-content[data-view="feed"] .feed-item img.media,
.profile-content[data-view="feed"] .feed-item video.media {
  height: 220px;
  object-fit: contain;
  display: block;
  background: rgba(15, 23, 42, 0.12);
}

.profile-content[data-view="feed"] .feed-item .rito-gallery.media {
  height: 220px;
}

/* ===== Right rail ===== */
.profile-rightbar h3 {
  margin: 0;
  font-size: 1rem;
}

.profile-rightbar > div {
  padding: 16px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--profile-card-bg) 82%, transparent);
  border: 1px solid var(--profile-card-border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.profile-rightbar > div + div {
  margin-top: 12px;
}

/* ===== Modals & utilities ===== */
.modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.55);
  padding: 24px;
  z-index: 1000;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: var(--profile-card-bg);
  color: var(--profile-text);
  border-radius: 22px;
  padding: clamp(22px, 3vw, 32px);
  border: 1px solid var(--profile-card-border);
  box-shadow: var(--profile-card-shadow);
  max-width: min(560px, 92vw);
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

#profileBooksRemoveModal .modal-content {
  max-width: 420px;
  padding: 20px 22px;
  gap: 12px;
}

#profileBooksRemoveModal h3 {
  margin: 0;
  font-size: 1.15rem;
}

#profileBooksRemoveModal p {
  margin: 0;
  color: var(--profile-muted);
  line-height: 1.45;
}

.row {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.modal-content .actions,
.modal-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.primary,
.type-opt,
.filter-btn,
.modal-buttons button:first-child {
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(120deg, rgba(99, 102, 241, 0.9), rgba(34, 211, 238, 0.8));
  color: #fff;
  box-shadow: 0 18px 42px -24px rgba(99, 102, 241, 0.95);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.primary:hover,
.type-opt:hover,
.filter-btn:hover,
.modal-buttons button:first-child:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -20px rgba(99, 102, 241, 0.85);
}

.actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

.filter-btn.is-active,
.filter-btn[aria-pressed="true"] {
  background: linear-gradient(120deg, rgba(99, 102, 241, 1), rgba(34, 211, 238, 0.9));
}

.type-opt {
  text-align: center;
}

.type-opt.active,
.type-opt[aria-pressed="true"] {
  transform: translateY(-1px);
  box-shadow: 0 18px 36px -18px rgba(99, 102, 241, 0.95);
  outline: 2px solid rgba(99, 102, 241, 0.45);
}

.ghost,
.modal-buttons button:last-child,
.cover-actions .ghost,
.view-toggle .view-btn {
  border: 1px solid var(--profile-card-border);
  background: rgba(148, 163, 184, 0.12);
  color: var(--profile-text);
}

.ghost:hover,
.modal-buttons button:last-child:hover {
  background: rgba(99, 102, 241, 0.16);
}

textarea,
input[type="text"],
input[type="search"],
input[type="datetime-local"],
input[type="file"],
input[type="url"],
input[type="email"],
select {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid var(--profile-card-border);
  background: color-mix(in srgb, var(--profile-card-bg) 82%, transparent);
  color: var(--profile-text);
  font-family: inherit;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus,
input:focus,
select:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--profile-accent) 72%, var(--profile-card-border));
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.16);
}

.muted {
  color: var(--profile-muted);
  font-size: 0.85rem;
}

.user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 60vh;
  overflow: auto;
}

.user-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--profile-card-bg) 78%, transparent);
  border: 1px solid var(--profile-card-border);
}

.user-row .avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  }

.user-row .username {
  font-weight: 600;
  color: var(--profile-text);
}

.user-row .visit {
  margin-left: auto;
}

/* ===== Avatar & cover utilities ===== */
.nav-avatar {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 20px 50px -28px rgba(15, 23, 42, 0.65);
  transition: transform 0.3s ease;
}

.nav-avatar:hover {
  transform: scale(1.03);
}

/* ===== Responsive adjustments ===== */
@media (max-width: 1080px) {
  .profile-page {
    grid-template-columns: minmax(220px, 260px) minmax(0, 1fr);
    grid-template-areas:
      "sidebar main"
      "right right";
  }

  .profile-sidebar {
    grid-area: sidebar;
  }

  .profile-main {
    grid-area: main;
  }

  .profile-rightbar {
    grid-area: right;
    position: relative;
    top: 0;
  }
}

@media (max-width: 860px) {
  .profile-identity {
    flex-direction: column;
    align-items: flex-start;
    gap: 18px;
    margin-top: clamp(-90px, -11vw, -70px);
  }

  .profile-identity__meta {
    width: 100%;
  }

  .profile-identity__top {
    align-items: flex-start;
  }

  .profile-identity__actions {
    width: 100%;
    justify-content: flex-start;
    margin-left: 0;
  }

  .navbar-container {
    flex-wrap: wrap;
    justify-content: center;
  }

  .search-bar {
    order: 3;
    width: 100%;
    margin-left: 0;
  }

  .search {
    width: 100%;
  }

  .profile-page {
    grid-template-columns: 1fr;
  }

  .profile-sidebar,
  .profile-rightbar {
    position: relative;
    top: 0;
  }

  .profile-sidebar,
  .profile-main,
  .profile-rightbar {
    padding: clamp(18px, 5vw, 26px);
  }

  .profile-identity {
    margin-top: -60px;
    padding: 0 clamp(18px, 5vw, 32px);
  }

  .profile-content {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  }

}

@media (max-width: 540px) {
  .profile-content {
    grid-template-columns: 1fr;
  }

  .profile-nav {
    flex-direction: column;
    align-items: stretch;
  }

  .view-toggle {
    width: 100%;
    justify-content: center;
  }

  .profile-action-row {
    flex-direction: column;
    align-items: stretch;
  }

  .follow-btn,
  .block-btn,
  .message-btn,
  .donate-btn,
  .share-btn {
    width: 100%;
  }
}



/* ===== Song cards & player ===== */
.song-card {
  display: grid;
  grid-template-columns: minmax(84px, 120px) 1fr;
  gap: 18px;
  align-items: center;
  padding: 18px;
  border-radius: 20px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92), rgba(255, 255, 255, 0.78));
  border: 1px solid rgba(148, 163, 184, 0.25);
  box-shadow: 0 24px 50px -30px rgba(15, 23, 42, 0.55);
  margin: 18px 0;
  color: var(--profile-text);
}

.song-card--feed {
  grid-template-columns: minmax(72px, 100px) 1fr;
  padding: 16px;
  margin: 14px 0;
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.92), rgba(224, 231, 255, 0.58));
  box-shadow: 0 18px 42px -26px rgba(15, 23, 42, 0.42);
}

body.dark .song-card {
  background: linear-gradient(140deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.78));
  border-color: rgba(99, 102, 241, 0.32);
  box-shadow: 0 32px 70px -28px rgba(2, 6, 23, 0.85);
}

body.dark .song-card--feed {
  background: linear-gradient(140deg, rgba(15, 23, 42, 0.88), rgba(30, 41, 59, 0.72));
  box-shadow: 0 28px 60px -28px rgba(2, 6, 23, 0.88);
}

.song-card__artwork {
  width: clamp(80px, 14vw, 132px);
  aspect-ratio: 1;
  border-radius: 18px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(148, 163, 184, 0.18);
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.28);
}

.song-card--feed .song-card__artwork {
  width: clamp(68px, 12vw, 110px);
}

.song-card__artwork-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.song-card__artwork-placeholder {
  font-size: 2.2rem;
  color: var(--profile-accent);
}

.song-card__content {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.song-card__meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.song-card__title {
  font-size: 1.08rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--profile-text);
  margin: 0;
}

.song-card__submeta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--profile-muted);
}

.song-card__separator {
  color: rgba(148, 163, 184, 0.5);
}

.song-card__duration {
  font-size: 0.85rem;
  color: var(--profile-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.song-card__duration span {
  font-variant-numeric: tabular-nums;
  letter-spacing: normal;
  margin-left: 6px;
  color: var(--profile-text);
}

body.dark .song-card__duration span {
  color: #e2e8f0;
}

.song-player {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(99, 102, 241, 0.1);
  border: 1px solid rgba(99, 102, 241, 0.28);
  backdrop-filter: blur(14px);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.song-card--feed .song-player {
  background: rgba(99, 102, 241, 0.08);
}

.song-player--feed {
  padding: 12px 14px;
}

body.dark .song-player {
  background: rgba(79, 70, 229, 0.16);
  border-color: rgba(99, 102, 241, 0.38);
}

body.dark .song-card--feed .song-player {
  background: rgba(79, 70, 229, 0.22);
}

.song-player.is-playing {
  box-shadow: 0 18px 32px -22px rgba(99, 102, 241, 0.55);
  border-color: rgba(99, 102, 241, 0.52);
}

.song-player__header {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}

.song-player__meta {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.song-player--card .song-player__meta {
  display: none;
}

.song-player__title {
  font-size: 0.98rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-player__subtitle {
  font-size: 0.85rem;
  color: var(--profile-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.song-player__subtitle.is-empty {
  display: none;
}

.song-player__wave {
  --progress: 0%;
  position: relative;
  height: 44px;
  border-radius: 14px;
  background: rgba(99, 102, 241, 0.08);
  border: 1px solid rgba(99, 102, 241, 0.18);
  overflow: hidden;
  pointer-events: none;
}

.song-player__wave-track,
.song-player__wave-progress {
  position: absolute;
  inset: 0;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(2px, 1fr);
  gap: 4px;
  align-items: center;
  padding: 6px 10px;
}

.song-player__wave-track {
  color: rgba(99, 102, 241, 0.45);
  z-index: 1;
}

.song-player__wave-progress {
  inset: 0 auto 0 0;
  width: 0%;
  max-width: 100%;
  overflow: hidden;
  color: rgba(79, 70, 229, 0.95);
  transition: width 0.12s linear;
  z-index: 2;
}

.song-player__wave-bar {
  width: 100%;
  height: var(--bar-height, 50%);
  background: currentColor;
  border-radius: 999px;
  opacity: 0.9;
}

.song-player--card .song-player__wave {
  height: 40px;
}

.song-player--feed .song-player__wave {
  height: 36px;
  border-radius: 12px;
}

body.dark .song-player__wave {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(99, 102, 241, 0.32);
}

body.dark .song-player__wave-track {
  color: rgba(148, 163, 184, 0.6);
}

body.dark .song-player__wave-progress {
  color: rgba(129, 140, 248, 0.95);
}

.song-player__play {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: none;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--profile-accent), var(--profile-highlight));
  color: #fff;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.song-player__play span[aria-hidden="true"] {
  font-size: 1.3rem;
}

.song-player__play.is-playing {
  background: linear-gradient(135deg, #f97316, #fb7185);
}

.song-player__play:hover {
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 18px 32px -22px rgba(99, 102, 241, 0.65);
}

.song-player__play:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.42);
  outline-offset: 3px;
}

.song-player__timeline {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.song-player__elapsed,
.song-player__remaining {
  font-size: 0.85rem;
  font-variant-numeric: tabular-nums;
  color: var(--profile-muted);
}

.song-player__slider {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
}

.song-player__seek {
  --progress: 0%;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--profile-accent) 0, var(--profile-accent) var(--progress), rgba(148, 163, 184, 0.32) var(--progress), rgba(148, 163, 184, 0.32) 100%);
  cursor: pointer;
  transition: background 0.2s ease;
}

.song-player__seek:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.32);
}

.song-player__seek::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--profile-accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.song-player__seek::-webkit-slider-thumb:hover {
  transform: scale(1.08);
}

.song-player__seek::-webkit-slider-thumb:active {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.24);
}

.song-player__seek::-webkit-slider-runnable-track {
  background: transparent;
  border-radius: 999px;
  height: 6px;
}

.song-player__seek::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid var(--profile-accent);
  box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.15);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.song-player__seek::-moz-range-thumb:hover {
  transform: scale(1.08);
}

.song-player__seek::-moz-range-thumb:active {
  transform: scale(1.15);
  box-shadow: 0 0 0 6px rgba(99, 102, 241, 0.24);
}

.song-player__seek::-moz-range-track {
  background: transparent;
  border-radius: 999px;
  height: 6px;
}

.song-player__seek:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.song-player__seek:disabled::-webkit-slider-thumb {
  display: none;
}

.song-player__seek:disabled::-moz-range-thumb {
  visibility: hidden;
}

.song-player--error {
  border-color: rgba(239, 68, 68, 0.45);
  box-shadow: inset 0 0 0 1px rgba(239, 68, 68, 0.15);
}

.song-player--error .song-player__remaining {
  color: rgba(239, 68, 68, 0.85);
}

.song-player.is-scrubbing .song-player__seek::-webkit-slider-thumb,
.song-player.is-scrubbing .song-player__seek::-moz-range-thumb {
  transform: scale(1.1);
}

@media (max-width: 768px) {
  .song-card {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .song-card__artwork {
    width: clamp(96px, 48vw, 180px);
    margin: 0 auto;
  }

  .song-card__content {
    gap: 12px;
  }

  .song-player__timeline {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }

  .song-player__elapsed {
    order: 1;
  }

  .song-player__slider {
    order: 2;
  }

  .song-player__remaining {
    order: 3;
    justify-self: end;
  }
}

@media (max-width: 480px) {
  .song-player__header {
    flex-wrap: wrap;
    gap: 10px;
  }

  .song-player__meta {
    width: 100%;
  }

  .song-player__title {
    white-space: normal;
  }

}
/* ===== Songs uploader CTA ===== */
.songs-upload-cta {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 22px;
  border-radius: 22px;
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.95), rgba(14, 165, 233, 0.85));
  color: #fff;
  text-decoration: none;
  box-shadow: 0 26px 48px -28px rgba(14, 51, 90, 0.75);
  margin-bottom: 18px;
  position: relative;
  overflow: hidden;
}

.songs-upload-cta:focus-visible {
  outline: 3px solid rgba(255, 255, 255, 0.85);
  outline-offset: 3px;
}

.songs-upload-cta::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(255, 255, 255, 0.35), transparent 55%);
  pointer-events: none;
}

.songs-upload-cta__icon {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
}

.songs-upload-cta__content {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.95rem;
}

.songs-upload-cta__content strong {
  font-size: 1.05rem;
  font-weight: 700;
}

.songs-upload-cta__content span {
  color: rgba(255, 255, 255, 0.82);
  font-weight: 500;
}

/* Songs upload modal */
.songs-upload-modal__content {
  max-width: 520px;
  width: 92%;
}

.songs-upload-modal__options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.songs-upload-modal__option {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.08);
  color: inherit;
  text-align: left;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.songs-upload-modal__option:hover {
  transform: translateY(-2px);
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 18px 34px -24px rgba(15, 23, 42, 0.4);
}

.songs-upload-modal__option:focus-visible {
  outline: 3px solid rgba(99, 102, 241, 0.5);
  outline-offset: 2px;
}

.songs-upload-modal__icon {
  font-size: 1.6rem;
}

.songs-upload-modal__label {
  font-weight: 700;
  font-size: 1.05rem;
}

.songs-upload-modal__hint {
  color: rgba(15, 23, 42, 0.7);
  font-size: 0.9rem;
}
.profile-book-lists {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--profile-card-border);
  border-radius: 18px;
  background: color-mix(in srgb, var(--profile-card-bg) 92%, transparent);
  box-shadow: var(--profile-card-shadow);
}

.profile-book-lists__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.profile-book-lists__cta {
  font-size: 0.85rem;
  text-decoration: none;
  color: var(--profile-accent, #4338ca);
}

.profile-book-lists__status {
  margin: 12px 0;
  font-size: 0.9rem;
  color: var(--profile-muted, #64748b);
}

.profile-book-lists__grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-book-list {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 14px;
  padding: 10px;
}

.profile-book-list__preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
}

.profile-book-list__preview img {
  width: 100%;
  aspect-ratio: 3 / 4.5;
  object-fit: cover;
  border-radius: 10px;
}

.profile-book-list__preview--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  color: var(--profile-muted, #94a3b8);
  text-align: center;
  padding: 6px;
}

.profile-book-list__body h4 {
  margin: 0 0 4px;
}

.profile-book-list__body p {
  margin: 0 0 4px;
  color: var(--profile-muted, #94a3b8);
}

.profile-book-list__count {
  font-size: 0.85rem;
  color: var(--profile-muted, #94a3b8);
}

.profile-book-list__link {
  text-decoration: none;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 6px 14px;
  font-size: 0.85rem;
  font-weight: 600;
  color: inherit;
}

/* ===== Profile Intelligence ===== */
.profile-intel-panel {
  background: var(--profile-panel-gradient) var(--profile-card-bg);
  border: 1px solid var(--profile-card-border);
  border-radius: var(--profile-radius-lg);
  box-shadow: var(--profile-card-shadow);
  padding: clamp(16px, 2vw, 22px);
}

.profile-intel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.profile-intel-header h2 {
  margin: 0;
  font-size: 1.15rem;
}

.profile-intel-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

@media (max-width: 980px) {
  .profile-intel-grid {
    grid-template-columns: 1fr;
  }
}

.profile-intel-card {
  background: color-mix(in srgb, var(--profile-card-bg) 92%, transparent);
  border: 1px solid var(--profile-card-border);
  border-radius: 18px;
  padding: 14px 14px;
}

.profile-intel-card h3 {
  margin: 0 0 10px;
  font-size: 0.98rem;
}

.profile-intel-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.profile-intel-thesis {
  margin: 0 0 12px;
  font-size: 0.98rem;
  line-height: 1.5;
}

.profile-intel-bullets {
  margin: 0;
  padding-left: 18px;
}

.profile-intel-bullets li {
  margin: 6px 0;
  color: color-mix(in srgb, var(--profile-text) 88%, var(--profile-muted));
}

.profile-intel-themes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.intel-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 999px;
  border: 1px solid var(--profile-card-border);
  background: color-mix(in srgb, var(--profile-card-bg) 82%, transparent);
  color: var(--profile-text);
  font-size: 0.82rem;
  cursor: pointer;
  text-transform: none;
}

.intel-chip:hover,
.intel-chip:focus-visible {
  border-color: color-mix(in srgb, var(--profile-accent) 65%, var(--profile-card-border));
  background: color-mix(in srgb, var(--profile-accent-soft) 55%, var(--profile-card-bg));
}

.profile-intel-qa__row {
  display: flex;
  align-items: stretch;
  gap: 10px;
}

.profile-intel-qa__row input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--profile-card-border);
  background: color-mix(in srgb, var(--profile-card-bg) 88%, transparent);
  color: var(--profile-text);
}

.profile-intel-qa__row input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--profile-accent) 70%, var(--profile-card-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--profile-accent-soft) 65%, transparent);
}

.profile-intel-suggestions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.profile-intel-error {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid rgba(239, 68, 68, 0.45);
  background: rgba(239, 68, 68, 0.08);
  color: color-mix(in srgb, #ef4444 70%, var(--profile-text));
}

.profile-intel-answer {
  margin-top: 12px;
  border-top: 1px solid var(--profile-card-border);
  padding-top: 12px;
}

.profile-intel-answer__direct {
  margin: 0 0 10px;
  font-weight: 650;
}

.profile-intel-answer__reasoning {
  margin: 0 0 12px;
  padding-left: 18px;
}

.profile-intel-citations {
  margin: 8px 0 0;
  padding-left: 18px;
}

.profile-intel-citations li {
  margin: 6px 0;
}

.profile-intel-search input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  border: 1px solid var(--profile-card-border);
  background: color-mix(in srgb, var(--profile-card-bg) 88%, transparent);
  color: var(--profile-text);
}

.profile-intel-search input:focus {
  outline: none;
  border-color: color-mix(in srgb, var(--profile-accent) 70%, var(--profile-card-border));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--profile-accent-soft) 65%, transparent);
}

.profile-intel-results {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.intel-result {
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--profile-card-border);
  background: color-mix(in srgb, var(--profile-card-bg) 86%, transparent);
}

.intel-result__title {
  display: inline-block;
  font-weight: 650;
  text-decoration: none;
}

.intel-result__title:hover {
  text-decoration: underline;
}

.intel-result__meta {
  margin: 6px 0 0;
  font-size: 0.8rem;
}

.intel-result__excerpt {
  margin: 8px 0 0;
  font-size: 0.86rem;
  color: color-mix(in srgb, var(--profile-text) 82%, var(--profile-muted));
}

/* Article composer privacy selector */
.profile-article-composer-modal .article-composer-privacy {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 16px;
  font-weight: 600;
}

.profile-article-composer-modal .article-composer-privacy span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
}

.profile-article-composer-modal .article-composer-privacy select {
  background: rgba(15, 23, 42, 0.4);
  color: #e2e8f0;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
}

.profile-article-composer-modal .article-composer-privacy select:focus-visible {
  outline: 2px solid rgba(59, 130, 246, 0.8);
  outline-offset: 2px;
}

/* Store tab */
.profile-store-panel {
  border: 1px solid var(--profile-card-border);
  border-radius: var(--profile-radius-lg);
  background: color-mix(in srgb, var(--profile-card-bg) 94%, transparent);
  box-shadow: var(--profile-card-shadow);
  padding: 20px;
}

.profile-store-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.profile-store-header__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.profile-store-add-btn {
  border-radius: 999px;
  padding: 8px 14px;
  border: 1px solid color-mix(in srgb, var(--profile-accent) 65%, var(--profile-card-border));
  background: color-mix(in srgb, var(--profile-accent-soft) 60%, var(--profile-card-bg));
  color: var(--profile-text);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.profile-store-add-btn:hover {
  border-color: var(--profile-accent);
}

.profile-store-eyebrow {
  margin: 0 0 6px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: color-mix(in srgb, var(--profile-text) 70%, var(--profile-muted));
}

.profile-store-title {
  margin: 0;
  font-size: 1.4rem;
}

.profile-store-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.profile-store-controls label {
  font-size: 0.85rem;
  color: var(--profile-muted);
}

.profile-store-controls select {
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--profile-card-border);
  background: color-mix(in srgb, var(--profile-card-bg) 86%, transparent);
  color: var(--profile-text);
}

.profile-store-status {
  margin: 0 0 16px;
  color: var(--profile-muted);
  font-size: 0.85rem;
}

.profile-store-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.profile-store-card {
  border: 1px solid var(--profile-card-border);
  border-radius: 18px;
  overflow: hidden;
  background: color-mix(in srgb, var(--profile-card-bg) 92%, transparent);
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 220px;
  cursor: pointer;
}

.profile-store-card__media {
  position: relative;
  width: 100%;
  aspect-ratio: 14 / 13;
  background: color-mix(in srgb, var(--profile-card-bg) 70%, #0f172a);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--profile-muted);
}

.profile-store-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.profile-store-card__media.is-empty span {
  font-size: 0.85rem;
}

.profile-store-card__body {
  padding: 14px 16px 16px;
  display: grid;
  gap: 8px;
}

.profile-store-card__title {
  margin: 0;
  font-size: 1rem;
}

.profile-store-card__price {
  margin: 0;
  font-size: 0.9rem;
  color: color-mix(in srgb, var(--profile-text) 85%, var(--profile-muted));
}

.profile-store-card__actions {
  display: flex;
  gap: 10px;
  margin-top: 6px;
}

.profile-store-btn {
  flex: 1;
  text-align: center;
  border-radius: 999px;
  padding: 8px 12px;
  border: 1px solid var(--profile-card-border);
  color: var(--profile-text);
  text-decoration: none;
  font-weight: 600;
  background: color-mix(in srgb, var(--profile-card-bg) 80%, transparent);
}

.profile-store-btn--primary {
  border-color: color-mix(in srgb, var(--profile-accent) 70%, var(--profile-card-border));
  background: color-mix(in srgb, var(--profile-accent-soft) 55%, var(--profile-card-bg));
}

.profile-store-empty {
  margin-top: 16px;
  padding: 16px;
  border-radius: 16px;
  border: 1px dashed var(--profile-card-border);
  text-align: center;
  color: var(--profile-muted);
}
