:root{--bg:#0d0f14;--card:#171a22;--card2:#1f2330;--tx:#eef1f7;--mut:#8b93a7;--acc:#ffcc33;--red:#ff3b4e;--ok:#2ecc71;--r:16px}
*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html,body{margin:0;background:var(--bg);color:var(--tx);font:16px/1.4 system-ui,-apple-system,"Segoe UI",Roboto,sans-serif}
body{padding-bottom:calc(76px + env(safe-area-inset-bottom))}
.top{display:flex;align-items:center;gap:10px;padding:calc(10px + env(safe-area-inset-top)) 16px 10px;position:sticky;top:0;background:rgba(13,15,20,.92);backdrop-filter:blur(8px);z-index:5}
.top img{width:30px;height:30px;border-radius:8px}.top h1{font-size:18px;margin:0;flex:1}
main{max-width:720px;margin:0 auto;padding:0 14px}
.view{display:none}.view.active{display:block}
h2{font-size:17px;margin:20px 2px 10px}h2 small{color:var(--mut);font-weight:400;font-size:13px;margin-left:6px}
.hidden{display:none!important}
.stage{position:relative;background:#000;border-radius:var(--r);overflow:hidden;aspect-ratio:16/9;max-height:60vh;margin:0 auto;touch-action:none}
.stage video,.stage canvas{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.stage.mirror video,.stage.mirror #camOverlay{transform:scaleX(-1)}
.stage-msg{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:20px;background:#0b0d12;color:var(--mut)}
.rec-badge{position:absolute;top:10px;left:10px;background:rgba(0,0,0,.6);padding:4px 10px;border-radius:20px;font-weight:700;display:flex;align-items:center;gap:6px}
.rec-badge .dot{width:10px;height:10px;border-radius:50%;background:var(--red);animation:bl 1s infinite}@keyframes bl{50%{opacity:.2}}
.meter{position:absolute;left:10px;right:10px;bottom:8px;height:4px;background:rgba(255,255,255,.15);border-radius:2px}.meter div{height:100%;width:0;background:var(--ok);border-radius:2px;transition:width .1s}
.controls{display:flex;justify-content:space-around;align-items:center;margin:14px 0}
.btn{appearance:none;border:0;border-radius:14px;background:var(--card2);color:var(--tx);font:600 16px system-ui,sans-serif;padding:14px 18px;min-height:52px;cursor:pointer;display:inline-flex;align-items:center;justify-content:center;gap:8px}
.btn:active{transform:scale(.97)}.btn.primary{background:var(--acc);color:#111}.btn.big{font-size:18px;padding:16px 22px}.btn.wide{width:100%;margin:10px 0}
.btn[disabled]{opacity:.45}
.btn.round{width:64px;height:64px;border-radius:50%;flex-direction:column;gap:0;font-size:22px;padding:0}.btn.round small{font-size:10px;font-weight:500;color:var(--mut)}
.btn.round.sm{width:48px;height:48px;min-height:48px;font-size:18px}
.btn.rec{width:84px;height:84px;border-radius:50%;background:transparent;border:5px solid #fff;padding:0}
.btn.rec span{width:62px;height:62px;border-radius:50%;background:var(--red);transition:.2s}.btn.rec.on span{width:32px;height:32px;border-radius:8px}
.chip{appearance:none;border:1px solid #2c3242;background:var(--card);color:var(--tx);border-radius:999px;padding:10px 14px;font:600 14px system-ui,sans-serif;min-height:44px}
.row{display:flex;align-items:center;gap:10px;justify-content:space-between}.row.wrap{flex-wrap:wrap;justify-content:flex-start;margin:8px 0}
.card{background:var(--card);border-radius:var(--r);padding:14px;margin:10px 0}
.toma-cards{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.toma-card{background:var(--card);border-radius:14px;padding:8px;border:2px solid transparent}.toma-card.sel{border-color:var(--acc)}.toma-card.off .thumb{opacity:.25}
.toma-card .thumb{width:100%;aspect-ratio:16/9;background:#000;border-radius:10px;display:block}
.toma-card .nm{display:flex;align-items:center;gap:6px;font-weight:700;margin:6px 2px}.sw{width:12px;height:12px;border-radius:3px;display:inline-block}
.tg{display:flex;align-items:center;gap:12px;width:100%;background:var(--card);border:0;color:var(--tx);border-radius:14px;padding:14px;margin:8px 0;text-align:left;font:inherit;min-height:64px;cursor:pointer}
.tg .tx{flex:1}.tg .tx b{display:block;font-size:16px}.tg .tx small{color:var(--mut);font-size:13px}
.tg .knob{flex:none;width:64px;height:36px;border-radius:18px;background:#3a4052;position:relative;transition:.2s}
.tg .knob::after{content:"";position:absolute;top:4px;left:4px;width:28px;height:28px;border-radius:50%;background:#fff;transition:.2s}
.tg .st{flex:none;width:76px;text-align:right;font-weight:700;color:var(--mut);font-size:14px}
.tg[aria-checked=true] .knob{background:var(--ok)}.tg[aria-checked=true] .knob::after{left:32px}.tg[aria-checked=true] .st{color:var(--ok)}
.toma-card .tg{padding:6px 4px;min-height:48px;margin:0;background:transparent}.toma-card .tg .st{width:auto}
.slider{display:grid;grid-template-columns:110px 1fr 54px;align-items:center;gap:8px;margin:8px 0}.slider span{text-align:right;color:var(--mut)}
input[type=range]{width:100%;height:36px;accent-color:var(--acc)}
.field{display:flex;flex-direction:column;gap:6px;margin:6px 0;font-weight:600}
.field input,.field select{font:16px system-ui,sans-serif;background:var(--card2);color:var(--tx);border:1px solid #2c3242;border-radius:12px;padding:12px}
.hint{color:var(--mut);font-size:13px;margin:6px 2px}
.empty{color:var(--mut);text-align:center;padding:60px 20px}
.program{margin-top:4px}.prog-toma{position:absolute;top:8px;left:8px;background:rgba(0,0,0,.6);border-radius:8px;padding:3px 8px;font-weight:700;font-size:13px}
.playrow{margin:10px 0}.mono{font-variant-numeric:tabular-nums;color:var(--mut);flex:1}
.timeline{position:relative;height:64px;background:var(--card);border-radius:12px;overflow:hidden;touch-action:none}
.timeline canvas{position:absolute;inset:0;width:100%;height:100%}
#tlSegs{position:absolute;left:0;right:0;bottom:0;height:26px}
.seg{position:absolute;bottom:0;height:26px;border-right:2px solid var(--bg);opacity:.85;font-size:11px;font-weight:700;color:#111;overflow:hidden;white-space:nowrap;padding:5px 3px}
.seg.sel{outline:3px solid #fff;outline-offset:-3px;opacity:1}
#tlHead{position:absolute;top:0;bottom:0;width:2px;background:#fff;left:0;pointer-events:none}
.toma-btns{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:10px 0}
.toma-btn{background:var(--card);border:3px solid transparent;border-radius:12px;padding:4px;color:var(--tx);font:700 12px system-ui,sans-serif}
.toma-btn canvas{width:100%;aspect-ratio:16/9;background:#000;border-radius:8px;display:block;margin-bottom:3px}
.toma-btn.cur{border-color:var(--acc)}
.result{background:var(--card);border-radius:var(--r);padding:12px;margin:10px 0}
.result video{width:100%;max-height:60vh;border-radius:12px;background:#000;display:block}
.result .row{margin-top:10px}.result .btn{flex:1}.result h3{margin:0 0 8px;font-size:16px}
.moments{display:flex;flex-direction:column;gap:6px;margin:10px 0}.moment{display:flex;gap:8px;align-items:center;color:var(--mut);font-size:14px}
.tabs{position:fixed;left:0;right:0;bottom:0;display:flex;background:rgba(18,20,27,.97);border-top:1px solid #222736;padding-bottom:env(safe-area-inset-bottom);z-index:10}
.tabs button{flex:1;background:none;border:0;color:var(--mut);font:600 12px system-ui,sans-serif;padding:8px 0 10px;display:flex;flex-direction:column;align-items:center;gap:2px;min-height:62px}
.tabs button span{font-size:20px}.tabs button.active{color:var(--acc)}
.busy{position:fixed;inset:0;background:rgba(0,0,0,.75);display:flex;align-items:center;justify-content:center;z-index:20;padding:20px}
.busy-box{background:var(--card);border-radius:20px;padding:22px;width:100%;max-width:420px;display:flex;flex-direction:column;gap:12px;align-items:stretch;text-align:center}
.steps{display:flex;flex-direction:column;gap:4px;text-align:left;font-size:14px;color:var(--mut)}.steps .done{color:var(--ok)}.steps .now{color:var(--tx);font-weight:700}
.bar{height:12px;background:#2a2f3d;border-radius:6px;overflow:hidden}.bar div{height:100%;width:0;background:var(--acc);transition:width .2s}
.toast{position:fixed;left:50%;bottom:calc(90px + env(safe-area-inset-bottom));transform:translateX(-50%) translateY(20px);background:#2a2f3d;color:#fff;padding:12px 18px;border-radius:12px;opacity:0;transition:.25s;z-index:30;max-width:90vw;text-align:center;pointer-events:none}
.toast.show{opacity:1;transform:translateX(-50%)}
.help p{margin:6px 0;font-size:14px}
.modesw-wrap{margin:8px 0 4px}
.modesw{display:grid;grid-template-columns:1fr 1fr;background:var(--card);border-radius:16px;padding:5px;gap:5px}
.modesw button{appearance:none;border:0;border-radius:12px;background:transparent;color:var(--mut);font:800 17px system-ui,sans-serif;min-height:56px;cursor:pointer}
.modesw button.on{background:var(--acc);color:#111}
.modesw button[data-m=manual].on{background:#4f9dff;color:#fff}
.toma-card.cur{border-color:var(--red)}
body.mode-auto #btnAddToma{display:none}
body.recording .tabs{pointer-events:none;opacity:.5}
body.mode-auto #btnAddToma2{display:none}
html,body{overflow-x:hidden}
.toma-card .tg .st{display:none}.toma-card .tg .knob{width:56px;height:32px}.toma-card .tg .knob::after{width:24px;height:24px}.toma-card .tg[aria-checked=true] .knob::after{left:28px}
.toma-btns{grid-template-columns:repeat(4,minmax(0,1fr))}
.dur-wrap{margin:4px 0 8px}.dur-label{font-weight:700;margin:0 2px 8px}
.dur-sel{display:flex;gap:8px;overflow-x:auto;padding-bottom:4px;scrollbar-width:none}.dur-sel::-webkit-scrollbar{display:none}
.dur-sel button{flex:none;appearance:none;border:1px solid #2c3242;background:var(--card);color:var(--tx);border-radius:999px;padding:10px 16px;min-height:48px;font:700 15px system-ui,sans-serif}
.dur-sel button.on{background:var(--acc);color:#111;border-color:var(--acc)}
body.recording .dur-sel{pointer-events:none;opacity:.5}
.dur-warn{background:#3a2f12;color:#ffd666;border-radius:12px;padding:10px 12px;font-size:14px;margin:8px 0 0}
.rec-badge.warn{background:var(--red);animation:pulse .5s infinite alternate}@keyframes pulse{to{transform:scale(1.12)}}
.stage.ending{box-shadow:0 0 0 4px var(--red) inset}.stage.ending::after{content:"";position:absolute;inset:0;border:4px solid var(--red);border-radius:var(--r);animation:bl .5s infinite;pointer-events:none}
.pre-banner{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);background:rgba(255,204,51,.95);color:#111;font:800 22px system-ui,sans-serif;padding:14px 22px;border-radius:16px;box-shadow:0 6px 30px rgba(0,0,0,.5);z-index:3;text-align:center}
.toma-card .nm{justify-content:flex-start}.toma-card .nmt{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.toma-card .del{appearance:none;border:1px solid #4a2630;background:#2a1519;color:#ff8a96;border-radius:10px;font:700 12px system-ui,sans-serif;padding:6px 8px;min-height:34px;cursor:pointer}
.kind{font-size:12px;color:var(--mut);margin:0 2px 2px}.kind.auto{color:var(--acc)}
.no-tomas{grid-column:1/-1;background:var(--card);border:2px dashed #2c3242;border-radius:14px;padding:22px;text-align:center;color:var(--mut)}
.add-presets{display:grid;grid-template-columns:1fr 1fr;gap:8px}.add-presets .btn{min-height:56px}
#addKind button[data-k=manual].on{background:#4f9dff;color:#fff}
.btn[disabled]{cursor:not-allowed}
.dev-box summary{font-weight:700;cursor:pointer;min-height:32px;list-style-position:inside}
.kbd-hint{display:none}
@media (min-width:1000px){
  main{max-width:1320px;padding:0 24px}
  #v-rec.active{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(340px,1fr);gap:24px;align-items:start}
  .rec-left{position:sticky;top:64px}
  .stage{max-height:68vh}
  .toma-cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .kbd-hint{display:block}
  #editMain{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:0 24px;align-items:start}
  #editMain > *{grid-column:1/-1}
  #editMain > .stage{width:100%;max-width:calc(68vh * 16 / 9)}
  #editTomaBtns{grid-template-columns:repeat(auto-fill,minmax(150px,1fr))!important;max-width:1000px}
  #editMain > #editResult{grid-column:1}#editMain > #editPromoResult{grid-column:2}
  #v-promo,#v-set{max-width:760px;margin:0 auto}
  .tabs{left:50%;right:auto;transform:translateX(-50%);width:min(720px,100%);border-radius:18px 18px 0 0;border:1px solid #222736;border-bottom:0}
  .btn,.chip,.tg,.dur-sel button,.modesw button{cursor:pointer}
  .btn:hover,.chip:hover,.dur-sel button:hover{filter:brightness(1.15)}
}
/* ===== Ajuste a la pantalla del celular (sin desbordes, zonas seguras) ===== */
.top{padding-left:max(16px,env(safe-area-inset-left));padding-right:max(16px,env(safe-area-inset-right))}
main{padding-left:max(14px,env(safe-area-inset-left));padding-right:max(14px,env(safe-area-inset-right))}
.tabs{padding-left:env(safe-area-inset-left);padding-right:env(safe-area-inset-right)}
.tabs button{min-width:0;min-height:58px}
.busy{padding:max(14px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(14px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left))}
.busy-box{max-height:100%;overflow-y:auto;overscroll-behavior:contain}
.btn{max-width:100%;white-space:normal;text-align:center;line-height:1.2}
/* selectores de tiempo y aviso: todos los botones a la vista, sin desplazar */
.dur-sel{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));overflow:visible;padding-bottom:0}
#preSel{grid-template-columns:repeat(2,minmax(0,1fr));max-width:320px}
.dur-sel button{min-width:0;padding:10px 4px;white-space:nowrap;font-size:15px}
/* tarjetas de tomas: nombre completo, botón Quitar como ✕ sobre la imagen */
.toma-card{position:relative;min-width:0}
.toma-card .nm{align-items:flex-start;margin:6px 2px 2px}.toma-card .sw{flex:none;margin-top:4px}
.toma-card .nmt{white-space:normal;overflow-wrap:anywhere;line-height:1.25}
.toma-card .del{position:absolute;top:12px;right:12px;width:40px;height:40px;min-height:40px;padding:0;border-radius:50%;background:rgba(10,12,16,.78);border:1px solid rgba(255,138,150,.6);color:#ff8a96;font-size:18px;line-height:1;display:flex;align-items:center;justify-content:center;z-index:2}
.toma-card .tg{gap:8px}.toma-card .tg .tx b{font-size:15px}
/* diálogo Nueva toma */
.add-presets .btn{min-height:52px;padding:10px 8px;font-size:15px}
#addCancel{min-height:48px}
/* Editar */
.toma-btn{min-width:0;overflow-wrap:anywhere;line-height:1.15}
.slider{grid-template-columns:minmax(84px,auto) minmax(0,1fr) 46px}
.row.wrap .chip{flex:1 1 auto}
.result h3{overflow-wrap:anywhere}
/* pantallas angostas (320–359 px) */
@media (max-width:359px){
  main{padding-left:max(10px,env(safe-area-inset-left));padding-right:max(10px,env(safe-area-inset-right))}
  .top{padding-top:calc(8px + env(safe-area-inset-top));padding-bottom:8px}.top h1{font-size:17px}
  .btn{font-size:15px;padding:12px 12px}
  .btn.round{width:56px;height:56px}.btn.rec{width:76px;height:76px}.btn.rec span{width:54px;height:54px}
  .dur-sel button{font-size:13.5px;padding:10px 2px}
  .toma-cards{gap:8px}.toma-card{padding:6px}
  .toma-card .del{top:10px;right:10px;width:36px;height:36px;min-height:36px;font-size:16px}
  .toma-card .tg .tx b{font-size:14px}.toma-card .tg .knob{width:48px;height:28px}.toma-card .tg .knob::after{width:20px;height:20px}.toma-card .tg[aria-checked=true] .knob::after{left:24px}
  .toma-btns{gap:6px}.toma-btn{font-size:11px}
  .tabs button{font-size:11.5px}
  .slider{grid-template-columns:minmax(76px,auto) minmax(0,1fr) 40px;gap:6px;font-size:15px}
  .busy-box{padding:16px}
}
/* celular acostado: cámara y botón de grabar siempre a la vista */
@media (orientation:landscape) and (max-height:600px){
  body{padding-bottom:calc(52px + env(safe-area-inset-bottom))}
  .top{position:static;padding-top:calc(6px + env(safe-area-inset-top));padding-bottom:6px}.top img{width:24px;height:24px}.top h1{font-size:16px}
  .tabs button{flex-direction:row;justify-content:center;gap:8px;min-height:50px;padding:4px 0;font-size:13px}.tabs button span{font-size:17px}
  #v-rec.active{display:grid;grid-template-columns:minmax(0,1.25fr) minmax(0,1fr);gap:14px;align-items:start}
  .rec-left{position:sticky;top:6px}
  .stage{max-height:calc(100vh - 52px - 136px - env(safe-area-inset-bottom));max-height:calc(100dvh - 52px - 136px - env(safe-area-inset-bottom))}
  .controls{margin:8px 0}.btn.rec{width:68px;height:68px;border-width:4px}.btn.rec span{width:48px;height:48px}.btn.round{width:52px;height:52px;font-size:19px}
  #v-rec h2{margin-top:12px}
  .program{max-height:calc(100dvh - 52px - 40px)}
  .result video{max-height:calc(100dvh - 52px - 120px)}
  .add-presets{grid-template-columns:repeat(3,minmax(0,1fr))}
  .busy-box{max-width:560px;gap:10px;padding:16px}
  .modesw button{min-height:48px}
  .toast{bottom:calc(64px + env(safe-area-inset-bottom))}
}
/* ===== Varias cámaras ===== */
.sec-start{margin-top:12px;font-size:13px;min-height:44px}
.src-bar{display:flex;flex-wrap:wrap;gap:8px;align-items:center;justify-content:center;margin:-4px 0 10px}
.src-chip{display:inline-flex;align-items:center;gap:6px;background:var(--card);border:1px solid #2c3242;border-radius:999px;padding:6px 12px;min-height:36px;max-width:100%;font-size:13px}
.src-chip i{width:10px;height:10px;border-radius:50%;flex:none}.src-chip b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:120px}.src-chip small{color:var(--mut)}
.conn-btn{min-height:40px;padding:8px 14px}
.conn-box{max-width:520px;text-align:left}.conn-box>b{text-align:center}
.conn-box h3{font-size:15px;margin:12px 0 4px}
.conn-box .modesw button{font-size:15px;min-height:48px;padding:4px 6px;line-height:1.15}
.conn-box .modesw button.on{background:var(--acc);color:#111}
.qr-row{display:flex;gap:14px;align-items:center;flex-wrap:wrap}
.qr{background:#fff;border-radius:12px;padding:6px;width:150px;height:150px;flex:none}.qr svg{width:100%;height:100%;display:block}
.qr-info{flex:1;min-width:160px}.code{font:800 34px ui-monospace,Menlo,Consolas,monospace;letter-spacing:3px;color:var(--acc)}
.peer-list{display:flex;flex-direction:column;gap:8px;margin:8px 0}
.peer{display:flex;align-items:center;gap:8px;background:var(--card2);border-radius:12px;padding:8px 10px;flex-wrap:wrap}
.peer i{width:12px;height:12px;border-radius:50%;flex:none;background:#888}.pinfo{flex:1;min-width:120px;display:flex;flex-direction:column}.pinfo small{color:var(--mut);font-size:12px}
.peer .chip{min-height:40px;padding:8px 12px}
.note{background:#1d2a3f;color:#9cc7ff;border-radius:12px;padding:10px 12px;font-size:14px;margin:8px 0}
.usb-help{margin:8px 0;font-size:14px}.usb-help summary{font-weight:700;cursor:pointer;min-height:40px;display:flex;align-items:center}.usb-help p{margin:6px 0;color:var(--tx)}
.add-src{display:flex;flex-direction:column;gap:6px}.src-pick{display:flex;flex-wrap:wrap;gap:6px}.src-pick .chip.on{background:var(--acc);color:#111;border-color:var(--acc)}
.toma-card .srcname{font-size:12px;color:#9cc7ff;margin:0 2px 2px;overflow-wrap:anywhere}
.sec-view{position:fixed;inset:0;z-index:25;background:var(--bg);overflow-y:auto;padding:calc(10px + env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) calc(14px + env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));display:flex;flex-direction:column;gap:10px}
body.sec-mode{overflow:hidden}body.sec-mode .tabs{display:none}
.sec-top{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap}.sec-top b{font-size:16px}
.pill{border-radius:999px;padding:6px 12px;font-weight:700;font-size:13px;background:#2a2f3d;color:var(--mut)}
.pill[data-s=connected]{background:#163d27;color:#5ee69a}.pill[data-s=connecting],.pill[data-s=reconnecting]{background:#3a2f12;color:#ffd666}.pill[data-s=lost],.pill[data-s=full]{background:#3d1620;color:#ff8a96}
.sec-stage{position:relative;background:#000;border-radius:var(--r);overflow:hidden;aspect-ratio:16/9;max-height:45vh;width:100%}
.sec-stage video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}.sec-stage video.mirror{transform:scaleX(-1)}
.sec-card{margin:0}.sec-btns{flex-wrap:wrap}.sec-btns .btn{flex:1 1 120px}
.sec-who{margin-bottom:8px}
@media (orientation:landscape) and (max-height:600px){
  .sec-view{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);grid-auto-rows:min-content;align-content:start}
  .sec-top{grid-column:1/-1}.sec-stage{grid-row:span 3;max-height:calc(100dvh - 80px)}
  .qr{width:120px;height:120px}
}
@media (orientation:landscape) and (max-height:600px){ .sec-btns{flex-wrap:nowrap}.sec-btns .btn{flex:1 1 0;min-width:0;padding-left:6px;padding-right:6px} }
/* ===== Grabar en el celular vertical: todo en una pantalla (cámara → tomas → zoom → grabar → tiempo) ===== */
.toma-row-home,.toma-row{display:contents}
#btnAddToma .add-s,#btnAddToma .add-n{display:none}
.adj-on,.adj-empty{display:none}
@media (max-width:999px) and (orientation:portrait){
  #v-rec.active{display:flex;flex-direction:column;gap:8px}
  #v-rec .rec-left,#v-rec .rec-right{display:contents}
  #v-rec #fsRoot{order:1;width:100%}
  #v-rec .stage{order:1;width:100%;margin:0;max-height:34vh;max-height:34dvh}
  #v-rec .toma-row{order:2}
  #v-rec .adj-empty{order:3}
  #v-rec #tomaAdjust{order:3}
  #v-rec .controls{order:4}
  #v-rec .dur-wrap{order:5}
  #v-rec #srcBar{order:6}
  #v-rec .rec-right>h2{order:7}
  #v-rec .rec-right>h2+.hint{order:8}
  #v-rec #devBox{order:9}
  #v-rec .kbd-hint{order:10}
  /* tira de tomas */
  .toma-row{display:flex;gap:8px;align-items:stretch;min-width:0}
  #btnAddToma{order:-1;flex:none;width:64px;margin:0;padding:4px;min-height:0;border-radius:12px;flex-direction:column;gap:2px;font-size:14px;line-height:1.1}
  #btnAddToma .add-l{display:none}#btnAddToma .add-s{display:block;font-weight:800}#btnAddToma .add-n{display:block;font-size:12px;font-weight:600;opacity:.75}
  #tomaCards{display:flex;flex:1;min-width:0;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;padding:0}
  #tomaCards::-webkit-scrollbar{display:none}
  #tomaCards .toma-card{flex:none;width:96px;padding:3px;border-radius:12px;scroll-snap-align:start;border-width:2px}
  #tomaCards .toma-card .thumb{border-radius:8px;cursor:pointer}
  #tomaCards .toma-card .nm{margin:3px 2px 0;font-size:12px;gap:4px;align-items:center}
  #tomaCards .toma-card .sw{width:9px;height:9px;margin:0}
  #tomaCards .toma-card .nmt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}
  #tomaCards .toma-card .kind,#tomaCards .toma-card .srcname,#tomaCards .toma-card .tg{display:none}
  #tomaCards .toma-card.off{opacity:.55}#tomaCards .toma-card.off .nmt{text-decoration:line-through}
  #tomaCards .toma-card.sel{border-color:var(--acc);background:#2a2614}
  #tomaCards .toma-card.cur{border-color:var(--red)}
  #tomaCards .toma-card .del{top:5px;right:5px;width:26px;height:26px;min-height:26px;font-size:13px;border-width:1px}
  #tomaCards .toma-card .del::after{content:"";position:absolute;inset:-8px}
  #tomaCards .no-tomas{flex:1;padding:10px;font-size:13px;border-radius:12px;display:flex;align-items:center;justify-content:center;min-height:64px}
  /* zoom de la toma elegida */
  .adj-empty{display:block;margin:0;padding:6px 4px;font-size:13px;text-align:center;min-height:40px;display:flex;align-items:center;justify-content:center}
  #tomaAdjust{margin:0;padding:6px 10px;border-radius:12px}
  #tomaAdjust .adj-head{gap:8px}
  #tomaAdjust #adjName{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}
  #tomaAdjust .adj-on{display:block;flex:none}
  #tomaAdjust .adj-on .tg{margin:0;padding:0 4px;min-height:40px;gap:6px;background:transparent;width:auto}
  #tomaAdjust .adj-on .tg .tx b{font-size:13px}#tomaAdjust .adj-on .tg .tx small,#tomaAdjust .adj-on .tg .st{display:none}
  #tomaAdjust .adj-on .tg .knob{width:44px;height:26px}#tomaAdjust .adj-on .tg .knob::after{width:18px;height:18px}#tomaAdjust .adj-on .tg[aria-checked=true] .knob::after{left:22px}
  #tomaAdjust #adjClose{min-height:40px;padding:6px 12px}
  #tomaAdjust .slider{margin:2px 0 0;grid-template-columns:auto minmax(0,1fr) 44px;font-size:14px;min-height:40px}
  #tomaAdjust .slider input{min-height:36px}
  #tomaAdjust #adjDrag,#tomaAdjust #adjDelete,#tomaAdjust #adjFollow:empty{display:none}
  /* fila de grabar más compacta */
  #v-rec .controls{margin:0}
  #v-rec .btn.rec{width:68px;height:68px;border-width:4px}#v-rec .btn.rec span{width:50px;height:50px}#v-rec .btn.rec.on span{width:28px;height:28px}
  #v-rec .btn.round{width:52px;height:52px;font-size:19px}
  /* tiempo de grabación y aviso, abajo y compactos */
  #v-rec .dur-label{font-size:13px;margin:0 2px 4px;color:var(--mut);font-weight:700}
  #v-rec .dur-label[style]{margin-top:6px!important}
  #v-rec .dur-sel button{min-height:42px;padding:6px 2px;font-size:14px}
  #v-rec #preSel{max-width:none;grid-template-columns:repeat(4,minmax(0,1fr))}
  #v-rec #preSel button{grid-column:span 1}
  #v-rec .dur-warn{font-size:12px;padding:6px 10px;margin:6px 0 0;line-height:1.3}
  #v-rec #preHint{display:none}
  #v-rec .src-bar{margin:6px 0 0}
  #v-rec .rec-right>h2{margin:10px 2px 0}
  /* mensaje de "Activar cámara" dentro de la cámara pequeña */
  #camStart{padding:8px;gap:6px}#camStart p{margin:0;font-size:13px}
  #camStart .btn.big{padding:10px 18px;min-height:44px;font-size:16px}#camStart .sec-start{margin-top:2px;min-height:40px;padding:6px 12px;font-size:12px}
}
@media (max-width:359px) and (orientation:portrait){
  #tomaCards .toma-card{width:88px}
  #btnAddToma{width:58px}
}
@media (max-width:999px) and (orientation:portrait){
  #v-rec .stage{max-height:31vh;max-height:31dvh}
  #v-rec .dur-wrap{display:flex;flex-direction:column;margin:0}
  #v-rec .dur-wrap .dur-warn{order:9;margin-top:6px}
  #v-rec.active{gap:7px}
}
/* celular acostado: a la derecha, tomas y zoom arriba; tiempo de grabación debajo */
@media (orientation:landscape) and (max-height:600px){
  #v-rec .rec-right{display:flex;flex-direction:column;gap:7px}
  #v-rec .toma-row{order:1}#v-rec .adj-empty,#v-rec #tomaAdjust{order:2}#v-rec .dur-wrap{order:3;margin:0;display:flex;flex-direction:column}
  #v-rec .dur-wrap .dur-warn{order:9}
  #v-rec .rec-right>h2{order:4}#v-rec .rec-right>h2+.hint{order:5}
  /* tira de tomas */
  .toma-row{display:flex;gap:8px;align-items:stretch;min-width:0}
  #btnAddToma{order:-1;flex:none;width:64px;margin:0;padding:4px;min-height:0;border-radius:12px;flex-direction:column;gap:2px;font-size:14px;line-height:1.1}
  #btnAddToma .add-l{display:none}#btnAddToma .add-s{display:block;font-weight:800}#btnAddToma .add-n{display:block;font-size:12px;font-weight:600;opacity:.75}
  #tomaCards{display:flex;flex:1;min-width:0;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;padding:0}
  #tomaCards::-webkit-scrollbar{display:none}
  #tomaCards .toma-card{flex:none;width:96px;padding:3px;border-radius:12px;scroll-snap-align:start;border-width:2px}
  #tomaCards .toma-card .thumb{border-radius:8px;cursor:pointer}
  #tomaCards .toma-card .nm{margin:3px 2px 0;font-size:12px;gap:4px;align-items:center}
  #tomaCards .toma-card .sw{width:9px;height:9px;margin:0}
  #tomaCards .toma-card .nmt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2}
  #tomaCards .toma-card .kind,#tomaCards .toma-card .srcname,#tomaCards .toma-card .tg{display:none}
  #tomaCards .toma-card.off{opacity:.55}#tomaCards .toma-card.off .nmt{text-decoration:line-through}
  #tomaCards .toma-card.sel{border-color:var(--acc);background:#2a2614}
  #tomaCards .toma-card.cur{border-color:var(--red)}
  #tomaCards .toma-card .del{top:5px;right:5px;width:26px;height:26px;min-height:26px;font-size:13px;border-width:1px}
  #tomaCards .toma-card .del::after{content:"";position:absolute;inset:-8px}
  #tomaCards .no-tomas{flex:1;padding:10px;font-size:13px;border-radius:12px;display:flex;align-items:center;justify-content:center;min-height:64px}
  /* zoom de la toma elegida */
  .adj-empty{display:block;margin:0;padding:6px 4px;font-size:13px;text-align:center;min-height:40px;display:flex;align-items:center;justify-content:center}
  #tomaAdjust{margin:0;padding:6px 10px;border-radius:12px}
  #tomaAdjust .adj-head{gap:8px}
  #tomaAdjust #adjName{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:14px}
  #tomaAdjust .adj-on{display:block;flex:none}
  #tomaAdjust .adj-on .tg{margin:0;padding:0 4px;min-height:40px;gap:6px;background:transparent;width:auto}
  #tomaAdjust .adj-on .tg .tx b{font-size:13px}#tomaAdjust .adj-on .tg .tx small,#tomaAdjust .adj-on .tg .st{display:none}
  #tomaAdjust .adj-on .tg .knob{width:44px;height:26px}#tomaAdjust .adj-on .tg .knob::after{width:18px;height:18px}#tomaAdjust .adj-on .tg[aria-checked=true] .knob::after{left:22px}
  #tomaAdjust #adjClose{min-height:40px;padding:6px 12px}
  #tomaAdjust .slider{margin:2px 0 0;grid-template-columns:auto minmax(0,1fr) 44px;font-size:14px;min-height:40px}
  #tomaAdjust .slider input{min-height:36px}
  #tomaAdjust #adjDrag,#tomaAdjust #adjDelete,#tomaAdjust #adjFollow:empty{display:none}
  /* tiempo de grabación y aviso, abajo y compactos */
  #v-rec .dur-label{font-size:13px;margin:0 2px 4px;color:var(--mut);font-weight:700}
  #v-rec .dur-label[style]{margin-top:6px!important}
  #v-rec .dur-sel button{min-height:42px;padding:6px 2px;font-size:14px}
  #v-rec #preSel{max-width:none;grid-template-columns:repeat(4,minmax(0,1fr))}
  #v-rec #preSel button{grid-column:span 1}
  #v-rec .dur-warn{font-size:12px;padding:6px 10px;margin:6px 0 0;line-height:1.3}
  #v-rec #preHint{display:none}
  #v-rec .src-bar{margin:6px 0 0}
  #v-rec .rec-right>h2{margin:10px 2px 0}
}
@media (orientation:landscape) and (max-height:600px){
  #tomaAdjust:not(.hidden){display:flex;align-items:center;gap:6px;flex-wrap:nowrap}
  #tomaAdjust .adj-head{display:contents}#tomaAdjust #adjName{display:none}
  #tomaAdjust .slider{order:1;flex:1;min-width:0;margin:0;grid-template-columns:auto minmax(40px,1fr) 38px;gap:4px}
  #tomaAdjust .adj-on{order:2}#tomaAdjust #adjClose{order:3}
}
@media (orientation:landscape) and (max-height:600px){ #tomaCards .toma-card{width:84px} #v-rec .rec-right{gap:6px} }
@media (orientation:landscape) and (max-height:600px){
  #tomaAdjust .slider{grid-template-columns:auto minmax(50px,1fr) 42px;font-size:13px}#tomaAdjust .slider span{font-size:13px}
  #tomaAdjust #adjClose{width:40px;padding:0;font-size:0;display:flex;align-items:center;justify-content:center}#tomaAdjust #adjClose::before{content:"✓";font-size:18px}
  #tomaAdjust .adj-on .tg{padding:0 2px}
}
@media (orientation:landscape) and (max-height:600px){
  #tomaAdjust .slider{font-size:0;position:relative;grid-template-columns:20px minmax(60px,1fr) 40px}#tomaAdjust .slider::before{content:"🔍";font-size:15px;position:absolute;left:0;top:50%;transform:translateY(-50%)}
}

/* ===== Pantalla completa de la cámara + zoom con los dedos ===== */
.toma-row-home{display:contents}
.fs-root{position:relative}
.fs-toggle{position:absolute;top:8px;right:8px;z-index:4;display:inline-flex;align-items:center;gap:6px;appearance:none;border:0;border-radius:999px;background:rgba(0,0,0,.62);color:#fff;font:700 13px system-ui,sans-serif;padding:0 12px 0 8px;min-height:44px;min-width:44px;cursor:pointer;backdrop-filter:blur(6px)}
.fs-toggle svg{flex:none;display:block}
.fs-toggle:active{transform:scale(.97)}
.zoom-ind{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);z-index:4;background:rgba(0,0,0,.62);color:#fff;font:800 28px/1 system-ui,sans-serif;padding:10px 16px;border-radius:14px;pointer-events:none;letter-spacing:.02em}
.fs-chrome{display:none}
body.fs-on{overflow:hidden}
body.fs-on .fs-toggle{display:none}
body.fs-on .top,body.fs-on .tabs,body.fs-on #tomaAdjust,body.fs-on .adj-empty{visibility:hidden!important;pointer-events:none!important}
body.fs-on .toast{bottom:150px;z-index:60}
body.fs-css #fsRoot{position:fixed;inset:0;z-index:40;width:100%;height:100%;background:#000;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);display:flex;flex-direction:column}
#fsRoot:fullscreen,#fsRoot:-webkit-full-screen{width:100%;height:100%;background:#000;display:flex;flex-direction:column;padding:env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);box-sizing:border-box}
body.fs-on #fsRoot .stage{flex:1 1 auto;width:100%;height:auto;min-height:0;max-height:none!important;aspect-ratio:auto!important;border-radius:0;margin:0}
body.fs-on #fsChrome,body.fs-on .fs-chrome{display:block;position:absolute;inset:0;z-index:5;pointer-events:none}
.fs-exit{pointer-events:auto;position:absolute;top:8px;right:8px;appearance:none;border:0;border-radius:999px;background:rgba(0,0,0,.66);color:#fff;font:700 15px system-ui,sans-serif;padding:0 14px;min-height:44px;cursor:pointer;backdrop-filter:blur(6px)}
.fs-bottom{pointer-events:auto;position:absolute;left:0;right:0;bottom:0;display:flex;flex-direction:column;align-items:center;gap:8px;padding:12px 8px 10px;background:linear-gradient(transparent,rgba(0,0,0,.78) 36%)}
.fs-toma-slot{width:100%;min-width:0}
body.fs-on .fs-bottom .btn.rec{width:68px;height:68px;border-width:4px;flex:none}
body.fs-on .fs-bottom .btn.rec span{width:50px;height:50px}
body.fs-on .fs-bottom .btn.rec.on span{width:28px;height:28px;border-radius:8px}
/* tira compacta de tomas en pantalla completa (también en escritorio) */
body.fs-on .toma-row{display:flex;gap:8px;align-items:stretch;min-width:0;width:100%}
body.fs-on #btnAddToma{order:-1;flex:none;width:64px;margin:0;padding:4px;min-height:0;border-radius:12px;flex-direction:column;gap:2px;font-size:14px;line-height:1.1}
body.fs-on #btnAddToma .add-l{display:none}body.fs-on #btnAddToma .add-s{display:block;font-weight:800}body.fs-on #btnAddToma .add-n{display:block;font-size:12px;font-weight:600;opacity:.75}
body.fs-on #tomaCards{display:flex;flex:1;min-width:0;gap:8px;overflow-x:auto;overscroll-behavior-x:contain;scroll-snap-type:x proximity;scrollbar-width:none;padding:0}
body.fs-on #tomaCards::-webkit-scrollbar{display:none}
body.fs-on #tomaCards .toma-card{flex:none;width:96px;padding:3px;border-radius:12px;scroll-snap-align:start;border-width:2px;background:rgba(23,26,34,.92)}
body.fs-on #tomaCards .toma-card .thumb{border-radius:8px;cursor:pointer}
body.fs-on #tomaCards .toma-card .nm{margin:3px 2px 0;font-size:12px;gap:4px;align-items:center}
body.fs-on #tomaCards .toma-card .sw{width:9px;height:9px;margin:0}
body.fs-on #tomaCards .toma-card .nmt{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;line-height:1.2;color:#fff}
body.fs-on #tomaCards .toma-card .kind,body.fs-on #tomaCards .toma-card .srcname,body.fs-on #tomaCards .toma-card .tg{display:none}
body.fs-on #tomaCards .toma-card.off{opacity:.55}
body.fs-on #tomaCards .toma-card.sel{border-color:var(--acc);background:#2a2614}
body.fs-on #tomaCards .toma-card.cur{border-color:var(--red)}
body.fs-on #tomaCards .toma-card .del{top:5px;right:5px;width:26px;height:26px;min-height:26px;font-size:13px;border-width:1px}
body.fs-on #tomaCards .no-tomas{flex:1;padding:10px;font-size:13px;border-radius:12px;display:flex;align-items:center;justify-content:center;min-height:64px;color:#ddd}
@media (orientation:landscape) and (max-height:600px){
  body.fs-on .fs-bottom{flex-direction:row;align-items:center;gap:10px;padding:8px 10px;background:linear-gradient(transparent,rgba(0,0,0,.8) 30%)}
  body.fs-on .toma-row{flex:1;min-width:0;flex-direction:row}
  body.fs-on #tomaCards{flex-direction:row;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x proximity}
  body.fs-on #tomaCards .toma-card{width:88px}
  body.fs-on #btnAddToma{width:58px;flex-direction:column}
  body.fs-on .fs-bottom .btn.rec{width:60px;height:60px}
  body.fs-on .toast{bottom:90px}
}
/* diálogos por encima de la pantalla completa (respaldo CSS) */
.busy{z-index:50}.toast{z-index:55}
@media (max-width:359px){ .fs-toggle span{display:none}.fs-toggle{padding:0;justify-content:center} }

/* ===== Monitor externo ===== */
.mon-btn{min-height:40px;padding:8px 14px}.mon-btn.on{border-color:var(--ok);color:#5ee69a}
.mon-opts{display:flex;flex-direction:column;gap:8px;margin:6px 0}
.mon-box .modesw button{font-size:15px;min-height:44px}
.mon-row{display:flex;flex-wrap:wrap;gap:8px;margin:6px 0}.mon-row .btn{flex:1 1 200px;margin:0}
.mon-on{display:flex;align-items:center;gap:8px;background:#163d27;color:#5ee69a;border-radius:12px;padding:8px 12px;margin:6px 0;font-weight:700;flex-wrap:wrap}.mon-on span{flex:1}
.mon-url{font:700 15px ui-monospace,Menlo,Consolas,monospace;color:var(--tx);overflow-wrap:anywhere}
.mon-local{position:fixed;inset:0;z-index:40;background:#000}
.mon-local video{position:absolute;inset:0;width:100%;height:100%;object-fit:contain}
.mon-local .chip{position:absolute;top:calc(10px + env(safe-area-inset-top));right:10px;opacity:0;transition:opacity .3s;background:rgba(0,0,0,.6)}
.mon-local.ui .chip{opacity:1}
