:root {
  color-scheme: dark;
  --bg: #090b0a;
  --surface: #111412;
  --surface-2: #171b18;
  --line: #2a302c;
  --text: #f4f7f5;
  --muted: #98a29b;
  --green: #1ed760;
  --green-soft: #a7f3c3;
  --yellow: #ffd166;
  --red: #ff7a7a;
  --radius: 18px;
  --max: 1380px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 16px; line-height: 1.5; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button, select, input { color: var(--text); }

.topbar { position: sticky; top: 0; z-index: 10; height: 68px; padding: 0 max(24px, calc((100vw - var(--max)) / 2)); display: flex; align-items: center; gap: 36px; border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(9,11,10,.88); backdrop-filter: blur(18px); }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 760; letter-spacing: -.02em; }
.brand-mark { width: 29px; height: 29px; padding: 6px; display: flex; align-items: end; gap: 2px; border-radius: 8px; background: var(--green); }
.brand-mark i { display: block; width: 4px; background: #071009; border-radius: 2px; }
.brand-mark i:nth-child(1) { height: 7px; }.brand-mark i:nth-child(2) { height: 12px; }.brand-mark i:nth-child(3) { height: 17px; }
.topbar nav { display: flex; gap: 24px; color: var(--muted); font-size: .88rem; }
.topbar nav a:hover, .topbar nav a:focus-visible { color: var(--text); }
.chart-picker select { height: 36px; max-width: 220px; padding: 0 32px 0 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); color: var(--text); font-size: .78rem; outline: none; }
.chart-picker select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,215,96,.12); }
.internal-badge { margin-left: auto; padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .08em; }

main { width: min(var(--max), calc(100% - 48px)); margin: 0 auto; }
.explore { min-height: calc(100vh - 68px); padding: 68px 0 48px; }
.explore-heading { max-width: 940px; }
.explore-heading h1 { font-size: clamp(3.2rem, 7vw, 7.4rem); }
.explore-heading > p:last-child { max-width: 650px; margin: 28px 0 0; color: var(--muted); font-size: 1rem; }
.explore-grid { margin-top: 48px; display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(330px, .82fr); gap: 18px; align-items: stretch; }
.map-panel, .region-panel { min-height: 620px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.map-panel { position: relative; padding: 24px; overflow: hidden; }
.map-meta { display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .76rem; }
.map-meta strong { color: var(--green-soft); font-weight: 650; }
.brazil-map { min-height: 540px; display: grid; place-items: center; }
.brazil-map svg { width: min(100%, 620px); max-height: 535px; overflow: visible; filter: drop-shadow(0 24px 45px rgba(0,0,0,.25)); }
.brazil-map path { fill: #202522; stroke: #080a09; stroke-width: 1.2; vector-effect: non-scaling-stroke; cursor: pointer; transition: fill .18s ease, transform .18s ease, filter .18s ease; transform-box: fill-box; transform-origin: center; outline: none; }
.brazil-map path.has-charts { fill: #31493a; }
.brazil-map path:hover, .brazil-map path:focus-visible { fill: var(--green); filter: brightness(1.08); transform: translateY(-1px); }
.brazil-map path.selected { fill: var(--green); filter: drop-shadow(0 0 12px rgba(30,215,96,.35)); }
.map-tooltip { position: absolute; z-index: 2; pointer-events: none; padding: 8px 10px; border: 1px solid #465048; border-radius: 8px; background: #080a09; color: var(--text); font-size: .75rem; box-shadow: 0 10px 26px rgba(0,0,0,.3); }
.region-panel { padding: 24px; display: flex; flex-direction: column; }
.brazil-card { width: 100%; min-height: 92px; padding: 18px 20px; display: flex; justify-content: space-between; align-items: center; border: 0; border-radius: 14px; background: var(--green); color: #071009; text-align: left; cursor: pointer; }
.brazil-card small, .brazil-card strong { display: block; }
.brazil-card small { color: #14592b; font-size: .7rem; font-weight: 760; letter-spacing: .08em; text-transform: uppercase; }
.brazil-card strong { margin-top: 4px; font-size: 1.35rem; letter-spacing: -.035em; }
.brazil-card > span:last-child { font-size: 1.35rem; }
.region-copy { margin-top: 38px; }
.region-copy h2 { margin: 0; font-size: clamp(2rem, 3vw, 3.2rem); line-height: .98; letter-spacing: -.05em; }
.region-copy > p:last-child { margin: 14px 0 0; color: var(--muted); font-size: .88rem; }
.city-options { margin-top: 26px; display: grid; gap: 12px; }
.city-group { padding-top: 16px; border-top: 1px solid var(--line); }
.city-group:first-child { padding-top: 0; border-top: 0; }
.city-group-heading { margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.city-group-heading strong { font-size: .95rem; }
.city-group-heading span { color: var(--muted); font-size: .72rem; }
.city-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.city-actions button { min-height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-align: left; cursor: pointer; }
.city-actions button:hover, .city-actions button:focus-visible { border-color: var(--green); color: var(--green-soft); }
.city-actions button:disabled { cursor: wait; opacity: .45; }
.empty-region { padding: 18px; border: 1px dashed var(--line); border-radius: 12px; color: var(--muted); font-size: .82rem; }
.map-credit { margin: 12px 2px 0; color: #626b65; font-size: .68rem; }
.map-credit a { text-decoration: underline; text-underline-offset: 2px; }
.intro { min-height: 330px; padding: 72px 0 54px; display: flex; align-items: end; justify-content: space-between; gap: 40px; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 12px; color: var(--green); font-size: .76rem; font-weight: 760; letter-spacing: .12em; text-transform: uppercase; }
h1 { margin: 0; max-width: 800px; font-size: clamp(3rem, 6vw, 6.7rem); line-height: .92; letter-spacing: -.065em; }
h1 span { color: #6c756f; }
.period-card { width: 290px; padding: 20px 0 3px 24px; border-left: 2px solid var(--green); display: grid; gap: 4px; }
.period-card span, .period-card small { color: var(--muted); font-size: .8rem; }
.period-card strong { font-size: 1.25rem; letter-spacing: -.02em; }
.status { margin-top: 20px; padding: 13px 16px; color: var(--muted); border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.status.ready { display: none; }
.status.error { color: #ffd0d0; border-color: #6a3030; }

.section { padding: 76px 0 12px; scroll-margin-top: 66px; }
.section-heading { margin-bottom: 28px; display: flex; justify-content: space-between; align-items: end; gap: 32px; }
.section-heading h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.4rem); letter-spacing: -.055em; line-height: 1; }
.section-note { max-width: 510px; margin: 0; color: var(--muted); font-size: .92rem; }

.target-kpi-grid { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.target-kpi { min-width: 0; min-height: 174px; padding: 24px 20px; display: flex; flex-direction: column; border-left: 1px solid var(--line); background: var(--surface); }
.target-kpi:first-child { border-left: 0; }
.target-kpi span { color: var(--green); font-size: .82rem; font-weight: 760; }
.target-kpi strong { margin: 20px 0 0; font-size: clamp(1.55rem, 2.5vw, 2.55rem); letter-spacing: -.055em; line-height: 1; }
.target-kpi small { margin-top: 4px; color: var(--muted); font-size: .78rem; }
.target-kpi em { margin-top: auto; padding-top: 18px; color: #727c75; font-size: .7rem; font-style: normal; line-height: 1.25; }
.target-kpi-primary { background: var(--green); color: #061109; }
.target-kpi-primary span, .target-kpi-primary small, .target-kpi-primary em { color: #0b5425; }
.targets-caption { margin: 10px 2px 0; color: var(--muted); font-size: .74rem; }
.no-streams-note { min-height: 112px; padding: 24px; display: flex; align-items: flex-start; gap: 16px; border-color: #31463a; background: #0e1711; }
.no-streams-note strong { font-size: .95rem; }
.no-streams-note p { margin: 5px 0 0; max-width: 760px; color: var(--muted); font-size: .84rem; }

.split-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 18px; }
.overview-grid { margin-top: 18px; }
.panel { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panel-heading { min-height: 84px; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--line); }
.panel-heading h3 { margin: 0; font-size: 1.22rem; letter-spacing: -.03em; }
.panel-heading .eyebrow { margin-bottom: 5px; }
.muted { color: var(--muted); font-size: .8rem; }

.top-five { padding: 4px 20px 10px; }
.top-track { min-height: 76px; display: grid; grid-template-columns: 32px 52px minmax(0, 1fr) auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.top-track:last-child { border-bottom: 0; }
.top-track .position { color: var(--muted); font-variant-numeric: tabular-nums; }
.cover { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; background: var(--surface-2); }
.track-copy { min-width: 0; overflow: hidden; }
.track-title, .track-artists { display: block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.track-title { font-weight: 680; letter-spacing: -.02em; }
.track-artists { color: var(--muted); font-size: .78rem; }
.track-value { min-width: max-content; justify-self: end; white-space: nowrap; text-align: right; font-weight: 680; font-variant-numeric: tabular-nums; }

.top-genres { padding: 4px 20px 10px; }
.top-genre-row { min-height: 102px; display: grid; grid-template-columns: 38px 1fr auto; align-items: center; gap: 15px; border-bottom: 1px solid var(--line); }
.top-genre-row:last-child { border-bottom: 0; }
.top-genre-rank { color: #4f5a52; font-size: 1.15rem; font-weight: 760; }
.top-genre-row > span > strong, .top-genre-row > span > small { display: block; }
.top-genre-row > span > small { margin-top: 4px; color: var(--muted); font-size: .76rem; }
.top-genre-numbers { text-align: right; }
.top-genre-numbers > strong { color: var(--green-soft); font-size: 1.35rem; letter-spacing: -.04em; }

.genre-panel { padding: 0 24px 14px; }
.genre-legend, .genre-row { display: grid; grid-template-columns: minmax(160px, .8fr) 2fr 90px 190px; gap: 20px; align-items: center; }
.genre-legend { height: 52px; color: var(--muted); font-size: .74rem; text-transform: uppercase; letter-spacing: .08em; border-bottom: 1px solid var(--line); }
.genre-row { min-height: 66px; border-bottom: 1px solid var(--line); }
.genre-row:last-child { border-bottom: 0; }
.genre-name { font-weight: 680; }
.genre-track { position: relative; height: 10px; border-radius: 999px; background: #242a26; overflow: hidden; }
.genre-track i { display: block; width: var(--width); height: 100%; border-radius: inherit; background: var(--color, var(--green)); }
.genre-share { margin-top: 4px; color: var(--muted); font-size: .75rem; }
.genre-metric { font-variant-numeric: tabular-nums; }
.genre-streams { color: var(--green-soft); font-weight: 700; }
.genre-streams small { margin-left: 3px; color: var(--muted); font-size: .72rem; font-weight: 500; }
.mobile-only { display: none; }

.ranking-heading { align-items: end; }
.filters { display: flex; gap: 10px; }
.filters input, .filters select { height: 44px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); outline: none; }
.filters input { width: min(330px, 38vw); padding: 0 14px; }
.filters select { min-width: 190px; padding: 0 34px 0 12px; }
.filters input:focus, .filters select:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,215,96,.12); }
.ranking-panel { overflow: hidden; }
.ranking-panel.no-streams .stream-column { display: none; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { height: 48px; padding: 0 14px; color: var(--muted); font-size: .71rem; font-weight: 620; text-align: left; text-transform: uppercase; letter-spacing: .06em; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { padding-left: 24px; }
th:nth-last-child(-n+4), td:nth-last-child(-n+4) { text-align: right; }
td { height: 76px; padding: 0 14px; border-bottom: 1px solid var(--line); font-size: .86rem; font-variant-numeric: tabular-nums; }
.rank-position { color: var(--muted); font-weight: 700; }
.song-cell { min-width: 310px; display: flex; align-items: center; gap: 12px; }
.song-cell .cover { flex: 0 0 auto; }
.genre-pill { display: inline-flex; padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; color: #c7cec9; font-size: .72rem; white-space: nowrap; }
.daily-value { color: var(--green-soft); font-weight: 720; }
.table-footer { min-height: 64px; padding: 0 24px; display: flex; align-items: center; justify-content: space-between; color: var(--muted); font-size: .82rem; }
.table-footer button { padding: 8px 14px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-2); cursor: pointer; }
.table-footer button:hover { border-color: #566058; }
.mobile-ranking { display: none; }

.methodology { margin: 78px 0 54px; padding: 22px; display: flex; gap: 16px; border: 1px solid #31463a; border-radius: var(--radius); background: #0e1711; }
.info-icon { flex: 0 0 auto; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--green); color: #071009; font-weight: 800; }
.methodology strong { font-size: .9rem; }
.methodology p { margin: 4px 0 0; max-width: 1000px; color: var(--muted); font-size: .84rem; }
footer { width: min(var(--max), calc(100% - 48px)); min-height: 80px; margin: 0 auto; display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: .78rem; border-top: 1px solid var(--line); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.auth-pending > :not(.auth-shell), .auth-locked > :not(.auth-shell) { display: none !important; }
.auth-shell[hidden] { display: none; }
.auth-shell { min-height: 100vh; padding: 28px; display: grid; place-items: center; background: radial-gradient(circle at 50% 0%, #15301f 0, #0b0d0c 38%, #070908 100%); }
.login-card { width: min(100%, 430px); padding: 36px; border: 1px solid var(--line); border-radius: 22px; background: rgba(14,17,15,.96); box-shadow: 0 28px 80px rgba(0,0,0,.42); }
.login-mark { margin-bottom: 28px; }
.login-card h1 { font-size: clamp(2.8rem, 10vw, 4.7rem); }
.login-copy { margin: 16px 0 30px; color: var(--muted); }
.login-card label { margin-top: 14px; display: grid; gap: 7px; color: var(--muted); font-size: .78rem; }
.login-card input { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--text); outline: none; }
.login-card input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(30,215,96,.12); }
.login-card > button { width: 100%; height: 50px; margin-top: 18px; border: 0; border-radius: 10px; background: var(--green); color: #071009; font-weight: 780; cursor: pointer; }
.login-card > button:disabled { cursor: wait; opacity: .65; }
.login-card > small { margin-top: 16px; display: block; color: #737d76; text-align: center; }
.login-error { min-height: 20px; margin: 12px 0 0; color: #ff9d9d; font-size: .78rem; }
.session-box { margin-left: 2px; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .72rem; }
.session-box button { padding: 5px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--text); cursor: pointer; }
.session-box button:hover { border-color: var(--green); }

@media (max-width: 960px) {
  .topbar nav { display: none; }
  .intro { min-height: 290px; padding-top: 52px; }
  .target-kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .target-kpi:nth-child(4) { border-left: 0; }
  .target-kpi:nth-child(n+4) { border-top: 1px solid var(--line); }
  .split-grid { grid-template-columns: 1fr; }
  .explore-grid { grid-template-columns: 1fr; }
  .map-panel, .region-panel { min-height: auto; }
  .region-panel { min-height: 460px; }
  .genre-legend, .genre-row { grid-template-columns: minmax(140px, .7fr) 2fr 70px 165px; gap: 12px; }
  .table-wrap { display: none; }
  .mobile-ranking { display: block; }
  .mobile-track { width: 100%; min-width: 0; padding: 16px 18px; display: grid; grid-template-columns: 28px 52px minmax(0, 1fr) auto; gap: 12px; align-items: center; border-bottom: 1px solid var(--line); }
  .mobile-track-meta { min-width: 0; max-width: 100%; margin-top: 7px; display: flex; gap: 7px; flex-wrap: wrap; color: var(--muted); font-size: .72rem; }
  .mobile-track-meta > span { white-space: nowrap; }
}

@media (max-width: 640px) {
  .topbar { height: 58px; padding: 0 14px; gap: 12px; }
  .brand > span:last-child { display: none; }
  .chart-picker { margin-left: auto; }
  .chart-picker select { width: min(72vw, 235px); max-width: none; }
  .internal-badge { display: none; }
  .session-box > span { display: none; }
  .login-card { padding: 28px 22px; }
  main, footer { width: min(100% - 28px, var(--max)); }
  .explore { padding-top: 46px; }
  .explore-heading h1 { font-size: clamp(3rem, 15vw, 4.8rem); }
  .explore-heading > p:last-child { margin-top: 20px; }
  .explore-grid { margin-top: 32px; }
  .map-panel { padding: 16px; }
  .map-meta { display: grid; gap: 3px; }
  .brazil-map { min-height: 400px; }
  .brazil-map svg { max-height: 390px; }
  .region-panel { padding: 18px; }
  .city-actions { grid-template-columns: 1fr 1fr; }
  .intro { min-height: auto; padding: 48px 0 34px; display: block; }
  h1 { font-size: clamp(2.9rem, 14vw, 4.5rem); }
  .period-card { width: 100%; margin-top: 38px; }
  .section { padding-top: 60px; }
  .section-heading { display: block; }
  .section-note { margin-top: 14px; }
  .target-kpi-grid { grid-template-columns: 1fr 1fr; }
  .target-kpi { min-height: 152px; padding: 19px 16px; }
  .target-kpi:nth-child(odd) { border-left: 0; }
  .target-kpi:nth-child(n+3) { border-top: 1px solid var(--line); }
  .target-kpi:nth-child(4) { border-left: 1px solid var(--line); }
  .target-kpi strong { font-size: 1.65rem; }
  .target-kpi em { padding-top: 12px; }
  .top-five { padding-inline: 12px; }
  .top-track { grid-template-columns: 23px 44px minmax(0, 1fr); gap: 10px; }
  .top-track .cover { width: 42px; height: 42px; }
  .top-track .track-value { grid-column: 3; justify-self: start; margin-top: -12px; text-align: left; color: var(--green-soft); font-size: .78rem; }
  .genre-panel { padding-inline: 14px; overflow: hidden; }
  .genre-legend { display: none; }
  .genre-row { padding: 14px 0; grid-template-columns: 1fr auto; gap: 7px 12px; }
  .genre-name { grid-column: 1; }
  .genre-row > div:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .genre-row > div:nth-child(3) { display: none; }
  .genre-row > div:nth-child(4) { grid-column: 2; grid-row: 1; text-align: right; }
  .mobile-only { display: inline; }
  .ranking-heading { display: block; }
  .filters { margin-top: 20px; display: grid; grid-template-columns: 1fr; }
  .filters input, .filters select { width: 100%; }
  .mobile-track { grid-template-columns: 24px 48px minmax(0, 1fr); padding-inline: 13px; }
  .mobile-track .cover { width: 46px; height: 46px; }
  .mobile-track > .track-value { grid-column: 3; justify-self: start; text-align: left; color: var(--green-soft); font-size: .8rem; }
  footer { display: grid; align-content: center; gap: 3px; }
}
