:root {
  --bg: #111418; --panel: #1b1f25; --line: #2a3038; --text: #e8eaed; --muted: #9aa3ad;
  --accent: #4da3ff; --danger: #ff6b6b;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-decoration: none; }
main { max-width: 1400px; margin: 0 auto; padding: 12px 16px 40px; }

.top { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top));
  background: rgba(17,20,24,.92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 8px; color: var(--text); font-weight: 600; font-size: 17px; }
.brand svg { width: 24px; height: 24px; }
.who { display: flex; align-items: center; gap: 12px; color: var(--muted); margin: 0; }
button.link { background: none; border: 0; color: var(--accent); font: inherit; cursor: pointer; padding: 0; }

h2 { font-size: 16px; font-weight: 600; margin: 22px 0 10px; color: var(--text); }
h2 small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 8px; } }
.card { position: relative; display: block; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
  color: var(--text); transition: border-color .15s, transform .15s; }
.card:hover { border-color: var(--accent); transform: translateY(-1px); }
.cardlink { display: block; color: var(--text); }
.dl { position: absolute; top: 6px; right: 6px; display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 8px; background: rgba(0,0,0,.6); color: #fff; opacity: .85; }
.dl:hover { opacity: 1; background: var(--accent); }
.dl .ico { width: 18px; height: 18px; }
.thumb { position: relative; aspect-ratio: 16/9; background: #000; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nothumb { display: flex; align-items: center; justify-content: center; height: 100%; color: var(--muted); }
.nothumb svg { width: 42px; height: 42px; }
.badge { position: absolute; right: 6px; bottom: 6px; display: flex; align-items: center; gap: 3px;
  background: rgba(0,0,0,.65); color: #fff; font-size: 12px; padding: 2px 7px 2px 4px; border-radius: 10px; }
.badge svg { width: 14px; height: 14px; }
.meta { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; font-size: 14px; }
.meta span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.more { text-align: center; margin-top: 24px; }
.button, button[type=submit]:not(.link) { display: inline-block; background: var(--accent); color: #fff; border: 0;
  border-radius: 8px; padding: 10px 18px; font: inherit; font-weight: 600; cursor: pointer; }
.empty { color: var(--muted); text-align: center; margin-top: 80px; }

.login { max-width: 340px; margin: 12vh auto 0; display: flex; flex-direction: column; gap: 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 28px 24px; }
.login .logo { width: 44px; height: 44px; color: var(--accent); align-self: center; }
.login h1 { margin: 0 0 6px; text-align: center; font-size: 22px; }
.login label { display: flex; flex-direction: column; gap: 6px; color: var(--muted); font-size: 14px; }
.login input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; color: var(--text);
  padding: 10px 12px; font: inherit; font-size: 16px; }
.login input:focus { outline: none; border-color: var(--accent); }
.error { color: var(--danger); margin: 0; text-align: center; }

.evnav { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; }
.evnav .back { white-space: nowrap; }
.evnav .title { flex: 1; display: flex; flex-direction: column; text-align: center; }
.evnav .title span { color: var(--muted); font-size: 14px; }
.arrows { display: flex; gap: 6px; }
.arrows a, .arrows span { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px;
  border-radius: 8px; background: var(--panel); border: 1px solid var(--line); font-size: 24px; line-height: 1; }
.arrows span { color: var(--line); }
.viewer { display: flex; flex-direction: column; gap: 12px; align-items: center; }
.viewer video, .viewer img { display: block; max-width: 100%; max-height: 78vh; border-radius: 10px; background: #000; }
.viewer video { width: 100%; }
.viewer .photo.secondary img { max-height: 40vh; }
.files { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 16px; }
.button.ghost { display: inline-flex; align-items: center; gap: 8px; background: var(--panel); color: var(--text);
  border: 1px solid var(--line); font-weight: 500; }
.button.ghost:hover { border-color: var(--accent); }
.button .ico { width: 18px; height: 18px; }
