:root {
  --bg-1: #f4f7f4;
  --bg-2: #dbe5da;
  --text: #122018;
  --text-soft: #415247;
  --panel: rgba(255, 255, 255, 0.72);
  --stroke: rgba(18, 32, 24, 0.12);
  --accent: #1f7a55;
  --accent-2: #ff7a45;
  --danger: #be2d2d;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(1100px 500px at 10% 0%, rgba(255, 122, 69, 0.12), transparent),
    radial-gradient(900px 380px at 100% 100%, rgba(31, 122, 85, 0.18), transparent),
    linear-gradient(140deg, var(--bg-1), var(--bg-2));
  padding: 2.4rem 1rem 3.2rem;
  overflow-x: hidden;
}

.ambient {
  position: fixed;
  width: 38vmax;
  height: 38vmax;
  border-radius: 50%;
  filter: blur(70px);
  z-index: -1;
  opacity: 0.45;
  animation: float 16s ease-in-out infinite alternate;
}

.ambient-top {
  top: -12vmax;
  left: -6vmax;
  background: rgba(255, 122, 69, 0.5);
}

.ambient-bottom {
  bottom: -16vmax;
  right: -8vmax;
  background: rgba(31, 122, 85, 0.46);
  animation-delay: 1.4s;
}

@keyframes float {
  from {
    transform: translate3d(0, 0, 0) scale(1);
  }
  to {
    transform: translate3d(18px, -12px, 0) scale(1.07);
  }
}

.app-shell {
  width: min(1050px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 1rem;
}

.hero {
  padding: 0.2rem 0.2rem 0.8rem;
  animation: rise 0.5s ease;
}

.badge {
  display: inline-flex;
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  border: 1px solid rgba(18, 32, 24, 0.16);
  background: rgba(255, 255, 255, 0.72);
  margin: 0 0 1rem;
  font-size: 0.85rem;
  font-weight: 600;
}

h1 {
  font-family: "Avenir Next", "Nunito Sans", "Segoe UI", sans-serif;
  margin: 0;
  font-size: clamp(2rem, 5vw, 3.2rem);
  letter-spacing: -0.03em;
}

.subtitle {
  margin: 0.72rem 0 0;
  max-width: 64ch;
  line-height: 1.55;
  color: var(--text-soft);
}

.panel {
  border: 1px solid var(--stroke);
  border-radius: 20px;
  background: var(--panel);
  backdrop-filter: blur(8px);
  box-shadow:
    0 16px 44px rgba(0, 0, 0, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.6);
  padding: 1rem;
  animation: rise 0.45s ease;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.controls-panel {
  display: grid;
  gap: 1rem;
}

.dropzone {
  min-height: 150px;
  width: 100%;
  border-radius: 16px;
  border: 2px dashed rgba(18, 32, 24, 0.2);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.65), rgba(255, 255, 255, 0.32));
  display: grid;
  place-items: center;
  gap: 0.25rem;
  padding: 1rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: rgba(31, 122, 85, 0.72);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.86), rgba(231, 245, 238, 0.6));
  transform: translateY(-1px);
}

.dropzone-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-soft);
}

.dropzone-title {
  font-family: "Manrope", sans-serif;
  font-size: clamp(1.04rem, 2.6vw, 1.3rem);
}

.dropzone-sub {
  color: var(--text-soft);
  font-size: 0.92rem;
}

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

.field {
  display: grid;
  gap: 0.42rem;
}

.field span {
  font-size: 0.86rem;
  color: var(--text-soft);
}

select {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--stroke);
  padding: 0.6rem 0.7rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.9);
  color: var(--text);
}

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

.btn {
  border-radius: 12px;
  border: 1px solid transparent;
  font: inherit;
  padding: 0.65rem 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:disabled {
  opacity: 0.48;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--accent);
  color: #f6fff9;
}

.btn-primary:hover:not(:disabled) {
  background: #146a49;
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text);
  border-color: var(--stroke);
}

.btn-ghost:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.95);
}

.btn-secondary {
  background: var(--accent-2);
  color: #fff;
}

.btn-secondary:hover:not(:disabled) {
  background: #e36737;
}

.engine-status {
  font-size: 0.92rem;
  color: var(--text-soft);
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  flex-wrap: wrap;
}

h2 {
  margin: 0;
  font-size: 1.1rem;
}

.file-list {
  list-style: none;
  margin: 1rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.68rem;
}

.file-item {
  border: 1px solid var(--stroke);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.82);
  display: grid;
  gap: 0.62rem;
  padding: 0.78rem;
}

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

.meta-field {
  display: grid;
  gap: 0.25rem;
}

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

.meta-field span {
  font-size: 0.74rem;
  color: var(--text-soft);
}

.meta-input {
  border-radius: 10px;
  border: 1px solid var(--stroke);
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.86rem;
  background: rgba(255, 255, 255, 0.92);
  color: var(--text);
}

.meta-input:focus {
  outline: 2px solid rgba(31, 122, 85, 0.28);
  border-color: rgba(31, 122, 85, 0.5);
}

.meta-textarea {
  resize: vertical;
  min-height: 52px;
}

.file-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.file-name,
.file-size {
  margin: 0;
}

.file-name {
  font-weight: 600;
}

.file-size {
  font-size: 0.85rem;
  color: var(--text-soft);
}

.file-state {
  display: grid;
  gap: 0.48rem;
}

.status-pill {
  justify-self: start;
  padding: 0.24rem 0.55rem;
  border-radius: 999px;
  background: rgba(18, 32, 24, 0.09);
  font-size: 0.78rem;
}

.status-pill.ready {
  background: rgba(31, 122, 85, 0.16);
  color: #0f4a33;
}

.status-pill.error {
  background: rgba(190, 45, 45, 0.16);
  color: #7f1f1f;
}

.status-pill.running {
  background: rgba(255, 122, 69, 0.2);
  color: #934321;
}

.progress-track {
  width: 100%;
  height: 8px;
  border-radius: 999px;
  background: rgba(18, 32, 24, 0.11);
  overflow: hidden;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f7a55, #ff7a45);
  transition: width 0.22s ease;
}

.download-link {
  justify-self: start;
  font-size: 0.9rem;
  color: #105c3e;
  text-decoration: none;
  border-bottom: 1px solid rgba(16, 92, 62, 0.2);
}

.download-link:hover {
  border-bottom-color: #105c3e;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  border: 0;
  padding: 0;
  clip: rect(0 0 0 0);
  overflow: hidden;
}

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

  .queue-head {
    align-items: stretch;
  }

  .queue-head .btn {
    width: 100%;
  }

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