:root {
  --bg: #121417;
  --surface: #1c1f24;
  --surface-2: #252930;
  --border: #31363f;
  --text: #e8eaed;
  --muted: #9aa0a6;
  --accent: #e5a00d;
  --accent-text: #1a1300;
  --pending: #9aa0a6;
  --downloading: #4c9be8;
  --finished: #3fb67a;
  --danger: #e5534b;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

a { color: var(--accent); }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
h1 { font-size: 1.5rem; margin: 0 0 12px; }
h2 { font-size: 1.05rem; margin: 0; }

.muted { color: var(--muted); }

/* Layout */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.brand { color: var(--text); font-weight: 700; font-size: 1.1rem; text-decoration: none; }
.topbar nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.topbar form { margin: 0; }
.who { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); }
.who img { width: 26px; height: 26px; border-radius: 50%; }

main { max-width: 900px; margin: 0 auto; padding: 24px 16px 48px; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
}
.narrow { max-width: 480px; margin: 40px auto; }
.center { text-align: center; }
.empty { text-align: center; color: var(--muted); }

/* Buttons */
.btn {
  display: inline-block;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
.btn:hover { filter: brightness(1.1); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn-sm { padding: 5px 12px; font-size: 0.9rem; }
.btn-block { display: block; width: 100%; }
.link { background: none; border: none; padding: 0; color: var(--muted); font: inherit; cursor: pointer; }
.link:hover { color: var(--text); text-decoration: underline; }
.link.danger:hover { color: var(--danger); }

/* Forms */
.stack { display: flex; flex-direction: column; gap: 16px; text-align: left; }
.stack label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.stack label .muted { font-weight: 400; }
input, textarea, select {
  width: 100%;
  padding: 9px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
input:focus, textarea:focus, select:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field-error { color: var(--danger); font-weight: 400; font-size: 0.9rem; }
.actions { display: flex; justify-content: flex-end; gap: 10px; }

/* Flash messages */
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; border: 1px solid var(--border); background: var(--surface); }
.flash-success { border-color: var(--finished); }
.flash-error { border-color: var(--danger); }

/* Request list */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.page-head h1 { margin: 0; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.tabs a {
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
}
.tabs a span { font-size: 0.8rem; opacity: 0.8; margin-left: 2px; }
.tabs a.active, .tabs a:hover { background: var(--surface-2); color: var(--text); }

.request-list { display: flex; flex-direction: column; gap: 10px; }
.req {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
}
.req-main { min-width: 0; }
.req-side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; flex-shrink: 0; }
.req-side form { margin: 0; }
.meta { margin: 4px 0 0; color: var(--muted); font-size: 0.9rem; }
.comments { margin: 10px 0 0; white-space: pre-line; overflow-wrap: anywhere; }
.imdb {
  font-size: 0.75rem;
  font-weight: 700;
  padding: 1px 6px;
  margin-left: 6px;
  border-radius: 4px;
  background: #f5c518;
  color: #000;
  text-decoration: none;
  vertical-align: middle;
}

.badge { font-size: 0.75rem; padding: 1px 7px; border-radius: 999px; background: var(--accent); color: var(--accent-text); font-weight: 700; }

.status, .status-select {
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: 999px;
  padding: 4px 12px;
  border: 1px solid currentColor;
}
.status-select { width: auto; background: var(--bg); padding-right: 8px; }
.status-none { color: var(--pending); }
.status-downloading { color: var(--downloading); }
.status-finished { color: var(--finished); }
.status-select option { color: var(--text); }

@media (max-width: 560px) {
  .req { flex-direction: column; }
  .req-side { flex-direction: row; align-items: center; justify-content: space-between; }
}

/* Guest access */
.small { font-size: 0.85rem; }
.divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--muted);
  font-size: 0.85rem;
}
.divider::before, .divider::after { content: ""; flex: 1; border-top: 1px solid var(--border); }
.badge-muted { background: var(--surface-2); color: var(--muted); }
/* Honeypot field: off-screen for people, still present for bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Approval queue */
.queue { margin-bottom: 32px; }
.section-title { font-size: 1.1rem; margin: 0 0 12px; }
.section-title span { color: var(--muted); font-weight: 400; }
.req-pending { border-color: var(--accent); }
.status-awaiting { color: var(--accent); }
