:root {
  color-scheme: light;
  --bg: #fdf8f3;
  --ink: #1f1810;
  --muted: #7a6a5a;
  --line: #ecdfd1;
  --panel: #ffffff;
  --accent: #e3730c;
  --accent-strong: #b85800;
  --amber: #f4a64b;
  --rose: #b74354;
  --shadow: 0 24px 70px rgba(180, 90, 20, 0.14);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-shell {
  min-height: 100vh;
  padding: 28px;
  display: grid;
  align-items: center;
}

.workspace {
  width: min(1120px, 100%);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(340px, 0.92fr);
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.input-panel {
  padding: 26px;
}

.player-panel {
  min-height: 560px;
  padding: 26px;
  display: flex;
  flex-direction: column;
}

.brand-row,
.player-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(34px, 6vw, 56px);
  line-height: 0.95;
}

h2 {
  font-size: 30px;
}

.status-pill {
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 11px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 680;
}

.status-pill.ready {
  color: var(--accent-strong);
  border-color: rgba(227, 115, 12, 0.28);
  background: rgba(227, 115, 12, 0.1);
}

.status-pill.missing {
  color: var(--rose);
  border-color: rgba(183, 67, 84, 0.24);
  background: rgba(183, 67, 84, 0.08);
}

form {
  display: grid;
  gap: 16px;
}

.auth-box {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffaf3;
  padding: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
}

.auth-label {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 720;
}

.auth-box strong {
  display: block;
  margin-top: 3px;
  font-size: 16px;
}

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

.drop-zone {
  min-height: 176px;
  border: 1.5px dashed #d4a574;
  border-radius: 8px;
  background: #fff7ec;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 22px;
  cursor: pointer;
}

.drop-zone input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.drop-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--accent);
  font-size: 26px;
  line-height: 1;
}

.drop-title {
  display: block;
  margin-top: 10px;
  font-size: 18px;
  font-weight: 760;
}

.drop-subtitle {
  display: block;
  margin-top: 4px;
  max-width: 100%;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.field,
.field-grid {
  display: grid;
  gap: 8px;
}

.field-grid {
  grid-template-columns: 1fr 180px;
  gap: 12px;
}

.field span {
  color: #4a3a2a;
  font-size: 13px;
  font-weight: 720;
}

.field small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 15px;
}

input,
select {
  height: 46px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  min-height: 92px;
  padding: 12px;
}

input[type="range"] {
  height: 28px;
  padding: 0;
  accent-color: var(--accent);
}

button,
.secondary-button {
  min-height: 48px;
  border-radius: 8px;
  font: inherit;
  font-weight: 760;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

button {
  border: 0;
  background: var(--accent);
  color: white;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.secondary-button {
  border: 1px solid var(--line);
  color: var(--accent-strong);
  background: #fff7ec;
  padding: 0 14px;
}

.secondary-button.subtle {
  color: var(--muted);
  background: white;
}

.empty-state {
  flex: 1;
  min-height: 330px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 18px;
  color: var(--muted);
  text-align: center;
}

.disc {
  width: min(240px, 62vw);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #fff 0 12%, #3a2818 12.5% 15%, transparent 15.5%),
    conic-gradient(from 40deg, #1f1810, #e3730c, #f4a64b, #1f1810);
  box-shadow: inset 0 0 0 18px rgba(255, 255, 255, 0.13), 0 26px 46px rgba(180, 90, 20, 0.22);
}

.result {
  display: grid;
  gap: 18px;
}

audio {
  width: 100%;
}

.result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meta-grid {
  margin: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.meta-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 13px;
  background: #fffaf3;
}

dt {
  color: var(--muted);
  font-size: 12px;
}

dd {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 780;
}

.ai-note,
.message,
.progress p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.progress {
  display: grid;
  gap: 10px;
}

.progress-bar {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #f4e6d3;
}

.progress-bar span {
  display: block;
  width: 42%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--amber));
  animation: loading 1.2s ease-in-out infinite alternate;
}

.message {
  min-height: 20px;
  margin-top: auto;
}

.message.error {
  color: var(--rose);
}

.hidden {
  display: none;
}

@keyframes loading {
  from {
    transform: translateX(-18%);
  }
  to {
    transform: translateX(160%);
  }
}

.brand-logo {
  display: inline-block;
  height: 56px;
  width: auto;
  margin-bottom: 10px;
}

.player-header {
  align-items: center;
}

.player-header .reset-button {
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  min-height: 0;
  padding: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff7ec;
  color: var(--accent-strong);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, transform 0.15s ease;
}

.player-header .reset-button:hover:not(:disabled) {
  background: var(--accent);
  color: white;
  transform: rotate(-90deg);
}

.player-header .reset-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.player-header .reset-button svg {
  width: 20px;
  height: 20px;
  display: block;
}

.app-footer {
  margin: 28px auto 0;
  width: min(1120px, 100%);
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 12px;
}

.app-footer img {
  height: 22px;
  width: auto;
  opacity: 0.85;
}

@media (max-width: 860px) {
  .app-shell {
    padding: 14px;
    align-items: start;
  }

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

  .player-panel {
    min-height: auto;
  }

  .field-grid,
  .result-actions,
  .auth-box {
    grid-template-columns: 1fr;
  }

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