:root {
  color-scheme: dark;
  --background: #08090d;
  --foreground: #f8fafc;
  --card: #12141c;
  --card-soft: #171a24;
  --card-strong: #1f2330;
  --muted: #9aa3b2;
  --muted-strong: #cbd5e1;
  --border: rgba(255, 255, 255, 0.1);
  --input: rgba(255, 255, 255, 0.16);
  --primary: #ff365f;
  --primary-strong: #e31b45;
  --primary-soft: rgba(255, 54, 95, 0.14);
  --teal: #19c6b7;
  --gold: #f5a524;
  --radius: 18px;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 78% 8%, rgba(255, 54, 95, 0.2), transparent 28rem),
    radial-gradient(circle at 24% 95%, rgba(25, 198, 183, 0.12), transparent 30rem),
    linear-gradient(180deg, #10121a 0%, var(--background) 34rem);
  color: var(--foreground);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
a,
input,
select,
textarea,
summary {
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

:focus-visible {
  outline: 2px solid transparent;
  box-shadow: 0 0 0 2px var(--background), 0 0 0 4px rgba(255, 54, 95, 0.55);
}

.app-shell {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background: rgba(10, 12, 18, 0.82);
  border-right: 1px solid var(--border);
  backdrop-filter: blur(22px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), #a855f7);
  color: white;
  font-weight: 900;
  box-shadow: 0 12px 30px rgba(255, 54, 95, 0.35);
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: var(--muted);
  font-size: 0.82rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-group {
  margin: 14px 0 3px;
  color: #687183;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav-list a,
.nav-button {
  width: 100%;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.nav-list a:hover,
.nav-list a.is-active,
.nav-button:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--foreground);
}

.mini-panel,
.metrics-grid article,
.section-band,
.filter-bar,
.advanced-drawer,
.empty-state,
.now-playing {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
}

.mini-panel {
  margin-top: auto;
  padding: 18px;
}

.mini-panel strong {
  display: block;
  margin-top: 8px;
  font-size: 1.9rem;
}

.mini-panel small {
  color: var(--muted);
}

.mini-divider {
  display: block;
  height: 1px;
  margin: 14px 0;
  background: rgba(255, 255, 255, 0.1);
}

main {
  min-width: 0;
  padding: 28px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 18px;
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 330px;
  padding: clamp(22px, 4vw, 48px);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(135deg, rgba(255, 54, 95, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.035));
  box-shadow: var(--shadow);
}

.eyebrow {
  color: #ff6b8b;
  font-size: 0.74rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 820px;
  margin-bottom: 16px;
  font-size: clamp(2.2rem, 5vw, 4.8rem);
  line-height: 0.98;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1.25rem;
}

h3 {
  font-size: 1rem;
}

.hero-copy p {
  max-width: 650px;
  color: var(--muted-strong);
  font-size: 1.02rem;
  line-height: 1.65;
}

.hero-actions,
.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.button {
  min-height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
}

.button.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  color: white;
  box-shadow: 0 14px 30px rgba(255, 54, 95, 0.24);
}

.button.secondary {
  width: 100%;
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.07);
  color: var(--foreground);
}

.button.ghost {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--foreground);
}

.button:hover,
.icon-button:hover,
.nav-button:hover {
  transform: translateY(-1px);
}

.compact-button {
  align-self: end;
  min-height: 36px;
  padding: 0 13px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted-strong);
  font-size: 0.88rem;
  white-space: nowrap;
}

.compact-button:hover {
  border-color: rgba(255, 54, 95, 0.38);
  background: rgba(255, 54, 95, 0.12);
  color: #ffd5de;
}

.now-playing {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

#pulseCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.album-stack {
  position: absolute;
  top: 34px;
  left: 50%;
  width: 230px;
  height: 210px;
  transform: translateX(-50%);
}

.album-art {
  position: absolute;
  width: 150px;
  height: 150px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 22px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.38);
}

.art-one {
  left: 38px;
  top: 0;
  z-index: 3;
}

.art-two {
  left: 0;
  top: 42px;
  transform: rotate(-10deg) scale(0.88);
  opacity: 0.65;
}

.art-three {
  right: 0;
  top: 42px;
  transform: rotate(10deg) scale(0.88);
  opacity: 0.65;
}

.track-spotlight {
  position: relative;
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(8, 9, 13, 0.72);
  backdrop-filter: blur(18px);
}

.track-spotlight img {
  width: 64px;
  height: 64px;
  border-radius: 15px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--teal));
}

.track-spotlight strong,
.track-spotlight span {
  display: block;
}

.track-spotlight strong {
  margin: 4px 0;
  overflow-wrap: anywhere;
}

.track-spotlight span:last-child {
  color: var(--muted);
}

.equalizer {
  display: flex;
  align-items: end;
  gap: 3px;
  height: 26px;
}

.equalizer i {
  display: block;
  width: 4px;
  border-radius: 999px;
  background: var(--primary);
  animation: equalize 850ms ease-in-out infinite alternate;
}

.equalizer i:nth-child(1) { height: 12px; }
.equalizer i:nth-child(2) { height: 24px; animation-delay: 120ms; }
.equalizer i:nth-child(3) { height: 16px; animation-delay: 240ms; }
.equalizer i:nth-child(4) { height: 21px; animation-delay: 360ms; }

@keyframes equalize {
  to { transform: scaleY(0.45); opacity: 0.62; }
}

.empty-state {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 18px;
  padding: 22px;
}

.empty-state[hidden] {
  display: none;
}

.empty-state p {
  margin-bottom: 0;
  color: var(--muted);
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 14px;
}

.metrics-toolbar {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 2px 2px 4px;
}

.metrics-toolbar label {
  width: min(220px, 100%);
}

.metrics-grid article {
  min-height: 144px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.metrics-grid span,
.metrics-grid small {
  color: var(--muted);
}

.metrics-grid strong {
  display: block;
  margin: 8px 0;
  font-size: clamp(1.35rem, 2vw, 2rem);
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.more-metrics {
  margin-bottom: 18px;
}

.more-metrics summary {
  width: fit-content;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
}

.filter-workbench {
  position: sticky;
  top: 14px;
  z-index: 5;
  margin-bottom: 18px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(9, 11, 17, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.2);
}

.filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.filter-heading h2 {
  margin-top: 3px;
  font-size: 1.1rem;
}

.filter-heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: min(560px, 100%);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.view-tabs {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  padding: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.045);
}

.view-tab {
  min-height: 36px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 850;
}

.view-tab:hover,
.view-tab.is-active {
  background: linear-gradient(135deg, rgba(255, 54, 95, 0.22), rgba(255, 255, 255, 0.08));
  color: var(--foreground);
}

.quick-analysis {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.quick-analysis > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.preset-chip,
.active-chip,
.limit-tag,
.remove-chip {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
}

.preset-chip {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 0 10px;
}

.preset-chip:hover {
  border-color: rgba(255, 54, 95, 0.48);
  background: var(--primary-soft);
  color: #ffd5de;
}

.top-limit-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.top-limit-tags > span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.limit-tag {
  min-height: 30px;
  padding: 0 11px;
}

.limit-tag:hover,
.limit-tag.is-active {
  border-color: rgba(255, 54, 95, 0.52);
  background: rgba(255, 54, 95, 0.16);
  color: #ffd5de;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(140px, 0.95fr) minmax(132px, 0.85fr) minmax(180px, 1.1fr) minmax(92px, 0.48fr) auto auto;
  gap: 8px;
  align-items: end;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.032);
}

.filter-bar.fixed-filters {
  grid-template-columns: minmax(135px, 0.95fr) minmax(132px, 0.8fr) minmax(160px, 1.05fr) minmax(160px, 1.05fr) auto auto auto;
}

.filter-bar.fixed-filters .utility-filter {
  display: none;
}

.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 30px;
  margin-top: 10px;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 29px;
  padding: 0 10px 0 12px;
}

.remove-chip {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border-color: transparent;
  background: rgba(255, 255, 255, 0.11);
  color: var(--foreground);
  line-height: 1;
}

.sr-control {
  position: absolute;
  width: 1px;
  height: 1px;
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--foreground);
}

select,
input {
  height: 36px;
  padding: 0 11px;
  font-size: 0.88rem;
  font-weight: 750;
}

select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 15px) 15px,
    calc(100% - 10px) 15px;
  background-repeat: no-repeat;
  background-size: 5px 5px, 5px 5px;
  padding-right: 34px;
}

select option {
  color: #111827;
}

textarea {
  min-height: 150px;
  resize: vertical;
  padding: 12px;
}

input::placeholder,
textarea::placeholder {
  color: #7d8796;
}

label {
  display: grid;
  gap: 5px;
  color: #858fa1;
  font-size: 0.72rem;
  font-weight: 850;
}

.date-filter[hidden],
.is-hidden {
  display: none !important;
}

.stat-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 54, 95, 0.12);
  color: #ff9ab0;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.stat-chip.passive {
  cursor: default;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.55fr);
  gap: 18px;
}

.main-column,
.side-column {
  display: grid;
  align-content: start;
  gap: 18px;
}

.section-band,
.advanced-drawer {
  padding: 20px;
}

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

.chart-range {
  max-width: 180px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--foreground);
  cursor: pointer;
  font-weight: 800;
}

.artist-list,
.data-list,
.track-list {
  display: grid;
  gap: 10px;
}

.artist-row,
.data-row,
.track-row {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.data-row {
  grid-template-columns: minmax(0, 1fr) auto;
}

.track-row {
  grid-template-columns: 48px minmax(170px, 1fr) minmax(150px, 0.7fr) auto;
}

.track-row img {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--teal));
}

.track-main,
.track-meta,
.track-date {
  min-width: 0;
}

.track-main strong,
.track-main span,
.track-meta,
.track-date {
  display: block;
  overflow-wrap: anywhere;
}

.track-main span,
.track-meta,
.track-date {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.track-date {
  text-align: right;
}

.artist-row:hover,
.data-row:hover,
.track-row:hover {
  border-color: rgba(255, 54, 95, 0.22);
  background: rgba(255, 255, 255, 0.055);
}

.music-group {
  min-width: 0;
}

/* content-visibility apenas nos grupos de artista (nível raiz).
   Usar em grupos aninhados (.album-group) causa double-skip e trava no scroll-back.
   O prefixo "auto" em contain-intrinsic-size faz o browser cachear o tamanho real
   após o primeiro render, eliminando o recálculo quando o item volta ao viewport. */
.artist-group {
  content-visibility: auto;
  contain-intrinsic-size: auto 72px;
}

.music-group summary {
  list-style: none;
}

.music-group summary::-webkit-details-marker {
  display: none;
}

.music-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.music-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(45deg);
  transition: transform 160ms ease;
}

.music-group[open] > .music-summary::after {
  transform: rotate(225deg);
}

.music-summary:hover,
.music-track-row:hover {
  border-color: rgba(255, 54, 95, 0.22);
  background: rgba(255, 255, 255, 0.055);
}

.music-summary img {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--primary), var(--teal));
}

.music-title {
  min-width: 0;
}

.music-title strong,
.music-title small {
  display: block;
  overflow-wrap: anywhere;
}

.music-title small,
.music-track-row small {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.music-children {
  display: grid;
  gap: 9px;
  margin: 9px 0 0 22px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
}

.album-group .music-summary {
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.026);
}

.music-track-list {
  display: grid;
  gap: 8px;
  margin: 8px 0 0 20px;
}

.music-track-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.music-track-row strong,
.music-track-row small {
  display: block;
  overflow-wrap: anywhere;
}

.rank {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: #ff8fa8;
  font-weight: 900;
}

.artist-avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(255, 54, 95, 0.85), rgba(168, 85, 247, 0.8));
  color: white;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(255, 54, 95, 0.18);
}

.artist-name,
.data-row > span:first-child {
  min-width: 0;
}

.artist-name strong,
.artist-name span,
.data-row strong,
.data-row span {
  display: block;
  overflow-wrap: anywhere;
}

.artist-name span,
.data-row span,
.helper {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.5;
}

.play-count,
.data-count {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--foreground);
  font-weight: 900;
}

.stats-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.stat-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.stat-panel.wide {
  grid-column: 1 / -1;
}

.advanced-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.035);
}

.drawer-control {
  flex: 1 1 210px;
  min-width: 190px;
}

.fieldset-subtitle {
  flex: 1 0 100%;
  margin-top: 4px;
  color: var(--muted-strong);
  font-size: 0.82rem;
}

.future-filter {
  flex: 1 0 100%;
  color: #7d8796;
  font-size: 0.84rem;
}

.suggestion-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.suggestion-card {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.035);
}

.suggestion-card span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

legend {
  padding: 0 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 0.86rem;
}

.check-row input {
  width: 15px;
  height: 15px;
  padding: 0;
  accent-color: var(--primary);
}

.goal-control {
  margin-bottom: 14px;
}

input[type="range"] {
  height: 22px;
  padding: 0;
  border: 0;
  background: transparent;
  accent-color: var(--primary);
}

.progress-track {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--primary), var(--teal), var(--gold));
}

.onboarding-modal {
  width: min(940px, calc(100vw - 28px));
  border: 1px solid var(--border);
  border-radius: 26px;
  padding: 0;
  background: #10121a;
  color: var(--foreground);
  box-shadow: var(--shadow);
}

.onboarding-modal::backdrop {
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(8px);
}

.modal-close-form {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
}

.modal-grid {
  display: grid;
  grid-template-columns: 0.86fr 1.14fr;
  min-height: 560px;
}

.modal-hero,
.modal-content {
  padding: 28px;
}

.modal-hero {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  background:
    linear-gradient(135deg, rgba(255, 54, 95, 0.32), transparent 58%),
    linear-gradient(180deg, #1b1f2c, #10121a);
}

.modal-hero p,
.modal-content .helper {
  color: var(--muted);
}

.modal-content {
  display: grid;
  align-content: center;
  gap: 18px;
}

.stacked-form {
  display: grid;
  gap: 12px;
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.form-actions .button {
  flex: 1 1 160px;
}

.connection-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.connection-status[data-type="error"] {
  color: #ff9ab0;
}

.connection-status[data-type="success"] {
  color: #80efe5;
}

.auth-note {
  margin: 0;
  padding: 11px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.api-key-guide {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.86rem;
}

.api-key-guide summary {
  padding: 10px 12px;
  color: var(--muted);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}

.api-key-guide summary::-webkit-details-marker { display: none; }

.api-key-guide summary::before {
  content: "▸";
  font-size: 0.75em;
  transition: transform 0.18s ease;
}

.api-key-guide[open] summary::before {
  transform: rotate(90deg);
}

.api-key-steps {
  margin: 0;
  padding: 2px 14px 14px 32px;
  color: var(--muted);
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.api-key-steps a {
  color: var(--primary);
  text-decoration: none;
}

.api-key-steps a:hover { text-decoration: underline; }

.api-key-tip {
  font-size: 0.82em;
  opacity: 0.7;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: min(420px, calc(100vw - 40px));
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: #161a24;
  color: var(--foreground);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
  z-index: 20;
}

.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media print {
  :root {
    color-scheme: light;
  }

  body {
    background: #ffffff;
    color: #111827;
  }

  .sidebar,
  .hero-actions,
  .filter-workbench,
  .advanced-drawer,
  .more-metrics,
  .empty-state,
  .toast,
  .icon-button,
  .goal-control {
    display: none !important;
  }

  .app-shell,
  .hero,
  .workspace,
  .stats-layout,
  .metrics-grid {
    display: block;
  }

  main {
    padding: 0;
  }

  .hero-copy,
  .now-playing,
  .metrics-grid article,
  .section-band,
  .stat-panel {
    break-inside: avoid;
    border: 1px solid #cbd5e1;
    box-shadow: none;
    background: #ffffff;
    color: #111827;
  }

  .metrics-grid article,
  .section-band {
    margin-bottom: 12px;
  }

  .is-hidden {
    display: none !important;
  }
}

@media (max-width: 1180px) {
  .metrics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-bar.fixed-filters {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .filter-workbench {
    position: static;
  }

  .filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-bar.fixed-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .app-shell,
  .hero,
  .workspace,
  .modal-grid {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
  }

  .nav-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-group {
    grid-column: 1 / -1;
  }

  .mini-panel {
    margin-top: 0;
  }

  .modal-grid {
    min-height: auto;
  }
}

@media (max-width: 720px) {
  main,
  .sidebar {
    padding: 18px;
  }

  .metrics-grid,
  .filter-bar,
  .view-tabs,
  .stats-layout,
  .advanced-grid,
  .suggestion-grid {
    grid-template-columns: 1fr;
  }

  .filter-bar.fixed-filters {
    grid-template-columns: 1fr;
  }

  .track-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .track-meta,
  .track-date {
    grid-column: 2;
    text-align: left;
  }

  .music-summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .music-summary .data-count,
  .music-summary::after {
    grid-column: 2;
  }

  .music-children,
  .music-track-list {
    margin-left: 0;
  }

  .filter-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-heading-actions,
  .report-actions {
    justify-content: stretch;
  }

  .empty-state,
  .metrics-toolbar,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .button,
  .compact-button {
    width: 100%;
  }

  .now-playing {
    min-height: 390px;
  }

  h1 {
    font-size: 2.6rem;
  }
}
