:root {
  --bg: #f6f6f4;
  --panel: #ffffff;
  --ink: #1a1a1a;
  --muted: #6b6b6b;
  --line: #e0e0dc;
  --accent: #1a1a1a;
  --ok: #1c7c3c;
  --warn: #b46a00;
  --danger: #b00020;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 4rem;
}
header { margin-bottom: 1.75rem; }
h1 {
  font-size: 1.35rem;
  margin: 0 0 .35rem;
  letter-spacing: -0.01em;
}
h2 {
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin: 0 0 1rem;
}
.tag { color: var(--muted); margin: 0; max-width: 46ch; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}

.row {
  display: grid;
  grid-template-columns: 6.5rem 1fr;
  align-items: center;
  gap: .75rem;
  margin-bottom: .7rem;
}
.row label {
  font-size: .82rem;
  color: var(--muted);
}
input[type="password"],
input[type="text"],
input[type="file"],
select,
textarea {
  width: 100%;
  font: inherit;
  padding: .5rem .55rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #fff;
  color: var(--ink);
}
input[type="file"] { padding: .4rem; }
textarea {
  display: block;
  margin: .4rem 0 .9rem;
  resize: vertical;
  min-height: 5.5rem;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
input:focus, select:focus, textarea:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.subhead {
  margin: 1.4rem 0 .8rem;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
}

.dropzone {
  margin: .4rem 0 .9rem;
  padding: 1rem;
  border: 1px dashed var(--line);
  border-radius: 4px;
  text-align: center;
  color: var(--muted);
  font-size: .85rem;
}
.dropzone.over {
  border-color: var(--accent);
  color: var(--ink);
  background: #fafaf8;
}

button {
  font: inherit;
  font-weight: 600;
  padding: .55rem 1.1rem;
  border: 1px solid var(--accent);
  border-radius: 4px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
button:disabled { opacity: .5; cursor: default; }
.link {
  display: inline-block;
  background: none;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 4px;
  font-weight: 500;
  padding: .3rem .55rem;
  font-size: .8rem;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
}
.link:hover { border-color: var(--accent); }

.progress-wrap {
  margin-top: .85rem;
  height: 6px;
  background: var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  width: 0;
  background: var(--accent);
  transition: width .15s linear;
}

.msg { margin: .7rem 0 0; font-size: .85rem; min-height: 1.2em; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--danger); }
.hint { margin: .5rem 0 0; font-size: .78rem; color: var(--muted); }

.live-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.count { font-size: .8rem; color: var(--muted); }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
}
th {
  text-align: left;
  font-weight: 600;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  padding: .4rem .5rem;
}
td {
  padding: .55rem .5rem;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
.c-size, .c-time { font-variant-numeric: tabular-nums; white-space: nowrap; }
.c-size { width: 5.5rem; }
.c-time { width: 6rem; }
.c-act { width: 13.5rem; text-align: right; }
.c-act .actions { display: inline-flex; flex-wrap: wrap; gap: .35rem; justify-content: flex-end; }

.fname {
  word-break: break-all;
}
.badge {
  display: inline-block;
  margin-right: .45rem;
  padding: .05rem .3rem;
  border: 1px solid var(--line);
  border-radius: 3px;
  font-size: .62rem;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--muted);
  vertical-align: 1px;
}
.expiring td { color: var(--danger); }
.expiring .fname { color: var(--ink); }

.empty { color: var(--muted); font-size: .88rem; margin: .85rem .5rem 0; }

footer {
  margin-top: 1.5rem;
  font-size: .78rem;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 560px) {
  .row { grid-template-columns: 1fr; gap: .3rem; }
  .c-size { display: none; }
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #171716;
    --panel: #1f1f1e;
    --ink: #ececea;
    --muted: #9a9a95;
    --line: #34342f;
    --accent: #ececea;
    --ok: #5bd07f;
    --warn: #e0a44a;
    --danger: #ff6b6b;
  }
  input[type="password"], input[type="text"], input[type="file"], select, textarea { background: #141413; }
  button { color: #171716; }
  .link { color: var(--ink); }
  .dropzone.over { background: #262624; }
}
