/* jomijo Teleprompter - the studio layout (the same as Explainer's: the top bar, the stage, the bar under it, the
   panel on the right; stacked on a phone) and the script over the stage. app.css (shared by every app) gives the
   buttons, fields and dialogs. */
:root { --accent: #f59e0b; --accent-2: #fcd34d; --psize: 34px; --pwf: 0.5; --ph: clamp(170px, 27vh, 300px); }
html, body.lb { height: 100%; }
body.lb { display: flex; flex-direction: column; overflow: hidden; position: relative; }
/* the bar sits under the video (the top of the screen is the script's, next to the camera) */
.lbtop { gap: 10px; flex-wrap: nowrap; padding-top: 8px; padding-bottom: 8px; position: static; border-bottom: 0; border-top: 1px solid var(--line); }
.lbtop h1 { white-space: nowrap; }
.grow { flex: 1; }
.seg2 { display: inline-flex; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; flex: none; }
.seg2 button { background: var(--panel-2); border: 0; padding: 7px 10px; font-weight: 700; font-size: 13px; cursor: pointer; color: var(--muted); }
.seg2 button[aria-pressed="true"] { background: color-mix(in srgb, var(--accent) 22%, var(--panel-2)); color: var(--ink); }
#camBtn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-2); }
.btn.primary { color: #2a1a00; }
.btn.stop { color: #fff; }

.lbwrap { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-rows: minmax(0, 1fr); }
.stagebox { display: flex; flex-direction: column; min-width: 0; min-height: 0; padding-top: var(--ph); background: #07060a; }
.lbstage { position: relative; flex: 1; min-height: 0; overflow: hidden; display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, #1d1a10, #07060a 75%); }
.frame { position: relative; border-radius: 6px; overflow: hidden; box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55); background: #000; }
#out { position: absolute; inset: 0; width: 100%; height: 100%; cursor: default; }
.lbstage .over { z-index: 6; font-size: 140px; }
.lbstage .recdot { z-index: 5; }
.recdot.paused { background: #f59e0b; animation: none; }
.toast { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); background: rgba(12, 17, 36, 0.94); border: 1px solid var(--line); padding: 8px 14px; border-radius: 12px; font-size: 13px; font-weight: 600; z-index: 7; max-width: min(560px, 90%); text-align: center; }
.hear { position: absolute; top: 12px; right: 12px; z-index: 5; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 50%; background: rgba(12, 17, 36, 0.8); font-size: 15px; transition: box-shadow 0.15s; }
.hear.on { box-shadow: 0 0 0 3px var(--accent); }

/* the script: at the very top of the screen, right under the camera. On a laptop it is centred on the SCREEN (the
   webcam), not on the video; its width is a share of the screen (Look → Width, or drag an edge) - a narrow column
   keeps your eyes, and your head, still. On a phone it lies over the top of the video, under the front camera. The
   line you are on sits on the reading line. */
.prompt { position: absolute; top: 0; left: 50%; transform: translateX(-50%); width: calc(var(--pwf) * 100%); min-width: 240px; height: var(--ph); z-index: 4; overflow: hidden; border-radius: 0 0 16px 16px;
  background: rgba(5, 6, 12, 0.78); backdrop-filter: blur(2px); -webkit-mask-image: linear-gradient(transparent, #000 10%, #000 82%, transparent); mask-image: linear-gradient(transparent, #000 10%, #000 82%, transparent); }
.prompt.flipx { transform: translateX(-50%) scaleX(-1); }
.ptext { padding: 0 6%; font: 700 var(--psize)/1.35 var(--font); color: #fff; transition: transform 0.45s cubic-bezier(.2, .7, .2, 1); will-change: transform; }
.ptext p { margin: 0 0 0.7em; }
.ptext .w { cursor: pointer; border-radius: 6px; transition: color 0.2s, background 0.2s; }
.ptext .w.read { color: rgba(255, 255, 255, 0.38); }
.ptext .w.cur { color: #1a1200; background: var(--accent-2); box-shadow: 0 0 0 3px var(--accent-2); }
.ptext .pz { font-size: 0.6em; vertical-align: middle; color: var(--accent-2); opacity: 0.8; }
.ptext .empty { color: rgba(255, 255, 255, 0.5); font-weight: 600; font-size: 0.6em; }
/* the edges: drag to resize (both sides move, so it stays centred) */
.pgrip { position: absolute; top: 50%; width: 22px; height: 64px; margin-top: -32px; cursor: ew-resize; touch-action: none; z-index: 1; opacity: 0.35; transition: opacity 0.2s; }
.pgrip::after { content: ""; position: absolute; top: 8px; bottom: 8px; left: 8px; width: 6px; border-radius: 3px; background: #fff; }
.pgrip.l { left: 2px; } .pgrip.r { right: 2px; }
.prompt:hover .pgrip, body.sizing .pgrip { opacity: 0.9; } body.sizing, body.sizing * { cursor: ew-resize !important; user-select: none; }
body.recording .pgrip { display: none; }
.pline { position: absolute; left: 0; width: 5px; top: 33%; height: calc(var(--psize) * 1.35); border-radius: 0 4px 4px 0; background: var(--accent); pointer-events: none; }

/* the bar under the stage */
.optbar { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-height: 54px; padding: 8px 12px; border-top: 1px solid var(--line); background: var(--panel); }
.obgrp { display: inline-flex; align-items: center; gap: 6px; }
.obgrp[hidden] { display: none; }
.obgrp input[type=range] { width: 110px; padding: 0; border: 0; background: none; accent-color: var(--accent); }
.ob { height: 34px; min-width: 34px; padding: 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--panel-2); cursor: pointer; font-weight: 700; font-size: 13px; white-space: nowrap; }
.ob:hover { border-color: var(--muted); } .ob:disabled { opacity: 0.35; cursor: default; }
.oblab { font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.obtip { font-size: 13px; color: var(--muted); flex: 1 1 140px; min-width: 0; }
.obsep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
#rehearse[aria-pressed="true"] { border-color: var(--accent); color: var(--accent-2); }

/* the panel */
.side { border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; gap: 12px; padding: 12px 16px 16px; min-width: 0; min-height: 0; overflow-y: auto; }
.setbox { border: 1px solid var(--line); border-radius: 12px; padding: 4px 12px 10px; background: var(--panel-2); flex: none; }
.setbox summary { cursor: pointer; font-weight: 700; padding: 6px 0; }
.setbox input[type=range] { padding: 0; accent-color: var(--accent); border: 0; background: none; }
.listrow { display: flex; gap: 6px; margin: 4px 0 8px; } .listrow select { flex: 1; min-width: 0; padding: 6px 10px; }
.notes { width: 100%; min-height: 220px; resize: vertical; font: 500 16px/1.55 var(--font); padding: 12px 14px; border-radius: 12px; }
.paste { min-height: 90px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.checkrow { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: 14px; cursor: pointer; }
.checkrow input { width: auto; accent-color: var(--accent); }
.tints { flex-wrap: wrap; } .tints button { display: inline-flex; align-items: center; gap: 6px; }
.tintdot { width: 12px; height: 12px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, 0.4); }
.tintdot.none { background: linear-gradient(135deg, transparent 45%, #ef4444 45% 55%, transparent 55%); } .tintdot.black { background: #000; } .tintdot.grey { background: #4a525c; } .tintdot.white { background: #fff; }
.small { font-size: 12px; } .top0 { margin-top: 0; }
kbd { display: inline-block; min-width: 20px; padding: 0 5px; border-radius: 6px; border: 1px solid var(--line); background: var(--panel); font: 600 11px/18px var(--font); text-align: center; }

/* while recording: the shape and the camera can't change, the script can't be edited */
body.recording .lbtop .seg2, body.recording #camBtn, body.recording #flip, body.recording #rehearse, body.recording [data-mode] { opacity: 0.4; pointer-events: none; }
body.recording #script { opacity: 0.5; pointer-events: none; }

@media (max-width: 1100px) { .lbwrap { grid-template-columns: minmax(0, 1fr) 300px; } .h1t { display: none; } }
/* a phone: the video at the top with the script over its top part (under the front camera), every control under it */
@media (max-width: 860px) {
  body.lb { overflow: auto; height: auto; padding-top: env(safe-area-inset-top); } .lbtop { flex-wrap: wrap; }
  .lbwrap { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto auto; } .stagebox { padding-top: 0; }
  .lbstage { height: 70vh; height: 70dvh; flex: none; place-items: end center; }   /* a 16:9 video sits low, out from under the script */
  .side { border-left: 0; border-top: 1px solid var(--line); }
  .prompt { top: env(safe-area-inset-top); width: calc((100% - 12px) * var(--pwf)); height: 30vh; height: 30dvh; }
  .lbstage .recdot, .lbstage .hear { top: auto; bottom: 18px; } .lbstage .toast { bottom: 56px; }
  /* recording on a phone: only the video, Pause and Stop */
  body.recording .side, body.recording .optbar, body.recording .home, body.recording .lbtop h1, body.recording .lbtop .seg2, body.recording #camBtn, body.recording #flip, body.recording .lbtop .grow { display: none; }
  body.recording .lbtop { justify-content: center; }
  body.recording { overflow: hidden; height: 100%; } body.recording .lbstage { height: calc(100dvh - 64px - env(safe-area-inset-top)); }
}
