:root {
  --bg: #121212;
  --surface: #181818;
  --surface-2: #232323;
  --surface-3: #2e2e2e;
  --line: #2a2a2a;
  --text: #ffffff;
  --text-2: #b3b3b3;
  --text-3: #7c7c7c;
  --accent: #1db954;
  --accent-hi: #1ed760;
  --accent-ink: #000000;
  --danger: #f15e6c;
  --radius: 14px;
  --top-h: 56px;
  --tabs-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html { background: var(--bg); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
svg { fill: currentColor; }
h1, h2, h3 { margin: 0; }

/* ---------- Barra in alto ---------- */
.top {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 6px;
  min-height: calc(var(--top-h) + var(--safe-t));
  padding: var(--safe-t) 10px 0 16px;
  background: rgba(18, 18, 18, .94);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top h1 { flex: 1; font-size: 20px; font-weight: 800; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#backBtn { margin-left: -8px; }
.icon-btn {
  width: 40px; height: 40px; flex: none;
  display: grid; place-items: center;
  border: 0; border-radius: 50%; background: none; color: var(--text-2);
}
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 52%;
  height: 34px; padding: 0 12px;
  border: 0; border-radius: 17px; background: var(--surface-2); color: var(--text);
  font-size: 13px; font-weight: 600;
}
.chip span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chip svg { width: 16px; height: 16px; flex: none; color: var(--accent); }

/* ---------- Contenuto ---------- */
main {
  max-width: 720px; margin: 0 auto;
  padding: 16px 16px calc(var(--tabs-h) + var(--safe-b) + 24px);
}

.hero { display: flex; flex-direction: column; gap: 4px; padding: 8px 2px 20px; }
.hero-label { color: var(--text-2); font-size: 13px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; }
.hero-num { font-size: clamp(40px, 14vw, 56px); font-weight: 800; letter-spacing: -.03em; line-height: 1.05; color: var(--accent); font-variant-numeric: tabular-nums; }
.hero-num small { font-size: 22px; color: var(--text); font-weight: 700; letter-spacing: 0; }
.hero-sub { color: var(--text-2); font-size: 14px; }

.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 560px) { .tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.tile { display: flex; flex-direction: column; gap: 2px; padding: 14px; background: var(--surface); border-radius: var(--radius); min-width: 0; }
.tile-label { color: var(--text-2); font-size: 12px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-value { font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-sub { color: var(--text-3); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card { background: var(--surface); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; min-height: 32px; }
.card h2 { font-size: 17px; font-weight: 700; }
.more { color: var(--text-2); font-size: 13px; font-weight: 600; }
.hint { color: var(--text-2); font-size: 13px; margin: 0 0 10px; }
.hint.pad { padding: 24px 0; text-align: center; }
.list-card { padding-bottom: 6px; }
.list-card .row { margin: 0 -8px; }

/* ---------- Grafici ---------- */
.chart { position: relative; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.chart svg { display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .grid.base { stroke: var(--surface-3); }
.chart .axis { fill: var(--text-3); font-size: 10px; font-variant-numeric: tabular-nums; }
.chart .bar { fill: var(--accent); transition: fill .1s; }
.chart .bar.on { fill: var(--accent-hi); }
.chart .tip {
  position: absolute; top: -6px; pointer-events: none;
  display: flex; flex-direction: column; gap: 1px;
  padding: 6px 10px; border-radius: 8px;
  background: var(--surface-3); box-shadow: 0 4px 16px rgba(0, 0, 0, .5);
  font-size: 12px; white-space: nowrap; transform: translateY(-100%);
}
.chart .tip span { color: var(--text-2); }
.chart .tip b small { color: var(--text-2); font-weight: 500; }

/* ---------- Classifiche ---------- */
.toolbar { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.search {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px;
  height: 40px; padding: 0 12px; border-radius: 20px; background: var(--surface-2);
}
.search svg { width: 18px; height: 18px; flex: none; color: var(--text-2); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 15px; }
.search input::placeholder { color: var(--text-3); }
.count { color: var(--text-3); font-size: 12px; margin: 8px 2px 4px; }
.list { margin: 0 -8px; }

.row {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; align-items: center; gap: 10px;
  padding: 10px 8px; border-radius: 10px;
}
.row:active { background: var(--surface-2); }
.rank { color: var(--text-2); font-weight: 700; font-size: 15px; text-align: center; font-variant-numeric: tabular-nums; }
.main { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sub { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { display: block; height: 3px; margin-top: 5px; border-radius: 2px; background: var(--surface-3); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 2px; background: var(--accent); }
.nums { display: flex; flex-direction: column; align-items: flex-end; text-align: right; font-variant-numeric: tabular-nums; }
.nums b { font-size: 15px; white-space: nowrap; }
.nums small { color: var(--text-3); font-size: 12px; white-space: nowrap; }

/* ---------- Controlli segmentati ---------- */
.seg { display: inline-flex; flex: none; padding: 3px; gap: 2px; border-radius: 20px; background: var(--surface-2); }
.seg button {
  border: 0; background: none; color: var(--text-2);
  height: 32px; padding: 0 11px; border-radius: 16px; font-size: 13px; font-weight: 600; white-space: nowrap;
}
.seg button.on { background: var(--text); color: #000; }
.seg.wide { display: flex; width: 100%; margin-bottom: 12px; }
.seg.wide button { flex: 1; padding: 0 4px; }
.card-head .seg button { height: 28px; padding: 0 10px; }

/* ---------- Dettaglio ---------- */
.dhead { padding: 6px 2px 18px; }
.dkind { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.dname { font-size: 28px; font-weight: 800; line-height: 1.15; margin: 4px 0 6px; letter-spacing: -.02em; overflow-wrap: anywhere; }
.dsub { color: var(--text); font-weight: 600; text-decoration: underline; text-decoration-color: var(--text-3); text-underline-offset: 3px; }
.dsub.muted { color: var(--text-2); }
.dot { color: var(--text-3); margin: 0 8px; }

/* ---------- Benvenuto / impostazioni ---------- */
.welcome { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 24px 4px; }
.welcome img { border-radius: 22px; }
.welcome h2 { font-size: 24px; font-weight: 800; }
.welcome p { color: var(--text-2); margin: 0; max-width: 420px; }
.welcome .note { font-size: 13px; color: var(--text-3); }
.howto { width: 100%; text-align: left; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; margin-top: 8px; }
.card .howto { background: var(--surface-2); }
.howto summary { font-weight: 600; cursor: pointer; }
.howto ol { margin: 10px 0 0; padding-left: 20px; color: var(--text-2); font-size: 14px; }
.howto li { margin-bottom: 6px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 48px; padding: 0 22px; border: 0; border-radius: 24px;
  background: var(--surface-3); color: var(--text); font-weight: 700; font-size: 15px;
}
.btn svg { width: 20px; height: 20px; }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary:active { background: var(--accent-hi); }
.btn.danger { background: none; color: var(--danger); border: 1px solid var(--danger); margin-top: 12px; }
.btn.block { display: flex; width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }

.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0 0 12px; font-size: 14px; }
.facts dt { color: var(--text-2); }
.facts dd { margin: 0; text-align: right; font-weight: 600; }
.files summary { color: var(--text-2); font-size: 14px; cursor: pointer; }
.files ul { margin: 8px 0 0; padding-left: 18px; color: var(--text-3); font-size: 12px; max-height: 200px; overflow: auto; overflow-wrap: anywhere; }

.empty { text-align: center; color: var(--text-2); padding: 48px 16px; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.empty p { margin: 0; }
.loading { display: grid; place-items: center; padding: 80px 0; }

/* ---------- Schede in basso ---------- */
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tabs-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: rgba(12, 12, 12, .97); border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tabs a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3); font-size: 11px; font-weight: 600; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a.on { color: var(--text); }
.tabs a.on svg { color: var(--accent); }

/* ---------- Pannello filtri ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .6); opacity: 0; transition: opacity .2s; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 720px; margin: 0 auto;
  max-height: 90vh; overflow: auto;
  padding: 8px 16px calc(16px + var(--safe-b));
  background: var(--surface); border-radius: 18px 18px 0 0;
  transform: translateY(100%); transition: transform .2s ease-out;
}
.sheet.open .sheet-backdrop { opacity: 1; }
.sheet.open .sheet-panel { transform: none; }
.grab { width: 40px; height: 4px; border-radius: 2px; background: var(--surface-3); margin: 0 auto 12px; }
.sheet h3 { font-size: 20px; font-weight: 800; margin-bottom: 14px; }
.lbl { display: block; color: var(--text-2); font-size: 13px; font-weight: 600; margin: 4px 0 8px; }
.field { margin: -4px 0 14px; }
.field select, .field input {
  width: 100%; height: 44px; padding: 0 12px;
  border: 1px solid var(--surface-3); border-radius: 10px; background: var(--surface-2); outline: 0;
}
.field.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field.two label { display: flex; flex-direction: column; gap: 4px; color: var(--text-2); font-size: 12px; }
.field.two input { color: var(--text); font-size: 15px; }
.switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; margin-bottom: 8px; }
.switch span { display: flex; flex-direction: column; }
.switch small { color: var(--text-2); font-size: 12px; }
.switch.disabled { opacity: .5; }
.switch input {
  -webkit-appearance: none; appearance: none; flex: none;
  width: 48px; height: 28px; border-radius: 14px; background: var(--surface-3); position: relative; transition: background .15s;
}
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked { background: var(--accent); }
.switch input:checked::after { transform: translateX(20px); }
.sheet-actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; margin-top: 6px; }

/* ---------- Avatar e profilo ---------- */
.avatar-btn {
  width: 36px; height: 36px; flex: none; margin-left: 4px; padding: 0;
  display: grid; place-items: center; overflow: hidden;
  border: 2px solid transparent; border-radius: 50%; background: var(--surface-3);
  font-weight: 800; font-size: 15px; color: var(--text);
}
.avatar-btn.on { border-color: var(--accent); }
.avatar-btn img, .profile-avatar img, .welcome-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.profile-head { display: flex; align-items: center; gap: 16px; padding: 8px 2px 20px; }
.profile-avatar, .welcome-avatar {
  width: 72px; height: 72px; flex: none; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center; background: var(--surface-3); font-size: 28px; font-weight: 800;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}
.welcome-avatar { width: 88px; height: 88px; font-size: 34px; }
.profile-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.profile-info h2 { font-size: 24px; font-weight: 800; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 11px;
  background: rgba(29, 185, 84, .15); color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.row.live { grid-template-columns: 34px 48px minmax(0, 1fr) auto; }
.row.live:not(:has(.rank)) { grid-template-columns: 48px minmax(0, 1fr) auto; }
.thumb { width: 48px; height: 48px; border-radius: 6px; object-fit: cover; background: var(--surface-3); display: block; }
.thumb.round { border-radius: 50%; }
.hint.small { font-size: 12px; color: var(--text-3); }
.loading.small { padding: 32px 0; }
.btn.small { height: 36px; padding: 0 16px; font-size: 14px; background: none; border: 1px solid var(--text-3); }
.btn.spotify { height: 52px; padding: 0 28px; border-radius: 26px; background: var(--accent); color: var(--accent-ink); font-size: 16px; }
.btn.spotify svg { width: 24px; height: 24px; }
.btn.spotify:hover:not(:disabled) { background: var(--accent-hi); transform: scale(1.02); }
.btn:disabled { opacity: .5; }
.btn { transition: transform .1s, background .15s; cursor: pointer; }
.welcome .more { margin-top: 6px; color: var(--accent); }
.tabs-brand, .tabs .tabs-extra { display: none !important; }

/* ---------- Foto e copertine ---------- */
.pic {
  display: block; flex: none; background: var(--surface-3) center / cover no-repeat;
  border-radius: 6px; position: relative; overflow: hidden;
}
.pic::after { /* nota musicale di riserva finché non arriva l'immagine */
  content: ""; position: absolute; inset: 0; margin: auto; width: 40%; height: 40%; opacity: .35;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4h11v12.5a3.5 3.5 0 1 1-2-3.2V8h-7v10.5a3.5 3.5 0 1 1-2-3.2z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 4h11v12.5a3.5 3.5 0 1 1-2-3.2V8h-7v10.5a3.5 3.5 0 1 1-2-3.2z'/%3E%3C/svg%3E") center / contain no-repeat;
  color: var(--text-2);
}
.pic.loaded::after { display: none; }
.pic.loaded { animation: picIn .35s ease-out; }
@keyframes picIn { from { opacity: 0; } to { opacity: 1; } }
.pic.round { border-radius: 50%; }
.pic.thumb { width: 48px; height: 48px; }
.row.with-pic { grid-template-columns: 26px 48px minmax(0, 1fr) auto; gap: 12px; }

/* Hero della panoramica con la foto dell'artista n.1 */
.hero { position: relative; overflow: hidden; border-radius: 20px; margin: 0 0 22px; padding: 0; background: var(--surface); isolation: isolate; }
.hero .hero-bg { position: absolute; inset: 0; border-radius: 0; z-index: -2; transform: scale(1.15); filter: blur(28px) saturate(1.3); opacity: .55; }
.hero .hero-bg::after { display: none; }
.hero::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(18, 18, 18, .2) 0%, rgba(18, 18, 18, .85) 100%); }
.hero-body { display: flex; flex-direction: column; gap: 4px; padding: 22px 20px 18px; }
.hero-label { color: rgba(255, 255, 255, .8); }
.hero-sub { color: rgba(255, 255, 255, .78); }
.hero-top {
  display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 12px;
  margin-top: 14px; padding: 8px 12px 8px 8px; border-radius: 14px;
  background: rgba(0, 0, 0, .35); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hero-top .pic.mini { width: 44px; height: 44px; }
.hero-top span { display: flex; flex-direction: column; min-width: 0; }
.hero-top small { color: rgba(255, 255, 255, .7); font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.hero-top b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hero-top em { font-style: normal; font-weight: 800; color: var(--accent); }

/* Caroselli */
.shelf { margin: 0 0 22px; }
.shelf .card-head { padding: 0 2px; }
.carousel {
  display: grid; grid-auto-flow: column; grid-auto-columns: 132px; gap: 14px;
  overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 16px; margin: 0 -16px; padding: 4px 16px 8px;
  scrollbar-width: none;
}
.carousel::-webkit-scrollbar { display: none; }
.tile-pic { display: flex; flex-direction: column; gap: 3px; scroll-snap-align: start; min-width: 0; }
.tile-pic .pic.cover { width: 132px; height: 132px; margin-bottom: 8px; box-shadow: 0 10px 24px rgba(0, 0, 0, .45); transition: transform .15s; }
.tile-pic:hover .pic.cover, .tile-pic:active .pic.cover { transform: translateY(-3px); }
.tile-pic b { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile-pic small { color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* In ascolto ora */
.np-wrap:empty { display: none; }
.np-wrap { margin-bottom: 16px; }
.np-card {
  position: relative; isolation: isolate; overflow: hidden;
  display: grid; grid-template-columns: 76px minmax(0, 1fr); align-items: center; gap: 14px;
  padding: 12px; border-radius: 18px; background: var(--surface-2);
}
.np-bg { position: absolute; inset: 0; z-index: -2; background: center / cover no-repeat; transform: scale(1.4); filter: blur(30px) saturate(1.4); opacity: .6; }
.np-card::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(90deg, rgba(0, 0, 0, .55), rgba(0, 0, 0, .25)); }
.np-art { width: 76px; height: 76px; border-radius: 10px; object-fit: cover; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); background: var(--surface-3); }
.np-info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.np-info b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-info > span:not(.np-label):not(.np-bar):not(.np-time) { color: rgba(255, 255, 255, .78); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.np-label { display: flex; align-items: center; gap: 7px; color: var(--accent); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; margin-bottom: 2px; }
.np-bar { display: block; height: 4px; margin-top: 8px; border-radius: 2px; background: rgba(255, 255, 255, .2); overflow: hidden; }
.np-bar i { display: block; height: 100%; width: 0; background: #fff; border-radius: 2px; transition: width 1s linear; }
.np-time { color: rgba(255, 255, 255, .6); font-size: 11px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.np-off { grid-template-columns: 44px minmax(0, 1fr) auto; }
.np-icon { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: rgba(29, 185, 84, .15); color: var(--accent); }
.np-icon svg { width: 22px; height: 22px; }
.np-off .np-info span { white-space: normal !important; color: var(--text-2) !important; }
.eq { display: inline-flex; align-items: flex-end; gap: 2px; height: 12px; }
.eq i { width: 3px; background: var(--accent); border-radius: 1px; animation: eq 1s ease-in-out infinite; }
.eq i:nth-child(2) { animation-delay: -.4s; }
.eq i:nth-child(3) { animation-delay: -.7s; }
@keyframes eq { 0%, 100% { height: 30%; } 50% { height: 100%; } }

/* Intestazione del dettaglio con foto grande */
.dhead { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 16px; margin: -16px -16px 18px; padding: 28px 16px 22px; overflow: hidden; }
.dhead .dhead-bg { position: absolute; inset: 0; z-index: -2; border-radius: 0; transform: scale(1.3); filter: blur(40px) saturate(1.4); opacity: .7; }
.dhead .dhead-bg::after { display: none; }
.dhead::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(180deg, rgba(18, 18, 18, .1), var(--bg) 96%); }
.dhead-pic { width: 180px; height: 180px; border-radius: 10px; box-shadow: 0 18px 50px rgba(0, 0, 0, .6); }
.dhead-pic.round { border-radius: 50%; }
.dhead-text { display: flex; flex-direction: column; align-items: center; min-width: 0; max-width: 100%; }
.dlinks { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; }

/* Sfumatura verde in cima alle pagine dell'app */
body:not(.is-landing) {
  background: radial-gradient(120% 420px at 50% -120px, rgba(29, 185, 84, .16), transparent 70%) no-repeat, var(--bg);
}

@media (min-width: 720px) {
  .carousel { grid-auto-columns: 160px; margin: 0; padding: 4px 0 8px; }
  .tile-pic .pic.cover { width: 160px; height: 160px; }
  .hero-body { padding: 30px 28px 24px; }
  .dhead { flex-direction: row; align-items: flex-end; text-align: left; padding: 40px 32px 26px; margin: -16px -32px 22px; }
  .dhead-pic { width: 200px; height: 200px; }
  .dhead-text { align-items: flex-start; }
  .dhead .dname { font-size: clamp(32px, 4vw, 56px); }
  .dlinks { justify-content: flex-start; }
}

/* ---------- Mappe di calore ---------- */
.hm-week { display: grid; grid-template-columns: 30px repeat(24, minmax(0, 1fr)); gap: 2px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.hm-x { color: var(--text-3); font-size: 10px; padding-bottom: 2px; }
.hm-y { color: var(--text-3); font-size: 10px; align-self: center; }
.hm-week i, .hm-cal i, .hm-legend i { display: block; aspect-ratio: 1; border-radius: 2px; background: var(--surface-3); }
.hm-cal { display: grid; grid-template-rows: repeat(7, auto); grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 2px; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.hm-cal i.pad { background: none; }
i.l1 { background: rgba(29, 185, 84, .28) !important; }
i.l2 { background: rgba(29, 185, 84, .5) !important; }
i.l3 { background: rgba(29, 185, 84, .75) !important; }
i.l4 { background: var(--accent) !important; }
.hm-week i.on, .hm-cal i.on { outline: 2px solid #fff; outline-offset: 0; }
.hm-legend { display: flex; align-items: center; justify-content: flex-end; gap: 3px; margin-top: 10px; color: var(--text-3); font-size: 11px; }
.hm-legend i { width: 11px; height: 11px; }

/* ---------- Recap ---------- */
.recap-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.recap-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 4px; }
@media (min-width: 720px) { .recap-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.recap-tile {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end; gap: 2px;
  min-height: 132px; padding: 12px; border-radius: 16px; overflow: hidden; isolation: isolate;
  background: linear-gradient(150deg, #1db954 0%, #127a37 55%, #0b3d1e 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35); transition: transform .15s;
}
.recap-tile.k-m { background: linear-gradient(150deg, #7b5cff 0%, #4b2fb3 55%, #22155a 100%); }
.recap-tile.k-y { background: linear-gradient(150deg, #ff8a3d 0%, #d4492b 55%, #5c1a12 100%); }
.recap-tile::before { content: ""; position: absolute; right: -30px; top: -30px; width: 110px; height: 110px; border-radius: 50%; background: rgba(255, 255, 255, .12); z-index: -1; }
.recap-tile:active, .recap-tile:hover { transform: translateY(-2px); }
.recap-tile .badge { position: absolute; top: 10px; left: 10px; background: rgba(0, 0, 0, .35); color: #fff; }
.recap-tile .badge::before { background: #fff; }
.rt-kind { color: rgba(255, 255, 255, .8); font-size: 11px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.recap-tile b { font-size: 15px; line-height: 1.2; }
.rt-num { font-size: 20px; font-weight: 900; }
.recap-view { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.recap-frame { width: 100%; max-width: 380px; aspect-ratio: 9 / 16; border-radius: 18px; overflow: hidden; background: var(--surface); box-shadow: 0 20px 60px rgba(0, 0, 0, .6); display: grid; place-items: center; }
.recap-frame img { width: 100%; height: 100%; display: block; }
.recap-frame .loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 0; }
.recap-actions { display: flex; gap: 10px; width: 100%; max-width: 380px; }
.recap-actions .btn { flex: 1; }

/* ---------- Oggi ---------- */
.today-card {
  display: flex; flex-direction: column; gap: 12px; margin-bottom: 16px; padding: 16px;
  border-radius: 18px; background: linear-gradient(135deg, #1e2a22 0%, var(--surface) 70%);
  border: 1px solid rgba(29, 185, 84, .18);
}
.today-head { display: flex; align-items: center; gap: 8px; }
.today-head b { font-size: 17px; }
.today-head em { margin-left: auto; font-style: normal; color: var(--accent); font-size: 13px; font-weight: 700; }
.today-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(29, 185, 84, .2); animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(29, 185, 84, 0); } }
.today-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.today-stats span { display: flex; flex-direction: column; }
.today-stats b { font-size: 24px; font-weight: 900; font-variant-numeric: tabular-nums; }
.today-stats small { color: var(--text-2); font-size: 12px; }
.today-covers { display: flex; align-items: center; min-width: 0; }
.today-covers .pic.cover-s { width: 40px; height: 40px; border-radius: 6px; margin-right: -10px; border: 2px solid var(--surface); box-shadow: 0 4px 10px rgba(0, 0, 0, .4); }
.today-covers small { margin-left: 20px; color: var(--text-2); font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }

.day-nav { display: grid; grid-template-columns: 40px 1fr 40px; align-items: center; gap: 8px; margin-bottom: 14px; }
.day-nav > span:not(.icon-btn) { display: flex; flex-direction: column; align-items: center; text-align: center; }
.day-nav b { font-size: 20px; font-weight: 800; }
.day-nav small { color: var(--text-2); font-size: 12px; }
.day-nav a.icon-btn { background: var(--surface-2); color: var(--text); }
.tile-artist { display: grid; grid-template-columns: 40px minmax(0, 1fr); column-gap: 10px; align-items: center; grid-column: span 2; }
.tile-artist .pic.mini { width: 40px; height: 40px; grid-row: span 3; }
@media (min-width: 560px) { .tile-artist { grid-column: auto; } }

.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 51px; top: 6px; bottom: 6px; width: 2px; background: var(--surface-3); border-radius: 1px; }
.tl-hour { padding: 14px 0 6px 64px; }
.tl-hour:first-child { padding-top: 2px; }
.tl-hour span { color: var(--accent); font-size: 12px; font-weight: 800; letter-spacing: .06em; }
.tl-item { display: grid; grid-template-columns: 40px 24px minmax(0, 1fr); align-items: center; }
.tl-item time { color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; text-align: right; padding-right: 2px; }
.tl-dot { justify-self: center; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); border: 2px solid var(--surface); position: relative; z-index: 1; }
.tl-item.skipped .tl-dot { background: var(--text-3); }
.tl-item.skipped .name { color: var(--text-2); }
.tl-body { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 6px 6px; border-radius: 10px; min-width: 0; }
.tl-body:active, .tl-body:hover { background: var(--surface-2); }
.tl-body .pic.thumb { width: 44px; height: 44px; }
.tl-dur { display: flex; flex-direction: column; align-items: flex-end; color: var(--text-2); font-size: 12px; font-variant-numeric: tabular-nums; }
.tl-dur small { color: var(--text-3); font-size: 10px; }

/* ---------- Esplora ---------- */
.x-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .x-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.x-card {
  position: relative; overflow: hidden; isolation: isolate; display: flex; flex-direction: column; gap: 4px;
  min-height: 118px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid #262626;
  transition: transform .15s;
}
.x-card:active, .x-card:hover { transform: translateY(-2px); }
.x-card svg { width: 26px; height: 26px; margin-bottom: auto; }
.x-card b { font-size: 15px; margin-top: 10px; }
.x-card small { color: var(--text-2); font-size: 12px; line-height: 1.35; }
.x-card::after { content: ""; position: absolute; right: -40px; bottom: -40px; width: 120px; height: 120px; border-radius: 50%; z-index: -1; opacity: .22; background: currentColor; }
.x-today { color: #1db954; } .x-memories { color: #3987e5; } .x-records { color: #c98500; } .x-compare { color: #199e70; }
.x-obsessions { color: #d55181; } .x-genres { color: #9085e9; } .x-story { color: #d95926; } .x-recap { color: #1db954; }
.x-card b, .x-card small { color: var(--text); } .x-card small { color: var(--text-2); }

.mem-card { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 14px; align-items: center; margin-bottom: 16px; padding: 12px; border-radius: 18px;
  background: linear-gradient(135deg, #17243a 0%, var(--surface) 75%); border: 1px solid rgba(57, 135, 229, .25); }
.mem-card .pic.cover-m { width: 76px; height: 76px; border-radius: 10px; box-shadow: 0 8px 20px rgba(0, 0, 0, .5); }
.mem-info { display: flex; flex-direction: column; min-width: 0; gap: 1px; }
.mem-info .np-label { color: #6aa8f0; }
.mem-info .np-label svg { width: 14px; height: 14px; }
.mem-info b { font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem-info > span:not(.np-label) { color: var(--text-2); font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem-info small { color: var(--text-3); font-size: 12px; }
.mem-artist { display: flex; align-items: center; gap: 10px; padding: 8px; margin: 0 -8px 4px; border-radius: 10px; }
.mem-artist .pic.mini { width: 40px; height: 40px; }
.mem-artist span { display: flex; flex-direction: column; }
.mem-artist small { color: var(--text-2); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }

.rec-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 16px; }
@media (min-width: 720px) { .rec-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.rec-card { display: flex; flex-direction: column; gap: 3px; padding: 14px; border-radius: 16px; background: var(--surface); min-width: 0; }
.rec-icon { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: rgba(201, 133, 0, .16); color: #e5a52a; margin-bottom: 6px; }
.rec-icon svg { width: 20px; height: 20px; }
.rec-label { color: var(--text-2); font-size: 12px; font-weight: 700; }
.rec-value { font-size: 22px; font-weight: 900; }
.rec-sub { color: var(--text-3); font-size: 12px; line-height: 1.35; overflow-wrap: anywhere; }
.rec-sub b { color: var(--text-2); }

.cmp-head { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; margin-bottom: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface); }
.cmp-head span:not(.vs) { display: flex; flex-direction: column; min-width: 0; }
.cmp-head span:last-child { text-align: right; }
.cmp-head small { color: var(--text-3); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; font-weight: 700; }
.cmp-head b { font-size: 15px; }
.vs { color: var(--accent); font-weight: 900; }
.dl { font-weight: 800; }
.dl.up { color: var(--accent); }
.dl.down { color: var(--danger); }
.mv { font-size: 12px; font-weight: 800; color: var(--text-3); }
.mv.up { color: var(--accent); }
.mv.down { color: var(--danger); }
.mv.new { color: #6aa8f0; font-size: 10px; letter-spacing: .06em; }
.chip { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 800; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.chip.gone { background: rgba(241, 94, 108, .15); color: #f58a95; }
.chip.now { background: rgba(29, 185, 84, .15); color: var(--accent); }
.obs-row .nums small { margin-top: 3px; }

.count-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.pl-btn { display: inline-flex; gap: 6px; height: 32px; padding: 0 12px; font-size: 13px; border-color: var(--surface-3); flex: none; }
.pl-btn svg { width: 16px; height: 16px; }
.dhead-text .pl-btn { margin-top: 12px; background: rgba(0, 0, 0, .3); }
.pl-done { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 6px 0 4px; }
.pl-done > svg { width: 44px; height: 44px; color: var(--accent); }
.pl-done .btn { width: 100%; }

.genre-row { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 12px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.stack-rows { display: flex; flex-direction: column; gap: 8px; }
.stack-row { display: grid; grid-template-columns: 40px 1fr; align-items: center; gap: 10px; font-size: 12px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.stack { display: flex; gap: 2px; height: 18px; }
.stack i { display: block; height: 100%; border-radius: 3px; cursor: pointer; }
.stack i:first-child { border-radius: 4px 3px 3px 4px; }

/* ---------- Storia animata ---------- */
body.is-story .top, body.is-story .tabs { display: none !important; }
body.is-story { padding-left: 0 !important; overflow: hidden; }
body.is-story main { max-width: none; padding: 0; }
.story { position: fixed; inset: 0; z-index: 20; background: #000; user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.story-bars { position: absolute; z-index: 3; top: calc(10px + var(--safe-t)); left: 10px; right: 10px; display: flex; gap: 4px; }
.story-bars span { flex: 1; height: 3px; border-radius: 2px; background: rgba(255, 255, 255, .3); overflow: hidden; }
.story-bars i { display: block; height: 100%; width: 0; background: #fff; }
.story-close { position: absolute; z-index: 3; top: calc(22px + var(--safe-t)); right: 12px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .3); color: #fff; font-size: 26px; line-height: 1; cursor: pointer; }
.story-stage { position: absolute; inset: 0; max-width: 520px; margin: 0 auto; overflow: hidden; }
.st {
  position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; gap: 14px;
  padding: calc(70px + var(--safe-t)) 28px calc(40px + var(--safe-b)); color: #fff;
  background: linear-gradient(160deg, #1db954 0%, #0d5c2a 55%, #06200f 100%);
}
.st > * { opacity: 0; transform: translateY(18px); }
.st.in > * { animation: stIn .6s cubic-bezier(.2, .8, .2, 1) forwards; }
.st.in > *:nth-child(2) { animation-delay: .12s; } .st.in > *:nth-child(3) { animation-delay: .24s; }
.st.in > *:nth-child(4) { animation-delay: .36s; } .st.in > *:nth-child(5) { animation-delay: .48s; } .st.in > *:nth-child(6) { animation-delay: .6s; }
@keyframes stIn { to { opacity: 1; transform: none; } }
.st h1 { font-size: clamp(44px, 13vw, 64px); line-height: 1; font-weight: 900; letter-spacing: -.03em; }
.st h1 em { font-style: normal; color: #0b0b0b; }
.st h2 { font-size: clamp(32px, 9vw, 46px); line-height: 1.05; font-weight: 900; letter-spacing: -.02em; overflow-wrap: anywhere; }
.st p { margin: 0; font-size: 18px; line-height: 1.45; color: rgba(255, 255, 255, .88); }
.st b { color: #fff; }
.st-kicker { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: rgba(255, 255, 255, .8); }
.st-small { font-size: 15px !important; }
.st-big { font-size: clamp(64px, 22vw, 120px); font-weight: 900; letter-spacing: -.04em; line-height: .95; font-variant-numeric: tabular-nums; }
.st-unit { font-size: 26px; font-weight: 800; margin-top: -8px; }
.st-delta { font-weight: 800; }
.st-delta.up { color: #b8ffd0 !important; } .st-delta.down { color: #ffc2c8 !important; }
.st-avatar { width: 120px; height: 120px; border-radius: 50%; overflow: hidden; display: grid; place-items: center; background: rgba(0, 0, 0, .25); font-size: 48px; font-weight: 900; box-shadow: 0 16px 40px rgba(0, 0, 0, .35); }
.st-avatar img { width: 100%; height: 100%; object-fit: cover; }
.st-minutes { background: linear-gradient(160deg, #3987e5 0%, #1c4a8a 55%, #0a1a33 100%); }
.st-artist { background: linear-gradient(160deg, #d55181 0%, #7a2348 60%, #250a16 100%); align-items: flex-start; }
.st-track { background: linear-gradient(160deg, #d95926 0%, #7d2f10 60%, #2a0f05 100%); }
.st-genre { background: linear-gradient(160deg, #9085e9 0%, #4a3fa6 60%, #16123a 100%); }
.st-persona { background: linear-gradient(160deg, #199e70 0%, #0c5a3f 60%, #041d14 100%); }
.st-records { background: linear-gradient(160deg, #c98500 0%, #6d4700 60%, #221600 100%); }
.st-list { background: linear-gradient(170deg, #222 0%, #111 100%); }
.st-outro { background: linear-gradient(160deg, #1db954 0%, #0b0b0b 85%); }
.st .pic.st-photo { width: min(68vw, 300px); height: min(68vw, 300px); border-radius: 50%; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); align-self: center; }
.st .pic.st-cover { width: min(70vw, 300px); height: min(70vw, 300px); border-radius: 12px; box-shadow: 0 24px 60px rgba(0, 0, 0, .5); }
.st-list ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; counter-reset: s; }
.st-list li { counter-increment: s; display: grid; grid-template-columns: 28px 60px minmax(0, 1fr); align-items: center; gap: 14px; }
.st-list li::before { content: counter(s); font-size: 22px; font-weight: 900; color: var(--accent); }
.st .pic.st-thumb { width: 60px; height: 60px; border-radius: 50%; }
.st .pic.st-thumb.sq { border-radius: 8px; }
.st-list li span { display: flex; flex-direction: column; min-width: 0; }
.st-list li b { font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-list li small { color: rgba(255, 255, 255, .65); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.st-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.st-chips span { padding: 8px 14px; border-radius: 20px; background: rgba(255, 255, 255, .15); font-weight: 700; }
.st-records p { display: flex; flex-direction: column; }
.st-records p b { font-size: 40px; font-weight: 900; line-height: 1.1; }
.st-records p small { font-size: 15px; color: rgba(255, 255, 255, .8); }
.st-actions { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.st-actions .btn { width: 100%; }
.st-outro .btn:not(.primary) { background: rgba(255, 255, 255, .14); }

/* ---------- Album mancanti ---------- */
.album-missing { padding: 36px 8px; }
.album-missing .pic.big { width: 96px; height: 96px; border-radius: 12px; }
.album-missing p { max-width: 440px; }

/* ---------- Pagina di accesso ---------- */
body.is-landing .top { display: none; }
body.is-landing main { max-width: none; padding: 0; }
.landing {
  min-height: 100vh;
  background:
    radial-gradient(1000px 600px at 85% -10%, rgba(29, 185, 84, .28), transparent 60%),
    radial-gradient(700px 500px at -10% 40%, rgba(29, 185, 84, .10), transparent 60%),
    var(--bg);
}
.landing > * { max-width: 1120px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.l-nav { display: flex; align-items: center; height: 72px; padding-top: var(--safe-t); }
.brand { display: inline-flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 800; letter-spacing: -.01em; }
.brand img { border-radius: 8px; }
.l-hero { display: grid; gap: 40px; padding-top: 28px; padding-bottom: 56px; align-items: center; }
.l-copy { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.eyebrow { color: var(--accent); font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.l-copy h1 { font-size: clamp(40px, 11vw, 72px); line-height: 1.02; font-weight: 900; letter-spacing: -.035em; }
.l-copy h1 em { font-style: normal; color: var(--accent); }
.lead { margin: 0; color: var(--text-2); font-size: 18px; line-height: 1.5; max-width: 520px; }
.fine { margin: 0; color: var(--text-3); font-size: 13px; max-width: 420px; }
.fine code { color: var(--text-2); }
.l-preview { display: flex; justify-content: center; }
.pv-card {
  width: 100%; max-width: 380px; padding: 22px; border-radius: 20px;
  background: linear-gradient(160deg, #222 0%, #161616 100%);
  border: 1px solid #2c2c2c; box-shadow: 0 30px 80px rgba(0, 0, 0, .6), 0 0 0 1px rgba(255, 255, 255, .02) inset;
  display: flex; flex-direction: column; gap: 10px; transform: rotate(-1.5deg);
}
.pv-label { color: var(--text-2); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.pv-num { color: var(--accent); font-size: 44px; font-weight: 900; letter-spacing: -.03em; line-height: 1; }
.pv-num small { color: var(--text); font-size: 18px; letter-spacing: 0; }
.pv-bars { display: flex; align-items: flex-end; gap: 4px; height: 90px; margin: 6px 0 8px; }
.pv-bars i { flex: 1; background: var(--accent); border-radius: 3px 3px 0 0; opacity: .9; }
.pv-row { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-top: 1px solid #2a2a2a; }
.pv-row b { color: var(--text-2); text-align: center; }
.pv-row span { display: flex; flex-direction: column; }
.pv-row em { font-style: normal; font-weight: 700; font-size: 14px; }
.pv-row small { color: var(--text-3); font-size: 12px; }
.l-features { display: grid; gap: 14px; padding-bottom: 56px; }
.l-features article { padding: 22px; border-radius: 16px; background: rgba(255, 255, 255, .03); border: 1px solid #242424; }
.l-features svg { width: 28px; height: 28px; color: var(--accent); }
.l-features h3 { font-size: 17px; margin: 12px 0 6px; }
.l-features p { margin: 0; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.l-steps { padding-bottom: 56px; }
.l-steps h2 { font-size: 28px; font-weight: 900; letter-spacing: -.02em; margin-bottom: 18px; }
.l-steps ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: s; }
.l-steps li { counter-increment: s; display: grid; grid-template-columns: 44px 1fr; grid-template-rows: auto auto; column-gap: 14px; align-items: center; }
.l-steps li::before {
  content: counter(s); grid-row: span 2; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; background: var(--surface-2); color: var(--accent); font-weight: 900; font-size: 18px;
}
.l-steps li b { font-size: 16px; }
.l-steps li span { color: var(--text-2); font-size: 14px; }
.l-foot { padding-top: 24px; padding-bottom: calc(32px + var(--safe-b)); border-top: 1px solid #222; }
.l-foot p { margin: 0; color: var(--text-3); font-size: 12px; }

@media (min-width: 720px) {
  .l-features { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1000px) {
  .l-hero { grid-template-columns: 1.15fr .85fr; padding-top: 64px; padding-bottom: 96px; }
  .l-features { grid-template-columns: repeat(4, 1fr); }
  .l-steps ol { grid-template-columns: repeat(3, 1fr); }

  /* Barra laterale su schermi grandi */
  body:not(.is-landing) { padding-left: 240px; }
  .tabs {
    top: 0; bottom: 0; right: auto; width: 240px; height: auto;
    display: flex; flex-direction: column; gap: 4px; padding: 18px 12px;
    border-top: 0; border-right: 1px solid var(--line); background: #0d0d0d;
  }
  .tabs-brand { display: flex !important; align-items: center; gap: 10px; padding: 6px 12px 22px; font-size: 18px; font-weight: 800; }
  .tabs-brand img { border-radius: 7px; }
  .tabs .tabs-extra { display: flex !important; margin-top: auto; }
  .tabs .tabs-recap { margin-top: 0; }
  .tabs a { flex-direction: row; justify-content: flex-start; gap: 14px; height: 46px; padding: 0 14px; border-radius: 10px; font-size: 14px; flex: none; }
  .tabs a:hover { color: var(--text); background: var(--surface); }
  .tabs a.on { background: var(--surface-2); }
  .top { padding-left: 32px; padding-right: 24px; }
  main { padding-left: 32px; padding-right: 32px; max-width: 980px; padding-bottom: 48px; }
  .toast { bottom: 24px; }
  .row:hover { background: var(--surface-2); }
}

/* ---------- Overlay di caricamento e messaggi ---------- */
.busy {
  position: fixed; inset: 0; z-index: 40;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: rgba(0, 0, 0, .8); padding: 24px; text-align: center;
}
.busy p { margin: 0; color: var(--text-2); white-space: pre-line; overflow-wrap: anywhere; }
.spinner { width: 40px; height: 40px; border-radius: 50%; border: 4px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.toast {
  position: fixed; left: 16px; right: 16px; z-index: 50; max-width: 520px; margin: 0 auto;
  bottom: calc(var(--tabs-h) + var(--safe-b) + 12px);
  padding: 12px 16px; border-radius: 10px; background: var(--text); color: #000; font-size: 14px; font-weight: 600;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .5);
}
