/* 0.5.31 — compactação real da mesa mobile para telas baixas.
   Corrige o caso em que a sala de arquivos empurra o rack para fora da tela. */
@media (max-width:760px){
  body.emr-mobile-mix-open #emr-mobile-mix-root:not([hidden]){
    inset:0!important;
    top:var(--emr-mobile-visible-top,0px)!important;
    height:var(--emr-mobile-visible-height,100dvh)!important;
    padding:0!important;
  }

  #emr-mobile-mix-root .emr-mobile-console,
  #emr-mobile-mix-root .emr-mobile-console *{box-sizing:border-box!important}

  /* Reserva espaço fixo para cada faixa superior e deixa o rack ocupar o resto. */
  #emr-mobile-mix-root .emr-mobile-console{
    grid-template-rows:40px 34px 40px 118px minmax(138px,1fr) 58px!important;
    border-radius:0!important;
    height:100%!important;
  }

  #emr-mobile-mix-root .emr-mobile-console>header{height:40px!important;padding:3px 6px!important}
  #emr-mobile-mix-root .emr-mobile-brand:before{width:28px!important;height:28px!important;flex-basis:28px!important;border-radius:5px!important}
  #emr-mobile-mix-root .emr-mobile-brand span{font-size:18px!important}
  #emr-mobile-mix-root .emr-mobile-brand strong{font-size:15px!important}
  #emr-mobile-mix-root .emr-mobile-brand b{font-size:8px!important}
  #emr-mobile-mix-root .emr-mobile-console>header>button{width:28px!important;height:28px!important;font-size:17px!important}

  #emr-mobile-mix-root .emr-mobile-preset{height:34px!important;padding:3px 8px!important;grid-template-columns:50px minmax(0,1fr)!important}
  #emr-mobile-mix-root .emr-mobile-preset label{font-size:8px!important}
  #emr-mobile-mix-root .emr-mobile-preset select{height:27px!important;font-size:12px!important}

  #emr-mobile-mix-root .emr-mobile-top-actions{height:40px!important;gap:6px!important;padding:4px 6px!important}
  #emr-mobile-mix-root .emr-mobile-top-actions button{
    height:30px!important;border-radius:16px!important;font-size:10px!important;letter-spacing:.2px!important;
  }

  /* A sala de arquivos fica bonita, mas compacta. */
  #emr-mobile-mix-root .emr-mobile-source-room{
    height:118px!important;min-height:118px!important;padding:6px!important;gap:8px!important;
    grid-template-columns:1.02fr .98fr!important;align-items:stretch!important;
  }
  #emr-mobile-mix-root .emr-mobile-source-left,
  #emr-mobile-mix-root .emr-mobile-source-right{
    height:100%!important;min-height:0!important;display:grid!important;gap:6px!important;
  }
  #emr-mobile-mix-root .emr-mobile-source-left{grid-template-rows:repeat(3,minmax(0,1fr))!important}
  #emr-mobile-mix-root .emr-mobile-source-right{grid-template-rows:repeat(2,minmax(0,1fr))!important}
  #emr-mobile-mix-root .emr-mobile-source-room button{
    width:100%!important;height:100%!important;min-height:0!important;padding:3px 5px!important;
    border-radius:14px!important;font-size:11px!important;line-height:1!important;align-self:stretch!important;
  }
  #emr-mobile-mix-root .emr-mobile-source-right button{border-radius:10px!important}

  /* O rack agora é o protagonista: sempre visível. */
  #emr-mobile-mix-root .emr-mobile-channel-stage{
    min-height:138px!important;height:100%!important;grid-template-rows:minmax(0,1fr) 10px!important;
  }
  #emr-mobile-mix-root .emr-mobile-channels{
    padding:3px 2px!important;gap:4px!important;align-items:stretch!important;
  }
  #emr-mobile-mix-root .emr-mobile-channel{
    flex:0 0 24.5%!important;min-width:72px!important;padding:5px 3px 12px!important;
  }
  #emr-mobile-mix-root .emr-mobile-channel>strong{padding-bottom:2px!important;font-size:9px!important}
  #emr-mobile-mix-root .emr-mobile-channel>span{margin-top:2px!important;font-size:7px!important;line-height:1!important}
  #emr-mobile-mix-root .emr-mobile-channel>b{margin-top:2px!important;font-size:10px!important}
  #emr-mobile-mix-root .emr-mobile-channel .emr-mobile-vu{left:5px!important;top:54px!important;bottom:13px!important;width:6px!important}
  #emr-mobile-mix-root .emr-mobile-channel input{
    top:62%!important;width:clamp(90px,18vh,130px)!important;height:26px!important;
  }
  #emr-mobile-mix-root .emr-mobile-rack-nav{height:10px!important;min-height:10px!important;padding:2px 6px!important}
  #emr-mobile-mix-root .emr-mobile-rack-scroll{height:4px!important}
  #emr-mobile-mix-root .emr-mobile-rack-scroll::-webkit-slider-thumb{width:22px!important;height:4px!important}
  #emr-mobile-mix-root .emr-mobile-rack-scroll::-moz-range-thumb{width:22px!important;height:4px!important}

  #emr-mobile-mix-root .emr-mobile-transport{
    height:58px!important;min-height:58px!important;padding:2px 6px max(2px,env(safe-area-inset-bottom))!important;
    grid-template-columns:40px 40px 56px 40px 40px!important;
  }
  #emr-mobile-mix-root .emr-mobile-transport button{width:40px!important;height:42px!important;border-radius:9px!important}
  #emr-mobile-mix-root .emr-mobile-transport button.is-play{width:54px!important;height:54px!important}
  #emr-mobile-mix-root .emr-mobile-transport .emr-play-icon{border-top-width:10px!important;border-bottom-width:10px!important;border-left-width:15px!important}
  #emr-mobile-mix-root .emr-mobile-transport .emr-stop-icon{width:14px!important;height:14px!important}
  #emr-mobile-mix-root .emr-mobile-transport .emr-repeat{font-size:26px!important}
}

@media (max-width:760px) and (max-height:620px){
  #emr-mobile-mix-root .emr-mobile-console{grid-template-rows:38px 32px 38px 108px minmax(130px,1fr) 54px!important}
  #emr-mobile-mix-root .emr-mobile-console>header{height:38px!important}
  #emr-mobile-mix-root .emr-mobile-brand:before{width:26px!important;height:26px!important;flex-basis:26px!important}
  #emr-mobile-mix-root .emr-mobile-brand span{font-size:17px!important}
  #emr-mobile-mix-root .emr-mobile-brand strong{font-size:14px!important}
  #emr-mobile-mix-root .emr-mobile-preset{height:32px!important}
  #emr-mobile-mix-root .emr-mobile-top-actions{height:38px!important}
  #emr-mobile-mix-root .emr-mobile-top-actions button{height:28px!important;font-size:9px!important}
  #emr-mobile-mix-root .emr-mobile-source-room{height:108px!important;min-height:108px!important;padding:5px!important;gap:6px!important}
  #emr-mobile-mix-root .emr-mobile-source-left,
  #emr-mobile-mix-root .emr-mobile-source-right{gap:5px!important}
  #emr-mobile-mix-root .emr-mobile-source-room button{font-size:10px!important;border-radius:12px!important}
  #emr-mobile-mix-root .emr-mobile-channel-stage{min-height:130px!important}
  #emr-mobile-mix-root .emr-mobile-channel{min-width:68px!important;flex-basis:25%!important}
  #emr-mobile-mix-root .emr-mobile-channel input{width:clamp(84px,17vh,118px)!important;top:63%!important;height:24px!important}
  #emr-mobile-mix-root .emr-mobile-channel .emr-mobile-vu{top:50px!important;bottom:11px!important}
  #emr-mobile-mix-root .emr-mobile-transport{height:54px!important;min-height:54px!important;grid-template-columns:38px 38px 52px 38px 38px!important}
  #emr-mobile-mix-root .emr-mobile-transport button{width:38px!important;height:40px!important}
  #emr-mobile-mix-root .emr-mobile-transport button.is-play{width:50px!important;height:50px!important}
}

@media (max-width:760px) and (max-height:560px){
  #emr-mobile-mix-root .emr-mobile-console{grid-template-rows:36px 30px 36px 96px minmax(118px,1fr) 50px!important}
  #emr-mobile-mix-root .emr-mobile-console>header{height:36px!important;padding:2px 5px!important}
  #emr-mobile-mix-root .emr-mobile-brand span{font-size:16px!important}
  #emr-mobile-mix-root .emr-mobile-brand strong{font-size:13px!important}
  #emr-mobile-mix-root .emr-mobile-preset{height:30px!important}
  #emr-mobile-mix-root .emr-mobile-preset select{height:24px!important;font-size:11px!important}
  #emr-mobile-mix-root .emr-mobile-top-actions{height:36px!important;padding:4px 5px!important;gap:5px!important}
  #emr-mobile-mix-root .emr-mobile-top-actions button{height:26px!important;font-size:8.5px!important}
  #emr-mobile-mix-root .emr-mobile-source-room{height:96px!important;min-height:96px!important}
  #emr-mobile-mix-root .emr-mobile-source-room button{font-size:9px!important;border-radius:10px!important;padding:2px 4px!important}
  #emr-mobile-mix-root .emr-mobile-channel-stage{min-height:118px!important}
  #emr-mobile-mix-root .emr-mobile-channel{min-width:62px!important;padding:4px 2px 10px!important}
  #emr-mobile-mix-root .emr-mobile-channel>strong{font-size:8px!important}
  #emr-mobile-mix-root .emr-mobile-channel>span{font-size:6px!important}
  #emr-mobile-mix-root .emr-mobile-channel>b{font-size:9px!important}
  #emr-mobile-mix-root .emr-mobile-channel input{width:clamp(76px,16vh,108px)!important;height:22px!important}
  #emr-mobile-mix-root .emr-mobile-channel .emr-mobile-vu{top:46px!important;bottom:9px!important}
  #emr-mobile-mix-root .emr-mobile-transport{height:50px!important;min-height:50px!important;grid-template-columns:34px 34px 48px 34px 34px!important}
  #emr-mobile-mix-root .emr-mobile-transport button{width:34px!important;height:36px!important}
  #emr-mobile-mix-root .emr-mobile-transport button.is-play{width:46px!important;height:46px!important}
  #emr-mobile-mix-root .emr-mobile-transport .emr-repeat{font-size:22px!important}
}
