:root {
  --bg: #f4f5f7; --panel: #fff; --text: #1c1f24; --muted: #68707d; --line: #dfe2e8;
  --accent: #1f5fd0; --accent-text: #fff; --bad: #b3261e; --badbg: #fdecea; --okbg: #e7f5ec; --ok: #1e6b3a;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #14161a; --panel: #1d2026; --text: #e8eaee; --muted: #9aa3b1; --line: #30353e;
    --accent: #5b93f5; --accent-text: #0d1117; --bad: #f2867f; --badbg: #3a1f1d; --okbg: #1b3325; --ok: #7fd3a0; }
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); }
header { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px;
  padding: 10px 20px; background: var(--panel); border-bottom: 1px solid var(--line); }
nav { display: flex; gap: 4px; flex-wrap: wrap; }
nav a { padding: 6px 12px; border-radius: 6px; text-decoration: none; color: var(--text); }
nav a.on { background: var(--bg); font-weight: 600; }
.logout { display: flex; align-items: center; gap: 10px; color: var(--muted); }
main { max-width: 1240px; margin: 0 auto; padding: 20px; }
h1 { font-size: 22px; margin: 0 0 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px;
  margin-bottom: 18px; display: grid; gap: 14px; }
.card.inline { grid-template-columns: 1fr 1fr auto; align-items: end; }
.login { max-width: 340px; margin: 12vh auto 0; }
label { display: grid; gap: 6px; font-size: 14px; color: var(--muted); }
label.row { display: flex; align-items: center; gap: 8px; color: var(--text); flex-wrap: wrap; }
fieldset { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 8px; margin: 0; }
legend { color: var(--muted); font-size: 14px; padding: 0 6px; }
input:not([type=radio]):not([type=checkbox]), select, textarea {
  width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 7px;
  background: var(--bg); color: var(--text); font: inherit; }
select { width: auto; max-width: 100%; }
textarea { font-family: ui-monospace, Consolas, monospace; font-size: 13px; resize: vertical; }
button, .btn { display: inline-block; padding: 9px 16px; border: 1px solid var(--accent); border-radius: 7px;
  background: var(--accent); color: var(--accent-text); font: inherit; font-weight: 600; cursor: pointer;
  text-decoration: none; }
button.ghost, .btn.ghost { background: transparent; color: var(--accent); }
button.danger { background: transparent; border-color: var(--bad); color: var(--bad); }
button:disabled { opacity: .5; cursor: not-allowed; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.actions, .bulk { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin: 14px 0; }
.note { padding: 10px 14px; border-radius: 8px; margin: 0 0 16px; }
.note.ok { background: var(--okbg); color: var(--ok); }
.note.bad { background: var(--badbg); color: var(--bad); }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.tile { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px;
  text-decoration: none; color: var(--text); display: grid; gap: 2px; }
.tile b { font-size: 28px; line-height: 1.1; }
.tile span { color: var(--muted); font-size: 14px; }
.tile.warn b { color: var(--bad); }
table { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; }
th, td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top;
  white-space: nowrap; }
th { font-size: 13px; color: var(--muted); font-weight: 600; }
tr:last-child td { border-bottom: 0; }
td.url { white-space: normal; word-break: break-all; font-size: 13px; color: var(--muted); min-width: 220px; }
tr.rowbad td { background: var(--badbg); }
.small { font-size: 12px; color: var(--muted); white-space: normal; max-width: 280px; }
.muted { color: var(--muted); }
.badtext { color: var(--bad); }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filters a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none;
  color: var(--text); font-size: 14px; }
.filters a.on { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.st { font-weight: 600; }
.st-ready { color: var(--ok); }
.st-error { color: var(--bad); }
@media (max-width: 640px) { .card.inline { grid-template-columns: 1fr; } main { padding: 14px; } }

video { max-width: 320px; max-height: 60vh; border-radius: 8px; background: #000; }
ol { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
button.mini { padding: 4px 10px; font-size: 13px; white-space: nowrap; }
.rowactions { display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.bulk + .bulk { margin-top: -6px; }

.filters a i { font-style: normal; opacity: .7; margin-left: 2px; }
.filters a.warn { color: var(--bad); border-color: var(--bad); }
.sticky { position: sticky; top: 0; z-index: 2; background: var(--bg); padding: 8px 0; }
.sep { width: 1px; align-self: stretch; background: var(--line); margin: 0 4px; }
.vid { display: flex; gap: 8px; align-items: center; white-space: nowrap; }
.vid img { border-radius: 4px; display: block; background: #000; }
.cap { max-width: 260px; overflow-wrap: anywhere; }
.pager { display: flex; gap: 12px; align-items: center; justify-content: center; margin-top: 16px; }
.card.inline2 { grid-template-columns: 1fr auto; align-items: end; }
details.card > summary { cursor: pointer; color: var(--accent); }
.stack { display: grid; gap: 14px; margin-top: 14px; }
table { width: 100%; }
[hidden] { display: none !important; }
main { overflow-x: auto; }

.gridhead { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.grid { max-height: 420px; overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; }
.gridrow { display: grid; grid-template-columns: 44px minmax(220px, 2fr) minmax(130px, 1fr) minmax(200px, 2fr); gap: 6px;
  align-items: center; padding: 3px 8px 3px 0; }
.gridrow.head { position: sticky; top: 0; z-index: 1; background: var(--panel); border-bottom: 1px solid var(--line);
  font-size: 13px; color: var(--muted); padding: 7px 8px 7px 0; }
.gridrow .num, .gridrow.head span:first-child { text-align: right; color: var(--muted); font-size: 13px; }
.gridrow input { padding: 6px 8px !important; font-size: 14px; }
@media (max-width: 720px) { .gridrow { grid-template-columns: 30px 1fr; } .gridrow.head span:nth-child(n+3) { display: none; }
  .gridrow input[name=acc], .gridrow input[name=cap] { grid-column: 2; } }
