:root {
  --bg: #f6f5f3;
  --panel: #ffffff;
  --ink: #1d1b19;
  --muted: #6d6862;
  --line: #e4e0db;
  --accent: #7a3e9d;
  --accent-ink: #ffffff;
  --filter: #b4382f;
  --allow: #2f7d4f;
  --warn: #a86b00;
  --radius: 10px;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; line-height: 1.45; }
a { color: var(--accent); }
header.top { display: flex; align-items: center; gap: 16px; padding: 12px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
header.top .brand { font-weight: 650; letter-spacing: 0.01em; }
header.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
header.top nav button { background: none; border: 0; padding: 6px 12px; border-radius: 6px; font: inherit; color: var(--muted); cursor: pointer; }
header.top nav button.on { background: var(--bg); color: var(--ink); font-weight: 600; }
header.top .who { margin-left: auto; color: var(--muted); font-size: 14px; }
main { max-width: 1200px; margin: 0 auto; padding: 20px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; margin-bottom: 16px; }
.panel h2 { margin: 0 0 12px; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.grid { display: grid; gap: 12px; }
.tiles { grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.tile .k { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.tile .v { font-size: 24px; font-weight: 650; font-variant-numeric: tabular-nums; }
.tile .s { font-size: 12px; color: var(--muted); }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th, td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
button.btn, a.btn { display: inline-block; font: inherit; padding: 8px 14px; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--ink); cursor: pointer; text-decoration: none; }
button.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
button.btn:disabled { opacity: 0.5; cursor: default; }
input[type=text], select, textarea { font: inherit; padding: 7px 9px; border: 1px solid var(--line); border-radius: 8px; background: #fff; color: var(--ink); }
textarea { width: 100%; }
textarea.code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; min-height: 360px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.pill.filter { background: #f6dedb; color: var(--filter); }
.pill.allow { background: #dbefe2; color: var(--allow); }
.pill.neutral { background: var(--bg); color: var(--muted); }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; cursor: pointer; }
.card img { width: 100%; height: 150px; object-fit: cover; display: block; background: #ddd; }
.card .meta { padding: 6px 8px; font-size: 12px; display: flex; justify-content: space-between; gap: 6px; align-items: center; }
.bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: var(--accent); }
dialog { border: 0; border-radius: 12px; padding: 0; max-width: min(900px, 95vw); width: 100%; }
dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
dialog .inner { padding: 18px; }
.err { color: var(--filter); }

/* review */
.review { max-width: 760px; margin: 0 auto; padding: 16px; }
.review .imgbox { background: #222; border-radius: 12px; display: flex; align-items: center; justify-content: center; min-height: 320px; max-height: 62vh; overflow: hidden; }
.review .imgbox img { max-width: 100%; max-height: 62vh; display: block; }
.review .choices { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.review .choices button { font: inherit; font-size: 18px; font-weight: 600; padding: 16px; border-radius: 12px; border: 2px solid transparent; cursor: pointer; }
.review .choices .hide { background: #f6dedb; color: var(--filter); border-color: #eab8b2; }
.review .choices .fine { background: #dbefe2; color: var(--allow); border-color: #b3dbc1; }
.review .cats { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.review .cats label { background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; font-size: 14px; cursor: pointer; user-select: none; }
.review .cats input { margin-right: 6px; }
.review .foot { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; }
kbd { font-family: ui-monospace, monospace; font-size: 12px; border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 0 4px; background: #fff; }
@media (max-width: 600px) {
  .review .choices button { font-size: 16px; padding: 14px 8px; }
  .hide-mobile { display: none; }
}

/* Admin: images are blurred unless "Show images" is ticked. */
body:not(.show-images) .card img, body:not(.show-images) dialog img { filter: blur(18px) grayscale(0.6); }
