:root {
  --bg: #0e1116; --panel: #171c24; --panel2: #1e2530; --border: #2a3342;
  --text: #e6ebf2; --muted: #8b98ab; --accent: #4f8ff7; --ok: #3fb87f;
  --warn: #e0a63a; --bad: #e05a5a; --radius: 10px;
}
* { box-sizing: border-box; margin: 0; }
body { background: var(--bg); color: var(--text); font: 15px/1.5 system-ui, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }

header { display: flex; align-items: center; gap: 24px; padding: 10px 20px;
  background: var(--panel); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.brand { font-size: 17px; white-space: nowrap; }
nav { display: flex; gap: 4px; flex: 1; }
nav a { padding: 6px 14px; border-radius: 8px; color: var(--muted); }
nav a.active, nav a:hover { background: var(--panel2); color: var(--text); }
.user { display: flex; gap: 10px; align-items: center; color: var(--muted); }

main { max-width: 1280px; margin: 0 auto; padding: 24px 20px 60px; }
h1 { font-size: 22px; margin-bottom: 16px; }
h2 { font-size: 17px; margin: 18px 0 10px; }
.loading, .empty { color: var(--muted); padding: 40px; text-align: center; }

button, .btn { background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 8px 16px; font-size: 14px; cursor: pointer; }
button:hover { filter: brightness(1.1); }
button.ghost { background: transparent; border: 1px solid var(--border); color: var(--muted); }
button.ok { background: var(--ok); } button.bad { background: var(--bad); }
button:disabled { opacity: .5; cursor: default; }
input, select { background: var(--panel2); border: 1px solid var(--border); color: var(--text);
  border-radius: 8px; padding: 9px 12px; font-size: 14px; }
input:focus, select:focus { outline: 1px solid var(--accent); }

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.stat { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.stat .v { font-size: 26px; font-weight: 700; } .stat .l { color: var(--muted); font-size: 13px; }

.searchbar { display: flex; gap: 10px; margin-bottom: 8px; }
.searchbar input[type=text] { flex: 1; font-size: 16px; padding: 12px 16px; }
.hints { color: var(--muted); font-size: 13px; margin-bottom: 16px; }
.hints span { cursor: pointer; border-bottom: 1px dashed var(--muted); margin-right: 10px; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }

.results { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.result { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; cursor: pointer; transition: transform .1s; }
.result:hover { transform: translateY(-2px); border-color: var(--accent); }
.result img { width: 100%; height: 160px; object-fit: cover; background: #000; display: block; }
.result .body { padding: 12px 14px; }
.result .title { font-weight: 600; display: flex; justify-content: space-between; }
.result .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 12px;
  background: var(--panel2); color: var(--muted); margin-right: 6px; }
.badge.detector { background: #14351f; color: var(--ok); }
.badge.semantic, .badge.semantic_frame { background: #1d2c4a; color: #7fa8ff; }
.badge.open_vocab { background: #3a2a12; color: var(--warn); }
.badge.confirmed { background: #14351f; color: var(--ok); }
.badge.rejected { background: #3a1515; color: var(--bad); }
.conf { font-variant-numeric: tabular-nums; }

table { width: 100%; border-collapse: collapse; background: var(--panel);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: 10px 14px; border-bottom: 1px solid var(--border); font-size: 14px; }
th { color: var(--muted); font-weight: 600; background: var(--panel2); }
tr:hover td { background: var(--panel2); }
.progressbar { background: var(--panel2); border-radius: 6px; height: 8px; width: 120px; }
.progressbar div { background: var(--accent); height: 8px; border-radius: 6px; }

.player-wrap { position: relative; background: #000; border-radius: var(--radius); overflow: hidden; }
video { width: 100%; display: block; max-height: 70vh; }
#overlay { position: absolute; inset: 0; pointer-events: none; }
.player-controls { display: flex; gap: 10px; margin: 12px 0; flex-wrap: wrap; align-items: center; }
.timecode { font-family: monospace; font-size: 15px; color: var(--accent); }

.drop { border: 2px dashed var(--border); border-radius: var(--radius); padding: 40px;
  text-align: center; color: var(--muted); margin: 14px 0; }
.drop.over { border-color: var(--accent); }
form.inline { display: flex; gap: 10px; flex-wrap: wrap; align-items: end; margin: 10px 0; }
form.inline label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.note { background: var(--panel2); border-left: 3px solid var(--accent); padding: 10px 14px;
  border-radius: 6px; color: var(--muted); font-size: 13px; margin: 12px 0; }
.tl { position: relative; height: 46px; background: var(--panel2); border-radius: 8px; margin: 8px 0; }
.tl .seg { position: absolute; top: 8px; height: 12px; border-radius: 3px; background: var(--accent);
  opacity: .8; cursor: pointer; min-width: 3px; }
.tl .seg.ov { top: 26px; background: var(--warn); }
