:root {
  --bg: #f4f3ef;
  --card: #ffffff;
  --text: #1d1d1b;
  --muted: #6b6a65;
  --line: #e2e0d9;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --ok: #2f6b3a;
  --ok-bg: #e7f2e8;
  --err: #a33a2b;
  --err-bg: #f8e8e5;
  --drop: #fafaf7;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151614;
    --card: #1e201d;
    --text: #e8e7e2;
    --muted: #9b9a93;
    --line: #34362f;
    --accent: #7fb8a4;
    --accent-text: #10201b;
    --ok: #8fd19b;
    --ok-bg: #1f3323;
    --err: #f0a194;
    --err-bg: #3a221e;
    --drop: #191b18;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px 16px;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 32px 28px;
}

h1 { margin: 0 0 8px; font-size: 1.5rem; font-weight: 650; letter-spacing: -0.01em; overflow-wrap: anywhere; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); font-size: 0.92rem; }
.note { white-space: pre-wrap; overflow-wrap: anywhere; }

.notice {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--drop);
  border: 1px solid var(--line);
}
.notice.ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.notice.error { background: var(--err-bg); color: var(--err); border-color: transparent; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 16px;
  padding: 32px 16px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: var(--drop);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.drop:hover, .drop.over { border-color: var(--accent); }
.drop.disabled { opacity: 0.5; cursor: not-allowed; }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.drop-sub { color: var(--muted); font-size: 0.88rem; }

.files { list-style: none; margin: 16px 0 0; padding: 0; }
.files li {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 2px 12px;
  align-items: center;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.files .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.files .size { color: var(--muted); font-size: 0.88rem; font-variant-numeric: tabular-nums; }
.files .rm {
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 1.2rem;
  line-height: 1;
  padding: 2px 4px;
  cursor: pointer;
}
.files .rm:hover { color: var(--err); }
.files progress { grid-column: 1 / -1; width: 100%; height: 4px; accent-color: var(--accent); display: none; }
.files .msg { grid-column: 1 / -1; font-size: 0.85rem; color: var(--muted); }
.files .msg:empty { display: none; }
.files li.uploading progress, .files li.done progress { display: block; }
.files li.done .msg { color: var(--ok); }
.files li.error .msg, .files li.rejected .msg { color: var(--err); }
.files li.rejected .name { text-decoration: line-through; color: var(--muted); }

button[type="submit"] {
  width: 100%;
  margin-top: 20px;
  padding: 12px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
button[type="submit"]:disabled { opacity: 0.45; cursor: default; }

[hidden] { display: none !important; }

.file {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 16px 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--drop);
}
.file .name { font-weight: 600; overflow-wrap: anywhere; }
.file .size { color: var(--muted); font-size: 0.9rem; white-space: nowrap; font-variant-numeric: tabular-nums; }

.btn {
  display: block;
  margin-top: 20px;
  padding: 12px;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-text);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}
.btn.disabled { opacity: 0.45; pointer-events: none; }
