:root {
  --bg: #fafaf8;
  --surface: #ffffff;
  --text: #1c1c1a;
  --muted: #6b6b66;
  --line: #e4e4de;
  --accent: #2f5d50;
  --accent-text: #ffffff;
  --danger: #b3261e;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151614;
    --surface: #1e201d;
    --text: #ececE6;
    --muted: #9a9a92;
    --line: #2f312d;
    --accent: #7fb5a3;
    --accent-text: #10201b;
    --danger: #f2b8b5;
  }
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px max(16px, calc((100% - 880px) / 2));
  border-bottom: 1px solid var(--line);
}
.top form { margin: 0; }
.link { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; }
.brand {
  font-weight: 700;
  text-decoration: none;
  color: var(--text);
}
.login { max-width: 320px; margin: 48px auto 0; display: grid; gap: 12px; }
.login h1 { margin: 0; font-size: 1.25rem; }
.login input {
  padding: 10px 12px;
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}
.login button { font: inherit; cursor: pointer; }
.login .err { margin: 0; color: var(--danger); }
.brand span { color: var(--muted); font-weight: 400; }
main { max-width: 880px; margin: 0 auto; padding: 24px 16px 64px; }
h2 { font-size: 1rem; margin: 32px 0 8px; }

.drop {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 36px 16px;
  border: 2px dashed var(--line);
  border-radius: 12px;
  background: var(--surface);
  text-align: center;
  cursor: pointer;
}
.drop span { color: var(--muted); font-size: .9rem; }
.drop:hover, .drop.over { border-color: var(--accent); }

.progress { list-style: none; margin: 12px 0 0; padding: 0; }
.progress li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 12px;
  padding: 8px 0;
  font-size: .9rem;
}
.progress .bar { grid-column: 1 / -1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.progress .bar i { display: block; height: 100%; width: 0; background: var(--accent); }
.progress .err { color: var(--danger); }

.files { width: 100%; border-collapse: collapse; }
.files th, .files td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); }
.files th { color: var(--muted); font-weight: 500; font-size: .85rem; }
.files .num { text-align: right; white-space: nowrap; }
.files .name { word-break: break-word; }
.files .actions { white-space: nowrap; text-align: right; }
.files .actions a { margin-left: 12px; }
.empty, .note { color: var(--muted); }

.back { display: inline-block; margin-bottom: 16px; text-decoration: none; }
.head h1 { margin: 0; font-size: 1.5rem; word-break: break-word; }
.meta { color: var(--muted); margin: 4px 0 16px; font-size: .9rem; }
.buttons { display: flex; gap: 8px; margin-bottom: 24px; }
.btn {
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
}
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }

.text {
  margin: 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font: .875rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.preview { max-width: 100%; height: auto; border: 1px solid var(--line); border-radius: 8px; }
.pdf { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

@media (max-width: 560px) {
  .files thead { display: none; }
  .files, .files tbody, .files tr, .files td { display: block; }
  .files tr { padding: 10px 0; border-bottom: 1px solid var(--line); }
  .files td { border: 0; padding: 2px 8px; text-align: left !important; }
}
