:root {
  --bg: #f6f3ee;
  --panel: #ffffff;
  --accent: #1e5b7d;
  --accent-dark: #184b66;
  --text: #1a1a1a;
  --muted: #666666;
  --border: #e0dcd6;
  --shadow: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", Tahoma, sans-serif;
}

body {
  background: radial-gradient(circle at top, #fdfaf5, #efe9e1 70%);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.app {
  max-width: 960px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header h1 {
  font-size: 2.5rem;
  margin-bottom: 8px;
}

.header p {
  color: var(--muted);
}

.panel {
  background: var(--panel);
  padding: 24px;
  border-radius: 18px;
  box-shadow: 0 20px 40px var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dropzone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.dropzone.dragover {
  border-color: var(--accent);
  background: #f0f7fb;
}

#fileInput {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.dropzone-text {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

button {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 1rem;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

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

button:not(:disabled):hover {
  background: var(--accent-dark);
  transform: translateY(-1px);
}

.status {
  color: var(--muted);
  min-height: 20px;
}

.previews {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.preview-card {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: #faf7f2;
}

.preview-card img {
  width: 100%;
  border-radius: 8px;
  object-fit: contain;
  min-height: 180px;
  background: repeating-linear-gradient(45deg, #eee, #eee 12px, #f7f7f7 12px, #f7f7f7 24px);
}

.download {
  display: inline-block;
  text-decoration: none;
  background: #2c8a4b;
  color: #fff;
  padding: 10px 16px;
  border-radius: 8px;
  text-align: center;
  transition: background 0.2s ease;
}

.download[aria-disabled="true"] {
  opacity: 0.6;
  pointer-events: none;
}

.download:hover {
  background: #246f3d;
}

@media (max-width: 640px) {
  body {
    padding: 20px;
  }

  .header h1 {
    font-size: 2rem;
  }
}
