:root {
  --bg: #f4f5f7; --card: #fff; --text: #1b1d22; --muted: #6b7180;
  --line: #e2e4e9; --accent: #2f6fed; --danger: #d33a3a;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #121317; --card: #1b1d23; --text: #e8e9ee; --muted: #8e93a1; --line: #2c2f38; --accent: #5b8cff; --danger: #ff6464; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, sans-serif; }
[hidden] { display: none !important; }
header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
nav { display: flex; gap: 12px; align-items: center; color: var(--muted); }
main { max-width: 1000px; margin: 16px auto; padding: 0 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.narrow { max-width: 360px; margin: 12vh auto; }
h1, h2 { margin: 0 0 12px; font-size: 20px; }
label { display: block; margin-bottom: 10px; }
input:not([type=file]) { display: block; width: 100%; margin-top: 4px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--text); font: inherit; }
button { padding: 8px 14px; border: 0; border-radius: 6px; background: var(--accent); color: #fff; font: inherit; cursor: pointer; }
button.link { background: none; color: var(--accent); padding: 0; }
button.danger { background: none; color: var(--danger); padding: 0; }
.error { color: var(--danger); min-height: 1.2em; margin: 8px 0 0; }
.muted { color: var(--muted); }
.drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: 10px; cursor: pointer; text-align: center; }
.drop.over { border-color: var(--accent); }
.drop small { color: var(--muted); }
.upload { margin-top: 8px; font-size: 13px; }
progress { width: 100%; }
.media { list-style: none; padding: 0; margin: 16px 0 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.media li { border: 1px solid var(--line); border-radius: 8px; overflow: hidden; display: flex; flex-direction: column; }
.media video, .media img { width: 100%; aspect-ratio: 9 / 16; object-fit: cover; background: #000; }
.media .info { padding: 8px; font-size: 13px; display: flex; flex-direction: column; gap: 4px; word-break: break-all; }
.media .row { display: flex; justify-content: space-between; }
.users { width: 100%; border-collapse: collapse; font-size: 14px; }
.users td { padding: 8px 6px; border-top: 1px solid var(--line); vertical-align: middle; }
.users td:last-child { text-align: right; white-space: nowrap; }
.users button { margin-left: 8px; }
.tag { font-size: 12px; padding: 2px 6px; border-radius: 4px; background: var(--bg); color: var(--muted); }
#tgLogin { width: 100%; }
