:root {
  --bg: #f7f7f8; --card: #fff; --text: #1d1d1f; --muted: #6b6b73; --line: #e3e3e8;
  --accent: #2a7ae2; --warn-bg: #fff4d6; --warn-text: #7a5300;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #151517; --card: #1f1f23; --text: #ececf1; --muted: #9a9aa3; --line: #2e2e34;
    --accent: #5b9cf0; --warn-bg: #3a2f10; --warn-text: #f3d48a;
  }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
       font: 16px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 960px; margin: 0 auto; padding: 16px; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 12px;
       padding: 12px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.top nav { display: flex; gap: 16px; align-items: center; }
.top form { margin: 0; }
.brand { font-weight: 600; color: var(--text); }
button, .button { font: inherit; padding: 6px 12px; border-radius: 8px; border: 1px solid var(--line);
                  background: var(--card); color: var(--text); cursor: pointer; display: inline-block; }
button.primary, .button.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
button.link { border: 0; background: none; color: var(--accent); padding: 0; }
input, select { font: inherit; padding: 6px 8px; border-radius: 8px; border: 1px solid var(--line);
                background: var(--card); color: var(--text); max-width: 100%; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 20px; }
.narrow { max-width: 420px; margin: 48px auto; }
.summary, .meta, .empty { color: var(--muted); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 12px 0 20px; }
.month { font-size: 15px; color: var(--muted); margin: 24px 0 8px; text-transform: uppercase;
         letter-spacing: .04em; }
.files { list-style: none; margin: 0; padding: 0; background: var(--card);
         border: 1px solid var(--line); border-radius: 12px; }
.file { padding: 12px 14px; border-top: 1px solid var(--line); }
.file:first-child { border-top: 0; }
.file .name { font-weight: 500; overflow-wrap: anywhere; }
.file .actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 4px; font-size: 14px; }
.file .error { font-size: 14px; color: var(--warn-text); overflow-wrap: anywhere; margin: 4px 0; }
.file form { margin-top: 6px; }
.file .name::before { margin-right: .4em; }
.kind-video .name::before { content: "🎬"; }
.kind-audio .name::before { content: "🎧"; }
.kind-document .name::before { content: "📄"; }
.kind-photo .name::before { content: "🖼"; }
.kind-other .name::before { content: "📦"; }
.badge, .banner { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 13px; }
.banner { display: block; padding: 10px 14px; margin: 12px 0; font-size: 15px; }
.warn { background: var(--warn-bg); color: var(--warn-text); }
.pager, .album { display: flex; gap: 16px; align-items: center; margin: 20px 0; }
.pager { justify-content: center; }
.viewer h1 { font-size: 22px; overflow-wrap: anywhere; margin-bottom: 4px; }
.preview { margin: 16px 0; }
.preview video, .preview img { max-width: 100%; max-height: 75vh; display: block; border-radius: 8px;
                               background: #000; }
.preview audio { width: 100%; }
.preview iframe { width: 100%; height: 80vh; border: 1px solid var(--line); border-radius: 8px; }
.actions .button { margin-right: 8px; }
.caption { background: var(--card); border: 1px solid var(--line); border-radius: 12px;
           padding: 4px 16px; white-space: pre-wrap; overflow-wrap: anywhere; }
.queue-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.queue-head h1 { margin-right: auto; }
.queue-head form { margin: 0; }
