:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c2230;
  --muted: #5b6475;
  --border: #cfd5df;
  --accent: #1f5fbf;
  --accent-dark: #174a96;
  --ok: #1b7a43;
  --error: #b3261e;
  --error-bg: #fdecea;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main {
  max-width: 40rem;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}

h1 { margin: 0 0 .5rem; font-size: 1.6rem; }
h2 { margin: 0 0 .75rem; font-size: 1.15rem; }
header p { margin: 0 0 2rem; color: var(--muted); }

#dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .25rem;
  padding: 3rem 1rem;
  background: var(--card);
  border: 2px dashed var(--border);
  border-radius: .75rem;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, background-color .15s;
}

#dropzone:hover,
#dropzone:focus-within,
#dropzone.dragover {
  border-color: var(--accent);
  background: #eef4fd;
}

#dropzone.busy { pointer-events: none; opacity: .6; }

.dropzone-title { font-size: 1.15rem; font-weight: 600; }
.dropzone-hint { color: var(--muted); }

#file {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

#status {
  margin-top: 1.5rem;
  padding: 1.25rem 1.5rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: .75rem;
}

#progress { display: flex; align-items: center; gap: .75rem; }

.spinner {
  width: 1.1rem;
  height: 1.1rem;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}

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

#success h2 { color: var(--ok); }

dl { margin: 0 0 1.25rem; }
dl div { display: flex; padding: .3rem 0; border-bottom: 1px solid #eceff4; }
dt { flex: 0 0 9rem; color: var(--muted); }
dd { margin: 0; font-weight: 600; }

.button {
  display: inline-block;
  padding: .65rem 1.1rem;
  background: var(--accent);
  color: #fff;
  border-radius: .5rem;
  font-weight: 600;
  text-decoration: none;
}

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

#failure h2 { color: var(--error); }
#errors { margin: 0; padding: .75rem 1rem .75rem 2rem; background: var(--error-bg); border-radius: .5rem; }
#errors li + li { margin-top: .35rem; }

footer { margin-top: 2rem; color: var(--muted); font-size: .875rem; }

[hidden] { display: none !important; }
