:root {
  --bg: #fafafa;
  --fg: #1a1a1a;
  --muted: #767676;
  --line: #e4e4e4;
  --accent: #1a1a1a;
  --accent-fg: #ffffff;
  --danger: #c0392b;
  --radius: 14px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #141414;
    --fg: #f2f2f2;
    --muted: #9a9a9a;
    --line: #2c2c2c;
    --accent: #f2f2f2;
    --accent-fg: #141414;
    --danger: #ff6b5e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.wrap {
  max-width: 620px;
  margin: 0 auto;
  padding: 56px 20px 80px;
}

.brand {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 32px;
}

.card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  background: var(--bg);
}

.login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.login-form label {
  font-size: 14px;
  color: var(--muted);
}
input[type="password"] {
  padding: 12px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: transparent;
  color: var(--fg);
}
input[type="password"]:focus {
  outline: 2px solid var(--fg);
  outline-offset: 1px;
}

button {
  font: inherit;
  cursor: pointer;
}

.login-form button,
.upload-btn {
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 500;
  color: var(--accent-fg);
  background: var(--accent);
  border: none;
  border-radius: 10px;
}

.dropzone {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 48px 24px;
  text-align: center;
  transition: border-color 0.15s, background 0.15s;
}
.dropzone.drag {
  border-color: var(--fg);
  background: color-mix(in srgb, var(--fg) 4%, transparent);
}
.dz-title { margin: 0 0 4px; font-size: 17px; font-weight: 500; }
.dz-sub { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.progress { margin-top: 20px; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
  gap: 12px;
}
.progress-label span:first-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.progress-track {
  height: 6px;
  background: var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0%;
  background: var(--fg);
  transition: width 0.2s ease;
}

.notice {
  margin-top: 16px;
  font-size: 14px;
  color: var(--muted);
}

.files-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 40px 0 12px;
}
.files-head h2 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
}
.link-btn {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  text-decoration: underline;
  padding: 0;
}

.file-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.file-row:last-child { border-bottom: 1px solid var(--line); }
.file-main {
  flex: 1;
  min-width: 0;
}
.file-name {
  font-size: 15px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-meta {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.file-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}
.icon-btn {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--fg);
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 13px;
  text-decoration: none;
  line-height: 1;
}
.icon-btn:hover { border-color: var(--fg); }
.icon-btn.danger { color: var(--danger); }
.icon-btn.danger:hover { border-color: var(--danger); }

.empty {
  color: var(--muted);
  font-size: 14px;
  padding: 16px 0;
}
.error {
  color: var(--danger);
  font-size: 13px;
  margin: 4px 0 0;
  min-height: 1em;
}

@media (max-width: 480px) {
  .wrap { padding: 36px 16px 64px; }
  .dropzone { padding: 36px 16px; }
  .file-actions { flex-direction: column; }
}
