:root {
  --bg: #fbf7f4;
  --fg: #2a211d;
  --muted: #7a6c64;
  --accent: #c2410c;
  --accent-fg: #fff;
  --card: #ffffff;
  --line: #eadfd8;
  --ok: #15803d;
  --warn: #b45309;
  --bad: #b91c1c;
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1c1714;
    --fg: #f5ece7;
    --muted: #a89a92;
    --accent: #fb923c;
    --accent-fg: #1c1714;
    --card: #2a221e;
    --line: #3d322c;
  }
}
:root[data-theme="dark"] {
  --bg: #1c1714;
  --fg: #f5ece7;
  --muted: #a89a92;
  --accent: #fb923c;
  --accent-fg: #1c1714;
  --card: #2a221e;
  --line: #3d322c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
main { max-width: 960px; margin: 0 auto; padding: 24px 16px 64px; }
h1 { font-size: 1.7rem; margin: 0 0 4px; }
h2 { font-size: 1.15rem; margin: 28px 0 10px; }
p { margin: 6px 0; }
.muted { color: var(--muted); }
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  margin-top: 16px;
}
label { display: block; font-weight: 600; margin: 12px 0 4px; }
input[type="text"], input[type="url"], input[type="file"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--fg);
  font: inherit;
}
.check { display: flex; gap: 8px; align-items: center; margin-top: 14px; font-weight: 500; }
.check input { width: 18px; height: 18px; }
button, .btn {
  display: inline-block;
  padding: 10px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: var(--accent-fg);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}
button.secondary, .btn.secondary {
  background: transparent;
  color: var(--fg);
  border: 1px solid var(--line);
}
button.danger { background: var(--bad); color: #fff; }
button:disabled { opacity: 0.55; cursor: default; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 12px; }
.stack > * + * { margin-top: 12px; }
.notice { padding: 10px 12px; border-radius: 10px; margin-top: 12px; border: 1px solid var(--line); }
.notice.ok { border-color: var(--ok); color: var(--ok); }
.notice.warn { border-color: var(--warn); color: var(--warn); }
.notice.bad { border-color: var(--bad); color: var(--bad); }
.linkbox {
  display: flex; gap: 8px; align-items: center;
  border: 1px dashed var(--line); border-radius: 10px; padding: 8px 10px; margin-top: 8px;
  word-break: break-all; font-family: ui-monospace, Consolas, monospace; font-size: 0.92rem;
}
.linkbox span { flex: 1; }
.qr { width: 220px; max-width: 70vw; height: auto; border-radius: 10px; background: #fff; padding: 8px; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 12px;
}
.tile {
  position: relative;
  aspect-ratio: 1;
  border-radius: 10px;
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line);
  display: block;
}
.tile img, .tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.tile .badge {
  position: absolute; left: 6px; bottom: 6px;
  background: rgba(0, 0, 0, 0.6); color: #fff;
  font-size: 0.75rem; padding: 2px 6px; border-radius: 6px;
}
.tile .status {
  position: absolute; top: 6px; left: 6px;
  font-size: 0.72rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; color: #fff;
}
.status.pending { background: var(--warn); }
.status.approved { background: var(--ok); }
.tile-actions { display: flex; gap: 6px; padding: 6px; background: var(--card); }
.tile-actions button { flex: 1; padding: 6px 4px; font-size: 0.85rem; }
.admin-tile { display: flex; flex-direction: column; }
.admin-tile .media-wrap { position: relative; aspect-ratio: 1; }
.admin-tile .media-wrap img, .admin-tile .media-wrap video { width: 100%; height: 100%; object-fit: cover; display: block; }

.empty { text-align: center; padding: 32px 8px; color: var(--muted); }
.pill { display: inline-block; font-size: 0.8rem; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.hidden { display: none !important; }

@media print {
  body { background: #fff; color: #000; }
  .no-print { display: none !important; }
}
