:root {
  --bg: #f6f4f0;
  --surface: #ffffff;
  --text: #1d2126;
  --muted: #5d6670;
  --line: #e2ddd5;
  --accent: #b9661a;
  --approve: #1f7a4d;
  --reject: #b3362b;
  --warn-bg: #fdf1dc;
  --warn-text: #7a4a00;
  --ok-bg: #e2f3ea;
  --ok-text: #14573a;
  --bad-bg: #fbe5e2;
  --bad-text: #8a241b;
  --radius: 12px;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #15181c;
    --surface: #1e2328;
    --text: #eceae6;
    --muted: #a3abb3;
    --line: #2f363d;
    --accent: #f0a65a;
    --approve: #2f9c66;
    --reject: #d1574b;
    --warn-bg: #3a2c12;
    --warn-text: #f3cf8e;
    --ok-bg: #173527;
    --ok-text: #a5dfc0;
    --bad-bg: #3d1c19;
    --bad-text: #f1b1aa;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 17px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-text-size-adjust: 100%;
}

.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.top { flex-wrap: wrap; }
.brand { font-weight: 700; color: var(--text); text-decoration: none; }
.admin { display: flex; gap: 16px; margin-right: auto; }
.admin a { text-decoration: none; }
.who { display: flex; align-items: center; gap: 12px; margin: 0; color: var(--muted); }

main { max-width: 860px; margin: 0 auto; padding: 16px; }

h1 { font-size: 1.6rem; line-height: 1.2; margin: 0; }
h2 { font-size: 1.15rem; margin: 0 0 12px; }
h3 { font-size: 1rem; margin: 20px 0 6px; color: var(--muted); font-weight: 600; }
p { margin: 0 0 12px; }
a { color: var(--accent); }

.meta { color: var(--muted); font-size: 0.93rem; }
.hint { color: var(--muted); font-weight: 400; font-size: 0.93rem; }
.back { text-decoration: none; }
.headline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 4px; }

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 16px 0;
}
.panel.narrow { max-width: 420px; margin: 32px auto; }
.panel h1 { margin-bottom: 16px; }

.tabs { display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; }
.tabs a {
  flex: none;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}
.tabs a.active { border-color: var(--accent); color: var(--accent); font-weight: 600; }
.count { color: var(--muted); font-variant-numeric: tabular-nums; }

.empty { color: var(--muted); padding: 32px 0; text-align: center; }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  color: inherit;
  text-decoration: none;
}
.card:hover, .card:focus-visible { border-color: var(--accent); }
.card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; background: var(--line); }
.card-body { padding: 12px 14px 14px; }
.card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.card .meta { margin: 0 0 6px; }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--line);
  color: var(--text);
}
.badge.warn { background: var(--warn-bg); color: var(--warn-text); }
.badge.status-approved { background: var(--ok-bg); color: var(--ok-text); }
.badge.status-rejected { background: var(--bad-bg); color: var(--bad-text); }

.notice { padding: 10px 14px; border-radius: 10px; background: var(--line); }
.notice.ok { background: var(--ok-bg); color: var(--ok-text); }
.notice.warn { background: var(--warn-bg); color: var(--warn-text); }
.notice.bad { background: var(--bad-bg); color: var(--bad-text); }

video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); margin-top: 12px; }

.preview { display: grid; grid-template-columns: minmax(0, 220px) 1fr; gap: 14px; align-items: start; }
.preview img { width: 100%; height: auto; border-radius: 8px; display: block; }
.preview-title { font-weight: 600; margin: 0 0 2px; }
@media (max-width: 520px) { .preview { grid-template-columns: 1fr; } }

.description { white-space: pre-wrap; overflow-wrap: anywhere; }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 16px 0 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

.checklist { margin: 0; padding-left: 20px; }
.checklist li { margin-bottom: 6px; }

.stack { display: grid; gap: 14px; margin: 0; }
label { display: grid; gap: 6px; font-weight: 600; }
input[type="file"] { font: inherit; font-weight: 400; max-width: 100%; }
input[type="text"], input[type="password"], textarea, select {
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}
input:focus-visible, textarea:focus-visible, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.btn {
  min-height: 52px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.approve { background: var(--approve); border-color: var(--approve); color: #fff; }
.btn.reject { background: var(--surface); border-color: var(--reject); color: var(--reject); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

a.btn { display: inline-flex; align-items: center; text-decoration: none; }
.btn.small { min-height: 40px; padding: 6px 14px; }

.jobs { list-style: none; margin: 0; padding: 0; }
.job h2 { margin: 0; }
.job p:last-child { margin-bottom: 0; }
.badge.job-running, .badge.job-queued { background: var(--warn-bg); color: var(--warn-text); }
.badge.job-done { background: var(--ok-bg); color: var(--ok-text); }
.badge.job-failed { background: var(--bad-bg); color: var(--bad-text); }

.link { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; cursor: pointer; text-decoration: underline; }
