/* Online video recorder. Base look: ../shared/theme.css + ../video/media.css */
.rec-grid { display: grid; grid-template-columns: minmax(280px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.rec-h { font-size: 13.5px; margin: 14px 0 8px; color: var(--muted); font-weight: 700; }
.rec-h:first-child { margin-top: 0; }
.rec-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.rec-mode { display: grid; justify-items: center; gap: 6px; padding: 12px 6px; border: 1.5px solid var(--line); border-radius: 14px; background: #fff; color: var(--fg); font: 650 13px/1.2 system-ui, sans-serif; cursor: pointer; transition: border-color .15s, background .15s, box-shadow .15s; }
.rec-mode svg { width: 30px; height: 30px; color: var(--accent); }
.rec-mode:hover { background: #f8f7ff; }
.rec-mode[aria-checked=true] { border-color: var(--sel); background: #f3f1ff; box-shadow: 0 0 0 3px rgba(91, 76, 240, .13); }
.rec-mode[aria-disabled=true] { opacity: .45; }
.rec-mode:focus-visible { outline: 2px solid var(--sel); outline-offset: 2px; }
.rec-check { display: flex; gap: 8px; align-items: center; margin: 8px 0; font-weight: 600; cursor: pointer; }
.rec-check input { width: 17px; height: 17px; accent-color: var(--accent); }
.rec-select { width: 100%; margin: 0 0 6px; }
.rec-note { margin: 0 0 4px; }
.rec-note:empty { display: none; }
.rec-line { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0; }
.rec-lbl { font-weight: 600; }
.rec-start { width: 100%; padding: 12px; font-size: 15px; margin-top: 12px; }
.rec-start:disabled { opacity: .55; }

.stage { position: relative; aspect-ratio: 16 / 9; background: #0d1020; border-radius: 14px; overflow: hidden; }
.stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; display: block; outline: none; }
.stage.drag video { cursor: grab; touch-action: none; }
.stage.drag video:active { cursor: grabbing; }
.stage video:focus-visible { box-shadow: inset 0 0 0 3px #ffc83d; }
.stage .placeholder { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: #aab0c8; padding: 18px; line-height: 1.6; }
.stage .placeholder b { color: #fff; font-size: 16px; }
.stage .placeholder .rec-tpl-art { position: absolute; inset: 0; }
.stage .placeholder .rec-tpl-art svg { display: block; width: 100%; height: 100%; }
.stage .placeholder.has-art > div:not(.rec-tpl-art) { position: relative; align-self: end; margin-bottom: 4%; padding: 6px 14px; border-radius: 12px; background: rgba(13, 16, 32, .74); line-height: 1.45; }
.stage-audio { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; color: #fff; font-weight: 650; }
.stage-audio svg { width: 74px; height: 74px; color: #c9c3ff; animation: rec-pulse 1.6s ease-in-out infinite; }
.countdown { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 18px; background: rgba(13, 16, 32, .6); color: #fff; }
.countdown span { font: 800 110px/1 system-ui, sans-serif; text-shadow: 0 6px 30px rgba(91, 76, 240, .7); animation: rec-pop 1s var(--ease) both; }
.meter { height: 8px; margin-top: 10px; border-radius: 999px; background: #eceafd; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #eab308 70%, #ef4444); transition: width .08s linear; }
.rec-controls { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 12px; flex-wrap: wrap; }
.rec-state { display: inline-flex; align-items: center; gap: 8px; font-size: 18px; min-width: 90px; }
.rec-dot { display: inline-block; width: 11px; height: 11px; border-radius: 50%; background: #ef4444; animation: rec-blink 1.2s steps(2, start) infinite; }
.paused .rec-dot { background: #eab308; animation: none; }
.btn.rec-stop { background: #ef4444; border-color: #ef4444; color: #fff; font-weight: 700; min-width: 92px; }
.btn.rec-stop:hover { background: #dc2626; }
.rec-stage-hint { margin: 10px 2px 0; }
.rec-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: #fff0f0; color: #b91c1c; font: 700 12.5px/1 system-ui, sans-serif; }

.rec-result-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; margin: 4px 0 12px; }
.rec-result-head h1 { margin: 0; font-size: 24px; }
.rec-result { display: grid; gap: 14px; }
.rec-player video { width: 100%; max-height: 62vh; background: #000; border-radius: 12px; display: block; }
.rec-player audio { width: 100%; }
.trim-head { display: flex; align-items: center; gap: 6px 14px; flex-wrap: wrap; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.trim-head b { color: var(--fg); font-size: 14px; }
.trim-head .mx-time { color: var(--fg); }
.btn.small { padding: 4px 10px; font-size: 12.5px; margin-left: auto; }
.mx-range .strip canvas { display: block; }
.rec-actions { display: flex; flex-wrap: wrap; gap: 8px; }
#resultMsg:empty { display: none; }

@keyframes rec-blink { to { visibility: hidden; } }
@keyframes rec-pop { from { transform: scale(1.6); opacity: 0; } 40% { opacity: 1; } to { transform: scale(1); opacity: 1; } }
@keyframes rec-pulse { 50% { transform: scale(1.08); opacity: .8; } }

@media (max-width: 820px) {
  .rec-grid { grid-template-columns: minmax(0, 1fr); }
  .rec-stage-panel { order: -1; }
}
@media (max-width: 640px) {
  .rec-modes { grid-template-columns: 1fr 1fr; }
  .rec-mode { padding: 10px 4px; font-size: 12.5px; }
  body.recording .rec-controls { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: 10px 12px max(10px, env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .97); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(27, 33, 51, .1); }
  .countdown span { font-size: 84px; }
  .rec-actions .btn { flex: 1 1 calc(50% - 8px); }
  .rec-result-head h1 { font-size: 20px; }
}

/* ---------- Editor frame (shared shell, html.ad-shell-on) ---------- */
html.ad-shell-on .ad-bar { display: none; }
html.ad-shell-on .ads-stage > .mx-main { max-width: none; margin: 0; padding: 14px 18px 24px; overflow: auto; }
html.ad-shell-on #setup .mx-hero { display: none; }
html.ad-shell-on .rec-grid { max-width: 1180px; margin: 0 auto; grid-template-columns: minmax(250px, 320px) minmax(0, 1fr); }
html.ad-shell-on #result { max-width: 1000px; margin: 0 auto; }
html.ad-shell-on .rec-player video { max-height: 46vh; }
/* Phones: the Pause/Stop bar sits just above the frame's bottom bar (44px) and tab strip (62px), so both stay tappable. */
@media (max-width: 640px) { html.ad-shell-on body.recording .rec-controls { bottom: calc(106px + env(safe-area-inset-bottom)); } }
/* Teleprompter overlay (on screen only, not recorded) */
.rec-prompter { position: absolute; left: 0; right: 0; top: 0; height: 44%; overflow: hidden; z-index: 3; pointer-events: none; padding: 12px 18px;
  background: linear-gradient(rgba(10, 12, 20, .78), rgba(10, 12, 20, .55)); color: #fff;
  -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.rec-prompter-in { white-space: pre-wrap; font: 600 24px/1.45 system-ui, sans-serif; text-align: center; will-change: transform; }
.rec-pscript { width: 100%; resize: vertical; min-height: 120px; margin: 8px 0; font: 14px/1.45 system-ui, sans-serif; }
.rec-pcheck { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 13.5px; }
.rec-tplnote { margin: 0 0 12px; font-size: 13px; }
.rec-tplnote b { display: block; margin-bottom: 2px; }
.rec-tplnote .rec-tplpts { display: block; margin-top: 8px; font-style: normal; font-weight: 700; font-size: 12px; color: var(--muted); }
.rec-tplnote ol { margin: 4px 0 0; padding-left: 20px; }
.rec-tplnote ol:empty, .rec-tplnote ol:empty + small, .rec-tplnote small:empty { display: none; }
.rec-tplnote small { display: inline-flex; align-items: center; gap: 6px; margin-top: 6px; color: var(--muted); }
.rec-tplnote small::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 3px solid var(--ring, #fff); box-shadow: 0 0 0 1px var(--line); }
.rec-pill { display: flex; align-items: center; gap: 4px; }
.rec-pbtn { display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 11px; border: 0; border-radius: 10px; background: transparent; color: var(--fg); font: 600 13.5px/1 system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.rec-pbtn:hover:not(:disabled) { background: #f1f0fb; }
.rec-pbtn[aria-pressed=true] { background: #ecebff; color: #4338ca; }
.rec-pbtn[aria-pressed=false] svg { opacity: .5; }
.rec-pbtn:disabled { opacity: .5; cursor: default; }
.rec-pbtn:focus-visible { outline: 2px solid var(--sel); outline-offset: 1px; }
.rec-pbtn.rec-precord { background: #ef4444; color: #fff; padding: 0 16px; }
.rec-pbtn.rec-precord:hover:not(:disabled) { background: #dc2626; }
.rec-pbtn.rec-precord.on { background: #1b2133; }
.rec-psep { width: 1px; height: 24px; background: var(--line); margin: 0 4px; }
.rec-ptime { font-weight: 700; color: #b91c1c; padding: 0 6px; }
.rec-th { font-size: 13px; font-weight: 700; color: var(--muted); margin: 16px 0 8px; }
.rec-tmuted { color: var(--muted); font-size: 12.5px; line-height: 1.45; margin: 6px 0; }
.rec-tseg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 4px; }
.rec-tfind, .rec-uprow { display: block; width: 100%; margin-top: 10px; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rec-drop { display: grid; gap: 4px; justify-items: center; text-align: center; padding: 22px 14px; border: 2px dashed #c7c2f5; border-radius: 14px; background: #f8f7ff; cursor: pointer; }
.rec-drop.on, .rec-drop:hover { border-color: var(--sel); background: #f1efff; }
.rec-drop small { color: var(--muted); line-height: 1.4; }
@media (max-width: 820px) {
  html.ad-shell-on .rec-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 759.98px) {
  html.ad-shell-on .ads-stage > .mx-main { padding: 10px 10px 16px; }
  .rec-pbtn:not(.rec-precord) span { display: none; }
  .rec-pbtn { padding: 0 9px; }
}

/* round 3: device test and delete while recording */
.rec-testbtn { margin-top: 8px; }
.rec-test { margin-top: 8px; font-size: 14px; }
.rec-test ul { margin: 0 0 6px; padding-left: 18px; }
.rec-test li.ok b { color: #15803d; }
.rec-test li.bad b { color: #b91c1c; }
