:root { --bg:#f7f7f8; --fg:#1b1b1f; --muted:#5d5d66; --card:#fff; --line:#dcdce2; --accent:#0a7d5a; }
@media (prefers-color-scheme: dark) {
  :root { --bg:#121214; --fg:#ececf0; --muted:#a0a0ab; --card:#1c1c20; --line:#33333a; --accent:#3ccf9a; }
}
* { box-sizing: border-box; }
body { margin:0; padding:16px; font:15px/1.5 system-ui, -apple-system, sans-serif; background:var(--bg); color:var(--fg); }
header h1 { margin:0 0 4px; font-size:22px; }
.sub, .status { color:var(--muted); margin:0 0 12px; }
.controls { display:flex; flex-wrap:wrap; gap:8px; align-items:end; margin-bottom:8px; }
label { display:flex; flex-direction:column; font-size:12px; color:var(--muted); gap:2px; }
select, button, .file { font:inherit; padding:7px 12px; border-radius:8px; border:1px solid var(--line); background:var(--card); color:var(--fg); }
button { cursor:pointer; }
button:hover { border-color:var(--accent); }
.file input { max-width:190px; }
.stage { background:#000; border-radius:10px; overflow:hidden; max-width:100%; }
/* keep the whole frame on screen: limit height, keep aspect ratio (toVideoXY uses the real rect) */
canvas { display:block; width:auto; height:auto; max-width:100%; max-height:70vh; margin:0 auto; cursor:crosshair; touch-action:none; }
.stats { display:grid; grid-template-columns:repeat(auto-fit,minmax(140px,1fr)); gap:8px; margin-top:12px; }
.stats div { background:var(--card); border:1px solid var(--line); border-radius:8px; padding:8px 12px; }
.stats span { display:block; font-size:12px; color:var(--muted); }
.stats b { font-variant-numeric:tabular-nums; font-size:18px; }
.models { margin-top:24px; }
.models h2 { font-size:18px; margin:0 0 4px; }
.table-wrap { overflow-x:auto; background:var(--card); border:1px solid var(--line); border-radius:10px; }
table { width:100%; border-collapse:collapse; font-size:14px; }
th, td { text-align:left; padding:8px 12px; border-bottom:1px solid var(--line); vertical-align:top; }
tr:last-child td { border-bottom:none; }
th { font-size:12px; color:var(--muted); font-weight:600; }
.note { font-size:12px; color:var(--muted); max-width:420px; }
.links a { color:var(--accent); white-space:nowrap; }
.badge { font-size:12px; padding:2px 8px; border-radius:999px; border:1px solid var(--line); white-space:nowrap; }
.badge.ready { color:var(--accent); border-color:var(--accent); }
.badge.test, .badge.untrained { color:var(--muted); }
code { font-size:12px; }
label.check { flex-direction:row; align-items:center; gap:6px; padding:7px 12px; border:1px solid var(--line); border-radius:8px; background:var(--card); color:var(--fg); font-size:14px; }
