:root {
  --bg: #f7f7f5;
  --text: #1f1d1a;
  --muted: #5f5a52;
  --card: #ffffff;
  --line: #b9bfcc;
  --accent: #2f46c8;
  --on-accent: #ffffff;
  --error: #b42318;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1218;
    --text: #e9ecf2;
    --muted: #9aa3b5;
    --card: #171b24;
    --line: #4a5367;
    --accent: #8fa2ff;
    --on-accent: #0f1218;
    --error: #ff8a80;
  }
}

* {
  box-sizing: border-box;
}

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

.page {
  max-width: 520px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
}

h1 {
  margin: 0 0 1rem;
  font-size: 1.5rem;
}

.zone {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 1.8rem 1rem;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: var(--card);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}

.zone:hover,
.zone.is-over {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--card));
}

/* The real input stays in the page for keyboards and screen readers. It is only invisible. */
.file {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  opacity: 0;
}

.zone:has(.file:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.zone-title {
  font-weight: 600;
}

.link {
  color: var(--accent);
  text-decoration: underline;
}

.zone-hint {
  color: var(--muted);
  font-size: 0.88rem;
}

.status {
  margin: 0.8rem 0 0.4rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.errors {
  margin: 0 0 0.4rem;
  padding: 0;
  list-style: none;
  color: var(--error);
  font-size: 0.88rem;
}

.errors li {
  margin: 0.15rem 0;
}

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

.file-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.thumb {
  flex: none;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg);
}

.meta {
  flex: 1;
  min-width: 0;
}

.name {
  display: block;
  overflow: hidden;
  font-size: 0.92rem;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.size {
  color: var(--muted);
  font-size: 0.82rem;
}

.remove {
  flex: none;
  min-height: 2.5rem;
  padding: 0 0.8rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
}

.remove:hover {
  border-color: var(--error);
  color: var(--error);
}

.remove:focus-visible,
.submit:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.submit {
  min-height: 2.75rem;
  padding: 0 1.4rem;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--on-accent);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
