:root {
  --bg: #080b10;
  --bg-soft: #0c1118;
  --panel: #10161f;
  --panel-2: #131b26;
  --panel-3: #172130;
  --line: rgba(255, 255, 255, 0.075);
  --line-strong: rgba(255, 255, 255, 0.13);
  --text: #e9eef5;
  --text-soft: #c3cede;
  --muted: #8797a9;
  --faint: #586678;
  --amber: #f6c453;
  --amber-soft: rgba(246, 196, 83, 0.14);
  --teal: #4fd1c5;
  --teal-soft: rgba(79, 209, 197, 0.13);
  --violet: #9d8cff;
  --violet-soft: rgba(157, 140, 255, 0.13);
  --rose: #f27d9d;
  --rose-soft: rgba(242, 125, 157, 0.13);
  --lime: #b7d96b;
  --danger: #ff7a8a;
  --danger-soft: rgba(255, 122, 138, 0.12);
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.32);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  background:
    radial-gradient(900px 520px at 74% -12%, rgba(246, 196, 83, 0.09), transparent 60%),
    radial-gradient(760px 500px at 2% 8%, rgba(79, 209, 197, 0.075), transparent 62%),
    radial-gradient(900px 700px at 88% 100%, rgba(157, 140, 255, 0.05), transparent 66%),
    var(--bg);
  background-attachment: fixed;
}

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

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

button {
  cursor: pointer;
}

::selection {
  background: rgba(246, 196, 83, 0.25);
}

:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
}

::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #26313f;
  border: 3px solid var(--bg);
  border-radius: 99px;
}
::-webkit-scrollbar-thumb:hover {
  background: #354457;
}

/* Boot / login ------------------------------------------------------------ */

.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  gap: 16px;
  text-align: center;
  color: var(--muted);
}

.boot-mark {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  height: 46px;
}
.boot-mark span {
  width: 6px;
  border-radius: 99px;
  background: linear-gradient(180deg, var(--amber), var(--teal));
  animation: boot-bar 1.1s ease-in-out infinite;
}
.boot-mark span:nth-child(1) {
  height: 16px;
  animation-delay: -0.2s;
}
.boot-mark span:nth-child(2) {
  height: 30px;
  animation-delay: -0.4s;
}
.boot-mark span:nth-child(3) {
  height: 44px;
  animation-delay: -0.6s;
}
.boot-mark span:nth-child(4) {
  height: 26px;
  animation-delay: -0.8s;
}
.boot-mark span:nth-child(5) {
  height: 14px;
  animation-delay: -1s;
}
@keyframes boot-bar {
  0%,
  100% {
    transform: scaleY(0.45);
    opacity: 0.45;
  }
  50% {
    transform: scaleY(1);
    opacity: 1;
  }
}

.login-screen {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 6vw;
  max-width: 1180px;
  margin: 0 auto;
  padding: 48px 32px;
}
.login-copy .eyebrow {
  color: var(--amber);
}
.login-copy h1 {
  margin: 10px 0 16px;
  font-size: clamp(2.5rem, 5vw, 4.4rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
  font-weight: 700;
}
.login-copy h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--amber), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-copy p {
  max-width: 46ch;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.7;
}
.login-points {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}
.login-points span {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  color: var(--text-soft);
  border-radius: 99px;
  padding: 6px 11px;
  font-size: 12px;
}
.login-card {
  border: 1px solid var(--line-strong);
  background: linear-gradient(155deg, rgba(22, 31, 43, 0.94), rgba(12, 17, 24, 0.98));
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}
.login-card h2 {
  margin: 0 0 4px;
  font-size: 22px;
  letter-spacing: -0.025em;
}
.login-card .hint {
  margin: 0 0 22px;
  color: var(--muted);
  font-size: 13px;
}
.login-card label {
  display: block;
  font-size: 12px;
  color: var(--text-soft);
  margin-bottom: 7px;
}
.login-card .field {
  display: flex;
  gap: 8px;
}
.login-card input {
  flex: 1;
  min-width: 0;
  background: #0a0f16;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 12px 14px;
  font-family: var(--mono);
  font-size: 13px;
}
.login-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.login-error {
  margin-top: 14px;
  color: var(--danger);
  font-size: 13px;
  min-height: 20px;
}
.login-foot {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--faint);
  font-size: 11px;
}
.link-button {
  border: 0;
  background: none;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
  font-size: 12px;
}
.link-button:hover {
  color: var(--text);
}

/* App shell --------------------------------------------------------------- */

.shell {
  min-height: 100vh;
}
.sidebar {
  position: fixed;
  z-index: 30;
  inset: 0 auto 0 0;
  width: 248px;
  display: flex;
  flex-direction: column;
  padding: 22px 16px 16px;
  background: linear-gradient(180deg, rgba(13, 18, 25, 0.96), rgba(8, 11, 16, 0.98));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 2px 8px 22px;
}
.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #0a0e13;
  border: 1px solid var(--line-strong);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.brand-name {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.brand-sub {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.nav {
  display: grid;
  gap: 3px;
}
.nav-label {
  padding: 14px 10px 7px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 11px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13.5px;
  transition: background 140ms ease, color 140ms ease;
}
.nav-item svg {
  width: 17px;
  height: 17px;
  stroke-width: 1.7;
}
.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.035);
}
.nav-item.active {
  color: var(--amber);
  background: linear-gradient(90deg, rgba(246, 196, 83, 0.13), rgba(246, 196, 83, 0.035));
  box-shadow: inset 2px 0 0 var(--amber);
}
.sidebar-scan {
  margin-top: auto;
  padding: 16px 8px 6px;
}
.sidebar-status {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.018);
  border-radius: 14px;
  padding: 12px;
}
.sidebar-status .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--muted);
}
.sidebar-status .row + .row {
  margin-top: 8px;
}
.sidebar-status strong {
  color: var(--text-soft);
  font-weight: 500;
}
.sidebar-foot {
  padding: 12px 10px 0;
  color: var(--faint);
  font-size: 10.5px;
  display: flex;
  justify-content: space-between;
}

.main {
  margin-left: 248px;
  min-height: 100vh;
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 66px;
  padding: 12px 30px;
  background: rgba(8, 11, 16, 0.72);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
}
.crumbs strong {
  color: var(--text);
  font-weight: 500;
}
.crumbs .sep {
  color: var(--faint);
}
.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
  border-radius: 99px;
  padding: 5px 10px;
  color: var(--muted);
  font-size: 11.5px;
}
.dot {
  width: 6px;
  height: 6px;
  border-radius: 99px;
  background: var(--faint);
}
.dot.ok {
  background: var(--teal);
  box-shadow: 0 0 0 4px rgba(79, 209, 197, 0.1);
}
.dot.warn {
  background: var(--amber);
  box-shadow: 0 0 0 4px rgba(246, 196, 83, 0.1);
}
.dot.bad {
  background: var(--danger);
  box-shadow: 0 0 0 4px rgba(255, 122, 138, 0.1);
}
.view {
  max-width: 1480px;
  margin: 0 auto;
  padding: 30px;
  animation: view-in 220ms ease both;
}
@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

/* Typography / primitives ------------------------------------------------- */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 10.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 16px;
  height: 1px;
  background: currentColor;
  opacity: 0.7;
}
h1,
h2,
h3,
p {
  margin-top: 0;
}
.page-title {
  margin: 6px 0 4px;
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 700;
}
.page-sub {
  color: var(--muted);
  margin: 0;
  max-width: 74ch;
}
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 14px;
}
.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.section-head span {
  color: var(--faint);
  font-size: 11.5px;
}
.mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}
.muted {
  color: var(--muted);
}
.faint {
  color: var(--faint);
}
.tiny {
  font-size: 11px;
}
.nowrap {
  white-space: nowrap;
}
.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.panel {
  border: 1px solid var(--line);
  background: linear-gradient(165deg, rgba(20, 28, 39, 0.72), rgba(12, 17, 24, 0.78));
  border-radius: var(--radius);
  padding: 18px;
}
.panel.flush {
  padding: 0;
  overflow: hidden;
}
.panel.hover:hover {
  border-color: var(--line-strong);
}
.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.panel-title h2 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
}
.panel-title .sub {
  color: var(--faint);
  font-size: 11px;
}
.grid {
  display: grid;
  gap: 16px;
}
.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid.four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.stack {
  display: grid;
  gap: 16px;
}
.row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.wrap {
  flex-wrap: wrap;
}
.spacer {
  flex: 1;
}
.divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

/* Buttons / forms --------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 12.5px;
  font-weight: 500;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
  min-height: 36px;
}
.btn:hover {
  background: rgba(255, 255, 255, 0.075);
  border-color: rgba(255, 255, 255, 0.2);
}
.btn:active {
  transform: translateY(1px);
}
.btn svg {
  width: 15px;
  height: 15px;
  stroke-width: 1.8;
}
.btn.primary {
  background: var(--amber);
  border-color: var(--amber);
  color: #1a1305;
}
.btn.primary:hover {
  background: #ffd36b;
  border-color: #ffd36b;
}
.btn.teal {
  background: var(--teal-soft);
  border-color: rgba(79, 209, 197, 0.28);
  color: var(--teal);
}
.btn.danger {
  background: var(--danger-soft);
  border-color: rgba(255, 122, 138, 0.28);
  color: var(--danger);
}
.btn.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.btn.ghost:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
}
.btn.small {
  min-height: 29px;
  padding: 5px 9px;
  font-size: 11.5px;
  border-radius: 8px;
}
.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.icon-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  border-radius: 9px;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 9px;
  padding: 13px;
  border: 1px solid var(--line);
  background: rgba(12, 17, 24, 0.66);
  border-radius: 14px;
  margin-bottom: 14px;
}
.field-group {
  display: grid;
  gap: 4px;
}
.field-group label {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}
.input,
.select {
  height: 35px;
  border: 1px solid var(--line-strong);
  background: #0a0f16;
  border-radius: 9px;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--text-soft);
  min-width: 0;
}
.input:focus,
.select:focus {
  border-color: rgba(246, 196, 83, 0.5);
  outline: none;
  box-shadow: 0 0 0 3px rgba(246, 196, 83, 0.08);
}
.input::placeholder {
  color: #52606f;
}
.search-row {
  position: relative;
  align-items: center;
}
.input.search {
  width: min(310px, 48vw);
  padding-right: 34px;
}
.search-icon {
  position: absolute;
  right: 10px;
  top: 50%;
  display: flex;
  color: var(--faint);
  pointer-events: none;
  transform: translateY(-50%);
}
.search-icon svg {
  width: 16px;
  height: 16px;
  stroke-width: 1.8;
}
.input.num {
  width: 86px;
}
.select {
  appearance: none;
  padding-right: 28px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 14px) 15px, calc(100% - 10px) 15px;
  background-size: 4px 4px, 4px 4px;
  background-repeat: no-repeat;
}

/* Hero / stats ------------------------------------------------------------ */

.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(290px, 0.65fr);
  gap: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  overflow: hidden;
  background:
    radial-gradient(600px 260px at 0% 0%, rgba(246, 196, 83, 0.1), transparent 70%),
    radial-gradient(500px 300px at 100% 100%, rgba(79, 209, 197, 0.09), transparent 70%),
    linear-gradient(150deg, rgba(20, 28, 39, 0.82), rgba(11, 15, 21, 0.92));
}
.hero::after {
  content: "";
  position: absolute;
  right: -70px;
  top: -120px;
  width: 330px;
  height: 330px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 50%;
  pointer-events: none;
}
.hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(30px, 4.2vw, 52px);
  line-height: 0.98;
  letter-spacing: -0.055em;
  max-width: 16ch;
}
.hero h1 em {
  font-style: normal;
  background: linear-gradient(100deg, var(--amber), var(--teal));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero p {
  color: var(--muted);
  max-width: 58ch;
  margin: 0;
  font-size: 13.5px;
  line-height: 1.7;
}
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 20px;
}
.hero-ring {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  border-left: 1px solid var(--line);
  padding-left: 26px;
}
.ring {
  position: relative;
  width: 154px;
  height: 154px;
}
.ring svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.ring .ring-value {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.ring .ring-value strong {
  display: block;
  font-size: 33px;
  line-height: 1;
  letter-spacing: -0.04em;
}
.ring .ring-value span {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.hero-ring .meta {
  text-align: center;
  color: var(--muted);
  font-size: 11.5px;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}
.stat {
  border: 1px solid var(--line);
  background: rgba(16, 22, 31, 0.72);
  border-radius: 15px;
  padding: 14px 15px;
}
.stat .label {
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.stat .value {
  margin-top: 6px;
  font-size: 24px;
  line-height: 1;
  letter-spacing: -0.03em;
  font-weight: 600;
}
.stat .sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 11px;
}
.stat.accent {
  background: linear-gradient(150deg, rgba(246, 196, 83, 0.11), rgba(16, 22, 31, 0.72));
  border-color: rgba(246, 196, 83, 0.2);
}
.stat.accent .value {
  color: var(--amber);
}

/* Charts ------------------------------------------------------------------ */

.chart {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
}
.chart .bar {
  transition: opacity 140ms ease;
}
.chart .bar:hover {
  opacity: 0.78;
}
.chart .axis {
  stroke: rgba(255, 255, 255, 0.07);
  stroke-width: 1;
}
.chart .label {
  fill: var(--faint);
  font-size: 9px;
  font-family: var(--mono);
}
.chart .value {
  fill: var(--text-soft);
  font-size: 9px;
  font-family: var(--mono);
}
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 11px;
  margin-top: 8px;
}
.legend i {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  margin-right: 5px;
}
.bar-list {
  display: grid;
  gap: 10px;
}
.bar-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}
.bar-row .name {
  font-size: 12px;
  color: var(--text-soft);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bar-row .num {
  color: var(--faint);
  font-size: 11px;
  font-family: var(--mono);
}
.bar-track {
  grid-column: 1 / -1;
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.045);
  overflow: hidden;
}
.bar-fill {
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  min-width: 2px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  border-radius: 99px;
  padding: 4px 9px;
  font-size: 11px;
  color: var(--text-soft);
}
.chip .count {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10px;
}
.chip.genre {
  border-color: color-mix(in srgb, var(--hue) 35%, transparent);
  background: color-mix(in srgb, var(--hue) 10%, transparent);
  color: color-mix(in srgb, var(--hue) 72%, white);
}
.chip.mood {
  border-color: rgba(157, 140, 255, 0.26);
  background: var(--violet-soft);
  color: #cfc7ff;
}
.chip.instrument {
  border-color: rgba(79, 209, 197, 0.22);
  background: var(--teal-soft);
  color: #b7f2ec;
}

/* Tables ------------------------------------------------------------------ */

.table-wrap {
  overflow: auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(12, 17, 24, 0.6);
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12.5px;
}
thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  padding: 11px 13px;
  background: #0e141d;
  border-bottom: 1px solid var(--line);
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  white-space: nowrap;
}
tbody td {
  padding: 10px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: middle;
}
tbody tr:last-child td {
  border-bottom: 0;
}
tbody tr {
  transition: background 100ms ease;
}
tbody tr.clickable {
  cursor: pointer;
}
tbody tr.clickable:hover {
  background: rgba(255, 255, 255, 0.028);
}
.track-cell {
  display: grid;
  gap: 1px;
  min-width: 180px;
}
.track-cell .title {
  color: var(--text);
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34ch;
}
.track-cell .artist {
  color: var(--muted);
  font-size: 11.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 34ch;
}
.bpm {
  font-family: var(--mono);
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.key-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--mono);
  font-size: 11px;
  color: var(--text-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px 6px;
  white-space: nowrap;
}
.key-badge .camelot {
  color: var(--amber);
}
.mini-bar {
  width: 70px;
  height: 4px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}
.mini-bar span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--teal), var(--amber));
}
.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 10.5px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.badge.analyzed,
.badge.ok,
.badge.online {
  color: var(--teal);
  background: var(--teal-soft);
  border-color: rgba(79, 209, 197, 0.22);
}
.badge.partial,
.badge.queued,
.badge.running {
  color: var(--amber);
  background: var(--amber-soft);
  border-color: rgba(246, 196, 83, 0.22);
}
.badge.failed,
.badge.missing {
  color: var(--danger);
  background: var(--danger-soft);
  border-color: rgba(255, 122, 138, 0.22);
}
.badge.pending,
.badge.done,
.badge.cancelled,
.badge.offline {
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--line);
}
.pager {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11.5px;
}
.empty {
  display: grid;
  place-items: center;
  gap: 6px;
  min-height: 180px;
  text-align: center;
  color: var(--muted);
  padding: 24px;
}
.empty strong {
  color: var(--text-soft);
  font-weight: 500;
}
.skeleton {
  border-radius: 10px;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.035));
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
.loading-grid {
  display: grid;
  gap: 12px;
}
.loading-line {
  height: 14px;
}

/* Track detail ------------------------------------------------------------ */

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}
.detail-title {
  margin: 4px 0 4px;
  font-size: clamp(28px, 3.8vw, 46px);
  line-height: 1.02;
  letter-spacing: -0.045em;
}
.detail-artist {
  color: var(--muted);
  font-size: 14px;
}
.path-line {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 8px;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 10.5px;
  max-width: 80ch;
}
.path-line > svg {
  width: 14px;
  height: 14px;
  flex: none;
  stroke-width: 1.8;
}
.path-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
.metric {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.022);
  border-radius: 13px;
  padding: 12px 13px;
  min-width: 0;
}
.metric .label {
  color: var(--faint);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.metric .value {
  margin-top: 4px;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.metric .value.small {
  font-size: 15px;
}
.metric .hint {
  margin-top: 2px;
  color: var(--faint);
  font-size: 10px;
}
.metric.accent {
  border-color: rgba(246, 196, 83, 0.22);
  background: var(--amber-soft);
}
.metric.accent .value {
  color: var(--amber);
}
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(320px, 0.75fr);
  gap: 16px;
}
.radar-wrap {
  display: grid;
  place-items: center;
  padding: 4px 0 2px;
}
.radar {
  width: min(100%, 340px);
  height: auto;
}
.radar .gridline {
  fill: none;
  stroke: rgba(255, 255, 255, 0.08);
  stroke-width: 1;
}
.radar .spoke {
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 1;
}
.radar .shape {
  fill: rgba(246, 196, 83, 0.16);
  stroke: var(--amber);
  stroke-width: 1.6;
}
.radar .dot {
  fill: var(--amber);
}
.radar .axis-label {
  fill: var(--muted);
  font-size: 9px;
  font-family: var(--mono);
}
.similar {
  display: grid;
  gap: 2px;
}
.similar-item {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 10px;
  transition: background 120ms ease;
}
.similar-item:hover {
  background: rgba(255, 255, 255, 0.035);
}
.sim-art {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, rgba(246, 196, 83, 0.18), rgba(79, 209, 197, 0.14));
  border: 1px solid var(--line);
  color: var(--amber);
  font-size: 11px;
  font-weight: 600;
}
.sim-title {
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sim-artist {
  color: var(--muted);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sim-score {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 10.5px;
}
.source-chip {
  border-color: rgba(157, 140, 255, 0.24);
  background: var(--violet-soft);
  color: #d5ceff;
}
.progress {
  height: 5px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
  margin-top: 10px;
}
.progress span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--amber), var(--teal));
  transition: width 300ms ease;
}
details.raw {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 4px;
}
details.raw summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  list-style: none;
}
details.raw summary::-webkit-details-marker {
  display: none;
}
details.raw summary::before {
  content: "+";
  display: inline-block;
  width: 16px;
  color: var(--amber);
}
details.raw[open] summary::before {
  content: "−";
}
pre.json {
  margin: 12px 0 0;
  max-height: 480px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #080c12;
  padding: 14px;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 10.5px;
  line-height: 1.6;
}

/* Jobs / system ----------------------------------------------------------- */

.job-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 130px;
}
.job-progress .mini-bar {
  width: 64px;
}
.error-cell {
  max-width: 34ch;
  color: var(--danger);
  font-size: 10.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  background: rgba(12, 17, 24, 0.7);
  border-radius: 10px;
}
.tabs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 6px 10px;
  border-radius: 7px;
  font-size: 11.5px;
}
.tabs button.active {
  background: rgba(255, 255, 255, 0.075);
  color: var(--text);
}
.kv {
  display: grid;
  grid-template-columns: minmax(110px, 0.7fr) minmax(0, 1.3fr);
  gap: 7px 16px;
  font-size: 12px;
}
.kv dt {
  color: var(--faint);
}
.kv dd {
  margin: 0;
  color: var(--text-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  overflow-wrap: anywhere;
}
.model-list {
  display: grid;
  gap: 5px;
  max-height: 340px;
  overflow: auto;
}
.model-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 7px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.022);
  font-size: 11px;
}
.model-row .file {
  font-family: var(--mono);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.model-row .ok {
  color: var(--teal);
}
.model-row .bad {
  color: var(--danger);
}

/* Toasts ------------------------------------------------------------------ */

.toasts {
  position: fixed;
  z-index: 100;
  top: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  width: min(360px, calc(100vw - 32px));
}
.toast {
  border: 1px solid var(--line-strong);
  background: rgba(16, 22, 31, 0.96);
  color: var(--text-soft);
  border-radius: 12px;
  padding: 11px 13px;
  box-shadow: var(--shadow);
  font-size: 12px;
  animation: toast-in 180ms ease both;
}
.toast.ok {
  border-color: rgba(79, 209, 197, 0.3);
}
.toast.err {
  border-color: rgba(255, 122, 138, 0.3);
  color: #ffd4d9;
}
.toast.warn {
  border-color: rgba(246, 196, 83, 0.3);
}
@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-5px);
  }
}

/* Responsive -------------------------------------------------------------- */

@media (max-width: 1180px) {
  .stat-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .grid.four {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-layout {
    grid-template-columns: 1fr;
  }
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-ring {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 18px 0 0;
    grid-auto-flow: column;
    justify-content: start;
    gap: 18px;
  }
  .hero-ring .ring {
    width: 112px;
    height: 112px;
  }
  .hero-ring .ring-value strong {
    font-size: 25px;
  }
}

@media (max-width: 860px) {
  .login-screen {
    grid-template-columns: 1fr;
    gap: 28px;
    padding: 36px 22px;
  }
  .login-copy h1 {
    font-size: clamp(2.2rem, 9vw, 3.6rem);
  }
  .sidebar {
    position: sticky;
    width: auto;
    inset: auto;
    top: 0;
    flex-direction: row;
    align-items: center;
    padding: 10px 14px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .brand {
    padding: 0 10px 0 0;
  }
  .brand-mark {
    width: 32px;
    height: 32px;
  }
  .brand-sub,
  .nav-label,
  .sidebar-scan,
  .sidebar-foot {
    display: none;
  }
  .nav {
    display: flex;
    gap: 2px;
    margin-left: auto;
  }
  .nav-item {
    padding: 8px 9px;
    font-size: 0;
    gap: 0;
  }
  .nav-item svg {
    width: 18px;
    height: 18px;
  }
  .nav-item.active {
    box-shadow: none;
  }
  .main {
    margin-left: 0;
  }
  .topbar {
    padding: 10px 16px;
    min-height: 54px;
  }
  .view {
    padding: 18px 16px 40px;
  }
  .stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid.two,
  .grid.three,
  .grid.four {
    grid-template-columns: 1fr;
  }
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .detail-head {
    flex-direction: column;
  }
  .topbar .status-pill {
    display: none;
  }
}

@media (max-width: 520px) {
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }
  .stat .value {
    font-size: 20px;
  }
  .hero {
    padding: 20px;
  }
  .hero h1 {
    font-size: 32px;
  }
  .filters {
    align-items: stretch;
  }
  .input.search {
    width: 100%;
  }
  .field-group {
    flex: 1 1 42%;
  }
  .login-card {
    padding: 20px;
  }
  .login-actions {
    flex-direction: column;
    align-items: stretch;
  }
  .path-line {
    max-width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
