:root {
  color-scheme: dark;
  --wallpaper:
    radial-gradient(circle at 16% 20%, rgba(224, 24, 96, 0.78), transparent 34%),
    radial-gradient(circle at 78% 58%, rgba(231, 151, 27, 0.82), transparent 30%),
    radial-gradient(circle at 62% 14%, rgba(15, 151, 180, 0.92), transparent 44%),
    linear-gradient(145deg, #0c426c 0%, #101338 48%, #05070b 100%);
  --panel-gradient: linear-gradient(180deg, #9098a0 0%, #4a535d 14%, #242b31 15%, #777f86 46%, #31383f 100%);
  --bezel: #101317;
  --cyan: #29d9cd;
  --cyan-dim: #126d69;
  --gold: #e2d96f;
  --amber: #f2b744;
  --green: #66e062;
  --text: #e9eef1;
  --skin-brightness: 1;
  font-family: "Helvetica Neue", Arial, sans-serif;
}

body[data-theme="base"] {
  --wallpaper: linear-gradient(145deg, #2c3036 0%, #111820 54%, #05070a 100%);
  --panel-gradient: linear-gradient(180deg, #b5bbc0 0%, #707981 14%, #272e35 15%, #8c9499 48%, #303840 100%);
  --cyan: #31e6a6;
  --gold: #e5df67;
  --amber: #f0c657;
  --green: #72e071;
}

body[data-theme="bento"] {
  --wallpaper:
    radial-gradient(circle at 18% 22%, rgba(48, 110, 224, 0.82), transparent 36%),
    radial-gradient(circle at 82% 64%, rgba(39, 219, 190, 0.46), transparent 32%),
    linear-gradient(145deg, #111f52 0%, #081220 62%, #030508 100%);
  --panel-gradient: linear-gradient(180deg, #9eb8cc 0%, #44637d 14%, #172534 15%, #637d95 46%, #1c2d3c 100%);
  --cyan: #61d8ff;
  --gold: #b6e0ff;
  --amber: #8bc9ff;
  --green: #62e4b8;
}

body[data-theme="amber"] {
  --wallpaper:
    radial-gradient(circle at 22% 24%, rgba(231, 165, 41, 0.84), transparent 36%),
    radial-gradient(circle at 78% 58%, rgba(106, 64, 20, 0.78), transparent 32%),
    linear-gradient(145deg, #2a190b 0%, #0e0b08 62%, #050403 100%);
  --panel-gradient: linear-gradient(180deg, #c7b08a 0%, #79653f 14%, #2e271b 15%, #9f895d 46%, #3c2f1c 100%);
  --cyan: #ffbf42;
  --gold: #ffe68a;
  --amber: #ff9b2f;
  --green: #ffc95a;
}

body[data-theme="night"] {
  --wallpaper:
    radial-gradient(circle at 20% 24%, rgba(42, 245, 128, 0.24), transparent 34%),
    linear-gradient(145deg, #02100b 0%, #030607 58%, #000 100%);
  --panel-gradient: linear-gradient(180deg, #2a4038 0%, #182822 14%, #050908 15%, #20392f 46%, #07110e 100%);
  --cyan: #40ff8a;
  --gold: #a6ff58;
  --amber: #80ff54;
  --green: #40ff8a;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
  background: var(--wallpaper);
  color: var(--text);
  user-select: none;
}

.login-page,
.admin-page {
  overflow: auto;
  user-select: auto;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(360px, 100%);
  display: grid;
  gap: 14px;
  padding: 24px;
  border: 2px solid #11161b;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 15%, transparent 85%, rgba(255, 255, 255, 0.14)),
    var(--panel-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55),
    0 22px 34px rgba(0, 0, 0, 0.38);
}

.login-bolt {
  color: #ffe649;
  filter: drop-shadow(0 0 5px rgba(255, 230, 73, 0.8));
  font-size: 34px;
  line-height: 1;
}

.login-panel h1,
.login-panel p {
  margin: 0;
}

.login-panel h1 {
  color: #f3f5f4;
  font-size: 24px;
  text-shadow: 0 2px 1px #000;
}

.login-panel p,
.login-panel label {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 0 #000;
}

.login-panel label {
  display: grid;
  gap: 5px;
}

.login-panel input {
  width: 100%;
  height: 34px;
  border: 2px solid #171c20;
  border-radius: 4px;
  padding: 0 10px;
  color: #06120f;
  background: linear-gradient(#f6f8ee, #8f9ca2 52%, #c8d0d1);
  font-weight: 700;
}

.login-panel .remember-login {
  display: flex;
  gap: 8px;
  align-items: center;
  color: #dfe878;
}

.login-panel .remember-login input {
  width: 18px;
  height: 18px;
  accent-color: #58c64d;
}

.login-panel button {
  height: 36px;
  border: 2px solid #171c20;
  border-radius: 4px;
  color: #06120f;
  background: linear-gradient(#a5ff79, #58c64d 52%, #c6f2a7);
  font-weight: 900;
}

.login-error {
  border: 1px solid rgba(255, 102, 90, 0.65);
  border-radius: 4px;
  padding: 8px 10px;
  color: #ffd9d5;
  background: rgba(52, 12, 10, 0.72);
  font-size: 12px;
  font-weight: 700;
}

button,
input,
select {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.stage {
  position: relative;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.top-links {
  position: fixed;
  right: 16px;
  bottom: 14px;
  z-index: 1000;
  display: flex;
  gap: 8px;
}

.top-links a {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 4px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.42);
  font-size: 11px;
  font-weight: 800;
  text-decoration: none;
}

.admin-shell {
  min-height: 100vh;
  display: grid;
  place-items: start center;
  padding: 32px 18px;
}

.admin-panel {
  width: min(980px, 100%);
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 2px solid #11161b;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 15%, transparent 85%, rgba(255, 255, 255, 0.14)),
    var(--panel-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55),
    0 22px 34px rgba(0, 0, 0, 0.38);
}

.admin-title {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 12px;
  align-items: center;
}

.admin-title h1,
.admin-title p,
.admin-card h2 {
  margin: 0;
}

.admin-title h1 {
  color: #f3f5f4;
  font-size: 22px;
  text-shadow: 0 2px 1px #000;
}

.admin-title p,
.admin-card label,
.user-row span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 0 #000;
}

.admin-title a,
.admin-card button,
.user-row button {
  border: 2px solid #171c20;
  border-radius: 4px;
  color: #17211d;
  background: linear-gradient(#f6f8ee, #8f9ca2 52%, #c8d0d1);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    0 1px rgba(0, 0, 0, 0.55);
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 900;
  text-decoration: none;
}

.admin-success {
  border: 1px solid rgba(113, 255, 125, 0.65);
  border-radius: 4px;
  padding: 8px 10px;
  color: #ddffe1;
  background: rgba(8, 55, 18, 0.72);
  font-size: 12px;
  font-weight: 700;
}

.admin-card,
.user-row {
  border: 2px solid #171c20;
  border-radius: 6px;
  background: rgba(2, 8, 8, 0.72);
  padding: 12px;
}

.admin-card {
  display: grid;
  gap: 10px;
}

.admin-card h2 {
  color: var(--cyan);
  font-size: 14px;
  text-shadow: 0 1px 0 #000;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(150px, 1fr) minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
}

.admin-card label {
  display: grid;
  gap: 5px;
}

.admin-card input,
.user-row input {
  min-width: 0;
  height: 32px;
  border: 2px solid #171c20;
  border-radius: 4px;
  padding: 0 9px;
  color: #06120f;
  background: linear-gradient(#f6f8ee, #8f9ca2 52%, #c8d0d1);
  font-weight: 800;
}

.admin-check {
  height: 32px;
  grid-template-columns: auto auto;
  align-items: center;
}

.admin-check input {
  width: 16px;
  height: 16px;
}

.user-list {
  display: grid;
  gap: 8px;
}

.user-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) minmax(210px, 1.4fr) auto auto;
  gap: 10px;
  align-items: center;
}

.user-row strong {
  display: block;
  color: var(--cyan);
  font-size: 15px;
  text-shadow: 0 0 6px rgba(49, 224, 209, 0.42);
  overflow-wrap: anywhere;
}

.deleted-user {
  border-color: rgba(255, 222, 95, 0.45);
  background: rgba(19, 12, 4, 0.78);
}

.deleted-user strong {
  color: #b8c2c2;
  text-shadow: none;
}

.deleted-note {
  color: #f2df79;
  font-size: 12px;
  font-weight: 800;
  text-shadow: 0 1px 0 #000;
}

.user-row form {
  display: flex;
  gap: 8px;
  align-items: center;
}

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

  .user-row form {
    align-items: stretch;
    flex-direction: column;
  }
}

.panel {
  position: absolute;
  border: 2px solid #11161b;
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.2), transparent 15%, transparent 85%, rgba(255, 255, 255, 0.14)),
    var(--panel-gradient);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.62),
    inset 0 -2px 0 rgba(0, 0, 0, 0.55),
    0 22px 34px rgba(0, 0, 0, 0.38);
  filter: brightness(var(--skin-brightness));
  overflow: hidden;
}

.panel::after {
  content: "";
  pointer-events: none;
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(
    90deg,
    rgba(255, 255, 255, 0.04) 0 1px,
    rgba(0, 0, 0, 0.04) 1px 3px
  );
  mix-blend-mode: overlay;
}

.player-panel {
  width: 576px;
  height: 286px;
  left: max(18px, calc(50vw - 491px));
  top: max(18px, calc(50vh - 266px));
}

.equalizer-panel {
  width: 576px;
  height: 238px;
  left: max(18px, calc(50vw - 491px));
  top: max(312px, calc(50vh + 28px));
}

.playlist-panel {
  width: 576px;
  height: 532px;
  left: max(602px, calc(50vw + 93px));
  top: max(18px, calc(50vh - 266px));
}

.panel.hidden {
  display: none;
}

.panel.shaded {
  height: 34px !important;
}

.panel.shaded.equalizer-panel,
.panel.shaded.playlist-panel {
  height: 28px !important;
}

.panel.shaded > :not(.titlebar) {
  display: none;
}

.titlebar {
  position: relative;
  z-index: 2;
  height: 34px;
  display: grid;
  grid-template-columns: 74px 22px 1fr auto 1fr 24px;
  align-items: center;
  gap: 8px;
  padding: 0 8px;
  color: #f3f5f4;
  text-shadow:
    0 1px 1px #000,
    1px 1px 0 #000;
}

.titlebar.compact {
  height: 28px;
  grid-template-columns: 22px 1fr auto 1fr repeat(2, 22px);
}

.drag-handle {
  cursor: move;
}

.window-lights {
  display: flex;
  gap: 9px;
  align-items: center;
}

.light {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.45);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.55);
}

.red {
  background: #ff665a;
}

.yellow {
  background: #f7ca46;
}

.green {
  background: #55d866;
}

.bolt {
  color: #ffe649;
  filter: drop-shadow(0 0 5px rgba(255, 230, 73, 0.8));
  font-size: 20px;
}

.title-line {
  height: 6px;
  border-top: 2px solid #d1c66e;
  border-bottom: 2px solid #2a2920;
  background: repeating-linear-gradient(90deg, #f2e78a 0 3px, #5d5a37 3px 5px);
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
  white-space: nowrap;
  font-size: 14px;
  line-height: 1;
}

h2 {
  font-size: 13px;
}

.window-button {
  width: 22px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 1px solid #1b2025;
  border-radius: 3px;
  color: #171b1f;
  background: linear-gradient(#dfe4e8, #7c858d);
  padding: 0;
  font-weight: 800;
}

.mini-corner {
  width: 12px;
  height: 12px;
  border: 1px solid #1e252b;
  background: var(--gold);
}

.main-display {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 196px 1fr;
  gap: 10px;
  padding: 8px 14px 6px;
}

.time-display {
  height: 82px;
  border: 3px solid #111820;
  border-radius: 4px;
  color: #31e0d1;
  background: #030808;
  font-family: Menlo, Monaco, monospace;
  font-size: 34px;
  text-shadow: 0 0 9px rgba(49, 224, 209, 0.65);
}

.meter-stack {
  min-width: 0;
  height: 82px;
  border: 3px solid #111820;
  border-radius: 4px;
  padding: 6px 8px;
  background: #03100f;
}

.meter-top,
.meter-readouts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--cyan);
  font-size: 11px;
  font-weight: 700;
}

.tiny-button {
  border: 0;
  color: var(--gold);
  background: transparent;
  font-size: 10px;
  font-weight: 800;
}

#visualizer {
  width: 100%;
  height: 38px;
  display: block;
  margin: 4px 0;
  background: #020707;
}

.track-strip {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 58px 58px;
  gap: 8px;
  padding: 0 14px 8px;
}

.marquee-viewport {
  height: 28px;
  overflow: hidden;
  border: 2px solid #111820;
  border-radius: 3px;
  background: #030808;
}

.marquee {
  display: inline-block;
  min-width: 100%;
  padding: 6px 10px;
  color: #42dbc5;
  font-size: 14px;
  line-height: 1;
  white-space: nowrap;
  text-shadow: 0 0 7px rgba(66, 219, 197, 0.5);
}

.marquee.scrolling {
  animation: marquee-slide var(--marquee-speed, 12s) linear infinite;
}

@keyframes marquee-slide {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(-100%);
  }
}

.mini-toggle,
.eq-pill,
.small-button,
.playlist-footer button,
.playlist-actions button {
  border: 2px solid #171c20;
  border-radius: 4px;
  color: #17211d;
  background: linear-gradient(#f6f8ee, #8f9ca2 52%, #c8d0d1);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.8),
    0 1px rgba(0, 0, 0, 0.55);
  font-weight: 700;
}

.mini-toggle {
  height: 28px;
  font-size: 11px;
}

.mini-toggle.active,
.eq-pill.active {
  color: #06120f;
  background: linear-gradient(#a5ff79, #58c64d 52%, #c6f2a7);
}

.seek-wrap {
  position: relative;
  z-index: 1;
  padding: 0 18px 8px;
}

.horizontal-slider {
  width: 100%;
  accent-color: var(--cyan);
}

.transport-row {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 82px 262px;
  gap: 8px;
  align-items: start;
  padding: 0 14px 10px 18px;
  transform: translateY(-10px);
}

.transport-controls {
  display: grid;
  grid-template-columns: repeat(5, 30px);
  gap: 5px;
}

.transport {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 2px solid #171c20;
  border-radius: 4px;
  color: #20282f;
  background: linear-gradient(#e3ebed, #8796a0 55%, #c0cbce);
  box-shadow:
    inset 0 1px rgba(255, 255, 255, 0.78),
    0 2px 0 rgba(0, 0, 0, 0.45);
  font-size: 15px;
}

.transport.primary {
  color: #06201b;
  background: linear-gradient(#dffffa, #33d6c8 56%, #b9fff6);
}

.knob-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.knob-row label {
  display: grid;
  gap: 3px;
  color: #f1de73;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
  text-shadow: 0 1px 0 #000;
}

.panel-switches {
  position: relative;
  display: grid;
  grid-template-columns: 54px 58px 34px 30px 34px 32px;
  gap: 4px;
  align-items: end;
  transform: translateY(-6px);
}

.panel-switches .mini-toggle {
  width: 100%;
  min-width: 0;
  padding-inline: 2px;
  overflow: hidden;
  font-size: 10px;
  white-space: nowrap;
}

.theme-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 1px 4px;
  align-items: center;
  color: var(--gold);
  font-size: 10px;
  font-weight: 700;
  text-shadow: 0 1px 0 #000;
}

.theme-picker > span {
  grid-row: 1 / span 2;
  align-self: center;
}

.theme-picker select {
  width: 100%;
  min-width: 0;
  height: 20px;
  border: 2px solid #171c20;
  border-radius: 4px;
  color: #06120f;
  background: linear-gradient(#f6f8ee, #8f9ca2 52%, #c8d0d1);
  font-size: 11px;
  font-weight: 700;
}

.skin-brightness {
  grid-column: 2;
  min-width: 0;
}

body.email-mode {
  --wallpaper: linear-gradient(145deg, #eef3f9 0%, #cfd8e6 58%, #aebbd0 100%);
  color: #172033;
}

body.email-mode .panel {
  border-color: #7e8da1;
  border-radius: 4px;
  background: linear-gradient(#f8fbff, #dfe7f2);
  box-shadow: 0 8px 18px rgba(49, 64, 82, 0.28);
  filter: none;
}

body.email-mode .panel::after {
  background-image: none;
}

body.email-mode .titlebar {
  color: #1f3555;
  background: linear-gradient(#f8fbff, #dce7f5);
  border-bottom: 1px solid #9badc2;
}

body.email-mode .titlebar h1,
body.email-mode .titlebar h2 {
  color: #1e3e68;
  text-shadow: none;
}

body.email-mode #player-panel .titlebar h1 {
  font-size: 0;
}

body.email-mode #player-panel .titlebar h1::before {
  content: "INBOX";
  font-size: 16px;
}

body.email-mode #eq-panel .titlebar h2 {
  font-size: 0;
}

body.email-mode #eq-panel .titlebar h2::before {
  content: "FILTERS";
  font-size: 15px;
}

body.mobile-audio #open-eq,
body.mobile-audio #eq-panel {
  display: none !important;
}

body.email-mode #playlist-panel .titlebar h2 {
  font-size: 0;
}

body.email-mode #playlist-panel .titlebar h2::before {
  content: "MAIL FOLDERS";
  font-size: 15px;
}

body.email-mode .main-display,
body.email-mode .track-strip,
body.email-mode .file-list,
body.email-mode .file-address,
body.email-mode .file-search,
body.email-mode .file-head,
body.email-mode .playlist-footer {
  background: #fff;
  color: #1f2c3f;
  border-color: #b8c5d6;
}

body.email-mode .meter-stack,
body.email-mode .marquee-viewport,
body.email-mode .playlist-total {
  background: #f9fbfe;
  border-color: #c7d1df;
  color: #1f4f89;
}

body.email-mode #visualizer {
  display: none;
}

body.email-mode .time-display {
  color: #1f4f89;
  background: #f9fbfe;
  border-color: #c7d1df;
  text-shadow: none;
}

body.email-mode .marquee::before {
  content: "Subject: ";
  color: #68788d;
}

body.email-mode .file-toolbar {
  background: linear-gradient(#f8fbff, #dde8f5);
  border-color: #b6c5d9;
}

body.email-mode button,
body.email-mode .mini-toggle,
body.email-mode .transport,
body.email-mode .eq-pill,
body.email-mode .playlist-actions button,
body.email-mode .playlist-footer button {
  color: #173455;
  background: linear-gradient(#ffffff, #d7e4f4);
  border-color: #8ea2ba;
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.82), 0 1px 0 rgba(80, 98, 120, 0.28);
}

body.email-mode .mini-toggle.active,
body.email-mode .transport.primary,
body.email-mode .eq-pill.active {
  background: linear-gradient(#fefefe, #b7d7ff);
  color: #0d315e;
}

body.cli-mode {
  --wallpaper:
    linear-gradient(rgba(32, 255, 136, 0.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 255, 136, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 50% 18%, rgba(38, 255, 152, 0.14), transparent 36%),
    #020503;
  --panel-gradient: linear-gradient(#06120b, #020403);
  --cyan: #39ff88;
  --gold: #b8ff7a;
  --green: #39ff88;
  --text: #b7ffd0;
  color: #b7ffd0;
  font-family: Menlo, Monaco, "Courier New", monospace;
}

body.cli-mode .panel {
  border-color: #1d7f45;
  border-radius: 2px;
  background:
    linear-gradient(rgba(57, 255, 136, 0.035) 1px, transparent 1px),
    #020805;
  background-size: 100% 3px, auto;
  box-shadow:
    inset 0 0 0 1px rgba(57, 255, 136, 0.22),
    0 0 18px rgba(0, 0, 0, 0.68);
  filter: none;
}

body.cli-mode .panel::after {
  background-image: none;
}

body.cli-mode .titlebar {
  color: #39ff88;
  background: #031007;
  border-bottom: 1px solid #1d7f45;
}

body.cli-mode .traffic .dot {
  border-color: #1d7f45;
  background: #07140b;
  box-shadow: inset 0 0 0 1px rgba(57, 255, 136, 0.35);
}

body.cli-mode .bolt {
  color: #39ff88;
  text-shadow: 0 0 8px rgba(57, 255, 136, 0.85);
}

body.cli-mode .titlebar h1,
body.cli-mode .titlebar h2 {
  color: #d2ffe0;
  font-family: Menlo, Monaco, "Courier New", monospace;
  letter-spacing: 0;
  text-shadow: 0 0 7px rgba(57, 255, 136, 0.55);
}

body.cli-mode #player-panel .titlebar h1,
body.cli-mode #eq-panel .titlebar h2,
body.cli-mode #playlist-panel .titlebar h2 {
  font-size: 0;
}

body.cli-mode #player-panel .titlebar h1::before {
  content: "djred@playa:~$ ./player";
  font-size: 13px;
}

body.cli-mode #eq-panel .titlebar h2::before {
  content: "top - audio";
  font-size: 13px;
}

body.cli-mode #playlist-panel .titlebar h2::before {
  content: "ls ./mp3";
  font-size: 13px;
}

body.cli-mode .main-display,
body.cli-mode .track-strip,
body.cli-mode .file-toolbar,
body.cli-mode .file-address,
body.cli-mode .file-search,
body.cli-mode .file-head,
body.cli-mode .playlist-footer {
  color: #b7ffd0;
  background: #020805;
  border-color: #1d7f45;
  font-family: Menlo, Monaco, "Courier New", monospace;
}

body.cli-mode .time-display,
body.cli-mode .meter-stack,
body.cli-mode .marquee-viewport,
body.cli-mode .playlist-total,
body.cli-mode .file-list {
  color: #39ff88;
  background: #000;
  border-color: #1d7f45;
  font-family: Menlo, Monaco, "Courier New", monospace;
  text-shadow: 0 0 7px rgba(57, 255, 136, 0.5);
}

body.cli-mode #visualizer {
  background:
    linear-gradient(rgba(57, 255, 136, 0.12) 1px, transparent 1px),
    #000;
  background-size: 100% 8px;
}

body.cli-mode .meter-top,
body.cli-mode .meter-readouts,
body.cli-mode .tiny-button,
body.cli-mode .knob-row label,
body.cli-mode .theme-picker {
  color: #b8ff7a;
  font-family: Menlo, Monaco, "Courier New", monospace;
  text-shadow: 0 0 6px rgba(184, 255, 122, 0.35);
}

body.cli-mode .marquee::before {
  content: "$ play ";
  color: #b8ff7a;
}

body.cli-mode .file-address label,
body.cli-mode .file-search label {
  font-size: 0;
}

body.cli-mode .file-address label::before {
  content: "$ cd ";
  font-size: 11px;
}

body.cli-mode .file-search label::before {
  content: "$ grep ";
  font-size: 11px;
}

body.cli-mode .file-address output,
body.cli-mode .file-search input,
body.cli-mode .theme-picker select {
  color: #39ff88;
  background: #000;
  border-color: #1d7f45;
  font-family: Menlo, Monaco, "Courier New", monospace;
  box-shadow: inset 0 0 8px rgba(57, 255, 136, 0.12);
}

body.cli-mode .file-head {
  color: #b8ff7a;
}

body.cli-mode .file-row:hover {
  color: #d2ffe0;
  background: rgba(57, 255, 136, 0.12);
  border-color: #1d7f45;
}

body.cli-mode .file-row.selected {
  color: #020805;
  background: #39ff88;
  border-color: #b8ff7a;
  text-shadow: none;
}

body.cli-mode button,
body.cli-mode .mini-toggle,
body.cli-mode .transport,
body.cli-mode .eq-pill,
body.cli-mode .playlist-actions button,
body.cli-mode .playlist-footer button {
  color: #39ff88;
  background: linear-gradient(#07140b, #020805);
  border-color: #1d7f45;
  box-shadow:
    inset 0 0 0 1px rgba(57, 255, 136, 0.16),
    0 0 8px rgba(57, 255, 136, 0.08);
  font-family: Menlo, Monaco, "Courier New", monospace;
  text-shadow: 0 0 5px rgba(57, 255, 136, 0.45);
}

body.cli-mode .mini-toggle.active,
body.cli-mode .transport.primary,
body.cli-mode .eq-pill.active {
  color: #020805;
  background: #39ff88;
  text-shadow: none;
}

.theme-picker .skin-brightness {
  height: 14px;
  margin: 0;
  accent-color: var(--gold);
}

.eq-toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  padding: 6px 14px 0;
}

.eq-pill {
  min-width: 58px;
  height: 24px;
  font-size: 12px;
}

.eq-sliders {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 58px repeat(10, minmax(34px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 8px 14px 0;
}

.eq-band {
  display: grid;
  justify-items: center;
  gap: 4px;
  color: #eff4d1;
  font-size: 11px;
  line-height: 1;
  text-shadow: 0 1px #000;
}

.eq-band output {
  color: var(--gold);
  min-height: 12px;
}

.eq-slider {
  width: 28px;
  height: 104px;
  accent-color: var(--cyan);
  writing-mode: vertical-lr;
  direction: rtl;
}

.eq-slider.preamp {
  accent-color: var(--green);
}

.eq-band span {
  color: #101817;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 3px;
  padding: 2px 3px;
  font-size: 10px;
  font-weight: 800;
}

.eq-footer {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 14px 0;
}

.small-button {
  min-width: 104px;
  height: 26px;
  font-size: 11px;
}

#preset-name {
  color: #141b1a;
  font-weight: 800;
}

.playlist-panel {
  display: grid;
  grid-template-rows: 28px 34px 30px 30px 24px 1fr 38px;
  min-width: 390px;
  min-height: 360px;
}

.file-toolbar {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  background: linear-gradient(#f6f8ff, #c8d9f2 48%, #9db7dd);
  border-top: 1px solid rgba(255, 255, 255, 0.75);
  border-bottom: 1px solid #6f86ad;
}

.file-toolbar button {
  min-width: 28px;
  height: 24px;
  border: 1px solid #6b7f9f;
  border-radius: 3px;
  color: #0b2d66;
  background: linear-gradient(#ffffff, #dbe9fb 54%, #b6cdee);
  font-size: 12px;
  font-weight: 900;
}

#play-folder {
  min-width: 92px;
}

#browser-up,
#browser-refresh {
  min-width: 54px;
  font-size: 18px;
  line-height: 1;
}

#browser-refresh {
  font-size: 0;
}

#browser-refresh::before {
  content: "⟳";
  display: block;
  font-family: Arial, "Helvetica Neue", sans-serif;
  font-size: 25px;
  font-weight: 900;
  line-height: 20px;
  transform: translateY(-1px);
}

.file-address {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  color: #24334a;
  background: #ece9d8;
  border-bottom: 1px solid #aca899;
  font-family: Tahoma, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
}

.file-address output {
  height: 20px;
  display: flex;
  align-items: center;
  border: 1px solid #7f9db9;
  background: #fff;
  padding: 0 8px;
  color: #102b55;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-search {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 6px;
  align-items: center;
  padding: 4px 8px;
  color: #24334a;
  background: #ece9d8;
  border-bottom: 1px solid #aca899;
  font-family: Tahoma, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
}

.file-search input {
  min-width: 0;
  height: 20px;
  border: 1px solid #7f9db9;
  border-radius: 0;
  background: #fff;
  padding: 0 8px;
  color: #102b55;
  font: inherit;
  outline: none;
}

.file-search input:focus {
  border-color: #2e68b7;
  box-shadow: inset 0 0 0 1px rgba(46, 104, 183, 0.35);
}

.file-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  color: #1b2f4d;
  background: linear-gradient(#fbfbfb, #e5e5dc);
  border-bottom: 1px solid #aca899;
  font-family: Tahoma, "Helvetica Neue", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
}

.file-head span {
  height: 24px;
  display: flex;
  align-items: center;
  padding: 0 8px;
}

.file-list {
  position: relative;
  z-index: 1;
  margin: 0;
  padding: 4px;
  list-style: none;
  overflow: auto;
  background: #fff;
  color: #111;
  font-family: Tahoma, "Helvetica Neue", Arial, sans-serif;
  font-size: 12px;
}

.file-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  min-height: 24px;
  border: 1px solid transparent;
  cursor: pointer;
}

.file-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row:hover {
  background: #edf4ff;
  border-color: #b8d6fb;
}

.file-row.selected {
  color: #fff;
  background: #316ac5;
  border-color: #0a246a;
}

.file-row.muted {
  display: block;
  color: #68758a;
  padding: 7px 8px;
  cursor: default;
}

.file-row.child-status {
  padding-left: calc(8px + (var(--level) * 18px));
}

.file-name {
  display: flex;
  align-items: center;
  gap: 2px;
  min-width: 0;
  padding-left: calc(4px + (var(--level) * 18px));
}

.file-twisty {
  width: 18px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 18px;
  border: 0;
  padding: 0;
  color: #274c7d;
  background: transparent;
  font: inherit;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
}

.file-twisty.spacer {
  position: relative;
  color: #1f6bd2;
  pointer-events: none;
}

.file-row.playing .file-twisty.spacer {
  color: #17488f;
  font-size: 0;
  text-shadow: 0 0 2px rgba(255, 255, 255, 0.85);
}

.file-row.playing .file-twisty.spacer::before {
  content: "▶";
  color: #22a548;
  font-size: 13px;
  line-height: 1;
  text-shadow:
    -1px 0 #fff,
    0 1px #fff,
    1px 0 #fff,
    0 -1px #fff;
}

.file-row.folder .file-twisty {
  color: #d99b10;
  font-weight: 900;
}

.file-label {
  min-width: 0;
  padding: 0 6px 0 0;
}

.playlist-footer {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr 34px;
  gap: 8px;
  align-items: center;
  padding: 5px 8px;
  background: rgba(19, 26, 31, 0.82);
}

.playlist-actions {
  display: flex;
  gap: 4px;
}

.playlist-footer button,
.playlist-actions button {
  min-width: 30px;
  height: 28px;
  font-size: 13px;
}

#add-url {
  min-width: 38px;
  font-size: 10px;
}

#move-up,
#move-down {
  position: relative;
  font-size: 0;
}

#move-up::before,
#move-down::before {
  content: "";
  position: absolute;
  left: 50%;
  width: 0;
  height: 0;
  transform: translateX(-50%);
}

#move-up::before {
  top: 6px;
  border-right: 7px solid transparent;
  border-bottom: 8px solid #17211d;
  border-left: 7px solid transparent;
}

#move-down::before {
  bottom: 6px;
  border-top: 8px solid #17211d;
  border-right: 7px solid transparent;
  border-left: 7px solid transparent;
}

#move-up::after,
#move-down::after {
  content: "";
  position: absolute;
  left: 50%;
  width: 5px;
  height: 10px;
  background: #17211d;
  transform: translateX(-50%);
}

#move-up::after {
  top: 13px;
}

#move-down::after {
  bottom: 13px;
}

.playlist-total {
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 8px;
  color: #48f3d6;
  background: #03100f;
  border: 2px solid #10181c;
  font-family: Menlo, Monaco, monospace;
  font-size: 11px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.playlist-resize-handle {
  position: absolute;
  right: 4px;
  bottom: 4px;
  z-index: 3;
  width: 16px;
  height: 16px;
  cursor: nwse-resize;
  background:
    linear-gradient(135deg, transparent 0 44%, #11191d 45% 52%, transparent 53%),
    linear-gradient(135deg, transparent 0 58%, rgba(255, 255, 255, 0.7) 59% 65%, transparent 66%);
}

body.dragging .panel {
  transition: none;
}

body.resizing {
  cursor: nwse-resize;
  user-select: none;
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  .stage {
    width: 100%;
    min-height: 100vh;
    height: auto;
    display: grid;
    gap: 12px;
    padding: 12px;
  }

  .panel {
    position: relative;
    left: auto !important;
    top: auto !important;
    width: min(100%, 576px);
    max-width: calc(100vw - 24px);
    margin: 0 auto;
  }

  .player-panel {
    height: auto !important;
    min-height: 0;
    overflow: visible;
  }

  .main-display {
    grid-template-columns: 1fr;
  }

  .meter-stack {
    display: none;
  }

  .playlist-panel {
    min-width: 0;
    width: 100%;
  }

  .transport-row {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
    min-width: 0;
    padding: 0 12px 16px;
    transform: none;
  }

  .transport-controls,
  .panel-switches,
  .knob-row {
    min-width: 0;
  }

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

  .transport {
    width: 100%;
    min-width: 0;
  }

  .knob-row label {
    text-align: left;
  }

  .panel-switches {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    transform: none;
  }

  .panel-switches .mini-toggle {
    width: 100%;
    min-width: 0;
    padding-inline: 2px;
    font-size: 10px;
    white-space: nowrap;
  }

  .theme-picker {
    gap: 3px;
  }

  .playlist-resize-handle {
    display: none;
  }
}

@media (max-width: 430px) {
  .time-display {
    height: 72px;
  }

  .track-strip {
    grid-template-columns: 1fr 54px 64px;
    gap: 6px;
  }

  .titlebar {
    grid-template-columns: 62px 18px minmax(24px, 1fr) auto minmax(24px, 1fr) 24px;
    gap: 6px;
  }

  .transport-controls {
    gap: 5px;
  }

  .panel-switches {
    gap: 4px;
  }

  .transport {
    height: 30px;
    font-size: 14px;
  }
}
