:root {
  color-scheme: dark;
  --bg: #0a0a0d;
  --panel: rgba(18, 18, 24, 0.92);
  --panel-2: rgba(30, 30, 38, 0.96);
  --line: rgba(255, 255, 255, 0.10);
  --line-strong: rgba(255, 255, 255, 0.22);
  --text: #fafafa;
  --muted: rgba(250, 250, 250, 0.62);
  --accent: #7c3aed;
  --accent-2: #22c55e;
  --danger: #ef4444;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top, rgba(124, 58, 237, 0.20), transparent 28%),
    radial-gradient(circle at bottom, rgba(34, 197, 94, 0.10), transparent 24%),
    var(--bg);
  color: var(--text);
}

body {
  min-height: 100dvh;
}

.shell {
  width: 100%;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 18px;
}

.converter {
  width: min(100%, 1120px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 112px;
  align-items: stretch;
  gap: 18px;
}

.uploads {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(260px, 0.7fr);
  gap: 18px;
}

.uploader {
  display: grid;
  grid-template-rows: minmax(260px, 1fr) auto;
  gap: 10px;
}

.dropzone,
.action {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border-radius: 30px;
  box-shadow: var(--shadow);
}

.dropzone {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 22px 72px;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dropzone::after {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1.5px dashed rgba(255, 255, 255, 0.14);
  border-radius: 22px;
  pointer-events: none;
}

.dropzone:hover,
.dropzone:focus-within,
.dropzone.dragover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.dropzone.ready {
  border-color: rgba(34, 197, 94, 0.52);
}

.dropzone.invalid {
  border-color: rgba(239, 68, 68, 0.56);
}

.icon {
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text);
  opacity: 0.9;
}

.icon svg {
  width: 100%;
  height: 100%;
}

.file-stack {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.file-chip,
.file-summary {
  min-height: 36px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
  color: var(--text);
  font-size: 0.82rem;
  line-height: 1.2;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-summary {
  color: var(--muted);
}

.zone-caption {
  text-align: center;
  color: var(--muted);
  font-size: 0.88rem;
  letter-spacing: 0.02em;
}

.action {
  width: 112px;
  min-height: 100%;
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.action:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(124, 58, 237, 0.48);
}

.action:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.action-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.action-idle {
  width: 42px;
  height: 42px;
}

.action-idle svg {
  width: 100%;
  height: 100%;
}

.action-busy {
  display: none;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 3px solid rgba(255, 255, 255, 0.16);
  border-top-color: var(--accent-2);
  animation: spin 0.8s linear infinite;
}

.action.loading .action-idle {
  display: none;
}

.action.loading .action-busy {
  display: inline-flex;
}

.action.done {
  border-color: rgba(34, 197, 94, 0.5);
}

.action.error {
  border-color: rgba(239, 68, 68, 0.5);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 900px) {
  .converter {
    grid-template-columns: minmax(0, 1fr) 90px;
    gap: 14px;
  }

  .uploads {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .uploader {
    grid-template-rows: minmax(190px, 1fr) auto;
  }

  .dropzone {
    min-height: 190px;
  }

  .action {
    width: 90px;
  }
}

@media (max-width: 520px) {
  .shell {
    padding: 12px;
  }

  .converter {
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 10px;
  }

  .dropzone {
    min-height: 164px;
    border-radius: 24px;
    padding: 18px 16px 66px;
  }

  .dropzone::after {
    inset: 10px;
    border-radius: 18px;
  }

  .icon {
    width: 58px;
    height: 58px;
  }

  .file-chip,
  .file-summary {
    min-height: 32px;
    font-size: 0.76rem;
  }

  .action {
    width: 74px;
    border-radius: 24px;
  }

  .action-idle {
    width: 34px;
    height: 34px;
  }
}
