:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #657084;
  --line: #d8deea;
  --accent: #16746c;
  --accent-dark: #0f5b55;
  --danger: #b3261e;
  --shadow: 0 18px 50px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

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

button,
a {
  font: inherit;
}

.app {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.workspace {
  width: min(920px, 100%);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
}

.header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: start;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(28px, 5vw, 42px);
  line-height: 1.1;
  letter-spacing: 0;
}

.clear-button,
.primary-button,
.download-button {
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  min-height: 40px;
  padding: 0 16px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}

.clear-button {
  background: #edf1f7;
  color: var(--text);
}

.primary-button,
.download-button {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.primary-button:hover,
.download-button:hover {
  background: var(--accent-dark);
}

button:disabled,
a[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.drop-zone {
  min-height: 260px;
  border: 2px dashed #9ea9bb;
  border-radius: 8px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 8px;
  background: #fbfcff;
  transition: border-color 0.15s ease, background 0.15s ease;
  cursor: pointer;
}

.drop-zone.is-dragging {
  border-color: var(--accent);
  background: #effaf8;
}

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

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

.drop-title {
  font-size: 20px;
  font-weight: 700;
}

.drop-subtitle,
.toolbar,
.file-detail {
  color: var(--muted);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  min-height: 40px;
}

.file-list {
  display: grid;
  gap: 12px;
}

.file-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}

.preview {
  width: 72px;
  height: 72px;
  object-fit: cover;
  border-radius: 6px;
  background: #edf1f7;
}

.file-name {
  margin: 0 0 4px;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.file-detail,
.file-error {
  margin: 0;
  font-size: 14px;
}

.file-error {
  color: var(--danger);
}

@media (max-width: 640px) {
  .workspace {
    padding: 18px;
  }

  .header,
  .toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .file-item {
    grid-template-columns: 64px 1fr;
  }

  .preview {
    width: 64px;
    height: 64px;
  }

  .download-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}
