/* ============================================================
  FILE: profilo.css
  Stili per la schermata Profilo + overlay profilo artista
  Usa le variabili CSS definite in style.css.
============================================================ */

/* Schermata scorrevole */
#profilo-view { overflow-y: auto; }
#profilo-view::-webkit-scrollbar { width: 4px; }
#profilo-view::-webkit-scrollbar-thumb { background: var(--border); }

/* min-height:100% → niente spazio nero; può crescere → scroll funziona */
.profilo-body {
  flex: 1;
  padding: 24px 32px 90px;
  width: 100%;
  box-sizing: border-box;
}

/* ============================================================
  COVER FOTO
============================================================ */
.profilo-cover-wrap {
  margin: -24px -32px 0;
  width: calc(100% + 64px);
  position: relative;
  background: var(--bg);
  overflow: hidden;
  flex-shrink: 0;
}

.profilo-cover-video {
  position: absolute;
  top: 0; left: 0; right: 0;
  overflow: hidden;
  background-color: var(--surface2);
  z-index: 0;
}

/* Il ratio mantiene 16:9 → più alto della cover → cropped da overflow:hidden */
.profilo-cover-video .evidenza-video-ratio {
  border-radius: 0;
  width: 100%;
}

/* Infobar, overlay btns e change btn non servono nella cover */
.profilo-cover-video .evidenza-infobar,
.profilo-cover-video .evidenza-overlay-btns,
.profilo-cover-video .evidenza-change-btn { display: none; }

.profilo-cover-btns {
  /* Ricopre la cover (altezza scritta da adjustCoverHeight in profilo.js) senza intercettare
     i clic: i singoli pulsanti stanno agli angoli e riprendono `pointer-events`. In alto a
     sinistra "Cambia video", in alto a destra "VAI AL VIDEO", in basso a destra l'audio. */
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  pointer-events: none;
}
.profilo-cover-btns > button { position: absolute; pointer-events: auto; }
.profilo-cover-btns .profilo-cover-edit-btn { top: 12px; left: 12px; }
.profilo-cover-btns .profilo-cover-goto-btn { top: 12px; right: 12px; }
.profilo-cover-btns .profilo-cover-mute-btn { bottom: 12px; right: 12px; }

.profilo-cover-edit-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 20px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: background 0.15s;
}
.profilo-cover-edit-btn:hover { background: rgba(0,0,0,0.75); }

.profilo-cover-goto-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  background: var(--accent);
  border: none;
  border-radius: 20px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: opacity 0.15s;
}
.profilo-cover-goto-btn:hover { opacity: 0.85; }

/* Hero dentro la cover, con padding top per respirare */
.profilo-top-layout {
  position: relative;
  z-index: 1;
  padding-top: 24px;
  padding-bottom: 24px;
}

/* Ring sull'avatar per separarlo dalla cover */
.profilo-avatar-big {
  outline: 4px solid var(--bg);
}

/* Card centrate nella griglia profilo */
.profilo-track-list {
  justify-content: center;
}

/* Ripristino layout verticale per le card nel profilo */
.profilo-track-list .track-item {
  flex-direction: column;
  height: auto;
  background: var(--surface2);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border: 1px solid rgba(255,255,255,0.07);
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  border-radius: 12px;
  contain-intrinsic-size: auto 260px;
}
.profilo-track-list .track-item::before { display: none; }
.profilo-track-list .track-item:hover {
  transform: translateY(-3px) scale(1);
  background: var(--surface2);
  box-shadow: 0 12px 32px rgba(0,0,0,0.5);
  border-color: rgba(255,255,255,0.13);
}
html[data-theme="light"] .profilo-track-list .track-item {
  background: var(--bg);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-color: rgba(0,0,0,0.07);
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}
.profilo-track-list .track-cover {
  width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 10px;
  box-shadow: none;
  border-right: none;
  border-bottom: 1px solid rgba(255,255,255,0.07);
}
html[data-theme="light"] .profilo-track-list .track-cover {
  border-bottom-color: rgba(0,0,0,0.07);
  box-shadow: none;
}
.profilo-track-list .track-item:hover .track-cover { box-shadow: none; }
.profilo-track-list .track-info {
  padding: 8px 10px 10px;
  align-items: center;
}
.profilo-track-list .track-title { text-align: center; }
.profilo-track-list .track-artists-row {
  align-items: center;
  margin-top: 4px;
  gap: 0;
}
.profilo-track-list .track-meta-row {
  justify-content: center;
  text-align: center;
}
.profilo-track-list .track-card-footer {
  border-top: none;
  padding-top: 0;
  margin-top: 8px;
}

.profilo-track-list .track-beat-tags-fixed {
  margin-top: 5px;
}

/* Mini card: tre puntini in alto a destra */
.profilo-mini-card:hover .track-menu-btn { opacity: 1; }
.track-menu-btn.active { opacity: 1; }

/* "Più recente": card riempie tutta la colonna */
.profilo-bottom-col .profilo-track-list {
  grid-template-columns: 1fr;
}

/* Sezione brani senza margine inferiore extra */
.profilo-section-tracks {
  margin-bottom: 40px;
}

/* ============================================================
  TOP LAYOUT: hero + in evidenza, centrati
============================================================ */
.profilo-top-layout {
  display: flex;
  gap: 0;
  align-items: flex-start;
  justify-content: center;
  margin-bottom: 32px;
  padding-top: 24px;
}

/* Colonna sinistra: avatar + info + social + segui */
.profilo-hero-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-align: left;
  width: 680px;
  flex-shrink: 0;
}

.profilo-hero-top {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 28px;
  width: 100%;
}

.profilo-hero-right-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.profilo-username-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

.profilo-avatar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  width: 260px;
}

.profilo-hero-info {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 10px;
}

.profilo-evidenza-col {
  width: 90%;
  max-width: 680px;
}

/* ============================================================
  RIGA 2: tutte le colonne da sinistra
============================================================ */
.profilo-bottom-row {
  display: flex;
  flex-direction: row;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.profilo-bottom-col {
  flex: 1;
  min-width: 0;
}

/* Sfondo sfocato per video portrait (Reel) — copre le bande nere ai lati */
.evidenza-ig-blur-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(16px) brightness(0.45);
  transform: scale(1.08);
  border-radius: 10px;
}

/* Label piccola con edit button */
.profilo-section-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 10px;
}

.profilo-evidenza-edit {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  transition: color 0.15s;
}
.profilo-evidenza-edit:hover { color: var(--accent); }

/* Mini card per In evidenza / Più recente */
.profilo-mini-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  transition: border-color 0.15s, transform 0.15s;
  position: relative;
}
.profilo-mini-card:hover { border-color: var(--accent); transform: translateY(-1px); }


.profilo-mini-thumb {
  width: 52px;
  height: 52px;
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.profilo-mini-thumb img { width: 100%; height: 100%; object-fit: cover; }

.profilo-mini-info { flex: 1; min-width: 0; }

.profilo-mini-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profilo-mini-artist {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profilo-mini-empty {
  padding: 24px 12px;
  background: var(--surface2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

/* Riga azioni: Segui + icone social */
.profilo-hero-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
}

/* Pulsante Segui */
.profilo-follow-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 24px;
  padding: 11px 20px;
  font-size: 14px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.profilo-follow-btn:hover { opacity: 0.85; transform: translateY(-1px); }

/* Pulsante Messaggio diretto */
.profilo-dm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  background: rgba(255,255,255,0.06);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  /* Il gap di .profilo-avatar-col è 12px: il margine negativo avvicina il
     pulsante al Segui (coppia di azioni) senza toccare i social links sotto. */
  margin-top: -6px;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.profilo-dm-btn:hover { background: rgba(255,255,255,0.10); border-color: rgba(255,255,255,0.25); transform: translateY(-1px); }
[data-theme="light"] .profilo-dm-btn { background: rgba(0,0,0,0.04); }
[data-theme="light"] .profilo-dm-btn:hover { background: rgba(0,0,0,0.08); border-color: rgba(0,0,0,0.22); }

/* Avatar grande circolare */
.profilo-avatar-big {
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: var(--accent);
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 104px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  overflow: hidden;
  transition: opacity 0.2s;
}
.profilo-avatar-big:hover { opacity: 0.85; }
.profilo-avatar-big img { width: 100%; height: 100%; object-fit: cover; }

/* Nome artista */
.profilo-username {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
}

/* Etichetta ruolo */
.profilo-tipo {
  white-space: nowrap;
  font-size: 13px;
  color: var(--accent);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  background: rgba(255,0,34,0.1);
  border: 1px solid rgba(255,0,34,0.2);
  padding: 4px 14px;
  border-radius: 20px;
  align-self: flex-start;
}

/* Ruolo artistico e distintivo staff restano SEMPRE affiancati. Il contenitore serve
   proprio a questo: `.profilo-username-row` ha `flex-wrap: wrap`, quindi con l'ARTname
   lungo il secondo distintivo finiva a capo, sotto al primo. Raggruppati con `nowrap`
   vanno a capo insieme, mantenendo l'uno accanto all'altro. */
.profilo-role-group {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: nowrap;
}

/* Distintivo staff (admin / moderatore) — accanto a .profilo-tipo, MAI al suo posto:
   sono due informazioni diverse (cosa fa l'utente / che poteri ha) e dal 2026-08-20
   vivono in due colonne distinte del database. Vedi CLAUDE.md, "Ruolo artistico e
   privilegio". Colori diversi dal rosso di .profilo-tipo per non confonderli a colpo
   d'occhio: oro per admin, azzurro per moderatore. */
.profilo-staff {
  white-space: nowrap;
  font-size: 13px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.profilo-staff--admin {
  color: #f5c518;
  background: rgba(245,197,24,0.12);
  border: 1px solid rgba(245,197,24,0.30);
}
.profilo-staff--moderator {
  color: #4aa3ff;
  background: rgba(74,163,255,0.12);
  border: 1px solid rgba(74,163,255,0.30);
}

/* Riga con i contatori */
.profilo-stats-row {
  display: flex;
  gap: 64px;
  margin-top: 4px;
}

.profilo-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.profilo-stat-icon {
  color: var(--muted);
  width: 22px;
  height: 22px;
}

/* Numero grande */
.profilo-stat-n {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}

/* Link social (IG, YT) — icone circolari */
.profilo-social-links {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.profilo-social-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: opacity 0.2s, transform 0.15s;
  background: var(--surface2);
  flex-shrink: 0;
}
.profilo-social-btn:hover { opacity: 0.8; transform: translateY(-1px); }
.profilo-social-ig { border-color: #E1306C88; color: #E1306C; background: rgba(225,48,108,0.35); backdrop-filter: blur(6px); }
.profilo-social-yt { border-color: #FF000088; color: #FF4444; background: rgba(255,0,0,0.35); backdrop-filter: blur(6px); }

/* Header riga sezione con contatore */
.profilo-section-header-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.profilo-tracks-count {
  font-size: 12px;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
}

/* ============================================================
  GRIGLIA BRANI STILE INSTAGRAM
============================================================ */
.profilo-ig-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3px;
}

.profilo-grid-item {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  cursor: pointer;
  background: var(--surface2);
}

.profilo-grid-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.profilo-grid-item:hover img {
  transform: scale(1.04);
}

/* Placeholder quando non c'è thumbnail */
.profilo-grid-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--muted);
}

/* Overlay su hover: icona play + titolo */
.profilo-grid-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.55);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  opacity: 0;
  transition: opacity 0.2s;
  padding: 12px;
}

.profilo-grid-item:hover .profilo-grid-overlay {
  opacity: 1;
}

.profilo-grid-overlay svg {
  color: #fff;
  flex-shrink: 0;
}

.profilo-grid-title {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  text-align: center;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-clamp: 2;
  line-height: 1.3;
}

.profilo-grid-badge {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.7);
  letter-spacing: 1px;
}

/* Bordo accent se la traccia è in riproduzione */
.profilo-grid-active::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 3px solid var(--accent);
  pointer-events: none;
}

/* Empty state griglia */
.profilo-grid-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 48px 0;
  color: var(--muted);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
}

/* ============================================================
  SEZIONI (Brani recenti, Impostazioni)
============================================================ */
.profilo-section {
  margin-bottom: 32px;
}

/* Titoletto sezione in uppercase */
.profilo-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--muted);
  margin-bottom: 16px;
}

/* ============================================================
  APP COLLEGATE
============================================================ */
.connected-apps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.connected-app-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
}

.connected-app-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.connected-app-info {
  flex: 1;
  min-width: 0;
}

.connected-app-name {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.connected-app-status {
  font-size: 11px;
  font-weight: 500;
}

.status-connected  { color: #4ade80; }
.status-disconnected { color: var(--muted); }

.connected-app-action { flex-shrink: 0; }

.connected-app-btns { display: flex; gap: 8px; align-items: center; }

.btn-app-revoke {
  background: transparent;
  border: 1px solid var(--accent);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.btn-app-revoke:hover { background: var(--accent); color: #fff; }

/* Modal conferma revoca */
.revoke-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  backdrop-filter: blur(4px);
}
.revoke-modal-box {
  background: var(--surface2);
  border: 1px solid var(--accent);
  border-radius: 16px;
  padding: 32px 28px 24px;
  max-width: 380px;
  width: 90vw;
  text-align: center;
}
.revoke-modal-icon { font-size: 32px; margin-bottom: 12px; }
.revoke-modal-title { font-size: 17px; font-weight: 700; color: var(--text); margin-bottom: 12px; }
.revoke-modal-desc { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 24px; }
.revoke-modal-desc strong { color: var(--text); }
.revoke-modal-actions { display: flex; gap: 10px; justify-content: center; }
.revoke-btn-cancel {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}
.revoke-btn-cancel:hover { border-color: var(--muted); color: var(--text); }
.revoke-btn-confirm {
  background: var(--accent);
  border: none;
  border-radius: 20px;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.15s;
}
.revoke-btn-confirm:hover { opacity: 0.85; }

.btn-app-connect {
  background: transparent;
  border: 1px solid;
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-app-connect:hover { opacity: 0.75; }

.btn-app-disconnect {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}
.btn-app-disconnect:hover {
  color: var(--accent2);
  border-color: var(--accent2);
}

.connected-app-note {
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}


/* ============================================================
  IMPOSTAZIONI ACCOUNT
============================================================ */
.settings-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

/* Singola riga impostazione */
.setting-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.setting-item:last-child { border-bottom: none; }

.setting-label { flex: 1; }

/* Nome impostazione */
.setting-name {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 2px;
}

/* Descrizione impostazione */
.setting-desc {
  font-size: 12px;
  color: var(--muted);
  font-family: 'DM Sans', sans-serif;
}

/* Pulsante "Modifica" / "Elimina" */
.btn-setting {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 7px 16px;
  border-radius: 7px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.2s;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-setting:hover { border-color: var(--accent); color: var(--accent); }

/* Variante pericolo (elimina account) */
.btn-danger-text:hover { border-color: var(--accent2); color: var(--accent2); }

/* Form cambio password (appare sotto la riga) */
.setting-form {
  padding: 16px 20px;
  border-top: 1px solid var(--border);
  background: var(--surface2);
}

.setting-form .btn-primary {
  width: auto;
  padding: 8px 24px;
  margin-top: 8px;
}

/* ============================================================
  CARTELLE (Più ascoltate / Album / Collaborazioni)
============================================================ */
.profilo-bottom-col .profilo-folder-card {
  width: 100%;
}

.profilo-folder-card {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.profilo-folder-card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 4px 16px rgba(0,0,0,0.2); }
.profilo-folder-card.active { border-color: var(--accent); border-width: 2px; }

/* Collage 2×2 */
.profilo-folder-covers {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  aspect-ratio: 1;
  background: var(--surface2);
}

.profilo-folder-cover-cell {
  overflow: hidden;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1;
}
.profilo-folder-cover-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profilo-folder-cover-empty { background: var(--border); opacity: 0.4; }

.profilo-folder-info { padding: 10px 14px 12px; }

.profilo-folder-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}

.profilo-folder-count {
  font-size: 11px;
  color: var(--muted);
}

/* Sezione espansa */
/* Sidebar cartella — slide da destra */
.profilo-folder-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: 340px;
  height: 100vh;
  background: rgba(10,10,10,0.15);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-left: 1px solid rgba(255,255,255,0.06);
  z-index: 600;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -12px 0 40px rgba(0,0,0,0.6);
}
.profilo-folder-sidebar.open {
  transform: translateX(0);
}

.profilo-folder-sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  flex-shrink: 0;
}

.profilo-folder-expanded-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.profilo-folder-expanded-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.15s;
}
.profilo-folder-expanded-close:hover { color: var(--text); }

.profilo-folder-sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Item lista nella sidebar */
.profilo-mini-card,
.sidebar-track-item,
.sidebar-album-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s;
}
.profilo-mini-card:hover,
.sidebar-track-item:hover,
.sidebar-album-item:hover { background: rgba(255,255,255,0.12); }

.profilo-mini-thumb,
.sidebar-item-thumb {
  width: 40px;
  height: 40px;
  border-radius: 6px;
  background: var(--surface);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.profilo-mini-thumb img,
.sidebar-item-thumb img { width: 100%; height: 100%; object-fit: cover; }

.profilo-mini-info,
.sidebar-item-info { flex: 1; min-width: 0; }

.profilo-mini-title,
.sidebar-item-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profilo-mini-artist,
.sidebar-item-meta {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Backdrop */
.profilo-folder-sidebar-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 599;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.profilo-folder-sidebar-backdrop.open {
  opacity: 1;
  pointer-events: all;
}

/* ============================================================
  IN EVIDENZA — PLAYER + PICKER + ADD BUTTON
============================================================ */
@keyframes evidenzaEnter {
  from { opacity: 0; transform: scale(0.94); }
  to   { opacity: 1; transform: scale(1); }
}

.evidenza-player-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
  animation: evidenzaEnter 0.4s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}

.evidenza-player-header { display: none; }

/* Infobar sovrapposta in alto al video, visibile su hover */
.evidenza-infobar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 6;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 24px;
  background: linear-gradient(to bottom, rgba(0,0,0,0.75) 0%, transparent 100%);
  border-radius: 20px 20px 0 0;
  opacity: 0;
  transition: opacity 0.2s;
}
.evidenza-video-ratio:hover .evidenza-infobar { opacity: 1; }

.evidenza-infobar-info {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.evidenza-infobar-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: rgba(255,255,255,0.55);
  font-family: 'DM Sans', sans-serif;
}

.evidenza-track-label {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.evidenza-change-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  transition: color 0.15s;
}
.evidenza-change-btn:hover { color: var(--accent); }

/* Contenitore video — default 16:9 (YT). Per IG portrait (Reel): JS imposta height fissa + width auto */
.evidenza-video-ratio {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
  border-radius: 20px;
  overflow: hidden;
}
.evidenza-video-ratio > div,
.evidenza-video-ratio > iframe,
#evidenza-yt-player,
#evidenza-yt-player iframe {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  border: none;
  border-radius: 20px;
}

/* Wrapper video + overlay buttons (fuori dall'iframe per stacking context) */
.evidenza-video-outer {
  position: relative;
}
.evidenza-yt-blocker {
  position: absolute;
  inset: 0;
  z-index: 5;
  pointer-events: all;
  background: transparent;
  border-radius: 20px;
}

/* Infobar overlay dentro evidenza-yt-holder (in alto) */
#evidenza-yt-infobar {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 2;
  pointer-events: none;
}
#evidenza-yt-infobar .evidenza-change-btn { pointer-events: auto; }

/* Bottoni overlay dentro evidenza-yt-holder (sopra l'iframe, z-index locale) */
#evidenza-yt-overlay-btns {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
  z-index: 2;
}
#evidenza-yt-overlay-btns > * { pointer-events: auto; }

/* Bottoni sovrapposti al video IG — rimangono nel DOM normale */
.evidenza-overlay-btns {
  position: absolute;
  bottom: 10px;
  left: 0; right: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  pointer-events: none;
}
.evidenza-overlay-btns > * { pointer-events: auto; }

/* Pulsante VAI AL VIDEO */
.evidenza-goto-btn {
  padding: 2px 8px;
  background: var(--accent);
  border: none;
  border-radius: 4px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}
.evidenza-goto-btn:hover { opacity: 0.85; }

/* Pulsante Muto — trasparente */
.evidenza-mute-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 22px;
  background: rgba(0,0,0,0.45);
  border: none;
  border-radius: 4px;
  color: #fff;
  cursor: pointer;
  backdrop-filter: blur(4px);
  transition: background 0.15s;
}
.evidenza-mute-btn:hover { background: rgba(0,0,0,0.7); }

/* Pulsante "Mostra un brano in evidenza" */
.evidenza-add-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--surface2);
  border: 2px dashed var(--border);
  border-radius: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.evidenza-add-btn:hover { border-color: var(--accent); color: var(--accent); }

/* Modal picker In evidenza */
.evidenza-picker-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.evidenza-picker-inner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 100%;
  max-width: 420px;
  max-height: 70vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.evidenza-picker-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.evidenza-picker-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
}

.evidenza-picker-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  padding: 4px;
  transition: color 0.15s;
}
.evidenza-picker-close:hover { color: var(--text); }

.evidenza-picker-list {
  overflow-y: auto;
  padding: 8px 0;
}

.evidenza-picker-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  cursor: pointer;
  transition: background 0.15s;
}
.evidenza-picker-item:hover { background: var(--surface2); }
.evidenza-picker-item.selected { background: rgba(255,0,34,0.07); }

.evidenza-picker-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--surface2);
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}
.evidenza-picker-thumb img { width: 100%; height: 100%; object-fit: cover; }

.evidenza-picker-info { flex: 1; min-width: 0; }
.evidenza-picker-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.evidenza-picker-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }

.evidenza-picker-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  background: var(--surface2);
  color: var(--muted);
  flex-shrink: 0;
}
.evidenza-picker-badge.current { background: rgba(255,0,34,0.15); color: var(--accent); }

.evidenza-picker-empty { padding: 32px 20px; color: var(--muted); font-size: 13px; text-align: center; }

/* ============================================================
  FOLLOW BUTTON — artist overlay
============================================================ */
.artista-follow-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  padding: 8px 22px;
  border-radius: 20px;
  border: 2px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: opacity 0.2s, transform 0.15s;
}
.artista-follow-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.artista-follow-btn.following {
  background: transparent;
  color: var(--accent);
}

/* ============================================================
  OVERLAY PROFILO ARTISTA
============================================================ */
.artista-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  overflow-y: auto;
  font-family: 'DM Sans', sans-serif;
}

.artista-overlay.open { display: block; }

.artista-overlay-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px 60px;
}

/* ---- Topbar con back button ---- */
.artista-topbar {
  padding: 20px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}

.artista-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  transition: all 0.2s;
}
.artista-back:hover { color: var(--text); border-color: var(--muted); }

/* ---- Header profilo ---- */
.artista-header {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 40px;
}

.artista-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--surface2);
  border: 3px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 40px;
  font-weight: 800;
  color: var(--text);
  flex-shrink: 0;
  overflow: hidden;
}
.artista-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.artista-header-info { flex: 1; }

.artista-name {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.2;
  margin-bottom: 8px;
}

.artista-role-badge {
  display: inline-block;
  background: rgba(232,0,10,0.15);
  color: var(--accent);
  border: 1px solid rgba(232,0,10,0.3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 20px;
}

#profilo-back-btn {
  position: absolute;
  top: 12px;
  left: 16px;
  z-index: 10;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  font-size: 13px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
#profilo-back-btn:hover { border-color: var(--accent); color: var(--accent); }

.artista-loading {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
  font-size: 14px;
}

.profilo-follow-btn.following {
  background: transparent;
  border-color: var(--muted);
  color: var(--muted);
}
.profilo-follow-btn.following:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.artista-not-found {
  text-align: center;
  padding: 60px 20px;
  color: var(--muted);
}
.artista-not-found .artista-not-found-icon {
  font-size: 48px;
  margin-bottom: 16px;
}
.artista-not-found h3 {
  font-size: 18px;
  color: var(--text);
  margin-bottom: 8px;
}

/* ---- Sezioni ---- */
.artista-section {
  margin-bottom: 40px;
}

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

.artista-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--muted);
}

.artista-add-album-btn {
  background: none;
  border: 1px solid var(--border);
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-family: 'DM Sans', sans-serif;
  cursor: pointer;
  transition: all 0.2s;
}
.artista-add-album-btn:hover { border-color: var(--accent); color: var(--accent); }

/* ---- Track list nel profilo artista ---- */
.artista-track-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background 0.15s;
}
.artista-track-item:hover { background: var(--surface2); }

.artista-track-thumb {
  width: 44px;
  height: 44px;
  border-radius: 6px;
  background: var(--surface2);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.artista-track-thumb img { width: 100%; height: 100%; object-fit: cover; }

.artista-track-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artista-track-meta {
  font-size: 12px;
  color: var(--muted);
}

.artista-track-badge {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  letter-spacing: 0.5px;
}
.artista-track-badge.beat { background: rgba(255,107,107,0.15); color: var(--accent2); }
.artista-track-badge.yt   { background: rgba(255,0,0,0.12); color: #ff4444; }
.artista-track-badge.ig   { background: rgba(188,24,136,0.12); color: #e040fb; }
.artista-track-badge.sc   { background: rgba(255,85,0,0.12); color: #ff5500; }

/* ---- Album grid ---- */
.artista-albums-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 16px;
}

.artista-album-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.2s;
}
.artista-album-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.artista-album-cover {
  width: 100%;
  aspect-ratio: 1;
  background: var(--surface2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
}
.artista-album-cover img { width: 100%; height: 100%; object-fit: cover; }

.artista-album-info { padding: 10px 12px; }
.artista-album-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.artista-album-year { font-size: 11px; color: var(--muted); margin-top: 2px; }
.artista-album-count { font-size: 11px; color: var(--muted); }

/* ---- Empty state ---- */
.artista-empty {
  padding: 20px 0;
  color: var(--muted);
  font-size: 13px;
}

/* ---- Toggle switch (usato nei modali di upload) ---- */
.beat-toggle-row, .ig-beat-toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0 4px;
}
.beat-toggle-row span { font-size: 13px; color: var(--text); }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  inset: 0;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 22px;
  cursor: pointer;
  transition: 0.2s;
}
.toggle-slider::before {
  content: '';
  position: absolute;
  width: 16px;
  height: 16px;
  left: 2px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--muted);
  border-radius: 50%;
  transition: 0.2s;
}
.toggle-switch input:checked + .toggle-slider { background: rgba(232,0,10,0.2); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translate(18px, -50%); background: var(--accent); }

/* ============================================================
  SEZIONE "SEGUE" — profilo e overlay artista
============================================================ */
.profilo-segue-grid, .artista-segue-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding: 8px 0 4px;
}

.profilo-segue-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  width: 72px;
}

.profilo-segue-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--border);
  position: relative;
}
.profilo-segue-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.profilo-segue-initials {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}

.profilo-segue-name {
  font-size: 11px;
  color: var(--text);
  text-align: center;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}
.profilo-segue-card:hover .profilo-segue-name { color: var(--accent); }

.artista-segue-grid .profilo-segue-card { width: 64px; }
.artista-segue-grid .profilo-segue-avatar { width: 46px; height: 46px; }

/* ============================================================
  TELEFONO (≤ 768px), dal 2026-10-03
  Su desktop l'eroe e' una colonna fissa da 680px con l'avatar da 260px
  affiancato alle informazioni, e le sei raccolte stanno in una riga sola.
  Sul telefono tutto si impila e si centra; le raccolte vanno a due colonne.
============================================================ */
@media (max-width: 768px) {
  .profilo-body { padding: 16px 14px calc(var(--tabbar-h) + 96px); }
  .profilo-cover-wrap { margin: -16px -14px 0; width: calc(100% + 28px); }
  .profilo-top-layout { padding-top: 12px; margin-bottom: 22px; }
  .profilo-hero-left { width: 100%; align-items: center; text-align: center; }
  .profilo-hero-top { flex-direction: column; align-items: center; gap: 14px; }
  .profilo-avatar-col { width: 100%; }
  .profilo-avatar-big { width: 132px; height: 132px; font-size: 54px; }
  .profilo-hero-right-col { width: 100%; align-items: center; }
  .profilo-hero-info { align-items: center; padding-top: 0; }
  .profilo-username-row { justify-content: center; }
  .profilo-username { font-size: 26px; }
  .profilo-evidenza-col { width: 100%; }
  .profilo-stats-row { gap: 40px; justify-content: center; }

  .profilo-bottom-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 12px;
  }
  .profilo-ig-grid { gap: 2px; }
  .profilo-folder-sidebar { width: 100vw; height: 100dvh; }
}

/* ============================================================
  TELEFONO, rifiniture (≤ 768px), dal 2026-10-03
  L'eroe sta dentro .profilo-cover-wrap, che ha il margine negativo per
  uscire dal padding del corpo: senza padding proprio, avatar e pulsanti
  toccano i bordi dello schermo. Il codice della cover video non cambia.
============================================================ */
@media (max-width: 768px) {
  /* Aria ai lati dell'eroe, e spazio in alto per il pulsante Indietro
     (assoluto in alto a sinistra) e per i pulsanti della cover. */
  .profilo-top-layout { padding: 84px 14px 0; }
  .profilo-hero-left { max-width: 100%; }

  /* Pulsanti della cover: restano piccoli e in basso a destra sul video (posizione di
     adjustCoverHeight), ma con un'area di tocco da 36px. */
  .profilo-cover-edit-btn,
  .profilo-cover-goto-btn { min-height: 36px; padding: 6px 11px; font-size: 11.5px; }
  #profilo-back-btn { top: 12px; left: 12px; min-height: 40px; padding: 8px 16px; }

  /* Segui e Messaggio: larghezza da pollice, non da bordo a bordo */
  .profilo-avatar-col { align-items: center; }
  .profilo-follow-btn,
  .profilo-dm-btn { width: 100%; max-width: 320px; min-height: 44px; }
  .profilo-dm-btn { margin-top: 0; }
  .profilo-social-btn { width: 44px; height: 44px; }

  .profilo-section-label { font-size: 13px; letter-spacing: 1.2px; color: color-mix(in srgb, var(--text) 70%, transparent); }
  .profilo-bottom-col { min-width: 0; }
  .profilo-folder-sidebar-header { padding: 14px 16px; }
  .profilo-folder-expanded-close { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .sidebar-album-item { min-height: 56px; }
  .profilo-folder-sidebar-content { padding-bottom: calc(var(--tabbar-h) + 96px); }

  /* Segue: carosello orizzontale voluto, con snap */
  .profilo-segue-grid, .artista-segue-grid {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    gap: 14px;
    padding: 8px 2px 8px;
  }
  .profilo-segue-card { flex: 0 0 auto; width: 76px; scroll-snap-align: start; }
  .profilo-segue-avatar { width: 56px; height: 56px; }
  .profilo-segue-name { font-size: 13px; }
  .artista-segue-grid .profilo-segue-card { width: 76px; }
  .artista-segue-grid .profilo-segue-avatar { width: 56px; height: 56px; }

  /* Selettore evidenza e modale di revoca */
  .evidenza-picker-modal { padding: 12px; align-items: flex-end; }
  .evidenza-picker-inner { max-height: 80dvh; border-radius: 16px 16px 12px 12px; }
  .evidenza-picker-item { min-height: 56px; }
  .evidenza-picker-close { min-width: 44px; min-height: 44px; }
  .evidenza-picker-name { font-size: 14px; }
  .revoke-modal-box { padding: 24px 18px 18px; width: calc(100vw - 24px); }
  .revoke-modal-actions { flex-direction: column-reverse; }
  .revoke-btn-cancel, .revoke-btn-confirm { min-height: 44px; width: 100%; }

  /* Overlay artista (header, brani, album) */
  .artista-overlay-inner { padding: 0 14px calc(var(--tabbar-h) + 96px); }
  .artista-topbar { padding: 12px 0 8px; margin-bottom: 20px; }
  .artista-back { min-height: 40px; }
  .artista-header { gap: 16px; margin-bottom: 24px; }
  .artista-avatar { width: 76px; height: 76px; font-size: 30px; }
  .artista-name { font-size: 22px; overflow-wrap: anywhere; }
  .artista-track-item { min-height: 56px; }
  .artista-albums-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Telefoni stretti (≤ 380px) */
@media (max-width: 380px) {
  .profilo-body { padding-left: 10px; padding-right: 10px; }
  .profilo-cover-wrap { margin-left: -10px; margin-right: -10px; width: calc(100% + 20px); }
  .profilo-stats-row { gap: 28px; }
  .profilo-avatar-big { width: 116px; height: 116px; font-size: 48px; }
  .profilo-username { font-size: 23px; }
  .profilo-bottom-row { gap: 16px 10px; }
}

/* Tablet in verticale (561-768px): tre raccolte per riga, le card restano a misura di mano */
@media (min-width: 561px) and (max-width: 768px) {
  .profilo-bottom-row { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ============================================================
  Pulsanti "Profilo" / "I tuoi file" (dal 2026-10-03): centrati sotto l'eroe del proprio
  profilo e in testa alla vista "I tuoi file", come due schede dello stesso posto. Markup in
  _profiloSwitchHtml() (profilo.js). Stessa forma delle pillole dei generi della Home: la
  voce accesa e' piena, l'altra e' un contorno.
============================================================ */
.profilo-switch-slot:empty { display: none; }
.profilo-switch-slot, #cloud-view > .profilo-switch { display: flex; justify-content: center; margin: 0 0 26px; }
.profilo-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: var(--surface2);
  border: 1px solid var(--border);
}
#cloud-view > .profilo-switch.profilo-switch { width: fit-content; margin: 14px auto 22px; }  /* due classi: batte il margine laterale di cloud.css */
.profilo-switch-btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: color-mix(in srgb, var(--text) 72%, transparent);
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease;
}
.profilo-switch-btn:hover { color: var(--text); }
.profilo-switch-btn.active { background: var(--text); color: var(--bg); cursor: default; }

/* Pannello laterale delle cartelle (riusato dalla lista delle sezioni della Home): da chiuso
   sta appena fuori dallo schermo a destra e la sua ombra rientrava come striscia scura sul
   bordo di ogni vista, anche su desktop. Da chiuso, niente ombra. */
.profilo-folder-sidebar:not(.open) { box-shadow: none; }

/* ============================================================
  CORPO DEL PROFILO (dal 2026-10-03, al posto delle cartelle)
  Ultima uscita + Popolari, poi schede e griglia. Le card dei brani e le righe della
  classifica sono quelle della Home (home.css): qui solo l'impaginazione e i pezzi nuovi.
============================================================ */
.pf-body { margin-top: 6px; }
.pf-top {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  gap: 28px;
  margin-bottom: 34px;
}
.pf-eyebrow {
  font-size: 10px; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.pf-empty {
  grid-column: 1 / -1;
  padding: 28px 20px;
  border: 1px dashed var(--border);
  border-radius: 16px;
  text-align: center;
  font-size: 15px; font-weight: 600;
  color: color-mix(in srgb, var(--text) 68%, transparent);
}

/* Ultima uscita: card orizzontale grande, tutta toccabile */
.pf-latest-card {
  display: flex; gap: 18px; align-items: stretch;
  padding: 14px;
  border-radius: 20px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 9%, transparent);
  cursor: pointer;
  transition: background-color .18s ease;
}
.pf-latest-card:hover { background: color-mix(in srgb, var(--text) 7%, transparent); }
.pf-latest-art {
  flex: 0 0 auto;
  width: 168px; aspect-ratio: 1 / 1;
  border-radius: 14px; overflow: hidden;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(0,0,0,0.3);
}
.pf-latest-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-latest-ph { font-size: 44px; font-weight: 800; color: color-mix(in srgb, var(--text) 35%, transparent); }
.pf-latest-info { min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.pf-latest-kind {
  align-self: flex-start;
  padding: 3px 9px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--accent) 45%, transparent);
  color: var(--accent);
  font-size: 10px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase;
}
.pf-latest-title {
  font-size: 24px; font-weight: 800; letter-spacing: -0.4px; line-height: 1.15;
  color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pf-latest-credits { font-size: 13px; font-weight: 600; color: color-mix(in srgb, var(--text) 68%, transparent); }
.pf-latest-credits:empty { display: none; }
.pf-latest-plays {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums;
  color: color-mix(in srgb, var(--text) 62%, transparent);
}
.pf-latest-btn {
  align-self: flex-start;
  display: inline-flex; align-items: center; gap: 6px;
  height: 40px; padding: 0 18px; margin-top: 6px;
  border-radius: 999px;
  background: var(--accent); color: #fff;
  font-size: 14px; font-weight: 700;
}
.pf-latest-card.playing .pf-latest-title, .pf-latest-card:focus-visible .pf-latest-title { color: var(--accent); }

/* Popolari: righe della classifica della Home, in colonna */
.pf-popular-list { display: grid; gap: 2px; }
.pf-popular-list .home-chart-row { padding-right: 10px; }

/* Schede */
.pf-tabs {
  display: flex; gap: 8px;
  overflow-x: auto; scrollbar-width: none;
  margin-bottom: 16px; padding-bottom: 2px;
}
.pf-tabs::-webkit-scrollbar { display: none; }
.pf-tab {
  flex: 0 0 auto;
  display: inline-flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: color-mix(in srgb, var(--text) 72%, transparent);
  font-family: inherit; font-size: 14px; font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.pf-tab:hover { color: var(--text); border-color: color-mix(in srgb, var(--text) 40%, transparent); }
.pf-tab.active { background: var(--text); border-color: var(--text); color: var(--bg); }
.pf-tab-n { font-size: 12px; font-weight: 800; opacity: .65; font-variant-numeric: tabular-nums; }

/* Griglia: card della Home */
.pf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
  gap: 16px 10px;
}
.pf-album { padding: 8px 8px 10px; border-radius: 16px; cursor: pointer; }
.pf-album:hover { background: color-mix(in srgb, var(--text) 5%, transparent); }
.pf-album-art {
  aspect-ratio: 1 / 1; border-radius: 12px; overflow: hidden;
  background: var(--surface2);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 10px;
}
.pf-album-art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pf-album-title { font-size: 14px; font-weight: 800; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-album-meta { font-size: 12px; font-weight: 600; color: color-mix(in srgb, var(--text) 60%, transparent); margin-top: 2px; }
.pf-more-wrap { display: flex; justify-content: center; margin: 18px 0 30px; }
.pf-more {
  height: 40px; padding: 0 22px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 14px; font-weight: 700;
  cursor: pointer;
}
.pf-more:hover { border-color: var(--text); }
.pf-more[hidden] { display: none; }

/* Pulsante dell'audio del video in copertina: tondo, vetro scuro come gli altri pulsanti
   della copertina (colori fissi: sta sopra un video) */
.profilo-cover-mute-btn {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff;
  cursor: pointer;
  transition: background-color .15s ease;
}
.profilo-cover-mute-btn:hover { background: rgba(0,0,0,0.75); }

@media (max-width: 900px) {
  .pf-top { grid-template-columns: minmax(0, 1fr); gap: 26px; }
}
@media (max-width: 768px) {
  .pf-latest-card { gap: 14px; padding: 12px; }
  .pf-latest-art { width: 112px; }
  .pf-latest-title { font-size: 19px; }
  .pf-latest-btn { height: 38px; padding: 0 16px; }
  .pf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 6px; }
  .pf-tabs { margin-left: -14px; margin-right: -14px; padding-left: 14px; padding-right: 14px; }
}

/* Telefono: area di tocco del pulsante audio della cover a 36px. In fondo al file perche' la
   regola base `.profilo-cover-mute-btn` sta piu' sotto della sezione telefono e, a parita' di
   specificita', vincerebbe. */
@media (max-width: 768px) {
  .profilo-cover-mute-btn { width: 36px; height: 36px; }
}
