@import url("https://fonts.googleapis.com/css2?family=Great+Vibes&display=swap");

@font-face {
  font-family: "Digital-7";
  src: url("./assets/Digital-7 Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

:root {
  --theme-text: #f8f0e4;
  --theme-bg-1: rgba(255, 189, 89, 0.18);
  --theme-bg-2: rgba(255, 103, 103, 0.16);
  --theme-bg-main-a: #120f14;
  --theme-bg-main-b: #1a1824;
  --theme-bg-main-c: #0d1119;
  --theme-orb-left: rgba(255, 190, 92, 0.14);
  --theme-orb-right: rgba(140, 188, 255, 0.13);
  --card-bg: rgba(16, 19, 28, 0.86);
  --card-border: rgba(255, 255, 255, 0.08);
  --panel-bg: rgba(255, 255, 255, 0.04);
  --panel-border: rgba(255, 255, 255, 0.06);
  --muted: #d5c2ad;
  --accent: #ffc36f;
  --button-start: #bec1c4;
  --button-end: #5d9376;
  --button-text: rgb(50, 31, 42);
}

body {
  font-family: "Trebuchet MS", Arial, sans-serif;
  background:
    radial-gradient(circle at top left, var(--theme-bg-1), transparent 28%),
    radial-gradient(circle at 80% 20%, var(--theme-bg-2), transparent 25%),
    linear-gradient(135deg, var(--theme-bg-main-a) 0%, var(--theme-bg-main-b) 45%, var(--theme-bg-main-c) 100%);
  color: var(--theme-text);
  margin: 0;
  min-height: 100vh;
  padding: 1.5rem;
}

.silent-scrollbar {
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.silent-scrollbar::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.page-shell {
  position: relative;
  min-height: calc(100vh - 3rem);
  display: flex;
  align-items: center;
  justify-content: center;
}

.page-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  opacity: 0.5;
  pointer-events: none;
}

.page-orb-left {
  width: 240px;
  height: 240px;
  top: 6%;
  left: 4%;
  background: var(--theme-orb-left);
}

.page-orb-right {
  width: 300px;
  height: 300px;
  bottom: 4%;
  right: 3%;
  background: var(--theme-orb-right);
}

.song-list-container {
  max-width: 1280px;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
}

.song-list-page-shell {
  align-items: flex-start;
  padding-top: 4vh;
}

.song-list-page {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 1rem;
}

#song-list {
  display: grid;
  grid-template-columns: 1fr;
  grid-gap: 10px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.editor-columns {
  display: grid;
  grid-template-columns: minmax(280px, 35fr) minmax(440px, 65fr);
  gap: 1rem;
  align-items: stretch;
}

.playlist-panel,
.library-panel {
  display: grid;
  min-width: 0;
  align-content: start;
  gap: 0.75rem;
  padding: 0.9rem;
  border-radius: 16px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
}

.playlist-panel {
  min-height: 0;
}

.playlist-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.playlist-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff4e2;
}

.playlist-panel-copy {
  color: var(--muted);
  font-size: 0.88rem;
}

.playlist-panel #song-list {
  height: min(105vh, 980px);
  max-height: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.playlist-panel #song-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.selected-tracks-panel {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.55rem;
  align-items: center;
  padding: 0.65rem 0.72rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

#selected-tracks-count {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.selected-tracks-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(6rem, 1fr));
  gap: 0.4rem;
}

.selected-tracks-actions button {
  width: 100%;
  margin: 0;
  min-width: 0;
  padding: 0.36rem 0.32rem;
  font-size: 0.72rem;
  line-height: 1.2;
  white-space: normal;
}

.selected-tracks-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.player-container {
  display: grid;
  grid-template-columns: minmax(320px, 2fr) minmax(420px, 3fr);
  grid-template-areas:
    "hero player"
    "copy player";
  align-items: start;
  gap: 1rem 1.25rem;
  position: relative;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 1.25rem;
  border-radius: 32px;
  border: 1px solid var(--card-border);
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02)),
    var(--card-bg);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
}

body.is-video-mode .card-note,
body.is-video-mode .art-row {
  display: none;
}

body.is-video-mode .player-aside {
  align-items: flex-start;
  min-height: auto;
}

body.is-video-mode .library-split {
  display: none;
}

body.is-video-mode .library-artists-pane {
  grid-column: 1 / -1;
}

body.is-video-mode .library-list.library-artists-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
  min-height: 0;
  max-height: 630px;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

body.is-video-mode .library-list.library-artists-row::-webkit-scrollbar {
  width: 0;
  height: 0;
}

body.is-video-mode .library-artist-item {
  flex: initial;
  min-width: 0;
  max-width: none;
  padding: 0.45rem 0.7rem 0.55rem;
  border-radius: 14px;
}

body.is-video-mode .library-song-actions {
  grid-template-columns: 1fr;
}

body.is-video-mode .library-song-select span {
  display: block;
}

.player-main {
  grid-area: player;
  min-width: 0;
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.75rem;
}

.card-hero {
  grid-area: hero;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 0.45rem;
}

.card-copy {
  grid-area: copy;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.75rem;
}

.player-trademark {
  grid-column: 1 / -1;
  justify-self: center;
  margin: 0.1rem 0 -0.2rem;
  color: rgba(255, 244, 226, 0.52);
  font-size: 0.74rem;
  text-transform: uppercase;
}

.hero-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.account-link {
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--muted);
  font-size: 0.78rem;
  text-decoration: none;
  font-family: inherit;
  cursor: pointer;
}

.account-link:hover,
.account-link.is-authorized {
  border-color: rgba(255, 195, 111, 0.35);
  color: #fff4e2;
}

.diagnostics-page {
  min-height: 100vh;
}

.diagnostics-shell {
  width: min(1120px, 100%);
  margin: 0 auto;
  padding: 1.25rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.4rem;
  background: rgba(17, 13, 24, 0.88);
}

.diagnostics-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.diagnostics-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.diagnostics-header h1 {
  margin: 0.25rem 0;
  color: #fff4e2;
}

.diagnostics-updated,
.diagnostics-empty {
  margin: 0;
  color: var(--muted);
}

.diagnostics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.diagnostics-panel {
  min-width: 0;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.035);
}

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

.diagnostics-panel h2 {
  margin: 0 0 0.8rem;
  color: var(--accent);
  font-size: 1rem;
}

.diagnostics-list {
  display: grid;
  grid-template-columns: minmax(9rem, 0.7fr) minmax(0, 1.3fr);
  margin: 0;
}

.diagnostics-list dt,
.diagnostics-list dd {
  margin: 0;
  padding: 0.48rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  overflow-wrap: anywhere;
}

.diagnostics-list dt { color: var(--muted); }
.diagnostics-list dd { color: #fff4e2; }
.diagnostics-warning { color: #ff8f85 !important; font-weight: 700; }

.diagnostics-key-list,
.diagnostics-errors {
  max-height: 18rem;
  margin-top: 0.8rem;
  overflow: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.diagnostics-key-list::-webkit-scrollbar,
.diagnostics-errors::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.diagnostics-key-list > div {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.38rem 0;
}

.diagnostics-key-list code,
.diagnostics-errors code {
  color: #c8b9d3;
  overflow-wrap: anywhere;
}

.diagnostics-errors article {
  display: grid;
  grid-template-columns: 11rem 12rem minmax(0, 1fr);
  gap: 0.65rem;
  padding: 0.55rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.diagnostics-errors time { color: var(--muted); }
.diagnostics-errors strong { color: #ffb6a9; }
.diagnostics-errors code { grid-column: 2 / -1; }

.toast {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 99999;
  padding: 0.65rem 0.95rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  background: rgba(20, 20, 20, 0.86);
  color: #f0d98a;
  font-size: 0.88rem;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(6px);
}

@media (max-width: 700px) {
  .diagnostics-header { flex-direction: column; }
  .diagnostics-grid { grid-template-columns: 1fr; }
  .diagnostics-panel-wide { grid-column: auto; }
  .diagnostics-list { grid-template-columns: 1fr; }
  .diagnostics-list dt { padding-bottom: 0; border-bottom: 0; }
  .diagnostics-errors article { grid-template-columns: 1fr; }
  .diagnostics-errors code { grid-column: auto; }
}

.eyebrow {
  margin: 0;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.78rem;
  color: var(--accent);
}

.impala-title {
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  isolation: isolate;
  transition: color 160ms ease, filter 160ms ease, text-shadow 160ms ease;
}

.impala-title::before {
  content: "";
  position: absolute;
  inset: -0.95rem -1.4rem;
  z-index: -1;
  background:
    repeating-conic-gradient(
      from -18deg,
      rgba(255, 207, 118, 0.22) 0deg 7deg,
      transparent 7deg 18deg
    );
  clip-path: ellipse(58% 44% at 14% 50%);
  opacity: 0;
  transform: scale(0.86);
  filter: blur(1px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.impala-title::after {
  content: "";
  position: absolute;
  inset: -0.35rem -0.75rem;
  z-index: -1;
  background: radial-gradient(ellipse at left, rgba(255, 216, 148, 0.22), transparent 64%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 180ms ease;
}

.impala-title:hover,
.impala-title:focus-visible {
  color: #ffd894;
  filter: brightness(1.08);
  text-shadow: 0 0 12px rgba(255, 195, 111, 0.18);
}

.impala-title:hover::before,
.impala-title:focus-visible::before {
  opacity: 0.34;
  transform: scale(1);
}

.impala-title:hover::after,
.impala-title:focus-visible::after {
  opacity: 1;
}

.impala-title:focus-visible {
  outline: 2px solid rgba(255, 195, 111, 0.45);
  outline-offset: 4px;
  border-radius: 4px;
}

#card-title {
  font-family: "Great Vibes", cursive;
  font-size: clamp(2.1rem, 4vw, 3.2rem);
  line-height: 0.92;
  margin: 0;
  color: #fff4e2;
}

.card-subtitle,
.card-note p,
.player-aside-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.about-dialog {
  width: min(720px, calc(100vw - 2rem));
  max-height: min(780px, calc(100vh - 2rem));
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(17, 13, 24, 0.94);
  color: var(--theme-text);
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(18px);
}

.diagnostics-dialog {
  width: min(1040px, calc(100vw - 2rem));
  max-height: min(820px, calc(100vh - 2rem));
}

.about-dialog::backdrop {
  background: rgba(8, 6, 12, 0.64);
}

.about-panel {
  display: grid;
  gap: 1rem;
  max-height: inherit;
  overflow: auto;
  padding: 1.1rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.about-panel::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.diagnostics-dialog-panel {
  grid-template-rows: auto minmax(0, 1fr);
  height: min(760px, calc(100vh - 3.8rem));
}

.diagnostics-frame {
  width: 100%;
  height: 100%;
  min-height: 28rem;
  border: 0;
  border-radius: 12px;
  background: rgba(17, 13, 24, 0.88);
}

.about-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.about-header h2 {
  margin: 0.2rem 0 0;
  color: #fff4e2;
  font-size: 1.55rem;
}

.about-close {
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff4e2;
  font: inherit;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.about-section {
  display: grid;
  gap: 0.65rem;
  padding: 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.035);
}

.about-section h3,
.about-section p,
.about-section figure,
.about-system dl {
  margin: 0;
}

.about-section h3 {
  color: var(--accent);
  font-size: 0.95rem;
}

.about-section p {
  color: var(--muted);
  line-height: 1.55;
}

.about-identity {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
}

.about-identity img {
  width: 4rem;
  height: 4rem;
  border-radius: 18px;
}

.about-version {
  font-size: 0.85rem;
}

.about-tagline {
  color: #fff4e2 !important;
  font-weight: 700;
}

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

.about-badges figure {
  display: grid;
  justify-items: center;
  align-content: start;
  gap: 0.45rem;
  min-width: 0;
  text-align: center;
}

.about-badges img {
  width: min(100%, 6rem);
  aspect-ratio: 1;
  object-fit: contain;
}

.about-badges figcaption {
  color: #fff4e2;
  font-size: 0.78rem;
  line-height: 1.25;
}

.about-system dl {
  display: grid;
  gap: 0.45rem;
}

.about-system dl > div {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr);
  gap: 0.65rem;
}

.about-system dt {
  color: var(--muted);
}

.about-system dd {
  margin: 0;
  color: #fff4e2;
  overflow-wrap: anywhere;
}

.auth-panel {
  display: grid;
  gap: 0.8rem;
  padding: 0.95rem 1rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-status-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.auth-status {
  margin: 0;
  color: var(--muted);
}

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

.auth-form input {
  min-width: 0;
  padding: 0.8rem 0.95rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.05);
  color: #fff4e2;
  font: inherit;
}

.auth-form input::placeholder {
  color: rgba(248, 240, 228, 0.55);
}

.auth-form button,
.auth-logout-btn {
  width: auto;
  max-width: none;
  margin: 0;
}

.card-note {
  padding: 0.72rem 0.85rem;
  border-radius: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
}

.track-panel,
.player-aside,
.player-frame {
  border-radius: 24px;
  border: 1px solid var(--card-border);
  background: var(--panel-bg);
}

.track-panel {
  padding: 0.85rem;
}

.starred-controls-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--card-border);
  border-radius: 18px;
  background: var(--panel-bg);
}

.track-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 0.85rem;
  color: #fff5e7;
  font-size: 0.95rem;
}

.track-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.player-starred-count {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.player-starred-btn {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0.45rem 0.62rem;
  font-size: 0.78rem;
  line-height: 1.1;
}

.player-starred-btn:disabled {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--panel-bg);
  color: rgba(213, 194, 173, 0.62);
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
}

.player-toast {
  position: fixed;
  left: 50%;
  bottom: 1.2rem;
  transform: translate(-50%, 120%);
  opacity: 0;
  z-index: 30;
  pointer-events: none;
  max-width: min(90vw, 44rem);
  padding: 0.62rem 0.88rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 195, 111, 0.45);
  background: rgba(14, 16, 24, 0.92);
  color: #fff4e2;
  text-align: center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.38);
  transition: transform 0.24s ease, opacity 0.24s ease;
}

.player-toast.is-visible {
  transform: translate(-50%, 0);
  opacity: 1;
}

.track-list {
  display: grid;
  gap: 0.7rem;
  max-height: 300px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.track-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.track-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 18px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid transparent;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.track-item-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.55rem;
  align-items: center;
}

.track-star-btn {
  width: 1.65rem;
  min-width: 1.65rem;
  height: 1.65rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 140, 0.65);
  background: linear-gradient(180deg, #fff0c7, #ffc881);
  color: #3f3027;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1;
}

.track-star-btn.is-selected {
  border-color: rgba(24, 11, 61, 0.95);
  background: linear-gradient(180deg, #644eca, #0d2a61);
  box-shadow: 0 0 0 2px rgba(111, 255, 123, 0.22);
}

.track-star-btn:focus-visible {
  outline: 2px solid rgba(255, 195, 111, 0.55);
  outline-offset: 2px;
}

.track-item:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 195, 111, 0.25);
}

.track-item.is-active {
  background: linear-gradient(135deg, rgba(255, 195, 111, 0.16), rgba(255, 126, 103, 0.14));
  border-color: rgba(255, 195, 111, 0.35);
}

.track-number {
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff6ea;
  font-size: 0.85rem;
}

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

.track-meta strong {
  color: #fff4e2;
}

.track-meta span {
  color: var(--muted);
  font-size: 0.92rem;
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  align-items: center;
  justify-content: center;
}

.playlist-picker {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.28rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.playlist-picker span {
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player-frame {
  padding: 0.65rem;
}

.player-stage {
  display: grid;
  gap: 0.65rem;
  padding: 0.8rem;
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(255, 195, 111, 0.1), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.02));
}

.lcd-display {
  min-height: 5.5rem;
  background: linear-gradient(180deg, #272c26, #11160f);
  color: #f6fbd0;
  font-family: "Digital-7", monospace, Arial, sans-serif;
  font-size: 1.1em;
  border-radius: 16px;
  border: 2px solid #060706;
  text-align: center;
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.65);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  padding: 0.8rem 0.75rem;
}

.lcd-status-row {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
}

.media-source-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  height: 1.2rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  border: 1px solid rgba(246, 251, 208, 0.32);
  background: rgba(246, 251, 208, 0.08);
  color: #f6fbd0;
  font-size: 0.72em;
  line-height: 1;
  letter-spacing: 0.03em;
}

.media-source-badge.is-local {
  border-color: rgba(150, 255, 171, 0.55);
  background: rgba(150, 255, 171, 0.2);
  color: #deffe6;
}

.media-source-badge.is-cloud {
  border-color: rgba(142, 211, 255, 0.55);
  background: rgba(142, 211, 255, 0.2);
  color: #e6f7ff;
}

.media-source-badge.is-unknown {
  border-color: rgba(246, 251, 208, 0.32);
  background: rgba(246, 251, 208, 0.08);
  color: #f6fbd0;
}

.playlist-label {
  display: block;
  margin-top: 0.35rem;
  font-size: 0.65em;
  letter-spacing: 0.08em;
  color: #c0c89b;
}

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

.transport-secondary {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
}

.transport-btn {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0.8rem 0.7rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff2de;
  font: inherit;
  letter-spacing: 0.04em;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.transport-btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 195, 111, 0.24);
}

.transport-btn-primary {
  background: linear-gradient(135deg, rgba(255, 195, 111, 0.28), rgba(255, 126, 103, 0.24));
  border-color: rgba(255, 195, 111, 0.32);
  color: #fff8ef;
}

.transport-btn-random.is-active,
.transport-btn-random[aria-pressed="true"],
.transport-btn-repeat.is-active,
.transport-btn-repeat[aria-pressed="true"] {
  background: linear-gradient(135deg, rgba(143, 255, 182, 0.28), rgba(82, 200, 255, 0.24));
  border-color: rgba(143, 255, 182, 0.5);
  color: #f2fff8;
  box-shadow: 0 0 0 1px rgba(143, 255, 182, 0.28), 0 10px 20px rgba(62, 170, 128, 0.28);
}

#audioPlayer {
  display: none;
  width: 100%;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
}

body.is-video-mode #audioPlayer,
body:not(.is-video-mode) .video-screen {
  display: none;
}

body.is-audio-mode #audioPlayer {
  display: block;
}

.video-screen {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

#videoPlayer {
  display: block;
  width: 100%;
  max-height: 68vh;
  background: #000;
}

.video-resume-btn {
  position: absolute;
  bottom: 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(0, 0, 0, 0.56);
  color: #fff;
  font: inherit;
  border-radius: 10px;
  padding: 0.42rem 0.58rem;
  cursor: pointer;
}

.video-resume-btn {
  left: 0.7rem;
}

.video-resume-btn:hover {
  background: rgba(0, 0, 0, 0.7);
}

.song-list-container button,
#songList {
  background: linear-gradient(135deg, var(--button-start), var(--button-end));
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 0.7rem 0.95rem;
  font-size: 0.92rem;
  color: var(--button-text);
  font-weight: bold;
  text-decoration: none;
  cursor: pointer;
}

#songList {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(135deg, rgba(18, 11, 8, 0.2), rgba(18, 11, 8, 0.42)),
    url("./assets/ddMusic.ico");
  background-position: center;
  background-repeat: no-repeat;
  background-size: cover;
  border-color: rgba(255, 190, 106, 0.5);
  color: #fff8ef;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.85);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 12px 24px rgba(255, 125, 58, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

#songList:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 205, 133, 0.7);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 14px 28px rgba(255, 125, 58, 0.28);
}

#song-list button {
  width: 100%;
  max-width: none;
  margin: 0;
  font-size: 0.9rem;
  padding: 0.6rem 0.75rem;
}

.track-list .track-item {
  width: 100%;
  max-width: none;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  cursor: pointer;
}

.track-item-empty {
  cursor: default;
}

#playlist-selector {
  background: rgba(255, 255, 255, 0.06);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 0.7rem 0.9rem;
  font-family: "Digital-7", monospace, Arial, sans-serif;
  font-size: 0.95em;
  width: auto;
  min-width: 11.5rem;
  text-align: center;
}

#playlist-selector option {
  background: #18151c;
  color: #f6f0e8;
  padding: 5px;
  text-align: center;
}

#playlist-selector:focus {
  outline: none;
  box-shadow: 0 0 5px grey;
}

.player-aside {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 0.85rem;
}

.player-aside-copy {
  display: grid;
  gap: 0.25rem;
}

.player-aside-label {
  margin: 0 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.74rem;
  color: var(--accent);
}

.art-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.art-tile,
.art-medallion {
  display: block;
  object-fit: cover;
  border-radius: 38px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.art-tile {
  width: 108px;
  height: 108px;
  margin-right: 0;
  border-radius: 24px;
}

.auth-page-shell {
  min-height: calc(100vh - 3rem);
}

.signin-card {
  position: relative;
  z-index: 1;
  width: min(100%, 430px);
  padding: 1.4rem;
  border: 1px solid var(--card-border);
  border-radius: 28px;
  background: var(--card-bg);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
}

.signin-back {
  display: inline-block;
  margin-bottom: 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.86rem;
}

.signin-brand {
  display: flex;
  align-items: center;
  gap: 0.9rem;
}

.signin-brand img {
  width: 68px;
  height: 68px;
  border-radius: 18px;
}

.signin-brand h1 {
  margin: 0.2rem 0 0;
  color: #fff4e2;
  font-size: 1.9rem;
}

.signin-intro {
  margin: 1rem 0 1.2rem;
  color: var(--muted);
}

.signin-form {
  display: grid;
  gap: 0.55rem;
}

.signin-form label {
  margin-top: 0.35rem;
  color: #fff4e2;
  font-size: 0.85rem;
}

.signin-form input {
  padding: 0.82rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff4e2;
  font: inherit;
}

.signin-form input:focus {
  outline: 2px solid rgba(255, 195, 111, 0.42);
  outline-offset: 1px;
}

.signin-form button,
.signed-in-actions a,
.signed-in-actions button {
  margin-top: 0.75rem;
  padding: 0.78rem 0.95rem;
  border: 1px solid rgba(255, 195, 111, 0.32);
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(255, 195, 111, 0.3), rgba(255, 126, 103, 0.25));
  color: #fff8ef;
  font: inherit;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
}

.signed-in-panel {
  padding: 1rem;
  border: 1px solid var(--panel-border);
  border-radius: 16px;
  background: var(--panel-bg);
}

.signed-in-panel p,
.signin-status {
  margin: 0;
  color: var(--muted);
}

.signed-in-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.signin-status {
  min-height: 1.35rem;
  margin-top: 0.85rem;
  color: var(--accent);
  text-align: center;
}

.art-medallion {
  width: 264px;
  height: 264px;
  border-radius: 999px;
}

.titles-container {
  position: relative;
  margin-bottom: 0.5rem;
  display: grid;
  gap: 0.35rem;
}

.titles-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.titles-container h1,
.titles-container h2 {
  margin: 0;
  color: var(--theme-text);
}

.song-list-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.song-list-back {
  display: inline-block;
  color: var(--theme-text);
  text-decoration: none;
  padding: 0.68rem 0.9rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.05);
}

.song-list-back:hover {
  background: rgba(255, 255, 255, 0.1);
}

.song-list-container .rebuild-index-button {
  margin: 0;
  padding: 0.68rem 0.9rem;
  background: linear-gradient(135deg, #a9d8b9, var(--button-end));
  border-color: rgba(169, 216, 185, 0.45);
  box-shadow: 0 8px 18px rgba(93, 147, 118, 0.2);
}

.song-list-container .rebuild-index-button:hover:not(:disabled) {
  filter: brightness(1.08);
}

.song-list-container .rebuild-index-button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.rebuild-index-control {
  display: grid;
  justify-items: center;
  gap: 0.25rem;
}

.rebuild-index-status {
  max-width: 14rem;
  color: #deffe6;
  font-size: 0.8rem;
  line-height: 1.2;
  text-align: center;
}

#song-list li {
  list-style: none;
}

.song-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.7rem;
  padding: 0.65rem 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.song-entry-select {
  min-width: 0;
  width: 100%;
  margin: 0;
  text-align: left;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-toolbar {
  display: grid;
  grid-template-columns: minmax(200px, 280px) minmax(0, 1fr);
  align-items: start;
  align-content: start;
  grid-auto-rows: min-content;
  gap: 0.55rem;
}

.library-toolbar {
  padding: 0.5rem 0.65rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 0;
}

.song-editor-picker {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  width: 100%;
  padding: 0.38rem 0.46rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  min-height: 0;
}

.song-editor-picker span {
  flex-shrink: 0;
  white-space: nowrap;
}

#editor-playlist-selector {
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  padding: 0.45rem 0.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  color: #fff4e2;
  font-size: 0.86rem;
}

.editor-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  align-content: start;
  grid-auto-rows: min-content;
  gap: 0.45rem;
}

.editor-actions button {
  width: 100%;
  margin: 0;
  min-width: 0;
  padding: 0.45rem 0.4rem;
  font-size: 0.79rem;
  line-height: 1.1;
  white-space: normal;
  min-height: 0;
  height: auto;
  align-self: start;
}

#create-playlist-btn { order: 1; }
#delete-playlist-btn { order: 2; }
#import-playlist-btn { order: 3; }
#rename-playlist-btn { order: 4; }

#delete-playlist-btn,
#delete-playlist-apply-btn {
  border-color: rgba(255, 130, 120, 0.42);
  background: linear-gradient(135deg, rgba(255, 118, 102, 0.42), rgba(132, 31, 47, 0.48));
  color: #fff5ef;
}

.editor-actions button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.import-playlist-panel {
  display: grid;
  gap: 0.6rem;
  padding: 0.75rem;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.import-playlist-panel[hidden] {
  display: none !important;
}

.import-playlist-input {
  display: grid;
  gap: 0.4rem;
}

.import-playlist-input span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.import-playlist-input textarea {
  width: 100%;
  min-height: 10rem;
  resize: vertical;
  padding: 0.72rem 0.86rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff4e2;
  font: inherit;
  font-size: 0.9rem;
}

.import-playlist-input select {
  width: 100%;
  min-height: 2.5rem;
  padding: 0.72rem 0.86rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff4e2;
  font: inherit;
  font-size: 0.9rem;
}

.import-playlist-input textarea:focus {
  outline: 2px solid rgba(255, 195, 111, 0.45);
  outline-offset: 1px;
}

.import-playlist-input select:focus {
  outline: 2px solid rgba(255, 195, 111, 0.45);
  outline-offset: 1px;
}

.import-playlist-help {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
}

.import-playlist-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.editor-message {
  min-height: 1.5rem;
  color: #ffc36f;
  text-align: center;
}

.song-list-empty {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.song-list-empty p {
  margin: 0;
}

.song-list-empty a {
  color: #ffc36f;
}

.song-entry-custom {
  grid-template-columns: auto minmax(0, 1fr) auto;
  cursor: grab;
  gap: 0.5rem;
}

.song-entry-custom.is-dragging {
  opacity: 0.45;
}

.song-entry-custom.is-drag-over {
  border-color: rgba(255, 195, 111, 0.5);
  background: linear-gradient(135deg, rgba(255, 195, 111, 0.15), rgba(255, 126, 103, 0.09));
}

.song-entry-controls {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
}

.song-entry-pick-btn {
  width: 1.45rem;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 210, 140, 0.65);
  background: linear-gradient(180deg, #fff0c7, #ffc881);
  color: #3f3027;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1;
}

.song-entry-pick-btn.is-selected {
  border-color: rgba(255, 238, 177, 0.95);
  background: linear-gradient(180deg, #ffd977, #ffaf53);
  box-shadow: 0 0 0 2px rgba(255, 195, 111, 0.22);
}

.song-entry-pick-btn:focus-visible {
  outline: 2px solid rgba(255, 195, 111, 0.55);
  outline-offset: 2px;
}

.song-entry-drag-handle {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 0.18rem;
  min-height: 1.7rem;
  min-width: 1.6rem;
  padding: 0.34rem 0.38rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.18);
}

.song-entry-drag-handle span {
  display: block;
  width: 0.78rem;
  height: 2px;
  margin: 0 auto;
  border-radius: 999px;
  background: rgba(248, 240, 228, 0.85);
}

.song-entry-remove-btn {
  width: 1.45rem;
  min-width: 1.45rem;
  height: 1.45rem;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255, 170, 170, 0.85);
  background: linear-gradient(180deg, #ff9c9c, #f06f6f);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.song-entry-remove-btn span {
  display: block;
  width: 0.56rem;
  height: 2px;
  border-radius: 999px;
  background: #ffffff;
}

.song-entry-remove-btn:hover {
  background: linear-gradient(180deg, #ffacac, #f37f7f);
}

.song-entry-remove-btn:focus-visible {
  outline: 2px solid rgba(255, 195, 111, 0.55);
  outline-offset: 2px;
}

.song-entry-controls button,
.library-song button {
  width: auto;
  max-width: none;
  margin: 0;
  padding: 0.5rem 0.7rem;
  font-size: 0.84rem;
}

.library-panel-header {
  display: grid;
  gap: 0.6rem;
}

.library-panel-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.library-panel-header h2 {
  margin: 0;
  font-size: 1.05rem;
  color: #fff4e2;
}

.library-panel-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.page-auth-status {
  position: static;
  min-height: 0;
  max-width: 100%;
  margin: 0;
  text-align: left;
  pointer-events: none;
}

.library-search {
  display: grid;
  gap: 0.4rem;
}

.library-search span {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.library-search input {
  width: 100%;
  min-width: 0;
  padding: 0.72rem 0.86rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: #fff4e2;
  font: inherit;
}

.library-search input::placeholder {
  color: rgba(245, 235, 222, 0.58);
}

.library-search input:focus {
  outline: 2px solid rgba(255, 195, 111, 0.45);
  outline-offset: 1px;
}

.library-browse-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.2rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  width: fit-content;
}

.library-mode-btn {
  margin: 0;
  min-width: 5.2rem;
  padding: 0.46rem 0.78rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: #fff4e2;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.library-mode-btn.is-active {
  border-color: rgba(126, 174, 230, 0.62);
  background: linear-gradient(135deg, #8eb7e3, #668dbd);
}

.library-browser {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.library-artists-pane {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 0.75rem;
}

.library-list.library-artists-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.55rem;
  max-height: none;
  min-height: 4.4rem;
  overflow-y: hidden;
  overflow-x: auto;
  padding: 0.2rem 0.2rem 0.2rem 0;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.library-list.library-artists-row::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.library-artist-item {
  flex: 0 0 auto;
  min-width: 9rem;
  max-width: 13rem;
  padding: 0.45rem 0.7rem;
  border-radius: 999px;
}

.library-artist-item .library-song-body {
  gap: 0.2rem;
}

.library-artist-item .library-song-select span {
  display: none;
}

.library-split {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.library-pane {
  min-width: 0;
  display: grid;
  gap: 0.75rem;
}

.library-pane-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0 0.1rem;
}

.library-pane-header h3 {
  margin: 0;
  color: #fff4e2;
  font-size: 0.98rem;
}

.library-play-hint {
  flex: 1;
  color: #fff4e2;
  font-size: 0.88rem;
  text-align: center;
}

.library-pane-label {
  min-width: 0;
  max-width: 70%;
  display: block;
  color: var(--muted);
  font-size: 0.88rem;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-list {
  display: grid;
  gap: 0.55rem;
  max-height: 630px;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 0;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.library-list::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.library-song {
  display: block;
  min-width: 0;
  padding: 0.45rem 0.7rem 0.55rem;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.library-song.is-selected {
  background: linear-gradient(135deg, rgba(255, 195, 111, 0.14), rgba(255, 126, 103, 0.08));
  border-color: rgba(255, 195, 111, 0.35);
}

.library-song-body {
  display: grid;
  min-width: 0;
  gap: 0.45rem;
}

.library-song-select {
  display: grid;
  min-width: 0;
  gap: 0.2rem;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  border: 0;
  color: inherit;
  font: inherit;
  font-weight: normal;
  text-align: left;
  cursor: pointer;
}

.library-song-select strong {
  min-width: 0;
  color: rgb(50, 31, 42);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.library-song-select span {
  min-width: 0;
  color: var(--muted);
  font-size: 0.84rem;
  overflow-wrap: anywhere;
}

body.is-video-mode .library-song-select span {
  display: none;
}

.library-song-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
}

.library-song-actions button {
  width: 100%;
  min-width: 0;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

@media (max-width: 880px) {
  .player-container,
  body.is-video-mode .player-container {
    grid-template-columns: 1fr;
    grid-template-areas:
      "hero"
      "player"
      "copy";
  }

  .playlist-panel #song-list {
    height: auto;
    max-height: 72vh;
  }

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

  .library-split {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  body {
    padding: 0.5rem;
  }

  .about-panel {
    padding: 0.85rem;
  }

  .about-identity,
  .about-system dl > div {
    grid-template-columns: 1fr;
  }

  .about-badges {
    grid-template-columns: 1fr;
  }

  .titles-row {
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .song-list-links {
    width: 100%;
    justify-content: flex-start;
  }

  .song-entry {
    grid-template-columns: 1fr;
  }

  .song-entry-custom,
  .library-song {
    grid-template-columns: 1fr;
  }

  .selected-tracks-panel,
  .selected-tracks-actions {
    grid-template-columns: 1fr;
  }

  .library-song-actions {
    grid-template-columns: 1fr;
    min-width: 0;
  }

  .auth-form {
    grid-template-columns: 1fr;
  }

  .player-container {
    padding: 0.9rem;
  }

  .lcd-display {
    font-size: 0.92em;
  }

  .transport-controls {
    grid-template-columns: repeat(2, 1fr);
  }

  .transport-secondary {
    flex-wrap: wrap;
    justify-content: center;
  }

  .userGuideLink {
    flex-wrap: wrap;
  }

  .userGuideLink a,
  .userGuideLink button {
    width: calc((100% - 0.65rem) / 2);
    flex: 1 1 auto;
  }

  .track-panel-actions {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
  }

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

  .player-aside {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-actions {
    flex-direction: column;
    align-items: center;
  }

  .playlist-picker {
    align-items: center;
  }

  .editor-toolbar,
  .library-panel-header,
  .song-entry-controls,
  .library-song-actions,
  .library-pane-header {
    justify-content: stretch;
  }

  .editor-toolbar {
    grid-template-columns: 1fr;
  }

  .song-editor-picker {
    flex-direction: row;
    padding: 0.5rem 0.58rem;
  }

  .song-editor-picker span {
    display: none;
  }

  .page-auth-status {
    position: static;
    max-width: none;
    text-align: left;
    margin-top: 0.65rem;
  }
}

.userGuideLink {
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.65rem;
  padding-inline: 1rem;
  margin-top: 0.5rem;
}

.userGuideLink a,
.userGuideLink button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 0;
  min-width: 0;
  color: var(--theme-text);
  text-decoration: none;
  padding: 0.8rem 0.7rem;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.06);
  letter-spacing: 0.04em;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
  font: inherit;
  cursor: pointer;
}

.userGuideLink [data-live-stream-surface][hidden] {
  display: none !important;
}

.userGuideLink a:hover,
.userGuideLink a:focus-visible,
.userGuideLink button:hover,
.userGuideLink button:focus-visible {
  transform: translateY(-1px);
  color: #fff8ef;
  border-color: rgba(255, 195, 111, 0.35);
  background: rgba(255, 255, 255, 0.1);
}

.feedback-dialog {
  width: min(92vw, 36rem);
  padding: 0;
  border: 1px solid rgba(255, 195, 111, 0.3);
  border-radius: 22px;
  background: #17121f;
  color: var(--theme-text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
}

.feedback-dialog::backdrop {
  background: rgba(5, 4, 9, 0.68);
  backdrop-filter: blur(3px);
}

.feedback-form { display: grid; gap: 1rem; padding: 1.2rem; }
.feedback-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.feedback-heading h2 { margin: 0.25rem 0 0; color: #fff4e2; }
.feedback-close { width: 2.2rem; margin: 0; padding: 0.2rem; background: transparent; color: var(--muted); font-size: 1.7rem; }
.feedback-sentiments { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.5rem; }
.feedback-sentiments button { min-width: 0; margin: 0; padding: 0.65rem 0.4rem; font-size: 0.78rem; background: rgba(255, 255, 255, 0.06); color: #fff4e2; }
.feedback-sentiments button[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 195, 111, 0.16); }
.feedback-message { display: grid; gap: 0.4rem; color: var(--muted); font-size: 0.85rem; }
.feedback-message textarea { width: 100%; min-height: 7rem; resize: vertical; padding: 0.8rem; border: 1px solid rgba(255, 255, 255, 0.12); border-radius: 14px; background: rgba(255, 255, 255, 0.06); color: #fff4e2; font: inherit; }
.feedback-message textarea:focus { outline: 2px solid rgba(255, 195, 111, 0.45); outline-offset: 1px; }
.feedback-footer { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.feedback-footer button { width: auto; min-width: 7rem; margin: 0; border: 1px solid rgba(255, 195, 111, 0.45); border-radius: 10px; background: linear-gradient(135deg, rgba(255, 195, 111, 0.28), rgba(255, 126, 103, 0.24)); color: #fff4e2; font: inherit; cursor: pointer; }
.feedback-status { min-height: 1.2rem; margin: 0; color: var(--muted); font-size: 0.84rem; }
.feedback-status[data-state="success"] { color: #8fe29a; }
.feedback-status[data-state="error"] { color: #ff9b91; }

.impala-prompt-dialog {
  width: min(92vw, 34rem);
  padding: 0;
  border: 1px solid rgba(255, 195, 111, 0.3);
  border-radius: 18px;
  background: #17121f;
  color: var(--theme-text);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.65);
}

.impala-prompt-dialog::backdrop {
  background: rgba(5, 4, 9, 0.68);
  backdrop-filter: blur(3px);
}

.impala-prompt-form {
  display: grid;
  gap: 0.85rem;
  padding: 1.1rem;
}

.impala-prompt-heading h2 {
  margin: 0.2rem 0 0;
  color: #fff4e2;
  font-size: 1.25rem;
}

.impala-prompt-message {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
  white-space: pre-line;
}

.impala-prompt-label {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.impala-prompt-input,
#impala-prompt-input {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: #fff4e2;
  font: inherit;
}

.impala-prompt-input:focus,
#impala-prompt-input:focus {
  outline: 2px solid rgba(255, 195, 111, 0.45);
  outline-offset: 1px;
}

.impala-prompt-footer {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
}

.impala-prompt-footer button {
  width: auto;
  min-width: 6.5rem;
  margin: 0;
  border-radius: 10px;
  font: inherit;
  cursor: pointer;
}

.impala-prompt-footer button[type="button"] {
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
}

.impala-prompt-footer button[type="submit"] {
  border-color: rgba(255, 195, 111, 0.45);
  background: linear-gradient(135deg, rgba(255, 195, 111, 0.28), rgba(255, 126, 103, 0.24));
  color: #fff4e2;
}

@media (max-width: 500px) {
  .feedback-sentiments { grid-template-columns: 1fr; }
  .feedback-footer { align-items: stretch; flex-direction: column; }
  .feedback-footer button { width: 100%; }
  .impala-prompt-footer { align-items: stretch; flex-direction: column; }
  .impala-prompt-footer button { width: 100%; }
}

.preferences-main,
.live-main {
  max-width: 1040px;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 1.5rem;
  border-radius: 24px;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.35);
  display: grid;
  gap: 1rem;
}

.preferences-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.preferences-top h1 {
  margin: 0;
  color: var(--theme-text);
}

.live-main {
  max-width: 880px;
  width: min(100%, 880px);
}

.preferences-intro {
  margin: 0;
  color: var(--muted);
}

.preferences-grid {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 1rem;
}

.prefs-panel {
  padding: 0.95rem;
  border-radius: 16px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  display: grid;
  gap: 0.75rem;
}

.prefs-panel h2 {
  margin: 0;
  color: var(--theme-text);
  font-size: 1.02rem;
}

.prefs-panel p {
  margin: 0;
  color: var(--muted);
}

.prefs-panel a {
  color: #ffd894;
  text-decoration-color: rgba(255, 216, 148, 0.55);
  text-underline-offset: 0.16em;
}

.prefs-panel a:hover,
.prefs-panel a:focus-visible {
  color: #fff4e2;
  text-decoration-color: currentColor;
}

.prefs-control {
  display: grid;
  gap: 0.4rem;
}

.prefs-control label {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.prefs-control select {
  width: 100%;
  min-height: 2.45rem;
  padding: 0.7rem 0.82rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--theme-text);
  font: inherit;
}

.prefs-control input,
.prefs-control textarea {
  width: 100%;
  padding: 0.7rem 0.82rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--theme-text);
  font: inherit;
}

.prefs-control textarea {
  resize: vertical;
  min-height: 5.4rem;
}

.prefs-dropzone {
  min-height: 9rem;
  border-style: dashed;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.prefs-dropzone.is-dragover {
  border-color: rgba(255, 195, 111, 0.7);
  background: rgba(255, 195, 111, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 195, 111, 0.22);
}

.prefs-control select:focus,
.prefs-control input:focus,
.prefs-control textarea:focus {
  outline: 2px solid rgba(255, 195, 111, 0.45);
  outline-offset: 1px;
}

.prefs-hint {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.prefs-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.prefs-toggle {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  color: var(--theme-text);
  font-size: 0.95rem;
}

.prefs-toggle input {
  width: 1.1rem;
  height: 1.1rem;
  accent-color: var(--accent);
}

.prefs-status {
  min-height: 1.2rem;
  color: var(--accent);
  font-size: 0.86rem;
}

.live-panel {
  gap: 0.9rem;
}

.live-catalog {
  display: grid;
  gap: 0.65rem;
}

.live-catalog-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.live-catalog-header h3 {
  margin: 0;
  color: var(--theme-text);
  font-size: 0.95rem;
}

.live-catalog-header span {
  color: var(--accent);
  font-size: 0.82rem;
}

.live-catalog-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.65rem;
}

.live-catalog-item {
  min-height: 7rem;
  padding: 0.8rem;
  border: 1px solid var(--panel-border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--theme-text);
  text-align: left;
  display: grid;
  align-content: start;
  gap: 0.3rem;
}

.live-catalog-item:hover,
.live-catalog-item:focus-visible {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.075);
}

.live-catalog-title {
  font-weight: 700;
}

.live-catalog-meta,
.live-catalog-description {
  color: var(--muted);
  font-size: 0.82rem;
}

.live-detail {
  min-height: 4rem;
  margin: 0;
  padding: 0.85rem;
  border: 1px solid var(--panel-border);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
  color: var(--muted);
  white-space: pre-wrap;
  font: 0.85rem/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.palette-preview {
  display: grid;
  gap: 0.55rem;
}

.palette-preview-row {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.45rem;
}

.palette-swatch {
  height: 2.6rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.future-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  display: grid;
  gap: 0.3rem;
}

@media (max-width: 880px) {
  .preferences-grid {
    grid-template-columns: 1fr;
  }
}
