:root {
  --bg: #faf9f5;
  --surface: #ffffff;
  --sunken: #f0eee6;
  --border: #e3e0d6;
  --text: #1f1e1d;
  --muted: #6b6a64;
  --accent: #c96442;
  --accent-hover: #b4583a;
  --accent-soft: #f5e3dc;
  --ok: #2f8a57;
  --err: #c0453a;
  --shadow: 0 1px 2px rgba(0,0,0,.04), 0 8px 24px rgba(0,0,0,.06);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #262624;
    --surface: #30302e;
    --sunken: #1f1e1d;
    --border: #45443f;
    --text: #faf9f5;
    --muted: #a6a39a;
    --accent: #d97757;
    --accent-hover: #e38667;
    --accent-soft: #3d2f29;
    --ok: #5fb87f;
    --err: #e06c5f;
    --shadow: 0 1px 2px rgba(0,0,0,.2), 0 8px 24px rgba(0,0,0,.25);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px;
}
.wrap { width: 100%; max-width: 620px; }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 28px; }
.logo {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--accent); display: grid; place-items: center; flex: none;
}
.logo svg { width: 18px; height: 18px; }
h1 { font-size: 22px; font-weight: 600; margin: 0; letter-spacing: -.01em; }
.sub { color: var(--muted); margin: 2px 0 0; font-size: 14px; }
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}
label.field { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password] {
  width: 100%;
  font: inherit;
  color: var(--text);
  background: var(--sunken);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 12px;
  outline: none;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
button, .btn {
  font: inherit; font-weight: 600;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 10px 18px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap;
}
button:hover, .btn:hover { background: var(--accent-hover); }
button:disabled { opacity: .5; cursor: default; }
button.ghost { background: transparent; color: var(--text); border-color: var(--border); }
button.ghost:hover { background: var(--sunken); }
button.small { padding: 6px 12px; font-size: 13px; }
.row { display: flex; gap: 10px; align-items: center; }
.row > input { flex: 1; min-width: 0; }
.err { color: var(--err); font-size: 14px; min-height: 21px; margin: 8px 0 0; }
.hidden { display: none !important; }

/* drop zone */
.drop {
  border: 2px dashed var(--border);
  border-radius: 14px;
  padding: 40px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
}
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop svg { width: 40px; height: 40px; color: var(--accent); }
.drop strong { display: block; font-size: 17px; margin: 10px 0 4px; }
.drop span { color: var(--muted); font-size: 14px; }

/* file list */
.files { list-style: none; margin: 0; padding: 0; }
.files li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.files li:first-child { border-top: 0; }
.fname { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fmeta { color: var(--muted); font-size: 13px; text-align: right; white-space: nowrap; }
.bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--sunken); overflow: hidden; }
.bar > i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
li.done .bar > i { background: var(--ok); }
li.failed .bar > i { background: var(--err); }
li.done .fmeta { color: var(--ok); }
li.failed .fmeta { color: var(--err); }
.summary { display: flex; justify-content: space-between; align-items: center; margin-bottom: 4px; }
.summary h2 { font-size: 15px; margin: 0; }

/* admin */
.share {
  font: 15px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace;
  background: var(--sunken);
}
.note { color: var(--muted); font-size: 13px; margin: 10px 0 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; gap: 8px; }
.toolbar h2 { font-size: 16px; margin: 0; }
.files a { color: var(--text); text-decoration: none; }
.files a:hover { color: var(--accent); text-decoration: underline; }
.folder-tag {
  display: inline-block; font-size: 12px; color: var(--muted);
  background: var(--sunken); border-radius: 6px; padding: 1px 7px; margin-left: 6px;
}
.empty { color: var(--muted); text-align: center; padding: 20px 0 8px; }
.foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 8px; }

@media (max-width: 520px) {
  body { padding: 28px 16px; }
  .card { padding: 18px; }
  .row.stack { flex-direction: column; align-items: stretch; }
}
