/* Sidebar Navigation */
.sidebar-nav {
  position: sticky;
  top: 2.2rem;
  align-self: start;
  grid-row: 1 / span 2;
  background:
    linear-gradient(180deg, rgba(71, 31, 105, 0.24), transparent 52%),
    rgba(25, 10, 43, 0.92);
  border-radius: 14px;
  border: 1px solid rgba(192, 111, 255, 0.22);
  padding: 1.2rem 1.1rem;
  margin-bottom: 1.2rem;
  min-width: 200px;
  max-height: calc(100vh - 3.2rem);
  overflow: auto;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.28);
  z-index: 10;
}

.sidebar-nav-head {
  margin-bottom: 0.85rem;
}

.sidebar-eyebrow {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 0.76rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #cba8ff;
}

.sidebar-caption {
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.sidebar-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.sidebar-nav a {
  display: block;
  color: var(--accent);
  text-decoration: none;
  font-family: "Orbitron", sans-serif;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  border-radius: 10px;
  border: 1px solid transparent;
  padding: 0.46rem 0.56rem;
  transition:
    color 0.18s,
    border-color 0.18s,
    background 0.18s,
    transform 0.18s;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus {
  color: #fff;
  text-decoration: none;
  border-color: rgba(218, 154, 255, 0.46);
  background: rgba(74, 30, 111, 0.42);
  transform: translateX(2px);
}

:root {
  --bg-a: #11041d;
  --bg-b: #220b3c;
  --panel: rgba(32, 12, 54, 0.82);
  --panel-strong: rgba(25, 10, 43, 0.92);
  --border: rgba(192, 111, 255, 0.38);
  --text: #f4e6ff;
  --muted: #d4c5e0;
  --accent: #c06fff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
  line-height: 1.45;
  background:
    radial-gradient(circle at 15% 18%, #4f1d76 0%, transparent 42%),
    radial-gradient(circle at 85% 30%, #2b1049 0%, transparent 36%),
    linear-gradient(150deg, var(--bg-a), var(--bg-b));
  min-height: 100vh;
  max-width: 100%;
  overflow-x: hidden;
}

body.auth-locked {
  overflow: hidden;
}

.auth-overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: rgba(9, 4, 18, 0.72);
  backdrop-filter: blur(14px);
}

.auth-overlay[hidden] {
  display: none;
}

.auth-overlay-card {
  width: min(480px, 100%);
  padding: 1.2rem;
  border-radius: 18px;
  border: 1px solid rgba(192, 111, 255, 0.34);
  background:
    radial-gradient(circle at top, rgba(94, 40, 135, 0.28), transparent 55%),
    rgba(17, 8, 30, 0.94);
  box-shadow: 0 24px 54px rgba(0, 0, 0, 0.34);
}

.auth-overlay-form {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.95rem;
}

.auth-overlay-actions {
  margin-top: 0;
  justify-content: flex-end;
}

.layout {
  width: min(1600px, 95vw);
  max-width: 100%;
  margin: 0 auto;
  padding: 2.2rem 0 3rem;
  display: grid;
  gap: 1.35rem;
  animation: rise-in 0.46s ease-out;
}

.desktop-main {
  display: grid;
  gap: 1.25rem;
  min-width: 0;
}

.hero {
  display: grid;
  gap: 0.35rem;
  padding: 1.35rem 1.45rem;
  border-radius: 18px;
  border: 1px solid rgba(192, 111, 255, 0.22);
  background:
    radial-gradient(
      circle at top right,
      rgba(134, 66, 183, 0.22),
      transparent 38%
    ),
    linear-gradient(180deg, rgba(39, 17, 62, 0.88), rgba(21, 10, 36, 0.88));
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.22);
}

.hero .lead {
  max-width: 62ch;
}

.layout-footer {
  display: grid;
  gap: 0.7rem;
}

.hero h1,
h2 {
  margin: 0.35rem 0;
  font-family: "Orbitron", sans-serif;
  letter-spacing: 0.04em;
}

.badge {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.11em;
  color: #9d79ff;
  font-size: 0.75rem;
}

.lead,
.muted {
  color: var(--muted);
}

.live-vibe-chip {
  margin: 0.45rem 0 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.24rem 0.65rem;
  font-size: 0.8rem;
  color: #f2ddff;
  border: 1px solid rgba(192, 111, 255, 0.38);
  background: rgba(66, 31, 95, 0.46);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
  min-width: 0;
  max-width: 100%;
  scroll-margin-top: 1rem;
  backdrop-filter: blur(7px);
  transition:
    transform 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.panel:target {
  border-color: rgba(233, 178, 255, 0.72);
  box-shadow:
    0 0 0 1px rgba(233, 178, 255, 0.18),
    0 12px 28px rgba(52, 20, 78, 0.38);
  animation: panel-target-glow 0.5s ease-out;
}

.panel:hover {
  transform: translateY(-2px);
  border-color: rgba(218, 154, 255, 0.55);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.24);
}

.panel-collapse-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  gap: 0.6rem;
}

.panel-collapse-btn {
  background: none;
  border: none;
  color: inherit;
  cursor: pointer;
  font-size: 0.75rem;
  padding: 0 0.25rem;
  line-height: 1;
  opacity: 0.6;
  transition:
    transform 0.2s ease,
    opacity 0.15s ease;
}

.panel-collapse-btn:hover {
  opacity: 1;
}

.panel-collapse-btn[aria-expanded="true"] {
  transform: rotate(180deg);
}

.panel-collapse-body {
  overflow: hidden;
  width: 100%;
  min-width: 0;
  transition:
    max-height 0.25s ease,
    opacity 0.2s ease;
  max-height: 2000px;
  opacity: 1;
}

.panel-collapse-body.panel-collapsed {
  max-height: 0;
  opacity: 0;
}

.row {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.85rem;
}

.row > * {
  min-width: 0;
}

.auth-status-chip {
  margin: 0.55rem 0 0;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.24rem 0.68rem;
  font-size: 0.8rem;
  color: #ffd8e4;
  border: 1px solid rgba(255, 137, 177, 0.36);
  background: rgba(89, 24, 50, 0.44);
}

.auth-status-chip.is-authenticated {
  color: #c8ffe4;
  border-color: rgba(111, 236, 175, 0.4);
  background: rgba(14, 55, 41, 0.45);
}

.auth-gate-card {
  margin-top: 0.8rem;
  padding: 0.78rem 0.82rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 137, 177, 0.28);
  background: rgba(79, 19, 43, 0.34);
}

.auth-gate-title {
  margin: 0 0 0.22rem;
  color: #ffd8e4;
  font-family: "Orbitron", sans-serif;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
}

.session-warning-banner {
  margin: 0.7rem 0 0;
  padding: 0.52rem 0.7rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 175, 96, 0.32);
  background: rgba(92, 46, 12, 0.28);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.session-warning-text {
  margin: 0;
  color: #ffd8a8;
  font-size: 0.86rem;
}

.session-warning-action {
  flex: 0 0 auto;
  border-color: rgba(255, 210, 138, 0.28);
  color: #fff1d8;
  background: rgba(255, 184, 98, 0.12);
}

.session-warning-action:hover {
  border-color: rgba(255, 210, 138, 0.45);
  background: rgba(255, 184, 98, 0.18);
}

.session-policy-text {
  margin: 0.42rem 0 0;
  font-size: 0.83rem;
}

.schedule-rows {
  display: grid;
  gap: 0.8rem;
}

.warnings {
  margin: 0.4rem 0 0.8rem;
  padding-left: 1.1rem;
  color: #ffd7a6;
}

.warnings li {
  margin: 0.2rem 0;
}

.drop-zone {
  margin-top: 0.7rem;
  padding: 1rem;
  border: 1px dashed rgba(192, 111, 255, 0.55);
  border-radius: 12px;
  background: rgba(20, 9, 33, 0.72);
  text-align: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.2s ease;
}

.drop-zone.active {
  background: rgba(58, 21, 88, 0.82);
  border-color: rgba(232, 167, 255, 0.85);
  transform: translateY(-1px);
}

.drop-title {
  margin: 0;
  color: var(--text);
  font-weight: 600;
}

.upload-status {
  display: grid;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.upload-item {
  padding: 0.65rem 0.75rem;
  border-radius: 10px;
  background: rgba(12, 7, 21, 0.76);
  border: 1px solid rgba(192, 111, 255, 0.26);
}

.upload-item-head {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  margin-bottom: 0.35rem;
}

.upload-name {
  color: var(--text);
  word-break: break-word;
}

.upload-meta {
  color: var(--muted);
  font-size: 0.88rem;
}

.upload-bar {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.upload-bar-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #8f62ff, #d98dff);
  transition: width 0.15s ease;
}

.track-editor-list {
  display: grid;
  gap: 1rem;
  margin-top: 0.8rem;
  max-height: min(72vh, 1100px);
  overflow-y: auto;
  padding-right: 0.3rem;
  scroll-padding-top: 0.5rem;
}

.track-editor-list::-webkit-scrollbar {
  width: 10px;
}

.track-editor-list::-webkit-scrollbar-track {
  background: rgba(18, 8, 30, 0.62);
  border-radius: 999px;
}

.track-editor-list::-webkit-scrollbar-thumb {
  background: rgba(154, 94, 205, 0.72);
  border-radius: 999px;
  border: 2px solid rgba(18, 8, 30, 0.62);
}

.track-editor-list::-webkit-scrollbar-thumb:hover {
  background: rgba(184, 125, 235, 0.82);
}

.bulk-editor-panel {
  margin-top: 0.8rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(12, 7, 21, 0.76);
  border: 1px solid rgba(192, 111, 255, 0.24);
}

.bulk-editor-row {
  margin-top: 0;
}

.bulk-field {
  min-width: 180px;
  flex: 1 1 180px;
}

.bulk-editor-actions {
  margin-top: 0.8rem;
}

.bulk-selection-actions {
  margin-top: 0.5rem;
  align-items: center;
}

.bulk-history-head {
  margin-top: 0.75rem;
  align-items: center;
  justify-content: space-between;
}

.bulk-history-list {
  display: grid;
  gap: 0.7rem;
  margin-top: 0.6rem;
}

.bulk-undo-audit-head {
  margin-top: 0.8rem;
  align-items: center;
}

.bulk-undo-audit-list {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.bulk-undo-audit-card {
  padding: 0.62rem 0.7rem;
  border-radius: 10px;
  background: rgba(15, 8, 26, 0.82);
  border: 1px solid rgba(192, 111, 255, 0.2);
}

.bulk-history-card {
  padding: 0.7rem;
  border-radius: 10px;
  background: rgba(15, 8, 26, 0.82);
  border: 1px solid rgba(192, 111, 255, 0.22);
}

.bulk-history-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
}

.bulk-history-sample {
  margin-top: 0.32rem;
  font-size: 0.8rem;
}

.harmonic-preview {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.7rem;
}

.harmonic-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.7rem;
  align-items: center;
  padding: 0.58rem 0.7rem;
  border-radius: 10px;
  background: rgba(12, 7, 21, 0.76);
  border: 1px solid rgba(192, 111, 255, 0.24);
}

.harmonic-row-title {
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.3;
}

.harmonic-row-keys {
  color: var(--muted);
  font-size: 0.82rem;
}

.harmonic-status {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.56rem;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
}

.harmonic-status.compatible {
  background: rgba(112, 246, 181, 0.14);
  color: #b4ffd7;
  border-color: rgba(112, 246, 181, 0.32);
}

.harmonic-status.weak {
  background: rgba(255, 175, 96, 0.16);
  color: #ffd8a8;
  border-color: rgba(255, 175, 96, 0.32);
}

.harmonic-status.unkeyed {
  background: rgba(150, 159, 184, 0.14);
  color: #d7ddef;
  border-color: rgba(150, 159, 184, 0.28);
}

.track-filter-row {
  align-items: center;
}

.track-filter-row label {
  font-size: 0.88rem;
}

.track-preset-row {
  margin-top: 0.2rem;
}

.track-preset-chip {
  background: rgba(37, 18, 62, 0.78);
  border: 1px solid rgba(192, 111, 255, 0.3);
  border-radius: 999px;
  padding: 0.42rem 0.72rem;
  font-size: 0.8rem;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.track-preset-chip:hover {
  transform: translateY(-1px);
  border-color: rgba(219, 158, 255, 0.58);
}

.track-preset-chip.is-active {
  background: rgba(109, 50, 156, 0.88);
  border-color: rgba(219, 158, 255, 0.6);
  color: #f8ebff;
}

#genreSourceFilter,
#camelotFilter {
  width: auto;
  min-width: 160px;
  background: rgba(15, 8, 26, 0.78);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.54rem 0.6rem;
}

#trackFilterSummary {
  font-size: 0.88rem;
  border: 1px solid rgba(192, 111, 255, 0.28);
  border-radius: 999px;
  padding: 0.24rem 0.66rem;
  background: rgba(52, 22, 79, 0.5);
}

.remediation-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.24rem 0.66rem;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  color: #ffd9a8;
  border: 1px solid rgba(255, 175, 96, 0.34);
  background: rgba(255, 175, 96, 0.12);
}

.subtle-btn {
  background: rgba(33, 17, 52, 0.72);
  border-color: rgba(192, 111, 255, 0.24);
  box-shadow: none;
}

.track-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 0.9rem;
  padding: 0.85rem;
  border-radius: 12px;
  background: rgba(12, 7, 21, 0.76);
  border: 1px solid rgba(192, 111, 255, 0.26);
  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.track-card:hover {
  transform: translateY(-2px);
  border-color: rgba(218, 154, 255, 0.46);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.2);
}

.track-card.is-selected {
  border-color: rgba(219, 158, 255, 0.62);
  box-shadow:
    0 0 0 1px rgba(219, 158, 255, 0.18),
    0 12px 26px rgba(0, 0, 0, 0.22);
}

.track-art {
  width: 112px;
  height: 112px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(
    180deg,
    rgba(93, 37, 140, 0.75),
    rgba(30, 12, 49, 0.85)
  );
  border: 1px solid rgba(192, 111, 255, 0.25);
}

.track-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.track-art-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-family: "Orbitron", sans-serif;
  font-size: 0.82rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.track-fields {
  display: grid;
  gap: 0.7rem;
}

.track-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}

.track-select-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.42rem;
  color: var(--text);
  font-size: 0.82rem;
}

.track-select-toggle input {
  width: 16px;
  height: 16px;
  accent-color: #c06fff;
}

.track-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.65rem;
}

.field-stack {
  display: grid;
  gap: 0.3rem;
}

.field-stack label {
  font-size: 0.88rem;
  color: var(--muted);
}

.track-card .row {
  margin-top: 0;
}

.track-id {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-all;
}

.track-meta-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.genre-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(117, 60, 167, 0.25);
  border: 1px solid rgba(192, 111, 255, 0.28);
  color: #f0d6ff;
}

.camelot-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: rgba(90, 149, 255, 0.2);
  border: 1px solid rgba(123, 176, 255, 0.34);
  color: #d8e8ff;
}

.genre-chip-row {
  display: flex;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.genre-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.18rem 0.58rem;
  font-size: 0.8rem;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(192, 111, 255, 0.2);
  color: var(--text);
}

.quality-warning-chip {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.58rem;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: rgba(255, 175, 96, 0.16);
  color: #ffd8a8;
  border: 1px solid rgba(255, 175, 96, 0.32);
}

.track-confidence-row {
  width: 100%;
  font-size: 0.78rem;
  color: #d7c3ef;
  letter-spacing: 0.01em;
}

.schedule-row {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr 1.5fr 0.9fr 0.9fr auto;
  gap: 0.5rem;
  align-items: center;
  background: rgba(14, 8, 25, 0.66);
  border: 1px solid rgba(192, 111, 255, 0.25);
  border-radius: 10px;
  padding: 0.55rem;
}

.energy-target-row {
  align-items: flex-end;
}

.energy-target-control {
  min-width: 170px;
  flex: 0 1 190px;
}

.energy-target-control .mini {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.25rem;
}

.schedule-row .mini {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0;
}

.schedule-row button {
  white-space: nowrap;
}

input,
textarea,
button {
  font-family: inherit;
}

input,
textarea {
  width: 100%;
  background: rgba(15, 8, 26, 0.78);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 0.68rem;
}

#tokenInput {
  flex: 1 1 320px;
}

#genreInput {
  flex: 0 1 180px;
}

#musicFilesInput {
  flex: 1 1 360px;
}

textarea {
  min-height: 260px;
  resize: vertical;
}

button {
  background: rgba(94, 40, 135, 0.86);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.62rem 0.92rem;
  min-height: 40px;
  cursor: pointer;
  text-align: center;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

button:hover {
  background: rgba(123, 57, 170, 0.93);
  border-color: rgba(223, 164, 255, 0.62);
  box-shadow: 0 9px 18px rgba(95, 35, 138, 0.34);
  transform: translateY(-1px);
}

button:active {
  transform: translateY(0);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  box-shadow: none;
}

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 2px solid rgba(220, 160, 255, 0.95);
  outline-offset: 2px;
}

pre {
  margin: 0.5rem 0 0;
  padding: 0.7rem;
  border-radius: 10px;
  background: rgba(12, 7, 21, 0.76);
  border: 1px solid rgba(192, 111, 255, 0.26);
  max-width: 100%;
  overflow-x: auto;
}

.result {
  margin: 0;
  color: var(--accent);
  padding: 0.56rem 0.72rem;
  border-radius: 10px;
  border: 1px solid rgba(192, 111, 255, 0.26);
  background: rgba(32, 14, 52, 0.56);
}

.result.state-error {
  color: #ffd0de;
  border-color: rgba(255, 137, 177, 0.45);
  background: rgba(79, 19, 43, 0.5);
}

.result.state-success {
  color: #c8ffe4;
  border-color: rgba(111, 236, 175, 0.42);
  background: rgba(14, 55, 41, 0.45);
}

a {
  color: var(--accent);
  text-decoration: none;
}

@keyframes rise-in {
  from {
    opacity: 0;
    transform: translateY(9px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-target-glow {
  from {
    transform: translateY(-2px);
  }
  to {
    transform: translateY(0);
  }
}

@media (min-width: 1200px) {
  .layout {
    grid-template-columns: 220px minmax(0, 1fr);
    column-gap: 1.4rem;
    align-items: start;
  }

  .sidebar-nav {
    grid-column: 1;
    grid-row: 1 / span 2;
    margin-right: 0.8rem;
  }

  .hero {
    grid-column: 2;
  }

  .panel-auth {
    grid-area: auth;
    position: static;
    max-height: none;
    overflow: visible;
    align-self: stretch;
  }

  .desktop-main {
    grid-column: 2;
    grid-row: 2;
    grid-template-columns: minmax(280px, 320px) minmax(0, 1.25fr) minmax(
        300px,
        0.9fr
      );
    grid-template-areas:
      "auth broadcast broadcast"
      "auth livedeck livedeck"
      "audit audit audit"
      "music music music"
      "analysis analysis analysis"
      "djmixes djmixes djmixes"
      "harmonic harmonic harmonic"
      "sweepers sweepers sweepers"
      "queue queue queue"
      "schedule schedule schedule"
      "track track track"
      "schedulejson schedulejson schedulejson"
      "footer footer footer";
    gap: 1.25rem;
    align-items: start;
  }

  .desktop-main > .panel,
  .desktop-main > .layout-footer {
    min-width: 0;
  }

  .panel-broadcast {
    grid-area: broadcast;
  }

  .panel-livedeck {
    grid-area: livedeck;
    height: fit-content;
    padding: 0.95rem 1.05rem;
  }

  .panel-livedeck h2 {
    margin: 0.2rem 0 0.45rem;
  }

  .panel-livedeck p {
    margin: 0.45rem 0;
  }

  .panel-livedeck .live-vibe-chip {
    margin-top: 0.35rem;
  }

  .panel-queue {
    grid-area: queue;
  }

  .panel-library-audit {
    grid-area: audit;
  }

  .panel-music-collection {
    grid-area: music;
  }

  .panel-analysis-status {
    grid-area: analysis;
  }

  .panel-dj-mixes {
    grid-area: djmixes;
  }

  .panel-schedule-builder {
    grid-area: schedule;
  }

  .panel-track-editor {
    grid-area: track;
  }

  .panel-harmonic {
    grid-area: harmonic;
  }

  .panel-sweepers {
    grid-area: sweepers;
  }

  .panel-schedule-json {
    grid-area: schedulejson;
  }

  .layout-footer {
    grid-area: footer;
  }

  .panel-livedeck,
  .panel-library-audit,
  .panel-harmonic {
    align-self: start;
  }

  .panel-track-editor,
  .panel-schedule-builder,
  .panel-schedule-json {
    width: 100%;
  }

  #streamStatus {
    min-height: 220px;
  }
}

@media (max-width: 1199px) {
  .sidebar-nav {
    position: static;
    min-width: 0;
    max-height: none;
    padding: 0.68rem;
    margin-bottom: 0.72rem;
    border-radius: 10px;
  }

  .sidebar-nav-head {
    margin-bottom: 0.55rem;
  }

  .sidebar-caption {
    font-size: 0.78rem;
  }

  .sidebar-nav ul {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 0.42rem;
    padding-bottom: 0.16rem;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
  }

  .sidebar-nav li {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  .sidebar-nav a {
    white-space: nowrap;
    font-size: 0.84rem;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 0.72rem;
    border-color: rgba(192, 111, 255, 0.2);
    background: rgba(44, 18, 70, 0.48);
  }

  .panel-auth {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

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

@media (max-width: 700px) {
  .layout {
    width: 100%;
    max-width: 100%;
    padding: 1.3rem 0.55rem 2rem;
    padding-top: 1.3rem;
  }

  .sidebar-nav {
    padding: 0.7rem;
  }

  .sidebar-nav ul {
    gap: 0.5rem;
  }

  .sidebar-nav a {
    min-height: 44px;
    font-size: 0.86rem;
    padding: 0.56rem 0.78rem;
  }

  .panel {
    padding: 0.9rem;
  }

  .panel-collapse-heading {
    align-items: center;
  }

  .row > input,
  .row > textarea,
  .row > select,
  .row > button {
    width: 100%;
  }

  .row > button,
  button:not(.panel-collapse-btn) {
    min-height: 44px;
    padding: 0.74rem 0.9rem;
    font-size: 0.94rem;
    line-height: 1.25;
    white-space: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
  }

  .row {
    gap: 0.58rem;
  }

  pre {
    font-size: 0.8rem;
  }

  .dj-mix-grid,
  .dj-mix-layout {
    grid-template-columns: 1fr;
  }

  .dj-mix-column .row,
  .dj-mix-card .row,
  .dj-mix-schedule-card .row {
    flex-direction: column;
    align-items: stretch;
  }

  .schedule-row {
    grid-template-columns: 1fr;
  }

  .track-card {
    grid-template-columns: 1fr;
  }

  .track-art {
    width: 100%;
    max-width: 180px;
    height: 180px;
  }

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

  .track-editor-list {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .harmonic-row {
    grid-template-columns: 1fr;
  }
}

.audit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.panel-analysis-status .row {
  margin-top: 0.9rem;
}

#analysisStatusResult {
  margin-top: 0.7rem;
  min-height: 1.3rem;
}

.audit-card,
.queue-card,
.schedule-history-card,
.audit-sample-group {
  border-radius: 12px;
  border: 1px solid rgba(192, 111, 255, 0.24);
  background: rgba(12, 7, 21, 0.76);
}

.audit-card {
  padding: 0.75rem;
}

.audit-card-actionable,
.audit-sample-actionable {
  border-color: rgba(219, 158, 255, 0.34);
}

.audit-label {
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.audit-value {
  margin: 0.25rem 0 0;
  color: var(--text);
  font-size: 1.2rem;
  font-family: "Orbitron", sans-serif;
}

.audit-samples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.75rem;
  margin-top: 0.85rem;
}

.audit-sample-group {
  padding: 0.8rem;
}

.audit-sample-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.audit-action-row {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.55rem;
}

.audit-sample-group ul {
  margin: 0.55rem 0 0;
  padding-left: 1rem;
}

.audit-sample-title {
  margin: 0;
  color: var(--text);
  font-size: 0.88rem;
}

.audit-jump-btn {
  padding: 0.38rem 0.66rem;
  font-size: 0.78rem;
  white-space: nowrap;
}

.queue-list {
  display: grid;
  gap: 0.9rem;
  margin-top: 0.75rem;
}

.schedule-history-head {
  margin-top: 0.9rem;
  align-items: center;
  justify-content: space-between;
}

.schedule-history-head h3 {
  margin: 0;
  font-family: "Orbitron", sans-serif;
  font-size: 0.96rem;
  letter-spacing: 0.04em;
}

.schedule-history-list {
  display: grid;
  gap: 0.85rem;
  margin-top: 0.75rem;
}

.queue-ops-note {
  margin: 0.65rem 0 0;
}

.queue-card,
.schedule-history-card {
  padding: 1rem;
}

.queue-card.is-scheduled-dj-mix {
  border: 1px solid rgba(123, 176, 255, 0.45);
  background: linear-gradient(
    180deg,
    rgba(20, 42, 78, 0.42),
    rgba(13, 25, 47, 0.35)
  );
  box-shadow: inset 0 0 0 1px rgba(90, 149, 255, 0.16);
}

.queue-card-head,
.schedule-history-card-head {
  display: flex;
  justify-content: space-between;
  gap: 0.7rem;
  align-items: center;
}

.queue-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 0.2rem 0.56rem;
  background: rgba(109, 50, 156, 0.88);
  border: 1px solid rgba(219, 158, 255, 0.42);
  color: #f8ebff;
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.queue-badge.is-dj-mix {
  background: rgba(57, 114, 193, 0.78);
  border-color: rgba(153, 206, 255, 0.5);
  color: #edf7ff;
}

.queue-title {
  margin-top: 0.55rem;
  color: var(--text);
  font-size: 0.96rem;
}

.queue-meta {
  margin-top: 0.25rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.queue-meta-note {
  color: #cce3ff;
}

.schedule-diff-block {
  margin-top: 0.7rem;
  padding: 0.7rem 0.75rem;
  border-radius: 10px;
  background: rgba(22, 11, 35, 0.78);
  border: 1px solid rgba(192, 111, 255, 0.18);
}

.schedule-diff-summary {
  color: var(--text);
  font-size: 0.84rem;
}

.schedule-diff-summary-match {
  color: #b4ffd7;
}

.schedule-diff-list {
  margin: 0.55rem 0 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.38rem;
}

.schedule-diff-list li {
  color: var(--muted);
  font-size: 0.82rem;
}

.schedule-diff-label {
  color: var(--text);
  margin-right: 0.38rem;
}

.schedule-diff-value {
  color: var(--muted);
}

.queue-actions {
  justify-content: flex-end;
}

.queue-action-btn {
  padding: 0.46rem 0.74rem;
  font-size: 0.82rem;
}

.queue-action-btn:disabled {
  opacity: 0.55;
}

.dj-mix-grid,
.dj-mix-layout {
  display: grid;
  gap: 1rem;
}

.dj-mix-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.dj-mix-layout {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  margin-top: 1.5rem;
}

.dj-mix-column,
.dj-mix-card,
.dj-mix-schedule-card {
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  padding: 1rem;
  background: rgba(255, 255, 255, 0.03);
}

.dj-mix-list,
.dj-mix-schedule-list {
  display: grid;
  gap: 1rem;
}

.dj-mix-meta {
  margin-bottom: 0.4rem;
}

.dj-mix-schedule-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.6rem;
}

.dj-mix-schedule-card.is-active {
  border-color: rgba(152, 255, 187, 0.45);
  box-shadow: 0 0 0 1px rgba(152, 255, 187, 0.2);
}
