:root { color-scheme: dark; }
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; background: #0b0f14; color: #e6edf3; font: 14px/1.4 system-ui, -apple-system, sans-serif; }
main { max-width: 720px; margin: 0 auto; padding: env(safe-area-inset-top) 16px env(safe-area-inset-bottom); display: flex; flex-direction: column; gap: 12px; }
.stage { position: relative; width: 100%; aspect-ratio: var(--video-aspect, 4 / 3); background: #000; border-radius: 12px; overflow: hidden; }
video, canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
video { transform: scaleX(-1); }
canvas { transform: scaleX(-1); pointer-events: none; }
#hud { position: absolute; left: 8px; top: 8px; display: flex; gap: 8px; padding: 4px 8px; background: rgba(0,0,0,0.45); border-radius: 6px; font-variant-numeric: tabular-nums; font-size: 12px; }
.controls { display: flex; gap: 8px; flex-wrap: wrap; }
button, .file-btn { flex: 1; padding: 10px 14px; border-radius: 8px; border: 1px solid #2a3340; background: #131a23; color: inherit; font: inherit; cursor: pointer; text-align: center; }
button:disabled, .file-btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
button:not(:disabled):hover, .file-btn:hover { background: #1a2330; }
#blendshapes { display: flex; flex-direction: column; gap: 4px; min-height: 0; }
#blendshapes:empty { display: none; }
.bs { display: grid; grid-template-columns: 9em 1fr 2.5em; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; font-size: 12px; }
.bs-name { opacity: 0.85; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bs-bar { background: #131a23; border-radius: 4px; height: 8px; overflow: hidden; }
.bs-bar > span { display: block; height: 100%; background: linear-gradient(90deg, #6ea3ff, #a36eff); }
.bs-val { text-align: right; opacity: 0.7; }
.lip-panel { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; background: #0f151d; border: 1px solid #2a3340; border-radius: 10px; }
.lip-row { display: grid; grid-template-columns: 4.5em 1fr auto; gap: 10px; align-items: center; }
.lip-viseme { font-weight: 600; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 6px; background: #131a23; text-align: center; transition: background 0.1s, color 0.1s; }
.lip-viseme.speaking { background: #6ea3ff; color: #06101f; }
.lip-meter { background: #131a23; border-radius: 4px; height: 8px; overflow: hidden; }
.lip-meter > span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #6effa3, #6ea3ff); transition: width 0.06s linear; }
.lip-word { font-variant-numeric: tabular-nums; min-width: 9em; text-align: right; opacity: 0.95; }
.lip-vocab { font-size: 12px; opacity: 0.7; }
.lip-panel input[type="text"] { flex: 1; padding: 10px 12px; border-radius: 8px; border: 1px solid #2a3340; background: #131a23; color: inherit; font: inherit; }
.note { opacity: 0.7; font-size: 12px; margin: 0; }
