:root {
  --bg: #ffffff;
  --bg-soft: #ffffff;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-muted: #f6f3ef;
  --border: rgba(72, 50, 33, 0.12);
  --border-strong: rgba(72, 50, 33, 0.2);
  --text: #2c2118;
  --text-muted: #695a4b;
  --text-dim: #8d7c6a;
  --heading: #17120e;
  --accent: #98271d;
  --accent-strong: #98271d;
  --accent-soft: rgba(152, 39, 29, 0.08);
  --accent-gold: #b26f18;
  --accent-gold-soft: rgba(178, 111, 24, 0.12);
  --flag-green: #10a760;
  --c-diamond-bg: #efe6dc;
  --c-diamond-fg: #3b2b1d;
  --c-mplat-bg: #f4ece0;
  --c-mplat-fg: #3b2b1d;
  --c-plat-bg: #f7efe4;
  --c-plat-fg: #3b2b1d;
  --c-gold-bg: #f4ebd4;
  --c-gold-fg: #6e4510;
  --c-silver-bg: #ece7e1;
  --c-silver-fg: #55483d;
  --radius-card: 26px;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --shadow: 0 24px 56px rgba(92, 64, 39, 0.1);
  --shadow-hover: 0 28px 68px rgba(92, 64, 39, 0.14);
  --transition: 180ms ease;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: 'Public Sans', 'Segoe UI', sans-serif;
  color: var(--text);
  background: #ffffff;
  line-height: 1.6;
  overflow-x: hidden;
}

img,
svg,
video,
canvas,
iframe {
  max-width: 100%;
}

a { color: inherit; text-decoration: none; }

.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  width: min(1280px, calc(100% - 32px));
  margin: 16px auto 0;
  padding: 14px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 16px 36px rgba(92, 64, 39, 0.09);
  backdrop-filter: blur(18px);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-copy strong {
  font-size: 0.98rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--heading);
}

.brand-copy small {
  color: var(--text-dim);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.13em;
}

.ng-flag,
.ng-flag-large {
  display: inline-flex;
  overflow: hidden;
}

.ng-flag {
  height: 18px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.ng-flag span:nth-child(1),
.ng-flag span:nth-child(3) {
  width: 10px;
  background: var(--flag-green);
}

.ng-flag span:nth-child(2) {
  width: 10px;
  background: #ffffff;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link.section-link {
  padding: 10px 16px;
  border-radius: var(--radius-pill);
  font-size: 0.83rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background-color var(--transition), color var(--transition), transform var(--transition);
}

.nav-link.section-link:hover {
  background: rgba(152, 39, 29, 0.05);
  color: var(--heading);
}

.nav-link.section-link.active {
  background: rgba(152, 39, 29, 0.08);
  color: var(--accent-strong);
  box-shadow: inset 0 0 0 1px rgba(152, 39, 29, 0.14);
}

.sub-nav {
  width: min(1280px, calc(100% - 32px));
  margin: 12px auto 0;
  padding: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(16px);
  scrollbar-width: none;
}

.sub-nav::-webkit-scrollbar { display: none; }

.sub-nav-link {
  padding: 9px 14px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  transition: background-color var(--transition), color var(--transition);
}

.sub-nav-link:hover {
  background: rgba(152, 39, 29, 0.05);
  color: var(--heading);
}

.sub-nav-link.active {
  background: rgba(152, 39, 29, 0.08);
  color: var(--accent-strong);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: none;
  background: transparent;
  padding: 6px;
  cursor: pointer;
}

.nav-toggle span {
  width: 22px;
  height: 2px;
  border-radius: 999px;
  background: var(--heading);
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.page-header {
  width: min(1280px, calc(100% - 32px));
  margin: 18px auto 0;
  padding: 44px 28px 36px;
  border-radius: 34px;
  border: 1px solid var(--border);
  background: #ffffff;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
}

.page-header.small { padding-top: 34px; padding-bottom: 30px; }

.header-inner {
  position: relative;
  z-index: 1;
  max-width: 820px;
}

.ng-flag-large {
  height: 12px;
  gap: 3px;
  margin-bottom: 18px;
  border-radius: var(--radius-pill);
}

.nf-g { width: 28px; background: #10a760; }
.nf-w { width: 28px; background: #ffffff; }

.page-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(2rem, 4.2vw, 3.5rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--heading);
}

.subtitle {
  margin-top: 12px;
  max-width: 62ch;
  color: var(--text-muted);
  font-size: 1rem;
}

main {
  flex: 1;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.container {
  width: 100%;
  margin: 0 auto;
}

.main-content {
  padding: 18px 0 48px;
}

.footer {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
}

.footer-grid {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px 0 34px;
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 1fr;
  gap: 24px;
}

.footer-kicker {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.7rem;
  font-weight: 800;
}

.footer-copy {
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.9rem;
}

.footer-links {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
}

.footer-links a {
  font-weight: 600;
  color: var(--text);
}

.footer-links a:hover { color: var(--accent); }

.stats-bar {
  display: grid;
  width: min(1280px, calc(100% - 32px));
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px auto 0;
}

.stat-chip,
.stat-item {
  min-height: 88px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 8px;
  padding: 16px 20px;
  border-radius: 18px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.stat-chip { background: var(--surface-strong); }
.stat-item { background: #ffffff; }

.stat-num {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  line-height: 1;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--heading);
}

.stat-label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 800;
}

.stat-chip.total {
  background: rgba(152, 39, 29, 0.08);
  color: var(--heading);
  box-shadow: inset 0 0 0 1px rgba(152, 39, 29, 0.14);
}

.stat-chip.total .stat-num,
.stat-chip.total .stat-label { color: #fff; }

.stat-chip.diamond { background: var(--c-diamond-bg); color: var(--c-diamond-fg); }
.stat-chip.multi-platinum { background: var(--c-mplat-bg); color: var(--c-mplat-fg); }
.stat-chip.gold { background: var(--c-gold-bg); color: var(--c-gold-fg); }
.stat-chip.silver { background: var(--c-silver-bg); color: var(--c-silver-fg); }

.stat-chip.diamond .stat-num,
.stat-chip.multi-platinum .stat-num,
.stat-chip.gold .stat-num,
.stat-chip.silver .stat-num,
.stat-chip.diamond .stat-label,
.stat-chip.multi-platinum .stat-label,
.stat-chip.gold .stat-label,
.stat-chip.silver .stat-label { color: inherit; }

.stat-item .stat-num.stat-gold { color: var(--accent-gold); }
.stat-item .stat-num.stat-plat { color: var(--accent-strong); }

.controls-bar,
.controls-panel {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.controls-bar {
  position: sticky;
  top: 98px;
  z-index: 90;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin-top: 14px;
  border-radius: 22px;
}

.controls-panel {
  padding: 16px;
  margin-bottom: 12px;
  border-radius: 22px;
}

.search-wrap {
  position: relative;
  flex: 1 1 250px;
  display: flex;
  align-items: center;
  min-width: 0;
}

.search-wrap-compact { margin-bottom: 0; }

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.ctrl-input,
.ctrl-select,
.search-input,
.select-control {
  min-height: 46px;
  border: 1px solid var(--border-strong);
  background: rgba(255, 255, 255, 0.82);
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition), background-color var(--transition);
}

.ctrl-input,
.search-input {
  width: 100%;
  border-radius: var(--radius-pill);
  padding: 0 42px 0 42px;
  font-size: 0.95rem;
}

.ctrl-select,
.select-control {
  border-radius: 14px;
  padding: 0 14px;
  font-size: 0.9rem;
}

.ctrl-input:focus,
.ctrl-select:focus,
.search-input:focus,
.select-control:focus {
  border-color: rgba(152, 39, 29, 0.25);
  box-shadow: 0 0 0 4px rgba(152, 39, 29, 0.08);
  background: rgba(255, 255, 255, 0.94);
}

.clear-btn,
.search-clear {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: rgba(152, 39, 29, 0.06);
  color: var(--text-muted);
  cursor: pointer;
}

.search-clear { display: none; }

.clear-btn:hover,
.search-clear:hover {
  background: rgba(152, 39, 29, 0.1);
  color: var(--heading);
}

.filters-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-group label {
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 0.68rem;
  font-weight: 800;
}

.table-wrap,
.levels-table-shell,
.tallies-section {
  border: 1px solid var(--border);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.table-wrap,
.levels-table-shell {
  overflow: hidden;
  border-radius: 24px;
}

.table-wrap,
.table-view,
.levels-table-shell,
.dsp-table-wrap,
.gc-table-wrap,
.archive-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.songs-table,
.levels-table-full {
  width: 100%;
  border-collapse: collapse;
}

.songs-table,
.levels-table-full,
.archive-table,
.gc-table,
.dsp-table {
  min-width: 720px;
}

.songs-table thead tr {
  background: #faf8f5;
}

.songs-table th {
  text-align: left;
  padding: 16px 18px;
  color: var(--text-dim);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border-bottom: 1px solid var(--border);
}

.songs-table th.sortable { cursor: pointer; }

.songs-table th.sortable:hover,
.songs-table th.sort-active { background: rgba(152, 39, 29, 0.05); }

.songs-table td {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(72, 50, 33, 0.08);
  color: var(--text);
  vertical-align: middle;
}

.song-row:hover { background: rgba(152, 39, 29, 0.04); }

.th-num,
.td-num,
.th-rank,
.td-songs {
  width: 72px;
  text-align: center;
}

.th-cert,
.td-cert { width: 180px; }

.th-units,
.td-units { width: 170px; }

.song-title {
  font-weight: 800;
  color: var(--heading);
}

.artist-link { color: inherit; }

.artist-link:hover .song-title,
.song-wiki-link:hover,
.cert-country-link:hover,
.level-country-link:hover { color: var(--accent); }

.artist-name,
.song-artist,
.title-sub { color: var(--text-muted); }

.td-units {
  font-weight: 800;
  color: var(--accent-strong);
  white-space: nowrap;
}

.sort-indicator { font-size: 0.8em; }

.loading-state,
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 18px;
  color: var(--text-muted);
}

.empty-icon,
.empty-state .icon { font-size: 2rem; }

.spinner {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 3px solid rgba(13, 122, 76, 0.15);
  border-top-color: var(--accent);
  animation: spin 0.75s linear infinite;
}

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

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: #f8f6f2;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary:hover { background: rgba(152, 39, 29, 0.08); }

.btn-link { text-decoration: none; }

.results-info {
  padding: 8px 4px 10px;
  min-height: 36px;
  color: var(--text-dim);
  font-size: 0.84rem;
}

.artist-total {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 8px 12px;
  border: 1px solid rgba(152, 39, 29, 0.16);
  border-radius: var(--radius-pill);
  background: rgba(152, 39, 29, 0.08);
  color: var(--accent-strong);
  font-weight: 800;
}

.pagination,
.archive-pagination {
  margin-top: 16px;
  display: flex;
  justify-content: center;
}

.page-btns {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.page-btn,
.page-link {
  min-width: 42px;
  min-height: 40px;
  padding: 0 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: #f8f6f2;
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

.page-btn:hover:not([disabled]),
.page-link:hover:not(.current) {
  background: rgba(152, 39, 29, 0.08);
}

.page-btn.active,
.page-link.current {
  background: rgba(152, 39, 29, 0.12);
  border-color: rgba(152, 39, 29, 0.18);
  color: var(--accent-strong);
}

.page-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.page-ellipsis { line-height: 40px; color: var(--text-dim); }

.legend-bar {
  margin-top: 14px;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: rgba(11, 17, 27, 0.78);
  box-shadow: var(--shadow);
  color: var(--text-muted);
  font-size: 0.82rem;
}

.legend-item { display: inline-flex; align-items: center; gap: 8px; }

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.dot.diamond { background: var(--c-diamond-bg); }
.dot.multi-platinum { background: var(--c-mplat-bg); }
.dot.platinum { background: var(--c-plat-bg); }
.dot.gold { background: var(--c-gold-bg); }
.dot.silver { background: var(--c-silver-bg); }

.view-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
}

.view-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: none;
  background: #f8f6f2;
  color: var(--text-muted);
  cursor: pointer;
}

.view-btn.active {
  background: rgba(152, 39, 29, 0.12);
  color: var(--accent-strong);
}

.skeleton-wrap,
.grid-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 18px;
  padding: 18px 0 46px;
}

.skeleton-card,
.song-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.skeleton-card { padding: 22px; }

.sk-title,
.sk-row {
  border-radius: 8px;
  background: #f2f2f2;
  animation: shimmer 1.2s ease-in-out infinite alternate;
}

.sk-title { height: 18px; width: 66%; margin-bottom: 14px; }
.sk-row { height: 14px; width: 92%; margin-bottom: 8px; }
.sk-row.short { width: 54%; }

@keyframes shimmer {
  from { background-position: -300px 0; }
  to { background-position: 300px 0; }
}

.song-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: riseIn 0.35s ease forwards;
}

.song-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
  border-color: rgba(152, 39, 29, 0.16);
}

@keyframes riseIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.song-card .song-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1rem;
  line-height: 1.3;
}

.song-wiki-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: rgba(152, 39, 29, 0.24);
  text-underline-offset: 3px;
}

.song-artist { margin-top: -2px; font-size: 0.85rem; }

.cert-list { display: flex; flex-direction: column; gap: 8px; }

.cert-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid rgba(72, 50, 33, 0.08);
}

.cert-row:last-child { border-bottom: none; }

.cert-row-left,
.cert-country-link,
.level-country-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.cert-row-right,
.cert-badge,
.tbl-badge,
.badge,
.th-badge,
.lv-val {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  font-size: 0.74rem;
  font-weight: 800;
  white-space: nowrap;
}

.tbl-cert-text {
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.cert-row-right { margin-left: auto; }

.flag-img {
  width: 16px;
  height: 12px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
}

.flag-img.table {
  width: 14px;
  height: 10px;
  vertical-align: -1px;
}

.diamond { background: #efe6dc; color: var(--text); }
.multi-platinum { background: #f4ece0; color: var(--text); }
.platinum { background: #f7efe4; color: var(--text); }
.gold { background: #f4ebd4; color: #6e4510; }
.silver { background: #ece7e1; color: #55483d; }

.table-view {
  padding: 18px 0 46px;
  overflow-x: auto;
}

.table-view .songs-table {
  border-radius: 24px;
  overflow: hidden;
  background: var(--surface-strong);
}

.table-view .songs-table thead th {
  position: sticky;
  top: 0;
  background: #faf8f5;
}

.region-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.title-main { font-weight: 800; color: var(--heading); }

.tbl-threshold {
  margin-top: 4px;
  font-size: 0.68rem;
  color: var(--text-dim);
}

.levels-container {
  padding: 18px 0 46px;
}

.levels-note {
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #f8f6f2;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.levels-notes-list { margin-top: 24px; }
.levels-notes-heading { color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.7rem; font-weight: 800; margin-bottom: 10px; }
.levels-notes-ol { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.levels-notes-ol li { color: var(--text-muted); font-size: 0.9rem; }

.levels-table-full { table-layout: fixed; }

.levels-table-full thead th {
  padding: 14px 10px;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  border-right: 1px solid rgba(31, 39, 35, 0.08);
  text-align: center;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.levels-table-full .country-col {
  width: 22%;
  min-width: 190px;
  text-align: left;
}

.levels-table-full tbody td {
  padding: 12px 10px;
  border-bottom: 1px solid rgba(31, 39, 35, 0.08);
  border-right: 1px solid rgba(31, 39, 35, 0.05);
  text-align: center;
}

.levels-table-full tbody tr:hover td { background: rgba(152, 39, 29, 0.04); }

.country-cell { text-align: left !important; }
.level-country { font-weight: 800; color: var(--heading); }
.group-head { color: var(--text-dim); }

.th-badge.diamond,
.lv-val.diamond,
.th-badge.platinum,
.lv-val.platinum,
.th-badge.gold,
.lv-val.gold,
.th-badge.silver,
.lv-val.silver {
  background: #f7f4ef;
  color: var(--text);
}

.page-shell {
  width: min(1280px, 100%);
  margin: 0 auto;
}

.page-shell-narrow { width: min(1120px, 100%); }

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 1fr);
  gap: 18px;
  align-items: start;
}

.left-column,
.right-column { min-width: 0; }

.tallies-section {
  padding: 18px;
  border-radius: 24px;
  position: sticky;
  top: 96px;
}

.tallies-section-static { position: static; }

.section-head { margin-bottom: 14px; }

.section-head h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.18rem;
  letter-spacing: -0.03em;
  color: var(--heading);
}

.section-head p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 0.88rem;
}

.section-head-spread {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.section-link {
  color: var(--accent);
  font-weight: 700;
  font-size: 0.85rem;
}

.section-link:hover { color: var(--accent-strong); }

.preview-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.preview-item {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-radius: 18px;
  border: 1px solid var(--border);
  background: #fbfaf8;
  transition: transform var(--transition), border-color var(--transition), background-color var(--transition);
}

.preview-item:hover {
  transform: translateY(-1px);
  border-color: rgba(152, 39, 29, 0.16);
  background: rgba(152, 39, 29, 0.05);
}

.preview-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(152, 39, 29, 0.08);
  color: var(--accent-strong);
  font-weight: 800;
}

.preview-copy { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.preview-name { font-weight: 800; color: var(--heading); }
.preview-meta { color: var(--text-muted); font-size: 0.82rem; }

.detail-actions { margin-bottom: 14px; }

.detail-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.detail-stat-item { min-height: 124px; }

.hidden { display: none !important; }

@media (max-width: 980px) {
  body.nav-open {
    overflow: hidden;
  }

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

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

  .navbar,
  .sub-nav,
  .page-header,
  main { width: calc(100% - 24px); }

  .navbar {
    align-items: flex-start;
    border-radius: 24px;
    margin-top: 10px;
    padding: 12px 14px;
  }

  .sub-nav {
    margin-top: 10px;
    padding: 6px;
  }

  .nav-toggle { display: flex; margin-left: auto; }

  .nav-links {
    display: none;
    position: fixed;
    top: 72px;
    left: 12px;
    right: 12px;
    z-index: 300;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 12px;
    border-radius: 20px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.98);
    box-shadow: var(--shadow);
  }

  .controls-bar {
    top: 88px;
    padding: 12px;
    border-radius: 18px;
  }

  .nav-link.section-link {
    display: flex;
    align-items: center;
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    touch-action: manipulation;
  }

  .nav-toggle[aria-expanded="false"] + .nav-links { display: none !important; }
  .nav-toggle[aria-expanded="true"] + .nav-links { display: flex !important; }
  .nav-links.open { display: flex; }
  .filters-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tallies-section { position: static; }
}

@media (max-width: 720px) {
  .controls-bar {
    position: relative;
    top: 0;
    gap: 10px;
  }

  .navbar,
  .sub-nav,
  .page-header,
  main {
    width: calc(100% - 16px);
  }

  .navbar {
    margin-top: 8px;
    padding: 10px 12px;
    gap: 10px;
  }

  .brand-copy strong {
    font-size: 0.86rem;
  }

  .sub-nav {
    margin-top: 8px;
    padding: 4px;
    gap: 4px;
  }

  .sub-nav-link {
    font-size: 0.74rem;
    padding: 8px 10px;
  }

  .stats-bar { grid-template-columns: 1fr; }
  .nav-links { top: 64px; left: 0; right: 0; }
  .page-header,
  .controls-panel,
  .controls-bar,
  .legend-bar,
  .tallies-section,
  .table-wrap,
  .levels-table-shell { border-radius: 22px; }
  .filters-row { grid-template-columns: 1fr; }
  .songs-table th,
  .songs-table td,
  .levels-table-full thead th,
  .levels-table-full tbody td { padding-left: 12px; padding-right: 12px; }

  .songs-table,
  .levels-table-full,
  .archive-table,
  .gc-table,
  .dsp-table {
    min-width: 640px;
  }

  .results-info,
  .gc-results-info,
  .dsp-results-info {
    font-size: 0.76rem;
  }
}

/* Flat black refresh */
:root {
  --bg: #050505;
  --bg-soft: #0a0a0a;
  --surface: #0c0c0c;
  --surface-strong: #101010;
  --surface-muted: #151515;
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.18);
  --text: #f3f3f3;
  --text-muted: #b3b3b3;
  --text-dim: #8f8f8f;
  --heading: #ffffff;
  --accent: #ffffff;
  --accent-strong: #ffffff;
  --accent-soft: rgba(255, 255, 255, 0.08);
  --accent-gold: #e0bb62;
  --accent-gold-soft: rgba(224, 187, 98, 0.14);
  --c-diamond-bg: #1a1a1a;
  --c-diamond-fg: #f0f0f0;
  --c-mplat-bg: #171717;
  --c-mplat-fg: #f0f0f0;
  --c-plat-bg: #141414;
  --c-plat-fg: #efefef;
  --c-gold-bg: #1d1810;
  --c-gold-fg: #e0bb62;
  --c-silver-bg: #161616;
  --c-silver-fg: #c9c9c9;
  --radius-card: 18px;
  --radius: 14px;
  --radius-sm: 10px;
  --font-body: 'Space Grotesk', 'Segoe UI', sans-serif;
  --font-heading: 'Sora', 'Segoe UI', sans-serif;
  --shadow: none;
  --shadow-hover: none;
}

body {
  font-family: var(--font-body);
  background: var(--bg);
}

.navbar {
  margin: 0 auto;
  padding: 16px 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: rgba(5, 5, 5, 0.98);
  box-shadow: none;
  backdrop-filter: none;
}

.brand-copy strong {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav-links {
  gap: 2px;
}

.nav-link.section-link,
.sub-nav-link {
  border-radius: 0;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.nav-link.section-link {
  padding: 10px 14px;
  font-size: 0.76rem;
}

.nav-link.section-link:hover,
.sub-nav-link:hover,
.footer-links a:hover,
.section-link:hover {
  background: transparent;
  color: var(--heading);
}

.nav-link.section-link.active,
.sub-nav-link.active {
  background: transparent;
  color: var(--heading);
  box-shadow: inset 0 -2px 0 0 #ffffff;
}

.sub-nav {
  padding: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  backdrop-filter: none;
}

.sub-nav-link {
  padding: 12px 0;
  font-size: 0.74rem;
}

.page-header {
  padding: 36px 0 28px;
  border-radius: 0;
  background: var(--surface-strong);
}

.page-header h1,
.stat-num,
.song-card .song-title,
.section-head h2 {
  font-family: var(--font-heading);
}

.footer {
  background: var(--bg);
}

.stat-chip,
.stat-item,
.controls-bar,
.controls-panel,
.table-wrap,
.levels-table-shell,
.tallies-section,
.legend-bar,
.skeleton-card,
.song-card,
.levels-note,
.preview-item,
.btn-secondary,
.page-btn,
.page-link,
.view-btn {
  background: var(--surface-strong);
  box-shadow: none;
}

.stat-item,
.preview-item,
.levels-note,
.btn-secondary,
.page-btn,
.page-link,
.view-btn,
.ctrl-input,
.ctrl-select,
.search-input,
.select-control {
  background: var(--surface-muted);
}

.stat-chip,
.stat-item,
.legend-bar,
.view-toggle {
  border-radius: 10px;
}

.ctrl-input,
.ctrl-select,
.search-input,
.select-control {
  color: var(--text);
  border-color: var(--border-strong);
}

.ctrl-input:focus,
.ctrl-select:focus,
.search-input:focus,
.select-control:focus {
  box-shadow: none;
  border-color: rgba(255, 255, 255, 0.3);
  background: var(--surface);
}

.clear-btn,
.search-clear {
  background: #1a1a1a;
}

.songs-table thead tr,
.table-view .songs-table thead th {
  background: #0d0d0d;
}

.songs-table td,
.levels-table-full tbody td,
.cert-row {
  border-bottom-color: var(--border);
}

.song-row:hover,
.preview-item:hover,
.page-btn:hover:not([disabled]),
.page-link:hover:not(.current) {
  background: #151515;
}

.btn-secondary:hover,
.view-btn.active,
.page-btn.active,
.page-link.current {
  background: #171717;
  color: var(--heading);
}

.song-wiki-link {
  text-decoration: none;
}

.flag-img {
  box-shadow: none;
}

.sk-title,
.sk-row {
  background: #1b1b1b;
}

@media (max-width: 980px) {
  .navbar {
    border-radius: 0;
  }

  .nav-links {
    border-radius: 0;
    background: var(--surface-strong);
    box-shadow: none;
  }
}

@media (max-width: 720px) {
  .page-header,
  .controls-panel,
  .controls-bar,
  .legend-bar,
  .tallies-section,
  .table-wrap,
  .levels-table-shell {
    border-radius: 0;
  }
}
