*{box-sizing:border-box}
html,body{margin:0;padding:0;background:#0f0f12;color:#e8e8ee;font-family:"맑은 고딕",system-ui,-apple-system,sans-serif}
.topbar{height:44px;background:#1a1a22;display:flex;align-items:center;justify-content:space-between;padding:0 12px;position:sticky;top:0;z-index:10}
.brand{font-weight:800;font-size:14px}
.badge{font-size:11px;color:#8a8a9a;background:#252532;padding:4px 8px;border-radius:999px}
.layout{display:flex;flex-direction:row;gap:12px;padding:12px;max-width:1280px;margin:0 auto}
.video-wrap{flex:1.6;position:relative;background:#000;border-radius:12px;overflow:hidden;min-height:360px;display:flex;align-items:center;justify-content:center;aspect-ratio:4/3}
video{width:100%;height:100%;object-fit:cover;display:block;transform:scaleX(-1)}
video.mirror-off{transform:none}
canvas{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}
.video-bar{position:absolute;bottom:0;left:0;right:0;height:28px;background:rgba(20,20,28,0.9);display:flex;align-items:center;gap:12px;padding:0 10px;font-size:12px;backdrop-filter:blur(6px)}
.video-bar #fps{color:#7af0a0;font-weight:700;font-family:Consolas,monospace}
.video-bar #hands{color:#70b8ff;font-weight:700}
.video-bar #res{margin-left:auto;color:#8a8a9a;font-size:11px}
.status{color:#ffaa55}
.loading{position:absolute;inset:0;background:rgba(0,0,0,0.85);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;z-index:5}
.loading small{color:#8a8a9a}
.spinner{width:28px;height:28px;border:3px solid #333;border-top-color:#2d7bff;border-radius:50%;animation:spin 1s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}
.panel{flex:0 0 360px;display:flex;flex-direction:column;gap:10px;max-height:calc(100vh - 68px);overflow:auto}
.card{background:#1e1e26;border-radius:12px;padding:12px}
.card-title{font-weight:800;font-size:13px;margin-bottom:8px}
.row{display:flex;gap:8px;align-items:center;flex-wrap:wrap;margin:6px 0}
.row.small{font-size:13px}
.btn{flex:1;padding:10px 12px;border:0;border-radius:8px;font-weight:700;cursor:pointer}
.btn.primary{background:#2d7bff;color:#fff}
.btn.ghost{background:#2a2a32;color:#e8e8ee}
.btn.sm{padding:8px 10px;font-size:12px;flex:1}
label{font-size:13px;display:flex;align-items:center;gap:6px}
select, input[type=range]{accent-color:#2d7bff}
pre{margin:0;background:#111118;border-radius:8px;padding:8px;font-size:11px;line-height:1.4;max-height:220px;overflow:auto;white-space:pre-wrap;word-break:break-all;font-family:Consolas,monospace}
.legend-row{display:flex;gap:10px;flex-wrap:wrap;margin:6px 0;font-size:12px}
.dot{width:10px;height:10px;border-radius:50%;display:inline-block;border:1px solid #fff;vertical-align:middle;margin-right:4px}
.line{width:16px;height:3px;display:inline-block;vertical-align:middle;margin-right:4px}
.tip small{color:#8a8a9a;line-height:1.5}
@media(max-width:900px){
  .layout{flex-direction:column}
  .panel{flex:1;max-height:none}
  .video-wrap{aspect-ratio:3/4;min-height:420px}
}
