:root {
  --bg: #0f1115; --panel: #171a21; --line: #272c37; --text: #e7e9ee; --muted: #9aa3b2;
  --accent: #7c8cff; --accent-text: #0b0d12; --ok: #3ecf8e; --warn: #f5b84b; --bad: #ff6b6b; --radius: 10px;
}
@media (prefers-color-scheme: light) {
  :root { --bg: #f5f6f8; --panel: #ffffff; --line: #dfe3ea; --text: #161a22; --muted: #5d6676; --accent: #4456e8; --accent-text: #ffffff; }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Arial, sans-serif; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
.wrap { max-width: 980px; margin: 0 auto; padding: 0 16px 80px; }
header.top { display: flex; align-items: center; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
header.top h1 { font-size: 18px; margin: 0; margin-inline-end: auto; }
.btn { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: 7px 12px; }
.btn:hover { border-color: var(--accent); }
.btn.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); font-weight: 600; }
.btn.danger { color: var(--bad); }
.btn.small { padding: 4px 9px; font-size: 13px; }
.btn[disabled] { opacity: .5; cursor: default; }
.icon { background: none; border: 0; padding: 4px 6px; font-size: 18px; line-height: 1; border-radius: 6px; }
.icon:hover { background: var(--line); }
.icon.on { color: var(--warn); }
nav.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
nav.tabs button { background: none; border: 0; padding: 10px 14px; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
nav.tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 14px; }
.input { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; width: 100%; }
.input:focus-visible, .btn:focus-visible, .icon:focus-visible, nav.tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 160px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.login { max-width: 360px; margin: 12vh auto 0; }
.login h1 { margin-top: 0; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; font-size: 13px; color: var(--muted); }
.error { color: var(--bad); margin: 8px 0; }
ul.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.item:last-child { border-bottom: 0; }
.thumb { width: 96px; height: 54px; border-radius: 6px; background: var(--line); object-fit: cover; flex: none; }
.thumb.none { display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 22px; }
.meta { flex: 1; min-width: 150px; }
.meta .t { font-weight: 600; overflow-wrap: anywhere; }
.badge { display: inline-block; font-size: 12px; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.badge.ok { color: var(--ok); border-color: var(--ok); }
.badge.warn { color: var(--warn); border-color: var(--warn); }
.badge.bad { color: var(--bad); border-color: var(--bad); }
.actions { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; }
.player { width: 100%; aspect-ratio: 16 / 9; max-height: 320px; border: 0; border-radius: 8px; background: #000; }
.bar { height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; min-width: 100px; }
.bar > i { display: block; height: 100%; background: var(--accent); }
.split { display: grid; grid-template-columns: 240px 1fr; gap: 14px; }
@media (max-width: 720px) { .split { grid-template-columns: 1fr; } .thumb { width: 72px; height: 40px; } }
.pl { display: flex; justify-content: space-between; gap: 8px; width: 100%; text-align: start; background: none; border: 0; padding: 8px 10px; border-radius: 8px; }
.pl[aria-current="true"] { background: var(--line); }
.code { font: 600 28px/1.2 ui-monospace, Consolas, monospace; letter-spacing: .12em; direction: ltr; unicode-bidi: isolate; }
#toast { position: fixed; inset-inline: 16px; bottom: 16px; max-width: 460px; margin-inline: auto; background: var(--text); color: var(--bg); padding: 10px 14px; border-radius: 8px; opacity: 0; transform: translateY(8px); transition: .2s; pointer-events: none; }
#toast.show { opacity: 1; transform: none; }
