/* The Character Training Lab (admin). */
.lab-page { max-width: 1280px; margin: 0 auto; padding: 14px 18px 40px; }
.lab-modes { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 10px; margin-top: 6px; }
.lab-mode { text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: var(--radius); background: var(--panel-2); border: 1px solid var(--line); cursor: pointer; }
.lab-mode:hover { border-color: var(--line-2); } .lab-mode.on { border-color: var(--accent); background: var(--accent-bg); }
.lab-sessions { display: flex; flex-direction: column; gap: 8px; }
.lab-srow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); }
.lab-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.lab-grid { display: grid; grid-template-columns: 300px 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .lab-grid { grid-template-columns: 1fr; } }
.lab-side { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; max-height: calc(100vh - 150px); overflow: auto; position: sticky; top: 0; }
.lab-prog { margin-bottom: 8px; } .lab-bar { height: 6px; background: var(--panel-3); border-radius: 6px; overflow: hidden; margin-bottom: 4px; } .lab-bar i { display: block; height: 100%; background: var(--ok); border-radius: 6px; transition: width .3s; }
.lab-gname { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint); margin: 10px 4px 3px; }
.lab-item { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 6px 8px; border-radius: var(--radius-s); background: none; border: 0; cursor: pointer; color: var(--text); }
.lab-item:hover { background: var(--panel-2); } .lab-item.cur { background: var(--accent-bg); }
.lab-dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--line-2); flex: none; }
.lab-item.accepted .lab-dot { background: var(--ok); border-color: var(--ok); } .lab-item.rejected .lab-dot, .lab-item.failed .lab-dot { border-color: var(--danger); background: var(--danger-bg); } .lab-item.analysing .lab-dot { border-color: var(--warn); }
.lab-it { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .lab-st { font-size: 11px; color: var(--muted); flex: none; }
.lab-item.rejected .lab-st, .lab-item.failed .lab-st { color: var(--danger); } .lab-item.accepted .lab-st { color: var(--ok); }
.lab-main { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.lab-stage { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.lab-ttitle { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; } .lab-ttitle h2 { margin: 0; }
.lab-do { font-size: 15px; line-height: 1.55; margin: 6px 0 0; }
.lab-say { margin-top: 8px; padding: 14px 16px; background: var(--bg-2); border-left: 3px solid var(--accent); border-radius: var(--radius-s); font-size: 22px; line-height: 1.6; }
.lab-cam { display: flex; flex-direction: column; gap: 6px; align-items: center; }
.lab-camwrap { position: relative; width: min(100%, 720px); aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); overflow: hidden; }
.lab-video, .lab-playback { width: min(100%, 720px); aspect-ratio: 16 / 9; background: #000; border-radius: var(--radius); object-fit: cover; }
.lab-camwrap .lab-video { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); }
.lab-oval { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border: 2px dashed rgba(255, 255, 255, .55); border-radius: 50%; pointer-events: none; }
.lab-oval.close { width: 34%; height: 78%; } .lab-oval.medium { width: 28%; height: 60%; top: 40%; } .lab-oval.wide { width: 21%; height: 46%; top: 34%; }
.lab-veil { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 120px; font-weight: 700; color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, .7); pointer-events: none; }
.lab-camtools { display: flex; gap: 10px; align-items: center; width: min(100%, 720px); flex-wrap: wrap; }
.lab-meter { flex: 1 1 120px; height: 8px; background: var(--panel-3); border-radius: 8px; overflow: hidden; } .lab-meter i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .08s; } .lab-meter i.hot { background: var(--danger); }
.lab-time { font: 600 18px var(--mono); color: var(--danger); }
.btn.danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.lab-verdict { padding: 12px 14px; border-radius: var(--radius); border: 1px solid var(--line); background: var(--panel-2); display: flex; flex-direction: column; gap: 6px; }
.lab-verdict.good { border-color: var(--ok); } .lab-verdict.bad { border-color: var(--danger); background: var(--danger-bg); } .lab-verdict.wait { border-color: var(--warn); }
.lab-verdict ul { margin: 2px 0 0 18px; padding: 0; } .lab-checks li.ok { color: var(--ok); } .lab-checks li.bad { color: var(--danger); } .lab-checks li.warn { color: var(--warn); }
.lab-portraits { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.lab-pt { padding: 0; border: 3px solid transparent; border-radius: var(--radius); background: none; cursor: pointer; overflow: hidden; } .lab-pt.on { border-color: var(--accent); } .lab-pt img { display: block; width: 100%; }
.lab-steps { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.lab-step { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--radius); flex-wrap: wrap; }

.lab-probes { width: 100%; border-collapse: collapse; } .lab-probes th, .lab-probes td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); } .lab-probes th { color: var(--muted); font-weight: 550; font-size: 12px; }

/* the lab outside the creator's frame */
body.lab-mode #side, body.lab-mode #topnav, body.lab-mode #activity { display: none !important; }
.lab-shell { display: flex; flex-direction: column; min-height: 100%; }
.lab-bar { display: flex; align-items: center; gap: 12px; padding: 10px 18px; border-bottom: 1px solid var(--line-2); background: var(--bg-2); position: sticky; top: 0; z-index: 5; }
.lab-bar .grow { flex: 1; }
.lab-live { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel-2); }
.lab-hint { font-weight: 600; } .lab-hint.good { color: var(--ok); }
.lab-live .lab-checks { margin: 0 0 0 18px; padding: 0; }

.lab-track { position: absolute; inset: 0; width: 100%; height: 100%; transform: scaleX(-1); pointer-events: none; }
.lab-coach { position: absolute; left: 12px; right: 12px; top: 12px; padding: 10px 14px; border-radius: 12px; font-size: 20px; font-weight: 700; line-height: 1.3; text-align: center; color: #fff; background: rgba(15, 23, 42, .72); border: 2px solid #60a5fa; text-shadow: 0 1px 6px rgba(0, 0, 0, .6); pointer-events: none; transition: border-color .2s, background .2s; }
.lab-coach.good { border-color: #34d399; background: rgba(6, 78, 59, .78); } .lab-coach.warn { border-color: #fbbf24; background: rgba(120, 53, 15, .78); } .lab-coach.bad { border-color: #f87171; background: rgba(127, 29, 29, .8); }
.lab-pbar { position: absolute; left: 12px; right: 12px; bottom: 12px; height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .22); overflow: hidden; pointer-events: none; }
.lab-pbar i { display: block; height: 100%; width: 0; background: #34d399; transition: width .25s ease; }
.lab-rep { position: absolute; right: 14px; bottom: 28px; padding: 4px 10px; border-radius: 10px; font-weight: 700; color: #fff; background: rgba(15, 23, 42, .72); pointer-events: none; }
.lab-rep:empty { display: none; }

/* COMPACT, ONE-SCREEN LAYOUT (24 Oct 2026): the camera on the left at the height the screen allows, the take, every button, the coach's checks and the script on the right - nothing needs scrolling on a laptop. */
.lab-page { padding: 8px 12px 24px; max-width: 1500px; }
.lab-head { margin-bottom: 6px; } .lab-h1 { margin: 0; font-size: 20px; }
.lab-grid { grid-template-columns: 220px minmax(0, 1fr); gap: 10px; }
.lab-side { max-height: calc(100vh - 100px); top: 52px; padding: 8px; }
.lab-group .lab-gname, .lab-gname { margin: 8px 4px 2px; }
.lab-item { padding: 4px 8px; font-size: 13.5px; }
.lab-stage { padding: 10px; gap: 8px; }
.lab-split { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(290px, 1fr); gap: 12px; align-items: start; }
.lab-cam { align-items: stretch; gap: 6px; }
.lab-camwrap { width: 100%; aspect-ratio: auto; height: clamp(230px, calc(100vh - 205px), 680px); }
.lab-video, .lab-playback { width: 100%; aspect-ratio: auto; }
.lab-playback { height: clamp(230px, calc(100vh - 205px), 680px); object-fit: contain; }
.lab-camtools { width: 100%; }
.lab-right { display: flex; flex-direction: column; gap: 8px; min-width: 0; max-height: calc(100vh - 205px); min-height: 230px; overflow: auto; padding-right: 2px; }
.lab-take h2 { font-size: 18px; margin: 0; } .lab-do { font-size: 14px; line-height: 1.45; margin: 4px 0 0; }
.lab-right .row.gap.wrap { gap: 6px; } .lab-right .btn { padding: 6px 12px; font-size: 13.5px; }
.lab-say { margin-top: 0; padding: 10px 12px; font-size: 17px; line-height: 1.5; max-height: 28vh; overflow: auto; }
.lab-live, .lab-verdict { padding: 8px 10px; font-size: 13.5px; }
.lab-live .lab-checks, .lab-verdict ul { margin-left: 16px; }
.lab-coach { font-size: clamp(15px, 2.1vw, 20px); padding: 8px 12px; top: 8px; left: 8px; right: 8px; }
.lab-veil { font-size: 90px; }
.lab-steps { padding: 10px; gap: 8px; }
@media (max-width: 980px) {
  .lab-grid { grid-template-columns: 1fr; }
  .lab-side { position: static; max-height: 220px; }
  .lab-split { grid-template-columns: 1fr; }
  .lab-camwrap, .lab-playback { height: clamp(200px, 44vh, 420px); }
  .lab-right { max-height: none; overflow: visible; }
}
@media (max-height: 640px) { .lab-camwrap, .lab-playback { height: clamp(200px, calc(100vh - 175px), 680px); } .lab-right { max-height: calc(100vh - 175px); } }
