:root {
  color-scheme: dark;
  --bg: #14161a;
  --panel: #1c1f25;
  --line: #2c313a;
  --text: #e6e8ec;
  --muted: #949cab;
  --accent: #6ea8fe;
  --danger: #f2777a;
  --ok: #7ec699;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

.shell { max-width: 940px; margin: 0 auto; padding: 32px 20px 64px; }

h1 { font-size: 20px; margin: 0; letter-spacing: .02em; }
h2 { font-size: 15px; font-weight: 600; margin: 32px 0 12px; }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); font-size: 13px; margin: 0; }

.bar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; }

button {
  font: inherit;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--text);
  border-radius: 7px;
  padding: 8px 14px;
  cursor: pointer;
}
button:hover { border-color: var(--accent); }
button.ghost { background: none; color: var(--muted); }
button.link {
  background: none; border: none; padding: 0;
  color: var(--accent); text-decoration: underline; cursor: pointer;
}

/* Login */
.card {
  max-width: 340px; margin: 12vh auto 0;
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 12px; padding: 28px;
  display: flex; flex-direction: column; gap: 14px;
}
.card p { margin: 0; }
.card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.card input {
  font: inherit; color: var(--text);
  background: var(--bg); border: 1px solid var(--line);
  border-radius: 7px; padding: 9px 11px;
}
.card input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.card button { margin-top: 6px; }

/* Upload */
.drop {
  border: 1.5px dashed var(--line); border-radius: 12px;
  padding: 34px 20px; text-align: center; transition: border-color .15s, background .15s;
}
.drop p { margin: 0 0 4px; }
.drop.over { border-color: var(--accent); background: #1a222f; }

.status { list-style: none; margin: 14px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.status li { font-size: 13px; color: var(--muted); }
.status li.bad { color: var(--danger); }
.status li.good { color: var(--ok); }
/* A duplicate is not a failure, so it reads as information rather than
   an error, and it stays put until dismissed because it carries a URL
   the user still has to copy. */
.status li.dupe { color: var(--accent); display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.status li.dupe code { color: var(--text); font-size: 12px; word-break: break-all; }

/* Grid */
.grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
}
.grid li {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; overflow: hidden;
  display: flex; flex-direction: column;
}
.grid img {
  width: 100%; height: 140px; object-fit: contain;
  background: #0f1114; display: block;
}
.grid a.preview { display: block; cursor: zoom-in; }
.grid a.preview:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.meta { padding: 9px 11px; display: flex; flex-direction: column; gap: 7px; }
.meta code {
  font-size: 11px; color: var(--muted);
  word-break: break-all; font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.actions { display: flex; gap: 7px; }
.actions button { flex: 1; padding: 6px 8px; font-size: 12.5px; }
.actions .del { color: var(--danger); }
