/* 0.5.34 — layout mobile realmente responsivo, sem escala forçada.
   Mantém o painel bonito, reduz os botões grandes e garante o transporte visível. */
@media (max-width:760px){
  html.emr-mobile-mix-open,
  body.emr-mobile-mix-open{
    width:100%!important;height:100%!important;min-height:100%!important;
    margin:0!important;overflow:hidden!important;background:#060a0c!important;
  }

  body.emr-mobile-mix-open #emr-mobile-mix-root:not([hidden]){
    position:fixed!important;left:0!important;right:0!important;top:var(--emr-mobile-visible-top,0px)!important;
    width:100vw!important;height:var(--emr-mobile-visible-height,100dvh)!important;
    margin:0!important;padding:0!important;overflow:hidden!important;background:#060a0c!important;
    z-index:2147483646!important;
  }

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

  #emr-mobile-mix-root .emr-mobile-console{
    position:relative!important;left:auto!important;top:auto!important;transform:none!important;
    width:100%!important;height:100%!important;min-height:0!important;max-height:none!important;
    margin:0!important;padding:0!important;border-radius:0!important;
    display:grid!important;grid-template-rows:44px 54px 60px 170px minmax(160px,1fr) 72px!important;
    overflow:hidden!important;border:1px solid #39464c!important;background:#080c0e!important;
    box-shadow:inset 0 0 18px #000,0 0 10px #000!important;
  }

  /* Cabeçalho */
  #emr-mobile-mix-root .emr-mobile-console>header{
    grid-row:1!important;display:grid!important;grid-template-columns:minmax(0,1fr) 44px!important;align-items:center!important;
    width:100%!important;height:44px!important;min-height:44px!important;padding:4px 8px!important;border:0!important;border-bottom:1px solid #344148!important;
    background:linear-gradient(180deg,#262e32,#161d20)!important;
  }
  #emr-mobile-mix-root .emr-mobile-brand{display:flex!important;align-items:center!important;gap:5px!important;min-width:0!important;white-space:nowrap!important;overflow:hidden!important}
  #emr-mobile-mix-root .emr-mobile-brand:before{flex:0 0 34px!important;width:34px!important;height:34px!important;border-radius:6px!important}
  #emr-mobile-mix-root .emr-mobile-brand span{font-size:20px!important;line-height:1!important}
  #emr-mobile-mix-root .emr-mobile-brand strong{font-size:17px!important;line-height:1!important}
  #emr-mobile-mix-root .emr-mobile-brand b{font-size:8px!important;line-height:1!important;letter-spacing:.2px!important}
  #emr-mobile-mix-root .emr-mobile-console>header>button{
    display:grid!important;place-items:center!important;width:38px!important;height:38px!important;padding:0!important;margin:0 auto!important;
    border-radius:8px!important;font-size:21px!important;line-height:1!important;
  }

  /* Modelo */
  #emr-mobile-mix-root .emr-mobile-preset{
    grid-row:2!important;display:grid!important;grid-template-columns:60px minmax(0,1fr)!important;align-items:center!important;gap:8px!important;
    width:100%!important;height:54px!important;min-height:54px!important;padding:8px 10px!important;border:0!important;border-bottom:1px solid #273239!important;background:#11191e!important;
  }
  #emr-mobile-mix-root .emr-mobile-preset label{font-size:9px!important;letter-spacing:1.8px!important}
  #emr-mobile-mix-root .emr-mobile-preset select{width:100%!important;height:36px!important;min-height:36px!important;padding:0 9px!important;border:1px solid #536168!important;border-radius:5px!important;font-size:14px!important}

  /* Top actions */
  #emr-mobile-mix-root .emr-mobile-top-actions{
    grid-row:3!important;display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;align-items:center!important;gap:8px!important;
    width:100%!important;height:60px!important;min-height:60px!important;padding:8px!important;background:#171d20!important;
  }
  #emr-mobile-mix-root .emr-mobile-top-actions button{
    width:100%!important;height:40px!important;min-width:0!important;padding:0 4px!important;border-radius:22px!important;
    font-size:12px!important;line-height:1!important;letter-spacing:.2px!important;white-space:nowrap!important;
  }

  /* Sala de arquivos — cartões menores, padronizados e com visual de botão. */
  #emr-mobile-mix-root .emr-mobile-source-room{
    grid-row:4!important;display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,.9fr)!important;align-items:stretch!important;
    gap:10px!important;width:100%!important;height:170px!important;min-height:170px!important;padding:10px!important;overflow:hidden!important;
    background:repeating-linear-gradient(90deg,#111719 0,#111719 3px,#151b1e 4px,#0d1214 7px)!important;
  }
  #emr-mobile-mix-root .emr-mobile-source-left,
  #emr-mobile-mix-root .emr-mobile-source-right{display:grid!important;align-items:stretch!important;width:100%!important;height:100%!important;min-height:0!important}
  #emr-mobile-mix-root .emr-mobile-source-left{grid-template-rows:repeat(3,minmax(0,1fr))!important;gap:8px!important}
  #emr-mobile-mix-root .emr-mobile-source-right{grid-template-rows:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  #emr-mobile-mix-root .emr-mobile-source-room button{
    display:flex!important;align-items:center!important;justify-content:center!important;width:100%!important;height:100%!important;min-height:0!important;
    padding:6px 8px!important;border-radius:20px!important;font-size:19px!important;line-height:1.02!important;letter-spacing:.2px!important;text-align:center!important;
    white-space:normal!important;overflow-wrap:break-word!important;word-break:keep-all!important;
    border:1px solid #465157!important;background:linear-gradient(#3b4145,#171b1d 55%,#080b0c)!important;box-shadow:inset 0 2px 2px #ffffff1f,inset 0 -5px 8px #000,0 5px 7px #0009!important;
  }
  #emr-mobile-mix-root .emr-mobile-source-right button{border-radius:14px!important;font-size:17px!important;padding:8px!important}

  /* Rack */
  #emr-mobile-mix-root .emr-mobile-channel-stage{
    grid-row:5!important;position:relative!important;display:grid!important;grid-template-rows:minmax(0,1fr) 12px!important;
    align-self:stretch!important;width:100%!important;height:100%!important;min-height:160px!important;margin:0!important;padding:0!important;overflow:hidden!important;background:#090d0f!important;
  }
  #emr-mobile-mix-root .emr-mobile-channels{
    grid-row:1!important;display:flex!important;align-items:stretch!important;gap:5px!important;width:100%!important;height:100%!important;min-height:0!important;
    margin:0!important;padding:4px 3px!important;overflow-x:auto!important;overflow-y:hidden!important;scrollbar-width:none!important;-ms-overflow-style:none!important;
    touch-action:none!important;cursor:grab!important;user-select:none!important;-webkit-user-select:none!important;
  }
  #emr-mobile-mix-root .emr-mobile-channels::-webkit-scrollbar{display:none!important}
  #emr-mobile-mix-root .emr-mobile-channels.is-dragging{cursor:grabbing!important}
  #emr-mobile-mix-root .emr-mobile-channel{
    position:relative!important;display:flex!important;flex:0 0 24%!important;min-width:90px!important;max-width:none!important;height:100%!important;min-height:0!important;
    flex-direction:column!important;align-items:center!important;margin:0!important;padding:7px 4px 16px!important;border:1px solid #58656c!important;border-radius:4px!important;
    background:linear-gradient(180deg,#3c454a,#252b2f)!important;overflow:hidden!important;
  }
  #emr-mobile-mix-root .emr-mobile-channel>strong{width:100%!important;padding:0 1px 4px!important;border-bottom:3px solid #28d8c0!important;font-size:11px!important;line-height:1!important;letter-spacing:.25px!important;text-align:center!important;white-space:nowrap!important}
  #emr-mobile-mix-root .emr-mobile-channel:nth-child(3)>strong,
  #emr-mobile-mix-root .emr-mobile-channel:nth-child(4)>strong,
  #emr-mobile-mix-root .emr-mobile-channel:nth-child(6)>strong{border-bottom-color:#e7bd38!important}
  #emr-mobile-mix-root .emr-mobile-channel>span{max-width:100%!important;margin-top:3px!important;font:700 8px/1.05 Arial,sans-serif!important;text-align:center!important;white-space:normal!important}
  #emr-mobile-mix-root .emr-mobile-channel>b{margin-top:3px!important;color:#f1c63b!important;font:900 11px/1 Arial,sans-serif!important}
  #emr-mobile-mix-root .emr-mobile-channel input{
    position:absolute!important;top:64%!important;left:50%!important;width:140px!important;height:28px!important;min-height:0!important;margin:0!important;
    transform:translate(-50%,-50%) rotate(-90deg)!important;accent-color:#f1f2f2!important;touch-action:none!important;z-index:4!important;cursor:pointer!important;
  }
  #emr-mobile-mix-root .emr-mobile-channel .emr-mobile-vu{
    position:absolute!important;left:6px!important;top:66px!important;bottom:16px!important;width:7px!important;min-height:28px!important;
    background:repeating-linear-gradient(to top,#20df68 0 6px,#07120b 7px 10px)!important;box-shadow:inset 0 0 4px #000!important;z-index:2!important;
  }
  #emr-mobile-mix-root .emr-mobile-channel>i{right:4px!important;bottom:2px!important;font-size:8px!important}

  /* Barrinha de navegação lateral */
  #emr-mobile-mix-root .emr-mobile-rack-nav{
    grid-row:2!important;display:block!important;width:100%!important;height:12px!important;min-height:12px!important;margin:0!important;padding:2px 8px!important;border-top:1px solid #354047!important;background:#14191c!important;overflow:hidden!important;
  }
  #emr-mobile-mix-root .emr-mobile-rack-nav span{display:none!important}
  #emr-mobile-mix-root .emr-mobile-rack-scroll{-webkit-appearance:none!important;appearance:none!important;display:block!important;width:100%!important;height:5px!important;margin:0!important;padding:0!important;border:0!important;border-radius:999px!important;background:#283035!important;box-shadow:inset 0 1px 2px #000!important;touch-action:none!important;cursor:ew-resize!important}
  #emr-mobile-mix-root .emr-mobile-rack-scroll::-webkit-slider-thumb{-webkit-appearance:none!important;appearance:none!important;width:24px!important;height:5px!important;border:0!important;border-radius:999px!important;background:#d6a91f!important;box-shadow:0 0 3px #000!important}
  #emr-mobile-mix-root .emr-mobile-rack-scroll::-moz-range-thumb{width:24px!important;height:5px!important;border:0!important;border-radius:999px!important;background:#d6a91f!important;box-shadow:0 0 3px #000!important}

  /* Transporte */
  #emr-mobile-mix-root .emr-mobile-transport{
    grid-row:6!important;position:relative!important;display:grid!important;grid-template-columns:46px 46px 62px 46px 46px!important;align-items:center!important;justify-content:space-evenly!important;
    width:100%!important;height:72px!important;min-height:72px!important;margin:0!important;padding:4px 8px max(4px,env(safe-area-inset-bottom))!important;
    border-top:1px solid #465157!important;background:linear-gradient(#252d31,#111619 72%,#080b0d)!important;box-shadow:0 -4px 10px #000b!important;overflow:visible!important;
  }
  #emr-mobile-mix-root .emr-mobile-transport button{display:grid!important;place-items:center!important;width:46px!important;height:52px!important;min-width:0!important;margin:0!important;padding:0!important;border-radius:10px!important}
  #emr-mobile-mix-root .emr-mobile-transport button.is-play{width:60px!important;height:60px!important;border-radius:50%!important}
  #emr-mobile-mix-root .emr-mobile-transport button>span{position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important;margin:0!important}
  #emr-mobile-mix-root .emr-play-icon{display:block!important;width:0!important;height:0!important;margin-left:4px!important;border-top:11px solid transparent!important;border-bottom:11px solid transparent!important;border-left:17px solid #161a1c!important;filter:none!important}
  #emr-mobile-mix-root .emr-stop-icon{width:16px!important;height:16px!important;background:#fff!important;box-shadow:0 1px 2px #111!important}
  #emr-mobile-mix-root .emr-repeat{font-size:28px!important}
  #emr-mobile-mix-root .emr-mobile-console button.is-lit{color:#fff!important;background:linear-gradient(#e7474d,#810d13)!important;box-shadow:inset 0 3px #ffaaaa66,0 0 18px #ff2938!important}
  #emr-mobile-mix-root .emr-mobile-transport button.is-lit .emr-play-icon{border-left-color:#fff!important}

  /* Telas mais baixas: reduz mais um pouco, mas mantém tudo visível. */
  @media (max-height:740px){
    #emr-mobile-mix-root .emr-mobile-console{grid-template-rows:42px 50px 56px 154px minmax(145px,1fr) 68px!important}
    #emr-mobile-mix-root .emr-mobile-console>header{height:42px!important;min-height:42px!important}
    #emr-mobile-mix-root .emr-mobile-preset{height:50px!important;min-height:50px!important}
    #emr-mobile-mix-root .emr-mobile-top-actions{height:56px!important;min-height:56px!important}
    #emr-mobile-mix-root .emr-mobile-top-actions button{height:37px!important;font-size:11px!important}
    #emr-mobile-mix-root .emr-mobile-source-room{height:154px!important;min-height:154px!important;padding:8px!important;gap:8px!important}
    #emr-mobile-mix-root .emr-mobile-source-left{gap:7px!important}
    #emr-mobile-mix-root .emr-mobile-source-right{gap:8px!important}
    #emr-mobile-mix-root .emr-mobile-source-room button{font-size:16px!important;border-radius:18px!important}
    #emr-mobile-mix-root .emr-mobile-source-right button{font-size:15px!important;border-radius:12px!important}
    #emr-mobile-mix-root .emr-mobile-channel{min-width:84px!important}
    #emr-mobile-mix-root .emr-mobile-channel input{width:130px!important;top:65%!important}
    #emr-mobile-mix-root .emr-mobile-channel .emr-mobile-vu{top:62px!important}
    #emr-mobile-mix-root .emr-mobile-transport{height:68px!important;min-height:68px!important;grid-template-columns:44px 44px 58px 44px 44px!important}
    #emr-mobile-mix-root .emr-mobile-transport button{width:44px!important;height:48px!important}
    #emr-mobile-mix-root .emr-mobile-transport button.is-play{width:56px!important;height:56px!important}
  }

  @media (max-height:660px){
    #emr-mobile-mix-root .emr-mobile-console{grid-template-rows:40px 46px 52px 138px minmax(135px,1fr) 64px!important}
    #emr-mobile-mix-root .emr-mobile-brand:before{width:30px!important;height:30px!important;flex-basis:30px!important}
    #emr-mobile-mix-root .emr-mobile-brand span{font-size:18px!important}
    #emr-mobile-mix-root .emr-mobile-brand strong{font-size:16px!important}
    #emr-mobile-mix-root .emr-mobile-preset{height:46px!important;min-height:46px!important;padding:6px 8px!important}
    #emr-mobile-mix-root .emr-mobile-preset select{height:32px!important;font-size:13px!important}
    #emr-mobile-mix-root .emr-mobile-top-actions{height:52px!important;min-height:52px!important;padding:6px!important}
    #emr-mobile-mix-root .emr-mobile-top-actions button{height:34px!important;font-size:10px!important}
    #emr-mobile-mix-root .emr-mobile-source-room{height:138px!important;min-height:138px!important;padding:7px!important;gap:7px!important}
    #emr-mobile-mix-root .emr-mobile-source-room button{font-size:14px!important;padding:5px 6px!important}
    #emr-mobile-mix-root .emr-mobile-source-right button{font-size:13px!important}
    #emr-mobile-mix-root .emr-mobile-channel{min-width:80px!important}
    #emr-mobile-mix-root .emr-mobile-channel>strong{font-size:10px!important}
    #emr-mobile-mix-root .emr-mobile-channel>span{font-size:7px!important}
    #emr-mobile-mix-root .emr-mobile-channel>b{font-size:10px!important}
    #emr-mobile-mix-root .emr-mobile-channel input{width:120px!important;top:66%!important;height:26px!important}
    #emr-mobile-mix-root .emr-mobile-channel .emr-mobile-vu{top:56px!important;bottom:13px!important}
    #emr-mobile-mix-root .emr-mobile-transport{height:64px!important;min-height:64px!important;grid-template-columns:42px 42px 54px 42px 42px!important}
    #emr-mobile-mix-root .emr-mobile-transport button{width:42px!important;height:46px!important}
    #emr-mobile-mix-root .emr-mobile-transport button.is-play{width:54px!important;height:54px!important}
  }
}
