:root {
  --ink: #1b2430;
  --muted: #5d6b7a;
  --line: #d5dce4;
  --bg: #f4f6f9;
  --card: #ffffff;
  --accent: #1a5fb4;
  --accent-ink: #ffffff;
  --ok: #1e7b46;
  --bad: #b3261e;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

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

main {
  max-width: 640px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

header { margin-bottom: 24px; }
h1 { margin: 0; font-size: 1.5rem; line-height: 1.25; }
.by { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }

section {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 20px;
}

.muted { color: var(--muted); font-size: 0.9rem; }
.error { color: var(--bad); font-size: 0.95rem; }

form label { display: block; margin: 14px 0 4px; font-weight: 600; }
form input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  color: inherit;
  background: #fff;
}
form input:focus-visible, button:focus-visible, .button:focus-visible, .drop:focus-within {
  outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent);
  outline-offset: 2px;
}

button, .button {
  font: inherit;
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  padding: 6px 12px;
}
.primary {
  display: inline-block;
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  padding: 10px 18px;
  font-weight: 600;
}
form .primary { margin-top: 18px; width: 100%; }
button:disabled { opacity: 0.6; cursor: default; }
.link { border: 0; background: none; color: var(--accent); padding: 0; text-decoration: underline; }

.who {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 16px;
  font-size: 0.95rem;
  overflow-wrap: anywhere;
}

.drop {
  border: 2px dashed var(--line);
  border-radius: 10px;
  padding: 24px 16px;
  text-align: center;
  background: var(--bg);
}
.drop p { margin: 0 0 10px; }
.drop .muted { margin: 10px 0 0; }
.drop.over { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, #fff); }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.files { list-style: none; margin: 16px 0 0; padding: 0; }
.files li {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
}
.file-head { display: flex; gap: 12px; justify-content: space-between; align-items: baseline; }
.file-name { font-weight: 600; overflow-wrap: anywhere; }
.file-size { color: var(--muted); font-size: 0.9rem; white-space: nowrap; }
.files progress { width: 100%; height: 10px; margin: 8px 0 4px; accent-color: var(--accent); }
.file-foot { display: flex; flex-wrap: wrap; gap: 8px 12px; justify-content: space-between; align-items: center; }
.file-status { font-size: 0.9rem; color: var(--muted); }
.files li.done .file-status { color: var(--ok); font-weight: 600; }
.files li.failed .file-status { color: var(--bad); }
.file-actions { display: flex; gap: 8px; }
.file-actions button { font-size: 0.9rem; padding: 4px 10px; }

.done-note {
  border: 1px solid color-mix(in srgb, var(--ok) 40%, #fff);
  background: color-mix(in srgb, var(--ok) 8%, #fff);
  color: var(--ok);
  border-radius: 8px;
  padding: 12px;
  font-weight: 600;
}
