:root {
  --bg: #0e0e10;
  --card: #1a1a1f;
  --fg: #f3f3f5;
  --muted: #9a9aa3;
  --line: #2a2a32;
  --acc: #ff4d8d;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.45 system-ui, sans-serif; }
a { color: var(--fg); text-decoration: none; }
a:hover { color: var(--acc); }
.top { display: flex; gap: 16px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: #0e0e10ee; z-index: 5; }
.logo { font-weight: 800; letter-spacing: .04em; color: var(--acc); }
nav { display: flex; gap: 14px; }
.search { margin-left: auto; }
.side { display: flex; gap: 4px; }
.side button, .tools button, .composer button, .auth button, .gate button, .linkish { font: inherit; color: var(--fg); background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; cursor: pointer; }
.side button.on, .tools button.on { border-color: var(--acc); color: var(--acc); }
.linkish { background: none; border: 0; padding: 0; }
.search input { background: var(--card); border: 1px solid var(--line); color: var(--fg); border-radius: 8px; padding: 8px 12px; min-width: 180px; }
.sub, main, footer { width: min(1200px, calc(100% - 32px)); margin: 0 auto; }
.sub { padding: 18px 0 0; }
h1, h2 { font-weight: 700; margin: 16px 0 10px; }
.cats { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; }
.cats a { display: flex; gap: 8px; align-items: baseline; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; }
.cats small, .taglist small { color: var(--muted); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; list-style: none; padding: 0; }
.card { display: flex; flex-direction: column; background: var(--card); border-radius: 10px; overflow: hidden; border: 1px solid var(--line); }
.shot, .shot-ph { display: block; background: hsl(var(--h, 320) 35% 28%); aspect-ratio: 1 / calc(1 / var(--ar, 0.68)); }
img.shot { width: 100%; object-fit: cover; }
.shot-ph .frame { height: 100%; }
.shot-ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
img.miss, .shot-ph img.miss { visibility: hidden; }
.cap { padding: 8px 10px 2px; font-size: 13px; }
.meta { padding: 0 10px 10px; color: var(--muted); font-size: 12px; }
.sort, .chips, .az { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 16px; }
.sort a, .chips a, .az a, .btn { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; }
.sort a.on, .az a.on { border-color: var(--acc); color: var(--acc); }
.taglist { columns: 3 180px; list-style: none; padding: 0; }
.taglist li { padding: 4px 0; }
.shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; list-style: none; padding: 0; }
.meta-dl { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; }
.meta-dl dt { color: var(--muted); }
.meta-dl a { margin-right: 8px; color: var(--acc); }
.empty { color: var(--muted); padding: 40px 0; }
.more { text-align: center; padding: 20px 0 40px; }
footer { color: var(--muted); padding: 32px 0; font-size: 12px; }
@media (max-width: 640px) {
  .top { flex-wrap: wrap; }
  .search { margin-left: 0; width: 100%; }
  .search input { width: 100%; }
}

.note { width: min(1200px, calc(100% - 32px)); margin: 12px auto 0; background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; }
.profile, .auth, .composer, .tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.profile { display: grid; grid-template-columns: 120px 1fr; gap: 6px 12px; }
.profile dt, .auth label { color: var(--muted); }
.auth { flex-direction: column; align-items: stretch; max-width: 360px; }
.auth input, .composer input, .composer textarea, .composer select { width: 100%; background: var(--card); border: 1px solid var(--line); color: var(--fg); border-radius: 8px; padding: 8px 10px; }
.composer textarea { min-height: 80px; }
.thread { list-style: none; padding: 0; }
.thread li { border-top: 1px solid var(--line); padding: 10px 0; }
.thread small { color: var(--muted); }
.frame { display: block; width: 100%; padding: 0; border: 0; background: transparent; cursor: zoom-in; }
.gate { max-width: 460px; margin: 48px auto; text-align: center; }
#stage { position: fixed; inset: 0; z-index: 20; background: #000d; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 16px; }
#stage[hidden] { display: none; }
#stage-pic { max-width: min(1000px, 80vw); max-height: 90vh; object-fit: contain; }
body.stage-open { overflow: hidden; }
@media (max-width: 640px) {
  .side { width: 100%; }
  #stage { flex-wrap: wrap; }
  #stage-pic { max-width: 100%; }
}
