:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f6f7f9;
  color: #20242a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
}

button,
input,
select {
  font: inherit;
}

button {
  border: 1px solid #20242a;
  border-radius: 6px;
  background: #20242a;
  color: #fff;
  cursor: pointer;
  min-height: 40px;
  padding: 0 14px;
}

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

a {
  color: #155bb5;
}

.page-header {
  align-items: center;
  background: #ffffff;
  border-bottom: 1px solid #dde1e7;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 24px clamp(16px, 4vw, 48px);
}

.page-header h1,
.page-header p,
h2,
h3,
p {
  margin: 0;
}

.page-header h1 {
  font-size: clamp(1.5rem, 2.5vw, 2.4rem);
  line-height: 1.1;
}

.page-header p {
  color: #5b6470;
  margin-top: 6px;
}

main {
  margin: 0 auto;
  max-width: 1120px;
  padding: 24px clamp(16px, 4vw, 48px) 48px;
}

.panel,
.asset-card {
  background: #fff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
}

.upload-panel {
  padding: 20px;
}

.upload-panel h2,
.section-heading h2 {
  font-size: 1.15rem;
}

form {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

label {
  color: #404852;
  font-weight: 650;
}

.upload-row {
  display: flex;
  gap: 10px;
}

input[type="file"] {
  border: 1px dashed #aab2bd;
  border-radius: 6px;
  flex: 1;
  min-height: 40px;
  min-width: 0;
  padding: 8px;
}

.migration-panel {
  margin-top: 24px;
  padding: 20px;
}

.import-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.import-grid label {
  display: grid;
  gap: 6px;
}

input[type="url"],
input[type="text"],
input[type="number"],
select {
  border: 1px solid #c5ccd5;
  border-radius: 6px;
  min-height: 40px;
  min-width: 0;
  padding: 8px 10px;
  width: 100%;
}

.metadata-fieldset {
  border: 1px solid #dde1e7;
  border-radius: 8px;
  display: grid;
  gap: 12px;
  margin: 8px 0 0;
  padding: 14px;
}

.metadata-fieldset legend {
  font-weight: 750;
  padding: 0 6px;
}

.metadata-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.metadata-grid label,
.import-grid label {
  display: grid;
  gap: 6px;
}

.wide-field {
  grid-column: 1 / -1;
}

.checkbox-label {
  align-content: end;
  display: flex !important;
  gap: 8px !important;
}

.checkbox-label input {
  width: auto;
}

.migration-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.migration-card {
  background: #ffffff;
  border: 1px solid #dde1e7;
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 14px;
}

progress {
  height: 12px;
  width: 100%;
}

.status-line {
  color: #404852;
  min-height: 22px;
}

.assets-section {
  margin-top: 28px;
}

.section-heading,
.asset-header,
.asset-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.muted,
.asset-meta,
.job-row,
.empty,
.error {
  color: #5b6470;
}

.asset-list {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.asset-card {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.asset-title {
  font-size: 1rem;
  overflow-wrap: anywhere;
}

.asset-meta {
  font-size: 0.9rem;
  margin-top: 4px;
}

.badge {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  padding: 5px 10px;
  text-transform: uppercase;
  white-space: nowrap;
}

.badge.pending,
.badge.queued,
.badge.uploaded {
  background: #fff2c7;
  color: #6d5200;
}

.badge.processing {
  background: #d7ecff;
  color: #064b80;
}

.badge.importing,
.badge.imported {
  background: #d7ecff;
  color: #064b80;
}

.badge.completed,
.badge.ready,
.badge.verified,
.badge.switched {
  background: #dff4dc;
  color: #1f5f25;
}

.badge.failed {
  background: #ffe0df;
  color: #8a1f1b;
}

.variants {
  display: grid;
  gap: 8px;
}

.variant-row {
  align-items: center;
  border-top: 1px solid #edf0f3;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  padding-top: 8px;
}

.variant-name {
  font-weight: 650;
}

.variant-details {
  color: #5b6470;
  font-size: 0.9rem;
}

.preview audio {
  width: 100%;
}

.loudness {
  background: #f8fafc;
  border: 1px solid #e2e7ee;
  border-radius: 6px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.loudness.warning {
  background: #fff7e0;
  border-color: #f0cf77;
  color: #6d5200;
}

.quality-report {
  background: #f8fafc;
  border: 1px solid #e2e7ee;
  border-radius: 6px;
  display: grid;
  gap: 12px;
  padding: 12px;
}

.quality-heading {
  font-weight: 800;
}

.report-section {
  border-top: 1px solid #e7ebf0;
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.report-section h4 {
  font-size: 0.92rem;
  margin: 0;
}

.definition-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.definition-item {
  display: grid;
  gap: 2px;
}

.definition-item span {
  color: #5b6470;
  font-size: 0.78rem;
}

.definition-item strong {
  color: #20242a;
  font-size: 0.92rem;
  overflow-wrap: anywhere;
}

.loudness-heading {
  font-weight: 750;
}

.loudness-values {
  color: #404852;
}

.loudness-notes,
.report-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.mini-badge {
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 750;
  padding: 4px 8px;
}

.mini-badge.good {
  background: #dff4dc;
  color: #1f5f25;
}

.mini-badge.ok {
  background: #dff4dc;
  color: #1f5f25;
}

.mini-badge.neutral {
  background: #edf0f3;
  color: #404852;
}

.mini-badge.warning {
  background: #ffe0df;
  color: #8a1f1b;
}

.mini-badge.fail {
  background: #8a1f1b;
  color: #ffffff;
}

.readiness-list {
  display: grid;
  gap: 10px;
}

.readiness-item {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: 130px 1fr;
}

.readiness-item ul {
  margin: 0;
  padding-left: 18px;
}

.readiness-item li {
  color: #404852;
}

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

.secondary-button {
  background: #ffffff;
  color: #20242a;
}

.compact-button {
  min-height: 32px;
  padding: 0 10px;
}

.error {
  color: #9a211b;
}

@media (max-width: 680px) {
  .page-header,
  .upload-row,
  .section-heading,
  .asset-header {
    align-items: stretch;
    flex-direction: column;
  }

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

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