:root {
  --ink: #101820;
  --navy: #12273d;
  --cream: #f4f1ea;
  --paper: #fbfaf7;
  --white: #fff;
  --muted: #6c7580;
  --line: #d9d8d3;
  --blue: #198fc8;
  --green: #15965f;
  --red: #df4051;
  --yellow: #e4b326;
  --shadow: 0 22px 60px rgba(18, 39, 61, .12);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--cream); font-family: "DM Sans", system-ui, sans-serif; }
button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
.hidden { display: none !important; }
.italian-line { height: 5px; display: grid; grid-template-columns: repeat(3,1fr); position: fixed; inset: 0 0 auto; z-index: 20; }
.italian-line i:nth-child(1) { background:#168754; }.italian-line i:nth-child(2) { background:#fff; }.italian-line i:nth-child(3) { background:#d92536; }
.site-header { min-height: 110px; padding: 10px max(24px,calc((100vw - 1240px)/2)) 5px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 28px; background: rgba(10,27,44,.97); border-bottom: 1px solid #ffffff1a; position: sticky; top: 0; z-index: 15; backdrop-filter: blur(14px); }
.brand { display: inline-flex; align-items: center; color: var(--navy); text-decoration: none; width: max-content; }
.brand-logo { display:block; width:254px; max-width:100%; height:auto; }
.main-nav { display:flex; align-items:center; gap:6px; background:#ffffff17; padding:5px; border:1px solid #ffffff17; border-radius:999px; }
.nav-tab { border:0; border-radius:999px; padding:10px 19px; color:#c5d0da; background:transparent; cursor:pointer; font-weight:700; font-size:13px; }
.nav-tab.active { background:#fff; color:var(--navy); box-shadow:0 5px 14px #0003; }
.admin-link { justify-self:end; color:#fff; text-decoration:none; font-size:12px; font-weight:700; border-bottom:1px solid #ffffffb8; padding-bottom:2px; }
main { overflow:hidden; }
.hero { max-width:1240px; margin:auto; padding:72px 24px 64px; display:grid; grid-template-columns:1fr 300px; gap:70px; align-items:end; }
.eyebrow,.section-kicker { margin:0 0 15px; font:800 11px/1 "Manrope"; letter-spacing:.23em; color:var(--blue); }
.hero h1 { font:800 clamp(48px,7vw,91px)/.95 "Manrope"; max-width:780px; letter-spacing:-.06em; margin:0; color:var(--navy); }
.issue-card { background:var(--navy); color:white; border-radius:22px; padding:27px; box-shadow:var(--shadow); }
.issue-card span,.issue-card label { display:block; text-transform:uppercase; letter-spacing:.18em; font-size:9px; color:#a9b8c7; }
.issue-card strong { display:block; font:800 27px/1 "Manrope"; margin:9px 0 25px; }
.issue-card label { margin-bottom:8px; }
.issue-card select { width:100%; color:white; background:#1e3a55; border:1px solid #3d5871; border-radius:9px; padding:10px; outline:none; }
.chart-shell { background:var(--paper); border-radius:32px 32px 0 0; padding:55px max(24px,calc((100vw - 1140px)/2)) 65px; min-height:800px; }
.chart-tools { display:flex; align-items:end; justify-content:space-between; gap:20px; margin-bottom:32px; }
.chart-tools h2 { margin:0; font:800 31px/1 "Manrope"; letter-spacing:-.04em; }
.search-box { width:min(370px,100%); background:#f0eee8; border:1px solid #deddd8; border-radius:13px; display:flex; align-items:center; gap:10px; padding:0 14px; }
.search-box span { font-size:25px; color:#7d848b; transform:rotate(-15deg); }
.search-box input { width:100%; border:0; outline:0; background:transparent; padding:14px 0; }
.podium { display:grid; grid-template-columns:repeat(3,1fr); gap:16px; margin-bottom:18px; }
.podium-card { min-height:370px; border-radius:20px; overflow:hidden; position:relative; background:var(--navy); color:white; cursor:pointer; box-shadow:0 14px 34px #12273d1d; isolation:isolate; }
.podium-card::after { content:""; position:absolute; inset:0; background:linear-gradient(180deg,transparent 30%,rgba(7,18,30,.92)); z-index:-1; }
.podium-card .cover-img,.podium-card .cover-fallback { position:absolute; inset:0; width:100%; height:100%; object-fit:cover; z-index:-2; }
.cover-fallback { display:flex; align-items:center; justify-content:center; background:linear-gradient(135deg,#1b3853,#0b1725); color:#ffffff26; font:800 100px/1 "Manrope"; }
.podium-position { position:absolute; top:19px; left:19px; width:58px; height:58px; border-radius:16px; background:rgba(251,250,247,.94); color:var(--navy); display:flex; align-items:center; justify-content:center; font:800 28px/1 "Manrope"; letter-spacing:-.07em; }
.podium-card .movement { position:absolute; top:25px; right:20px; }
.podium-copy { position:absolute; inset:auto 23px 23px; }
.podium-copy h3 { font:800 24px/1.05 "Manrope"; margin:0 0 8px; letter-spacing:-.035em; }
.podium-copy .artist { margin:0 0 7px; font-weight:600; }
.podium-copy .label { margin:0; color:#bbc6d0; font-size:12px; }
.ranking { display:grid; gap:8px; }
.rank-row { display:grid; grid-template-columns:72px 72px minmax(0,1fr) minmax(160px,.45fr) 48px; align-items:center; gap:18px; min-height:92px; padding:10px 18px 10px 10px; border:1px solid #e2e1dc; border-radius:15px; background:#fff; cursor:pointer; transition:.2s ease; }
.rank-row:hover { transform:translateY(-2px); border-color:#c4d3df; box-shadow:0 12px 25px #12273d0d; }
.rank-position { text-align:center; font:800 26px/1 "Manrope"; color:var(--navy); letter-spacing:-.06em; }
.rank-cover { width:72px; height:72px; border-radius:10px; overflow:hidden; }
.rank-cover img,.rank-cover .cover-fallback { width:100%; height:100%; object-fit:cover; font-size:27px; position:static; }
.rank-title { min-width:0; }
.rank-title h3 { margin:0 0 6px; font:800 16px/1.2 "Manrope"; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rank-title p { margin:0; color:#616b74; font-size:14px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rank-label { color:#75808a; font-size:12px; }
.movement { width:36px; height:36px; border-radius:50%; display:inline-flex; justify-content:center; align-items:center; font-style:normal; font:800 15px/1 "Manrope"; }
.movement.up { color:#fff; background:var(--green); }.movement.down{color:#fff;background:var(--red)}.movement.same{color:#372d05;background:var(--yellow)}.movement.new{color:#fff;background:var(--blue)}
.legend { display:flex; justify-content:center; flex-wrap:wrap; gap:21px; margin-top:28px; color:#68727b; font-size:12px; }
.legend span { display:flex; align-items:center; gap:7px; }.legend .movement{width:24px;height:24px;font-size:11px}
.loading,.empty-state { min-height:300px; display:flex; align-items:center; justify-content:center; gap:11px; color:#747d85; }
.loading span { width:18px;height:18px;border:2px solid #c7cdd1;border-top-color:var(--blue);border-radius:50%;animation:spin .8s linear infinite }
@keyframes spin { to { transform:rotate(360deg) } }
.method { max-width:900px; margin:auto; padding:72px 24px; text-align:center; }
.method p:last-child { font-size:17px; line-height:1.75; color:#5f6972; }
footer { padding:48px max(24px,calc((100vw - 1140px)/2)); border-top:4px solid transparent; border-image:linear-gradient(90deg,#168754 0 33.333%,#fff 33.333% 66.666%,#d92536 66.666%) 1; display:flex; align-items:center; justify-content:space-between; gap:32px; color:#b7c2cc; background:#0a1b2c; font-size:12px; }
.footer-brand .brand-logo { width:220px; }
.footer-meta { display:grid; justify-items:end; gap:9px; text-align:right; }
.footer-meta p { margin:0; }
.footer-meta a { color:#fff; text-decoration:none; }
.footer-meta a:hover { text-decoration:underline; }
.track-dialog { width:min(900px,calc(100% - 28px)); padding:0; border:0; border-radius:25px; overflow:hidden; box-shadow:0 30px 100px #06111f66; }
.track-dialog::backdrop { background:#0c1721b8; backdrop-filter:blur(5px); }
.dialog-close { position:absolute; right:15px; top:15px; z-index:4; border:0; background:#fff; width:39px; height:39px; border-radius:50%; cursor:pointer; font-size:25px; box-shadow:0 5px 18px #0002; }
.dialog-grid { display:grid; grid-template-columns:42% 1fr; min-height:520px; }
.dialog-art { background:var(--navy); min-height:420px; }
.dialog-art img,.dialog-art .cover-fallback { width:100%;height:100%;object-fit:cover;font-size:110px;position:static; }
.dialog-info { padding:54px 48px 38px; }
.dialog-info .position-line { color:var(--blue); font-weight:800; letter-spacing:.12em; font-size:11px; }
.dialog-info h2 { margin:16px 0 8px; font:800 38px/1 "Manrope"; letter-spacing:-.045em; }
.dialog-info .dialog-artist { margin:0 0 7px; font-size:20px; color:#4e5963; }.dialog-info .dialog-label{margin:0;color:#899199;font-size:13px}
.metrics { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:29px 0; }
.metric { border:1px solid #e2e2dd; border-radius:12px; padding:13px; }
.metric span { display:block; color:#858d94; text-transform:uppercase; letter-spacing:.09em; font-size:8px; margin-bottom:6px; }.metric strong{font:800 22px/1 "Manrope"}
.history-chart { height:150px; margin:8px 0 18px; }.history-chart svg{width:100%;height:100%;overflow:visible}.history-chart .gridline{stroke:#e2e2dd;stroke-width:1}.history-chart .line{fill:none;stroke:var(--blue);stroke-width:3}.history-chart .dot{fill:var(--paper);stroke:var(--blue);stroke-width:3}
.spotify-btn { display:inline-flex; align-items:center; gap:9px; background:#1db954; color:white; text-decoration:none; border-radius:999px; padding:12px 19px; font-weight:800; font-size:13px; }
.spotify-btn::before { content:'▶'; width:23px;height:23px;background:#fff;color:#1db954;border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:9px;padding-left:2px }
@media(max-width:800px){
  .site-header{height:auto;min-height:86px;grid-template-columns:1fr auto;padding:15px 18px 10px}.site-header .brand-logo{width:205px}.main-nav{grid-column:1/-1;grid-row:2;justify-self:center}.admin-link{font-size:0}.admin-link::after{content:'Admin';font-size:11px}.hero{grid-template-columns:1fr;padding-top:54px;gap:30px}.issue-card{max-width:420px}.podium{grid-template-columns:1fr}.podium-card{min-height:330px}.rank-row{grid-template-columns:45px 60px minmax(0,1fr) 40px;gap:11px;min-height:79px;padding-right:10px}.rank-cover{width:60px;height:60px}.rank-label{display:none}.chart-tools{align-items:stretch;flex-direction:column}.search-box{width:100%}.dialog-grid{grid-template-columns:1fr}.dialog-art{height:320px;min-height:0}.dialog-info{padding:35px 25px}.dialog-info h2{font-size:31px}footer{flex-direction:column;text-align:center}.footer-brand{margin:auto}.footer-meta{justify-items:center;text-align:center}
}
@media(max-width:440px){.site-header .brand-logo{width:174px}.hero h1{font-size:49px}.chart-shell{border-radius:22px 22px 0 0}.rank-title h3{font-size:14px}.rank-title p{font-size:12px}.metrics{grid-template-columns:1fr}.dialog-art{height:270px}}

/* Layout pubblico V3: richiama l'azzurro del sito storico. */
:root { --legacy-blue:#a6d5f4; }
.site-header {
  min-height:126px;
  grid-template-columns:auto minmax(260px,370px) auto;
  justify-content:space-between;
  background:rgba(166,213,244,.97);
  border-bottom:1px solid #7ebbe3;
}
.site-header .brand-logo,
.footer-brand .brand-logo { filter:none; }
.header-search {
  justify-self:center;
  width:100%;
  background:#fff;
  border-color:#6e8291;
  box-shadow:0 5px 18px #31536c1a;
}
.header-search input { color:var(--ink); }
.admin-link { color:var(--navy); border-bottom-color:var(--navy); }
.hero {
  display:block;
  max-width:1100px;
  padding:58px 24px 46px;
  text-align:center;
}
.hero h1 {
  max-width:none;
  font:700 clamp(34px,4.3vw,52px)/1.08 "Montserrat",sans-serif;
  letter-spacing:.055em;
  text-transform:uppercase;
}
.main-nav {
  justify-content:center;
  gap:14px;
  width:max-content;
  margin:30px auto 0;
  padding:0;
  background:transparent;
  border:0;
  border-radius:0;
}
.nav-tab {
  min-width:190px;
  padding:15px 30px;
  border:1px solid #668399;
  border-radius:8px;
  color:var(--navy);
  background:#fff;
  font-size:14px;
  text-transform:uppercase;
  letter-spacing:.06em;
}
.nav-tab.active {
  background:#1467d8;
  color:#fff;
  border-color:#1467d8;
  box-shadow:0 8px 20px #1467d82b;
}
.issue-card {
  max-width:760px;
  margin:34px auto 0;
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:34px;
  align-items:end;
  text-align:left;
  color:var(--navy);
  background:#fff;
  border:1px solid #d9e1e6;
  border-radius:15px;
  padding:22px 25px;
  box-shadow:0 12px 35px #12273d12;
}
.issue-card span,.issue-card label { color:#667887; }
.issue-card strong { margin:9px 0 0; font-size:24px; }
.issue-card label { margin-bottom:8px; }
.issue-card select {
  color:var(--navy);
  background:#f4f7f9;
  border:1px solid #cbd6dd;
}
.chart-shell { padding-top:48px; }
footer {
  color:var(--navy);
  background:var(--legacy-blue);
  border-bottom:1px solid #7ebbe3;
}
.footer-meta a { color:var(--navy); }

@media(max-width:800px){
  .site-header{grid-template-columns:1fr auto;gap:12px;padding:17px 18px 14px}
  .site-header .brand-logo{width:195px}
  .header-search{grid-column:1/-1;grid-row:2;width:100%}
  .hero{padding-top:45px}
  .hero h1{font-size:34px;letter-spacing:.035em}
  .main-nav{grid-column:auto;grid-row:auto;width:100%;gap:8px}
  .nav-tab{min-width:0;flex:1;padding:14px 12px}
  .issue-card{grid-template-columns:1fr;gap:20px;max-width:520px}
}
@media(max-width:440px){
  .site-header .brand-logo{width:165px}
  .hero h1{font-size:29px}
  .nav-tab{font-size:12px;letter-spacing:.035em}
  .issue-card{padding:19px}
}

/* V4: podio orizzontale e classifica editoriale come nel concept approvato. */
.issue-card { grid-template-columns:1fr 1.2fr; }
.update-date { display:flex; align-items:center; gap:14px; min-width:0; }
.archive-field { display:grid; grid-template-columns:38px minmax(105px,1fr) minmax(135px,170px); align-items:center; gap:10px; min-width:0; border-left:1px solid #d5dee4; padding-left:24px; }
.info-icon { flex:0 0 38px; width:38px; height:38px; display:flex; align-items:center; justify-content:center; color:var(--navy); }
.info-icon svg { width:30px; height:30px; fill:none; stroke:currentColor; stroke-width:1.7; stroke-linecap:round; stroke-linejoin:round; }
.info-copy { display:grid; gap:7px; }
.issue-card .info-copy small,.archive-field label { color:#667887; text-transform:uppercase; letter-spacing:.12em; font-size:9px; font-weight:700; }
.issue-card .info-copy strong { margin:0; }
.archive-field label { flex:0 0 auto; margin:0; }
.archive-field select { width:100%; min-width:0; }

.podium { gap:14px; margin-bottom:34px; }
.podium-card {
  min-height:200px;
  display:grid;
  grid-template-columns:76px 124px minmax(0,1fr);
  align-items:stretch;
  position:relative;
  overflow:hidden;
  color:var(--navy);
  background:#fff;
  border:1px solid #d7dee3;
  border-radius:14px;
  box-shadow:0 10px 28px #12273d10;
  isolation:auto;
}
.podium-card::after { display:none; }
.podium-card.podium-1 { border-color:#e5bd4c; background:#fffdf6; }
.podium-card.podium-2 { border-color:#cbd1d6; background:#fbfcfd; }
.podium-card.podium-3 { border-color:#d9a27d; background:#fffaf7; }
.podium-rank { display:flex; flex-direction:column; align-items:center; justify-content:center; gap:18px; background:#f1f4f6; }
.podium-1 .podium-rank { background:#fff0b8; }
.podium-2 .podium-rank { background:#e8ecef; }
.podium-3 .podium-rank { background:#f1d0b8; }
.podium-position { position:static; width:auto; height:auto; border-radius:0; background:transparent; font:800 50px/1 "Montserrat",sans-serif; letter-spacing:-.06em; }
.podium-card .movement,.rank-row .movement { position:static; color:inherit; background:transparent; width:32px; height:32px; font-size:21px; }
.podium-card .movement.up,.rank-row .movement.up { color:var(--green); }
.podium-card .movement.down,.rank-row .movement.down { color:var(--red); }
.podium-card .movement.same,.rank-row .movement.same { color:var(--yellow); }
.podium-card .movement.new,.rank-row .movement.new { color:var(--blue); }
.podium-cover { width:124px; height:124px; align-self:center; overflow:hidden; background:#e8edf0; }
.podium-cover .cover-img,.podium-cover .cover-fallback { position:static; width:100%; height:100%; object-fit:cover; font-size:38px; }
.podium-copy { position:static; inset:auto; align-self:center; min-width:0; padding:18px 15px; }
.podium-copy .artist { margin:0 0 8px; color:var(--navy); font:800 16px/1.2 "Montserrat",sans-serif; text-transform:uppercase; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.podium-copy h3 { margin:0 0 20px; color:#253442; font:500 16px/1.3 "DM Sans",sans-serif; letter-spacing:0; }
.podium-copy .label { margin:0; color:#74818c; font-size:11px; line-height:1.35; }

.ranking-header,.rank-row {
  display:grid;
  grid-template-columns:56px 52px 48px minmax(135px,.8fr) minmax(190px,1.2fr) minmax(145px,.75fr);
  align-items:center;
  gap:14px;
}
.ranking-header { padding:0 14px 11px; color:#6d7b87; border-bottom:1px solid #ccd5db; text-transform:uppercase; letter-spacing:.09em; font-size:9px; font-weight:800; }
.ranking { gap:0; }
.rank-row { min-height:67px; padding:8px 14px; border:0; border-bottom:1px solid #dce3e7; border-radius:0; background:transparent; }
.rank-row:hover { transform:none; border-color:#cbd6dd; background:#fff; box-shadow:0 8px 22px #12273d0b; }
.rank-position { font-size:21px; text-align:left; letter-spacing:0; }
.rank-cover { width:42px; height:42px; border-radius:5px; }
.rank-cover img,.rank-cover .cover-fallback { font-size:16px; }
.rank-artist { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; font-size:13px; font-weight:800; text-transform:uppercase; }
.rank-title h3 { margin:0; font:500 14px/1.25 "DM Sans",sans-serif; }
.rank-title p { display:none; }
.rank-label { font-size:11px; line-height:1.3; }
.issue-card .info-copy strong { font-size:17px; line-height:1.15; font-weight:800; }
.archive-field select { font-size:9px; font-weight:700; }
.podium-copy .artist {
  font-size:14px;
  line-height:1.25;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
}
.podium-copy h3 { font-size:14px; line-height:1.3; overflow-wrap:anywhere; }
.rank-artist { font-size:12px; }
.rank-title h3 { font-size:13px; }
.footer-meta { display:flex; align-items:center; justify-content:center; gap:34px; flex:1; text-align:center; }
.footer-meta > * + * { border-left:1px solid #6fa9ce; padding-left:34px; }

@media(max-width:1050px){
  .podium{grid-template-columns:1fr}
  .podium-card{grid-template-columns:90px 150px minmax(0,1fr);min-height:174px}
  .podium-cover{width:138px;height:138px}
}
@media(max-width:800px){
  .issue-card{grid-template-columns:1fr}
  .archive-field{border-left:0;border-top:1px solid #d5dee4;padding:20px 0 0}
  .ranking-header{display:none}
  .rank-row{grid-template-columns:38px 52px minmax(0,1fr) 36px;grid-template-areas:"pos cover title mov";gap:10px;padding:9px 5px}
  .rank-position{grid-area:pos;text-align:center}
  .rank-row>.movement{grid-area:mov}
  .rank-cover{grid-area:cover;width:48px;height:48px}
  .rank-artist{display:none}
  .rank-title{grid-area:title}
  .rank-title h3{font-weight:800}
  .rank-title p{display:block;margin-top:4px}
  .rank-label{display:none}
  .footer-meta{flex-direction:column;gap:9px}
  .footer-meta > * + *{border-left:0;padding-left:0}
}
@media(max-width:520px){
  .podium-card{grid-template-columns:62px 92px minmax(0,1fr);min-height:132px}
  .podium-position{font-size:38px}
  .podium-cover{width:82px;height:82px}
  .podium-copy{padding:12px 10px}
  .podium-copy .artist{font-size:13px}
  .podium-copy h3{font-size:13px;margin-bottom:10px}
  .podium-copy .label{font-size:9px}
  .archive-field{display:grid;grid-template-columns:38px 1fr}
  .archive-field select{grid-column:1/-1;width:100%}
}

/* V5.3: maggiore leggibilità per le posizioni dalla 4 alla 30. */
.ranking-header,.rank-row {
  grid-template-columns:64px 58px 90px minmax(150px,.8fr) minmax(210px,1.2fr) minmax(150px,.75fr);
  gap:16px;
}
.ranking-header { font-size:10px; padding:0 16px 13px; }
.rank-row { min-height:106px; padding:11px 16px; }
.rank-position { font-size:27px; }
.rank-row .movement { width:38px; height:38px; font-size:24px; }
.rank-cover { width:82px; height:82px; border-radius:9px; }
.rank-cover img,.rank-cover .cover-fallback { font-size:28px; }
.rank-artist { font-size:15px; line-height:1.25; }
.rank-title h3 { font-size:16px; line-height:1.3; }
.rank-label { font-size:13px; line-height:1.4; }
.rank-artist,.rank-title h3 {
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  overflow-wrap:anywhere;
}

@media(max-width:800px){
  .rank-row {
    grid-template-columns:44px 72px minmax(0,1fr) 42px;
    grid-template-areas:"pos cover title mov";
    gap:12px;
    min-height:92px;
    padding:10px 6px;
  }
  .rank-position { font-size:23px; }
  .rank-cover { width:68px; height:68px; }
  .rank-row .movement { width:36px; height:36px; font-size:22px; }
  .rank-title h3 { font-size:15px; white-space:normal; overflow:visible; text-overflow:clip; }
  .rank-title p { font-size:13px; }
}

@media(max-width:440px){
  .rank-row { grid-template-columns:38px 64px minmax(0,1fr) 38px; gap:9px; }
  .rank-cover { width:60px; height:60px; }
  .rank-position { font-size:21px; }
  .rank-row .movement { width:32px; height:32px; font-size:20px; }
  .rank-title h3 { font-size:14px; }
  .rank-title p { font-size:12px; }
}
