.charts-layout {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  grid-template-areas:
    "stats stats"
    "table aside";
}

.charts-stats,
.charts-aside,
.charts-table {
  position: relative;
  z-index: 2;
}

.charts-stats {
  grid-area: stats;
}

.charts-table {
  grid-area: table;
}

.charts-aside {
  grid-area: aside;
}

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

.stats-grid article {
  border: 1px solid rgba(93, 121, 180, 0.32);
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.74);
  padding: 12px;
}

.stats-grid p {
  margin: 0;
  color: #9db0d6;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.stats-grid strong {
  display: block;
  margin-top: 8px;
  font-size: 1.15rem;
  color: #e7f6ff;
}

.aside-subtitle {
  margin: -4px 0 10px;
  color: #9db0d6;
  font-size: 0.86rem;
}

.country-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 460px;
  overflow: auto;
  padding-right: 4px;
}

.country-pill {
  border: 1px solid rgba(109, 146, 214, 0.44);
  border-radius: 999px;
  background: rgba(15, 25, 47, 0.86);
  color: #d7ecff;
  padding: 7px 12px;
  font-size: 0.82rem;
  cursor: pointer;
}

.country-pill:hover {
  border-color: rgba(130, 178, 255, 0.72);
}

.country-pill.active {
  background: rgba(50, 210, 255, 0.22);
  border-color: rgba(50, 210, 255, 0.62);
}

.empty-pill {
  color: #9db0d6;
  font-size: 0.86rem;
}

.field-row {
  margin-top: 8px;
  display: grid;
  grid-template-columns: 1fr 1.3fr 120px 150px 130px 140px 120px 120px 160px;
  gap: 10px;
}

.field-row input,
.field-row select {
  width: 100%;
}

.back-link {
  margin-top: 8px;
  display: inline-block;
  color: #dff7ff;
  text-decoration: none;
  border: 1px solid rgba(118, 161, 219, 0.55);
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.78rem;
}

.summary-text {
  margin: 0;
  color: #b8cff4;
  font-size: 0.88rem;
}

.summary-row {
  margin: 10px 0 12px;
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.charts-method-note {
  margin: 4px 0 10px;
  border: 1px solid rgba(98, 134, 197, 0.34);
  border-radius: 12px;
  background: rgba(10, 17, 31, 0.7);
  padding: 10px 12px;
}

.charts-method-note p {
  margin: 0;
  color: #c8dbfb;
  font-size: 0.84rem;
  line-height: 1.5;
}

.new-only-switch {
  display: grid;
  align-content: center;
  gap: 5px;
}

.new-only-switch input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #32d2ff;
}

.new-only-switch small {
  color: #9db0d6;
  font-size: 0.74rem;
  line-height: 1.25;
}

.download-csv-btn {
  text-decoration: none;
  border: 1px solid rgba(111, 152, 224, 0.6);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 0.8rem;
  color: #e6f7ff;
  background: rgba(19, 30, 54, 0.88);
}

.download-csv-btn:hover {
  border-color: rgba(50, 210, 255, 0.7);
}

.csv-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.download-csv-btn.subtle {
  padding: 6px 10px;
  font-size: 0.74rem;
  opacity: 0.86;
  background: rgba(16, 25, 44, 0.66);
}

.download-csv-btn.subtle:hover {
  opacity: 1;
}

.download-csv-btn.subtle.primary {
  border-color: rgba(80, 200, 120, 0.55);
  color: #d8ffe5;
  background: rgba(16, 42, 28, 0.72);
}

.download-csv-btn.subtle.primary:hover {
  border-color: rgba(80, 200, 120, 0.8);
}

.spotify-auth-bar {
  margin-bottom: 12px;
  border: 1px solid rgba(99, 132, 192, 0.44);
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.74);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.spotify-auth-main strong {
  display: block;
  font-size: 0.88rem;
  color: #e8f5ff;
}

.spotify-auth-main p {
  margin: 5px 0 0;
  font-size: 0.8rem;
  color: #a8c1ea;
}

.spotify-auth-actions {
  display: flex;
  gap: 8px;
}

.spotify-auth-btn {
  border: 1px solid rgba(111, 152, 224, 0.62);
  border-radius: 999px;
  background: rgba(17, 29, 54, 0.9);
  color: #eaf6ff;
  font-size: 0.74rem;
  padding: 6px 12px;
  cursor: pointer;
}

.spotify-auth-btn.ghost {
  background: rgba(29, 19, 26, 0.6);
}

.transfer-dock {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 60;
  width: min(460px, calc(100vw - 36px));
  border: 1px solid rgba(92, 135, 214, 0.34);
  border-radius: 24px;
  background:
    radial-gradient(circle at top left, rgba(46, 93, 189, 0.25), transparent 44%),
    linear-gradient(180deg, rgba(5, 10, 20, 0.96), rgba(10, 16, 29, 0.96));
  box-shadow: 0 18px 60px rgba(0, 0, 0, 0.42);
  padding: 16px 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  backdrop-filter: blur(18px);
}

.transfer-dock.is-empty {
  opacity: 0.92;
}

.transfer-dock-copy {
  min-width: 0;
}

.transfer-kicker {
  display: inline-block;
  margin-bottom: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7edcff;
}

.transfer-count-label {
  display: block;
  font-size: 1.05rem;
  color: #f4fbff;
}

.transfer-status-line {
  margin: 6px 0 0;
  color: #adc9e8;
  font-size: 0.83rem;
  line-height: 1.45;
}

.transfer-dock-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.transfer-dock-btn {
  border: 1px solid rgba(117, 160, 233, 0.4);
  border-radius: 999px;
  background: rgba(12, 21, 39, 0.9);
  color: #edf7ff;
  padding: 10px 14px;
  font-size: 0.82rem;
  cursor: pointer;
}

.transfer-dock-btn.primary {
  background: linear-gradient(180deg, rgba(64, 148, 255, 0.34), rgba(22, 74, 176, 0.28));
  border-color: rgba(113, 178, 255, 0.58);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}

.transfer-dock-btn.ghost {
  background: rgba(18, 24, 34, 0.78);
}

.transfer-modal-shell {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: none;
}

.transfer-modal-shell.is-open {
  display: block;
}

.transfer-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 7, 15, 0.72);
  backdrop-filter: blur(8px);
}

.transfer-modal-card {
  position: relative;
  width: min(720px, calc(100vw - 28px));
  margin: 7vh auto 0;
  border-radius: 28px;
  border: 1px solid rgba(92, 135, 214, 0.32);
  background:
    radial-gradient(circle at top left, rgba(55, 111, 214, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(6, 12, 24, 0.98), rgba(10, 17, 29, 0.98));
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.48);
  padding: 26px;
}

.transfer-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(16, 22, 34, 0.92);
  color: #edf7ff;
  cursor: pointer;
}

.transfer-modal-kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #7edcff;
}

.transfer-modal-card h3 {
  margin: 0;
  font-size: 1.5rem;
  color: #f6fbff;
}

.transfer-modal-lead {
  margin: 10px 0 18px;
  color: #aac4e4;
  line-height: 1.6;
}

.transfer-field {
  display: block;
}

.transfer-field span {
  display: block;
  margin-bottom: 8px;
  color: #d9ecff;
  font-size: 0.84rem;
}

.transfer-field input {
  width: 100%;
  border-radius: 16px;
  border: 1px solid rgba(120, 154, 219, 0.3);
  background: rgba(13, 20, 34, 0.92);
  color: #f2f8ff;
  padding: 14px 16px;
  font-size: 0.95rem;
}

.transfer-public-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 14px 0 18px;
  color: #c7d8ee;
  font-size: 0.86rem;
}

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

.transfer-provider-card {
  border: 1px solid rgba(122, 162, 222, 0.28);
  border-radius: 20px;
  background: rgba(13, 22, 39, 0.88);
  min-height: 112px;
  text-align: left;
  padding: 16px;
  cursor: pointer;
  color: #f4f8ff;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.transfer-provider-card:hover {
  transform: translateY(-1px);
  border-color: rgba(129, 189, 255, 0.48);
}

.transfer-provider-card.is-connected {
  background: linear-gradient(180deg, rgba(16, 38, 66, 0.92), rgba(13, 22, 39, 0.92));
}

.transfer-provider-card.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.provider-name {
  display: block;
  font-weight: 700;
  font-size: 1rem;
}

.provider-subtitle {
  display: block;
  margin-top: 7px;
  color: #9ab8da;
  font-size: 0.82rem;
}

.transfer-modal-inline-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.transfer-inline-btn {
  border: 1px solid rgba(129, 162, 216, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 40, 0.88);
  color: #e7f3ff;
  padding: 9px 14px;
  font-size: 0.82rem;
  cursor: pointer;
}

.transfer-modal-summary {
  margin-top: 18px;
  color: #d8e8ff;
  font-size: 0.9rem;
}

.transfer-modal-result {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(98, 137, 194, 0.24);
  background: rgba(12, 19, 33, 0.88);
  color: #dcebff;
  min-height: 20px;
}

.transfer-modal-result.is-success {
  border-color: rgba(74, 198, 128, 0.32);
  color: #d5ffe6;
}

.transfer-modal-result.is-error {
  border-color: rgba(234, 98, 98, 0.34);
  color: #ffd7d7;
}

.transfer-modal-result a {
  color: #8fd3ff;
}

.table-wrap {
  position: relative;
  overflow: auto;
  border: 1px solid rgba(93, 121, 180, 0.35);
  border-radius: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 980px;
  background: rgba(9, 15, 29, 0.85);
}

thead th {
  text-align: left;
  font-size: 0.78rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #b8cff4;
  border-bottom: 1px solid rgba(93, 121, 180, 0.35);
  padding: 10px;
  position: sticky;
  top: 0;
  background: rgba(12, 19, 34, 0.95);
}

tbody td {
  padding: 10px;
  border-bottom: 1px solid rgba(93, 121, 180, 0.22);
  font-size: 0.9rem;
}

tbody tr:hover {
  background: rgba(38, 62, 108, 0.26);
}

.rank-chip {
  display: inline-block;
  min-width: 34px;
  text-align: center;
  border-radius: 999px;
  background: rgba(50, 210, 255, 0.25);
  border: 1px solid rgba(50, 210, 255, 0.5);
  color: #d9f9ff;
  font-size: 0.8rem;
  padding: 3px 8px;
}

.track-link {
  color: #f0f8ff;
  text-decoration: none;
  font-weight: 600;
}

.track-link:hover {
  text-decoration: underline;
}

.track-link-btn {
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.track-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.track-btns {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.track-title {
  color: #f0f8ff;
  font-weight: 600;
}

.play-btn {
  border: 1px solid rgba(111, 152, 224, 0.62);
  border-radius: 999px;
  background: rgba(17, 29, 54, 0.9);
  color: #eaf6ff;
  font-size: 0.74rem;
  padding: 5px 12px;
  cursor: pointer;
}

.play-btn:hover {
  border-color: rgba(50, 210, 255, 0.72);
}

.dl-btn {
  border: 1px solid rgba(80, 200, 120, 0.55);
  border-radius: 999px;
  background: rgba(10, 34, 20, 0.9);
  color: #b6f5cc;
  font-size: 0.74rem;
  padding: 5px 10px;
  cursor: pointer;
}

.dl-btn:hover {
  border-color: rgba(80, 200, 120, 0.85);
  color: #d6ffe8;
}

/* ── Inline download panel ── */
.inline-download-row td {
  background: rgba(8, 20, 14, 0.97);
  border-bottom: 1px solid rgba(80, 200, 120, 0.28);
}

.inline-download-wrap {
  padding: 12px 10px 14px;
}

.dl-resolve-status {
  font-size: 0.82rem;
  color: #a9c0e8;
  margin-bottom: 8px;
}

.dl-track-info {
  font-size: 0.88rem;
  color: #d6ffe8;
  margin-bottom: 10px;
}

.dl-track-info strong {
  color: #f0fff8;
}

.dl-duration {
  color: #8dd4aa;
  font-size: 0.8rem;
}

.dl-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dl-url-input {
  flex: 1 1 280px;
  min-width: 220px;
  background: rgba(4, 14, 10, 0.9);
  border: 1px solid rgba(80, 200, 120, 0.4);
  border-radius: 8px;
  color: #d6ffe8;
  font-size: 0.82rem;
  padding: 6px 10px;
}

.dl-url-input:focus {
  outline: none;
  border-color: rgba(80, 200, 120, 0.8);
}

.dl-quality-select {
  background: rgba(4, 14, 10, 0.9);
  border: 1px solid rgba(80, 200, 120, 0.4);
  border-radius: 8px;
  color: #d6ffe8;
  font-size: 0.82rem;
  padding: 6px 8px;
  cursor: pointer;
}

.dl-start-btn {
  border: 1px solid rgba(80, 200, 120, 0.65);
  border-radius: 999px;
  background: rgba(20, 60, 35, 0.95);
  color: #b6f5cc;
  font-size: 0.8rem;
  padding: 6px 14px;
  cursor: pointer;
  white-space: nowrap;
}

.dl-start-btn:hover {
  border-color: rgba(80, 200, 120, 0.95);
  color: #d6ffe8;
}

.dl-close-btn {
  border: 1px solid rgba(120, 120, 160, 0.4);
  border-radius: 999px;
  background: rgba(20, 20, 38, 0.7);
  color: #9db0d6;
  font-size: 0.76rem;
  padding: 5px 12px;
  cursor: pointer;
  white-space: nowrap;
}

.dl-close-btn:hover {
  border-color: rgba(160, 160, 200, 0.6);
  color: #c8d8f4;
}

.dl-progress {
  padding-top: 4px;
}

.dl-progress-status {
  font-size: 0.82rem;
  color: #a9c0e8;
  margin-bottom: 6px;
}


.dl-result {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 4px;
}

.dl-download-link {
  display: inline-block;
  border: 1px solid rgba(80, 200, 120, 0.7);
  border-radius: 999px;
  background: rgba(20, 60, 35, 0.95);
  color: #b6f5cc;
  font-size: 0.82rem;
  padding: 7px 16px;
  text-decoration: none;
  white-space: nowrap;
}

.dl-download-link:hover {
  border-color: rgba(80, 200, 120, 1);
  color: #d6ffe8;
}

.dl-result-name {
  font-size: 0.8rem;
  color: #8dd4aa;
  font-family: monospace;
}

.inline-player-row td {
  background: rgba(11, 18, 33, 0.95);
  border-bottom: 1px solid rgba(93, 121, 180, 0.35);
}

.inline-player-wrap {
  padding: 8px 6px 10px;
}

.inline-player-status {
  margin: 0 0 8px;
  color: #a9c0e8;
  font-size: 0.8rem;
}

.inline-player-audio {
  display: block;
  width: 100%;
  height: 40px;
  border-radius: 10px;
  background: rgba(4, 8, 18, 0.85);
}

.inline-open-link {
  margin-top: 7px;
  display: inline-block;
  color: #9ad5ff;
  text-decoration: none;
  font-size: 0.78rem;
}

.empty-row {
  text-align: center;
  color: #9db0d6;
}

@media (max-width: 1100px) {
  .charts-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "stats"
      "aside"
      "table";
  }

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

@media (max-width: 760px) {
  .field-row {
    grid-template-columns: 1fr;
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .summary-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .spotify-auth-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .track-main {
    align-items: flex-start;
    flex-direction: column;
  }

  .dl-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .dl-url-input {
    min-width: 0;
  }
}


.dl-terms-box {
  margin: 8px 0 12px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 190, 90, 0.35);
  border-radius: 10px;
  background: rgba(36, 27, 10, 0.55);
}

.dl-terms-box p {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: #f9e5bf;
  line-height: 1.5;
}

.dl-terms-check-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #ffecc9;
  font-size: 0.8rem;
}

.dl-terms-check {
  width: 16px;
  height: 16px;
}
/* --- Charts UX refresh --- */
.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(111, 152, 224, 0.62);
  background: rgba(17, 29, 54, 0.9);
  color: #eaf6ff;
  font-size: 0.92rem;
  line-height: 1;
  cursor: pointer;
}

.play-btn.is-playing {
  border-color: rgba(50, 210, 255, 0.82);
  color: #7ee5ff;
}

.dl-btn {
  border-color: rgba(80, 200, 120, 0.65);
  background: rgba(10, 34, 20, 0.9);
  color: #b6f5cc;
}

.track-main {
  align-items: center;
}

.track-title {
  display: inline-block;
  max-width: 520px;
}

.trend-wrap {
  min-width: 170px;
}

.trend-badge {
  display: inline-flex;
  min-width: 44px;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(148, 176, 233, 0.45);
  padding: 2px 8px;
  font-size: 0.72rem;
  font-weight: 700;
}

.trend-wrap.up .trend-badge {
  border-color: rgba(80, 220, 140, 0.65);
  color: #8ef3be;
}

.trend-wrap.down .trend-badge {
  border-color: rgba(255, 120, 120, 0.6);
  color: #ffb0b0;
}

.trend-wrap.new .trend-badge {
  border-color: rgba(255, 210, 90, 0.72);
  color: #ffe3a1;
}

.trend-meter {
  margin-top: 5px;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(107, 132, 186, 0.2);
  overflow: hidden;
}

.trend-fill {
  display: block;
  height: 100%;
}

.trend-fill.up {
  background: linear-gradient(90deg, #2bd489, #80ffd1);
}

.trend-fill.down {
  background: linear-gradient(90deg, #f05d6f, #ff9ca7);
}

.trend-fill.flat {
  background: linear-gradient(90deg, #7084ad, #8ea3cf);
}

.trend-wrap small {
  display: block;
  margin-top: 4px;
  color: #9db0d6;
  font-size: 0.72rem;
}

.now-playing-card {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 10px;
  width: min(330px, calc(100vw - 24px));
  border: 1px solid rgba(92, 133, 205, 0.45);
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.95);
  padding: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
}

.now-playing-card.active {
  display: flex;
}

.now-cover {
  width: 54px;
  height: 54px;
  border-radius: 10px;
  object-fit: cover;
  border: 1px solid rgba(122, 157, 221, 0.45);
}

.now-meta {
  min-width: 0;
}

.now-meta strong,
.now-meta p {
  margin: 0;
}

.now-meta strong {
  display: block;
  color: #e8f6ff;
  font-size: 0.86rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.now-meta p {
  color: #9db0d6;
  font-size: 0.78rem;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.download-modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
}

.download-modal.active {
  display: block;
}

.download-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 3, 8, 0.72);
  backdrop-filter: blur(4px);
}

.download-modal-card {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 24px));
  border: 1px solid rgba(92, 133, 205, 0.45);
  border-radius: 14px;
  background: rgba(7, 14, 26, 0.96);
  padding: 16px;
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.5);
}

.download-modal-card h3 {
  margin: 0 0 6px;
}

.dl-modal-track {
  margin: 0 0 8px;
  color: #d8ecff;
}

.download-modal-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid rgba(144, 168, 214, 0.45);
  background: rgba(18, 28, 48, 0.9);
  color: #cfddf7;
  cursor: pointer;
}

.download-modal .dl-progress-status {
  margin-top: 10px;
}

.download-modal .dl-result {
  margin-top: 10px;
}

@media (max-width: 760px) {
  .trend-wrap {
    min-width: 130px;
  }

  .track-title {
    max-width: 100%;
  }

  .download-modal-card {
    padding: 14px;
  }
}


/* Simplified trend UI */
.trend-simple {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid rgba(120, 140, 175, 0.45);
  background: rgba(11, 18, 32, 0.65);
  font-size: 0.78rem;
}

.trend-icon {
  font-weight: 700;
}

.trend-label {
  color: #dbe9ff;
}

.trend-extra {
  font-weight: 700;
}

.trend-simple.up {
  border-color: rgba(80, 220, 140, 0.65);
}

.trend-simple.up .trend-icon,
.trend-simple.up .trend-extra {
  color: #8ef3be;
}

.trend-simple.down {
  border-color: rgba(255, 120, 120, 0.6);
}

.trend-simple.down .trend-icon,
.trend-simple.down .trend-extra {
  color: #ffb0b0;
}

.trend-simple.new {
  border-color: rgba(255, 210, 90, 0.72);
}

.trend-simple.new .trend-icon,
.trend-simple.new .trend-extra {
  color: #ffe3a1;
}


/* macOS-like icon buttons */
.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.06) 100%);
  backdrop-filter: blur(10px) saturate(130%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 2px 8px rgba(0,0,0,0.22);
  color: #e9f3ff;
  padding: 0;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  margin: 0 auto;
}

.play-btn svg path,
.download-btn svg path,
.dl-btn svg path {
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.play-btn svg path:first-child {
  fill: currentColor;
  stroke: none;
}

.play-btn svg rect {
  fill: currentColor;
}

.play-btn.is-playing {
  border-color: rgba(130, 215, 255, 0.5);
  color: #a6e8ff;
}

.icon-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.28);
}

.icon-btn:active {
  transform: translateY(0);
}

.dl-btn {
  color: #c9ffd8;
}


/* Integrated countries block */
.charts-layout {
  grid-template-columns: 1fr;
  grid-template-areas:
    "stats"
    "table";
}

.charts-aside {
  display: none;
}

.countries-inline {
  margin: 10px 0 12px;
  border: 1px solid rgba(93, 121, 180, 0.28);
  border-radius: 12px;
  background: rgba(8, 14, 28, 0.58);
  padding: 10px;
}

.countries-inline-title {
  margin: 0 0 8px;
  color: #b8cff4;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.country-pills-inline {
  max-height: 140px;
  overflow: auto;
  padding-right: 4px;
}

/* Trend simplified */
.trend-cell {
  display: inline-flex;
}

.trend-badge-simple {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.76rem;
  border: 1px solid rgba(120, 140, 175, 0.4);
  background: rgba(11, 18, 32, 0.65);
  color: #dbe9ff;
  white-space: nowrap;
}

.trend-badge-simple.up {
  border-color: rgba(80, 220, 140, 0.65);
  color: #8ef3be;
}

.trend-badge-simple.down {
  border-color: rgba(255, 120, 120, 0.6);
  color: #ffb0b0;
}

.trend-badge-simple.new {
  border-color: rgba(255, 210, 90, 0.72);
  color: #ffe3a1;
}

.trend-badge-simple.stable {
  color: #c9d6ee;
}


/* Full-width charts table area */
.charts-layout {
  grid-template-columns: 1fr !important;
  grid-template-areas:
    "stats"
    "table" !important;
}

.charts-table {
  width: 100%;
}

.table-wrap {
  width: 100%;
}

table {
  min-width: 100%;
}


.cover-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(121, 153, 214, 0.4);
  background: rgba(11, 19, 35, 0.85);
  display: block;
}
/* Layout full width */
.charts-layout {
  grid-template-columns: 1fr !important;
  grid-template-areas:
    "stats"
    "table" !important;
}

/* Language selector */
.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.lang-switch span {
  color: #b8cff4;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.lang-switch select {
  border: 1px solid rgba(120, 152, 214, 0.5);
  border-radius: 10px;
  background: rgba(12, 20, 38, 0.88);
  color: #ecf5ff;
  font-size: 0.8rem;
  padding: 5px 8px;
}

.csv-actions {
  display: flex;
  gap: 8px;
}

.download-csv-btn.ghost {
  background: rgba(14, 20, 32, 0.88);
}

.table-wrap {
  width: 100%;
}

table {
  min-width: 100%;
}

.sel-col {
  width: 36px;
}

.row-select,
#select-all {
  width: 15px;
  height: 15px;
  accent-color: #4fc3ff;
}

.title-col {
  min-width: 320px;
}

.actions-col {
  text-align: right;
  width: 96px;
}

.actions-wrap {
  display: inline-flex;
  gap: 6px;
  justify-content: flex-end;
  width: 100%;
}

.icon-btn {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: linear-gradient(180deg, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.06) 100%);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.28), 0 2px 8px rgba(0,0,0,0.22);
  color: #e9f3ff;
  padding: 0;
  cursor: pointer;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
  display: block;
  margin: 0 auto;
}

.play-btn svg path,
.dl-btn svg path {
  stroke: currentColor;
  stroke-width: 1.9;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.play-btn svg path:first-child {
  fill: currentColor;
  stroke: none;
}

.play-btn svg rect {
  fill: currentColor;
}

.play-btn.is-playing {
  border-color: rgba(130, 215, 255, 0.5);
  color: #a6e8ff;
}

.dl-btn {
  color: #c9ffd8;
}

.cover-thumb {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid rgba(121, 153, 214, 0.4);
  background: rgba(11, 19, 35, 0.85);
  display: block;
}

.trend-cell {
  display: inline-flex;
}

.trend-badge-simple {
  display: inline-block;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.76rem;
  border: 1px solid rgba(120, 140, 175, 0.4);
  background: rgba(11, 18, 32, 0.65);
  color: #dbe9ff;
  white-space: nowrap;
}

.trend-badge-simple.up { border-color: rgba(80, 220, 140, 0.65); color: #8ef3be; }
.trend-badge-simple.down { border-color: rgba(255, 120, 120, 0.6); color: #ffb0b0; }
.trend-badge-simple.new { border-color: rgba(255, 210, 90, 0.72); color: #ffe3a1; }

.now-playing-card {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 40;
  display: none;
  align-items: center;
  gap: 10px;
  width: min(330px, calc(100vw - 24px));
  border: 1px solid rgba(92, 133, 205, 0.45);
  border-radius: 14px;
  background: rgba(8, 14, 28, 0.95);
  padding: 10px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.42);
}

.now-playing-card.active { display: flex; }
.now-cover { width: 54px; height: 54px; border-radius: 10px; object-fit: cover; border: 1px solid rgba(122, 157, 221, 0.45); }
.now-meta strong, .now-meta p { margin: 0; }
.now-meta strong { color: #e8f6ff; font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.now-meta p { color: #9db0d6; font-size: 0.78rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.download-modal { position: fixed; inset: 0; z-index: 50; display: none; }
.download-modal.active { display: block; }
.download-modal-backdrop { position: absolute; inset: 0; background: rgba(1,3,8,.72); backdrop-filter: blur(4px); }
.download-modal-card { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, calc(100vw - 24px)); border: 1px solid rgba(92,133,205,.45); border-radius: 14px; background: rgba(7,14,26,.96); padding: 16px; }
.download-modal-close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; border-radius: 999px; border: 1px solid rgba(144,168,214,.45); background: rgba(18,28,48,.9); color: #cfddf7; cursor: pointer; }

@media (max-width: 760px) {
  .field-row { grid-template-columns: 1fr; }
  .csv-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .title-col { min-width: 220px; }
  .now-playing-card {
    left: 10px;
    top: 10px;
    width: min(300px, calc(100vw - 20px));
  }
}


thead th:nth-child(4),
tbody td:nth-child(4) {
  width: 20%;
}

thead th:nth-child(6),
tbody td:nth-child(6) {
  width: 16%;
}

tbody td:nth-child(4) {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

tbody td:nth-child(6) {
  font-variant-numeric: tabular-nums;
  color: #d5e7ff;
}

body.theme-light .charts-method-note {
  background: rgba(255, 255, 255, 0.86);
  border-color: rgba(135, 160, 198, 0.4);
}

body.theme-light .charts-method-note p,
body.theme-light .summary-text,
body.theme-light .stats-grid p,
body.theme-light .empty-row,
body.theme-light tbody td:nth-child(6) {
  color: #334155;
}

body.theme-light .stats-grid article,
body.theme-light .table-wrap,
body.theme-light .field-row select,
body.theme-light .field-row input,
body.theme-light .download-csv-btn {
  background: rgba(255, 255, 255, 0.88);
  border-color: rgba(132, 156, 194, 0.5);
  color: #0f172a;
}

body.theme-light table {
  background: rgba(255, 255, 255, 0.92);
}

body.theme-light thead th {
  background: rgba(245, 249, 255, 0.98);
  color: #334155;
  border-bottom-color: rgba(136, 161, 200, 0.5);
}

body.theme-light tbody td {
  border-bottom-color: rgba(136, 161, 200, 0.35);
  color: #0f172a;
}

body.theme-light tbody tr:hover {
  background: rgba(87, 140, 220, 0.12);
}


.charts-loading[hidden] {
  display: none !important;
}

.charts-loading {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  font-size: 0.82rem;
  color: #cfe2ff;
  background: rgba(10, 18, 34, 0.92);
  border-bottom: 1px solid rgba(93, 121, 180, 0.35);
}

.spinner {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid rgba(180, 208, 255, 0.28);
  border-top-color: #5bd5ff;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

body.theme-light .charts-loading {
  color: #334155;
  background: rgba(245, 249, 255, 0.96);
  border-bottom-color: rgba(136, 161, 200, 0.45);
}

body.theme-light .spinner {
  border: 2px solid rgba(100, 116, 139, 0.25);
  border-top-color: #0284c7;
}

.djcity-filter-block {
  margin: 18px 0 12px;
}

.djcity-filter-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: rgba(228, 239, 255, 0.86);
  font-size: 0.9rem;
}

.djcity-genre-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.genre-chip {
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 9px 14px;
  background: rgba(255, 255, 255, 0.05);
  color: #e9f3ff;
  cursor: pointer;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.genre-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(130, 215, 255, 0.4);
}

.genre-chip.is-active {
  background: linear-gradient(180deg, rgba(97, 202, 255, 0.26) 0%, rgba(54, 140, 255, 0.18) 100%);
  border-color: rgba(130, 215, 255, 0.52);
  color: #f7fbff;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.22), 0 10px 24px rgba(11, 26, 54, 0.28);
}

.djcity-range-input {
  min-width: 110px;
}

body.theme-light .djcity-filter-head {
  color: #24415f;
}

body.theme-light .genre-chip {
  background: rgba(20, 38, 71, 0.05);
  color: #173456;
  border-color: rgba(20, 38, 71, 0.12);
}

body.theme-light .genre-chip.is-active {
  background: linear-gradient(180deg, rgba(97, 202, 255, 0.2) 0%, rgba(54, 140, 255, 0.14) 100%);
  border-color: rgba(54, 140, 255, 0.28);
  color: #102a48;
}

@media (max-width: 900px) {
  .transfer-dock {
    left: 12px;
    right: 12px;
    bottom: 12px;
    width: auto;
    grid-template-columns: 1fr;
  }

  .transfer-dock-actions {
    justify-content: stretch;
  }

  .transfer-dock-btn {
    flex: 1;
  }

  .transfer-modal-card {
    width: calc(100vw - 16px);
    margin-top: 14px;
    padding: 20px;
  }

  .transfer-provider-grid {
    grid-template-columns: 1fr;
  }
}
