/* Live Avatar */
.live { max-width: 1500px; }
.live-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.live-head h1 { margin-bottom: 4px; }
.live-steps { display: flex; gap: 8px; }
.live-grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 18px; align-items: start; }
@media (max-width: 1050px) { .live-grid { grid-template-columns: 1fr; } }
.live-main { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.live-toolbar { justify-content: space-between; }
.seg { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.live-stage { display: grid; gap: 10px; background: #05070c; border: 1px solid var(--line); border-radius: 12px; padding: 10px; width: 100%; }
.live-stage[data-layout='side'] { grid-template-columns: 1fr 1fr; }
.live-stage[data-layout='stack'], .live-stage[data-layout='avatar'] { grid-template-columns: 1fr; }
.live-pane { position: relative; background: #000; border-radius: 8px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.live-pane video, .live-pane canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.live-stage[data-output='vertical'] .live-pane { aspect-ratio: 9 / 16; max-height: 62vh; margin: 0 auto; width: auto; }
.live-stage[data-output='vertical'][data-layout='side'] .live-pane { max-height: 62vh; }
.live-stage[data-output='square'] .live-pane { aspect-ratio: 1; max-height: 62vh; margin: 0 auto; }
.live-stage[data-output='wide'] .live-pane { aspect-ratio: 16 / 9; }
.live-stage[data-layout='stack'][data-output='vertical'] .live-pane { max-height: 44vh; }
.live-pane canvas { object-fit: contain; }
.live-tag { position: absolute; left: 8px; top: 8px; background: rgba(0, 0, 0, .55); color: #fff; font-size: 11px; padding: 2px 8px; border-radius: 999px; }
.live-stage.recording { border-color: var(--danger); box-shadow: 0 0 0 2px rgba(255, 107, 107, .35); }
.live-stats { display: flex; gap: 6px; flex-wrap: wrap; min-height: 24px; }
.live-chip { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line-2); font-size: 12px; color: var(--muted); background: var(--panel); }
.live-chip.ok { color: var(--ok); border-color: rgba(62, 207, 142, .5); } .live-chip.warn { color: var(--warn); border-color: rgba(245, 185, 66, .5); }
.live-actions { align-items: center; }
.live-timer { font: 600 15px var(--mono); color: var(--danger); }
.rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--danger); display: inline-block; }
.btn.rec:disabled .rec-dot { opacity: .4; }
.live-stage.recording ~ .live-actions .rec-dot, .live-stage.recording + .live-stats + .live-status + .live-actions .rec-dot { animation: livepulse 1s infinite; }
@keyframes livepulse { 50% { opacity: .25; } }
.live-sel { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 8px; max-width: 220px; }
.live-srcrow { align-items: center; }
.live-side { background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 12px; position: sticky; top: 8px; max-height: calc(100vh - 80px); overflow: auto; }
.live-tabs { flex-wrap: wrap; margin-bottom: 10px; }
.live-tab { display: flex; flex-direction: column; gap: 8px; }
.live-row { display: grid; grid-template-columns: 130px 1fr 62px; align-items: center; gap: 8px; font-size: 13px; }
.live-row.toggle { grid-template-columns: 22px 1fr; }
.live-row select { grid-column: 2 / 4; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 7px; padding: 4px 8px; }
.live-row input[type=range] { width: 100%; }
.live-val { text-align: right; color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.live-h { margin: 8px 0 2px; font-size: 12.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.live-chars { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; max-height: 330px; overflow: auto; }
.live-char { position: relative; display: flex; flex-direction: column; gap: 4px; align-items: center; padding: 6px; background: var(--panel-2); border: 2px solid var(--line); border-radius: 10px; cursor: pointer; color: var(--text); font-size: 12px; }
.live-char img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 7px; }
.live-char.on { border-color: var(--accent); background: var(--accent-bg); }
.live-char.add { justify-content: center; min-height: 110px; color: var(--muted); border-style: dashed; }
.live-badge { position: absolute; right: 8px; top: 8px; font-size: 10px; background: var(--video); color: #fff; padding: 1px 6px; border-radius: 999px; font-style: normal; }
.ok-text { color: var(--ok); } .err-text { color: var(--danger); }
.live-looks { display: flex; gap: 6px; flex-wrap: wrap; }
.live-bars { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.live-bar { display: grid; grid-template-columns: 140px 1fr; gap: 8px; font-size: 11px; color: var(--muted); align-items: center; }
.live-bar i, .live-meter { display: block; height: 7px; background: var(--panel-3); border-radius: 4px; overflow: hidden; width: 100%; }
.live-bar b, .live-meter b { display: block; height: 100%; background: var(--accent); width: 0; transition: width .06s; }
.live-meter { grid-column: 2 / 4; }
.live-voices { display: flex; flex-direction: column; }
.live-card { display: flex; flex-direction: column; gap: 10px; padding: 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.live-card.ok { border-color: rgba(62, 207, 142, .5); } .live-card.err { border-color: rgba(255, 107, 107, .5); }
.live-play { width: 100%; max-height: 60vh; background: #000; border-radius: 8px; }
.live-history { margin-top: 22px; }
.live-hlist { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-top: 10px; }
.live-hitem { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.live-hitem video, .live-hwait { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; background: #000; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.live-hmeta { padding: 10px; display: flex; flex-direction: column; gap: 4px; }
.live-det summary { cursor: pointer; }
/* the neutral-face calibration step shown over the character while the person holds a relaxed face (about a second) */
.live-cal { position: absolute; left: 8px; right: 8px; bottom: 8px; padding: 8px 12px; border-radius: 8px; background: rgba(15, 17, 26, .78); color: #fff; font-size: 13px; display: flex; flex-direction: column; gap: 6px; pointer-events: none; }
.live-cal[hidden] { display: none; }
.live-cal i { display: block; height: 5px; border-radius: 3px; background: rgba(255, 255, 255, .25); overflow: hidden; }
.live-cal b { display: block; height: 100%; width: 0; background: var(--accent); transition: width .08s; }
/* the expression meter: what the tracker sees (grey, behind) and what the character shows (colour, in front) */
.live-bar i.two { position: relative; }
.live-bar i.two b { position: absolute; left: 0; top: 0; }
.live-bar i.two b.raw { background: var(--line-2); }

/* mode switch and "What it learned" (22 Oct 2026) */
.live-mode { align-items: center; margin-bottom: .6rem; flex-wrap: wrap; }
.live-learn-sec { margin-top: .9rem; }
.live-learn-list { display: grid; gap: .5rem; }
.live-learn-item { display: grid; grid-template-columns: 9rem 1fr auto; gap: .6rem; align-items: center; padding: .5rem .6rem; border: 1px solid var(--border, #333); border-radius: 8px; }
.live-learn-meta input { width: 100%; }
.live-spark { display: grid; gap: 2px; }
.live-spark-row { display: grid; grid-template-columns: 1fr 3rem; gap: .3rem; font-size: .7rem; align-items: center; }
.live-spark-row i { font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; opacity: .75; }
.live-spark-row b { display: block; height: 5px; border-radius: 3px; background: var(--accent, #7c5cff); }
.live-bar { display: grid; grid-template-columns: 9rem 1fr 3.5rem; gap: .5rem; align-items: center; font-size: .8rem; }
.live-bar i.two { position: relative; display: block; height: 7px; border-radius: 4px; background: rgba(255,255,255,.08); overflow: hidden; }
.live-bar i.two b { position: absolute; left: 0; top: 0; height: 100%; background: var(--accent, #7c5cff); }
.live-bar i.two b.raw { opacity: .35; }
@media (max-width: 640px) { .live-learn-item { grid-template-columns: 1fr; } }
