:root {
  color-scheme: dark;
  font-family: "Segoe UI", Arial, sans-serif;
  background: #111310;
  color: #f4f1e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button,
.file-button {
  border: 1px solid #4f8f68;
  background: #2f6f4e;
  color: #ffffff;
  border-radius: 6px;
  padding: 9px 12px;
  cursor: pointer;
  white-space: nowrap;
}

button.ghost {
  background: transparent;
  border-color: #6b7280;
}

input {
  border: 1px solid #3c4239;
  background: #181b16;
  color: #f8fafc;
  border-radius: 6px;
  padding: 9px 10px;
  min-width: 0;
}

code {
  display: block;
  border: 1px solid #3c4239;
  background: #10120f;
  border-radius: 6px;
  padding: 9px 10px;
  color: #d8e9c9;
  overflow-wrap: anywhere;
}

.shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px;
}

.topbar,
.login-panel,
.panel {
  border: 1px solid #2d342b;
  background: #171a15;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}

.topbar,
.login-panel,
.panel-head,
.track {
  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
}

h2 {
  font-size: 18px;
}

.muted,
#stats,
.empty {
  color: #aab5a0;
}

.login-form,
.search {
  display: flex;
  gap: 8px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 16px;
}

.file-button input {
  display: none;
}

.wide {
  width: 100%;
  margin-top: 12px;
}

.queue,
.tracks,
.api-panel {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.queue-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.3fr) repeat(4, minmax(110px, 1fr)) 80px;
  gap: 8px;
  align-items: center;
  border: 1px solid #2d342b;
  background: #10120f;
  border-radius: 8px;
  padding: 10px;
}

.queue-row.success {
  border-color: #4f8f68;
}

.queue-row.duplicate {
  border-color: #d09a3a;
}

.queue-row.error {
  border-color: #b45309;
}

.queue-row.uploading {
  border-color: #d09a3a;
}

.queue-file {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.queue-file strong,
.queue-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-file span,
.queue-status,
.track-meta {
  color: #aab5a0;
  font-size: 14px;
}

.track {
  border: 1px solid #2d342b;
  background: #10120f;
  border-radius: 8px;
  padding: 12px;
}

.track-title {
  font-weight: 700;
}

.track-meta {
  margin-top: 4px;
}

.track-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

audio {
  width: 280px;
}

.log {
  min-height: 64px;
  white-space: pre-wrap;
  color: #d6d3ca;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .topbar,
  .login-panel,
  .panel-head,
  .track {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .login-form,
  .search,
  .track-actions {
    align-items: stretch;
    flex-direction: column;
  }

  audio {
    width: 100%;
  }
}
