:root {
  color-scheme: light dark;
  --bg: #f3f4f6;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --dash: #c9ced6;
  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --on-accent: #ffffff;
  --accent-soft: #eff4ff;
  --ok: #15803d;
  --err: #b91c1c;
  --track: #e9ebef;
  --focus: 0 0 0 3px rgb(37 99 235 / 0.35);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1013;
    --card: #16191e;
    --text: #e6e8eb;
    --muted: #9ba3af;
    --line: #2a2e35;
    --dash: #3d434d;
    --accent: #6d9bff;
    --accent-hover: #8bb0ff;
    --on-accent: #0b1222;
    --accent-soft: #18233a;
    --ok: #4ade80;
    --err: #f87171;
    --track: #262a31;
    --focus: 0 0 0 3px rgb(109 155 255 / 0.4);
  }
}

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

body {
  margin: 0;
  min-height: 100vh;
  padding: clamp(16px, 8vh, 80px) 16px 40px;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.card {
  max-width: 560px;
  margin: 0 auto;
  padding: 28px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.04), 0 12px 32px -12px rgb(0 0 0 / 0.12);
}

.head { display: flex; gap: 14px; align-items: center; margin-bottom: 24px; }
.mark {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
}
.mark svg { width: 22px; height: 22px; }
h1 { margin: 0; font-size: 20px; line-height: 1.25; font-weight: 650; letter-spacing: -0.01em; }
.sub { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.optional { font-weight: 400; }

.field { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 550; }
input[type="text"], input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="text"]:focus-visible, input[type="password"]:focus-visible { border-color: var(--accent); box-shadow: var(--focus); }

.btn { font: inherit; font-weight: 600; border: 0; border-radius: 10px; padding: 11px 16px; cursor: pointer; }
.btn.primary { width: 100%; margin-top: 16px; background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--accent-hover); }
.btn:disabled { opacity: 0.6; cursor: progress; }
.btn:focus-visible, .icon-btn:focus-visible, .link-btn:focus-visible { outline: none; box-shadow: var(--focus); }

.link-btn {
  padding: 4px 6px;
  margin: -4px -6px;
  font: inherit;
  font-size: 13px;
  color: var(--muted);
  background: none;
  border: 0;
  border-radius: 6px;
  white-space: nowrap;
  cursor: pointer;
}
.link-btn:hover { color: var(--text); text-decoration: underline; }

.error { margin: 10px 0 0; color: var(--err); font-size: 14px; }
.notice { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.drop {
  position: relative;
  margin-top: 18px;
  border: 1.5px dashed var(--dash);
  border-radius: 14px;
  transition: border-color 0.15s, background-color 0.15s;
}
.drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 34px 16px;
  text-align: center;
  cursor: pointer;
}
.drop-icon { width: 36px; height: 36px; margin-bottom: 8px; color: var(--accent); }
.drop-title { font-size: 16px; font-weight: 600; }
.drop .link { color: var(--accent); font-weight: 550; }
.drop .small { margin-top: 6px; }
.drop:hover, body.dragging .drop { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { border-color: var(--accent); box-shadow: var(--focus); }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0 4px;
  color: var(--muted);
  font-size: 13px;
}
.files { list-style: none; margin: 0; padding: 0; }
.file { padding: 12px 0; }
.file + .file { border-top: 1px solid var(--line); }
.file-row { display: flex; align-items: center; gap: 12px; }
.file-main { flex: 1; min-width: 0; }
.file-name { font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.file[data-state="error"] .file-meta { color: var(--err); }
.file[data-state="done"] .file-meta { color: var(--ok); }
.file[data-state="cancelled"] { opacity: 0.6; }

.icon-btn {
  flex: none;
  width: 32px; height: 32px;
  display: grid; place-items: center;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}
.icon-btn:hover { background: var(--track); color: var(--text); }
.icon-btn:disabled { cursor: default; background: none; }
.icon-btn svg { width: 18px; height: 18px; }
.file[data-state="done"] .icon-btn { color: var(--ok); }

.bar { height: 4px; margin-top: 8px; overflow: hidden; border-radius: 99px; background: var(--track); }
.bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--accent); transition: width 0.2s linear; }
.file[data-state="done"] .bar span { background: var(--ok); }
.file[data-state="error"] .bar span { background: var(--err); }

.foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

@media (max-width: 480px) {
  .card { padding: 20px; border-radius: 12px; }
  .drop-inner { padding: 26px 12px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
